CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

adding Energy eqn to the porousSimpleFoam solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By adambarfi

Reply
 
LinkBack Thread Tools Display Modes
Old   March 17, 2014, 10:13
Default adding Energy eqn to the porousSimpleFoam solver
  #1
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 314
Rep Power: 6
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
hi everybody,

I'm Trying to add Energy Eqn to the porousSimpleFoam solver and I'm encountering some problems. I want to solve natural convection in a porous zone. I added TEqn and necessary terms to momentum equation, but when I wmake it the below error appeared:

Code:
/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/fvMatrix.C:1862:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::operator+(const Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >&, const Foam::tmp<Foam::fvMatrix<Type> >&)
/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/fvMatrix.C:2101:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::operator+(const Foam::fvMatrix<Type>&, const Foam::dimensioned<Type>&)
/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/fvMatrix.C:2114:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::operator+(const Foam::tmp<Foam::fvMatrix<Type> >&, const Foam::dimensioned<Type>&)
/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/fvMatrix.C:2127:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::operator+(const Foam::dimensioned<Type>&, const Foam::fvMatrix<Type>&)
/home/mostafa/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/fvMatrix.C:2140:34: note: template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::operator+(const Foam::dimensioned<Type>&, const Foam::tmp<Foam::fvMatrix<Type> >&)
make: *** [Make/linux64GccDPOpt/bbpsfMy.o] Error 1
I can't understand where is the problem. anybody knows from where does this error originate?

Best,
Mostafa
yesaswi92 likes this.
adambarfi is offline   Reply With Quote

Old   March 26, 2014, 01:56
Default
  #2
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 314
Rep Power: 6
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
and finally, after lots of endeavor, I couldn't do that!!!!

so I decided to write the code in my way and don't using the porousZone of OF! but I have a big problem:
I don't know how to specify an equation for a region that I defined it in my mesh?!?! how can I tell OF that the zone, for example, named PorousZ have different governing equation with the other zone? or how can I use a source term in my equations that have a coefficient like 'beta':
beta=0 if zone=FluidZ
beta=1 if zone=PorousZ
?

thanks
Mostafa
adambarfi is offline   Reply With Quote

Old   March 26, 2014, 03:52
Default
  #3
Member
 
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 84
Rep Power: 4
chrisb2244 is on a distinguished road
Dear Mostafa,

I haven't tried doing this, but my guess is that you might find your second method easier.

If you can write a set of equations which is applied to all of your mesh, with all of the mesh being affected by a source term, which is multiplied by zero for your FluidZ zone, then that should be fairly simple?

Assuming that your zones are constant in time, you can use something like
Code:
volScalarField betaMultiplier
(
	IOobject
	(
		"beta",
		runTime.timeName(),
		mesh,
		IOobject::NO_READ,
		IOobject::AUTO_WRITE,
		true
	),
	mesh,
	dimensionedScalar
	(
		"beta",
		dimensionSet(0, 0, 0, 0, 0, 0, 0),
		0.0
	),
	// Some boundary types here - I guess these might not matter?
);
and then set values using something like

Code:
forAll(mesh.cellCentres(), cellI)
{
    if (some test for zones)
    {
          betaMultiplier.internalField()[cellI] = 1;
    }
    else
    {
          betaMultiplier.internalField()[cellI] = 0;
     }
}
Like I said, I haven't tested this for what you're trying to do, and I don't know anything about cellZones, but I used a similar setup to generate an alpha field in a class I have recently written. (Seemingly the alphaGeneration class works nicely, although I have numerous other (I think unrelated) problems with my solver! :P )
chrisb2244 is offline   Reply With Quote

Old   March 31, 2014, 20:14
Default
  #4
New Member
 
Yesaswi
Join Date: Jan 2014
Posts: 24
Rep Power: 3
yesaswi92 is on a distinguished road
Hi,

I am also trying to do the same. Did you figure out how to do it??
yesaswi92 is offline   Reply With Quote

Old   April 1, 2014, 04:17
Default
  #5
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 239
Rep Power: 9
olivierG is on a distinguished road
Hello,

Why don't you use buoyantSimpleFoam / buoyantBoussinesqSimpleFoam ?
For porosity, just use fvOptions, with explicitPorositySource type.

Regards,
olivier
olivierG is offline   Reply With Quote

Old   April 1, 2014, 04:29
Default
  #6
Senior Member
 
adambarfi's Avatar
 
Mostafa Mahmoudi
Join Date: Jan 2012
Posts: 314
Rep Power: 6
adambarfi is on a distinguished road
Send a message via Yahoo to adambarfi Send a message via Skype™ to adambarfi
Quote:
Originally Posted by olivierG View Post
Hello,

Why don't you use buoyantSimpleFoam / buoyantBoussinesqSimpleFoam ?
For porosity, just use fvOptions, with explicitPorositySource type.

Regards,
olivier
Hi Olivier,

AFAIK, fvOptions is just for OF-2.2.x, am I right?
It's a good idea, but I haven't enough information about how fvOptions works!

can you please give me some information?

Thanks a lot for your idea,
Mostafa
adambarfi is offline   Reply With Quote

Old   April 1, 2014, 04:49
Default
  #7
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 239
Rep Power: 9
olivierG is on a distinguished road
hello,
fvOption should work for at least OF 2.2 and 2.3
Here is an exemple file for fvOption with porosity, and also with the topoSetDict. Both should be in system.
Just run "topoSet" to create the cellZone before running the solver.

regards,
olivier
Attached Files
File Type: zip fvOptions.zip (706 Bytes, 9 views)
File Type: zip topoSetDict.zip (569 Bytes, 7 views)
olivierG is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
chtMultiRegionSimpleFoam samiam1000 OpenFOAM Running, Solving & CFD 28 May 16, 2015 11:33
Adding Radiation to a turbulent solver MasAmi OpenFOAM Running, Solving & CFD 0 October 25, 2013 02:36
energy eqn + constant fluid properties cfx_user Main CFD Forum 1 March 6, 2013 08:13
Different ans of poisson eqn with different solver Quarkz Main CFD Forum 0 October 6, 2005 11:49
Solver for poisson eqn in FVM? Mudpack, fishpack.? zonexo Main CFD Forum 0 October 5, 2005 19:11


All times are GMT -4. The time now is 10:41.