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

adding temperature to simpleFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree31Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2012, 05:32
Default my_SimpleFoam solver problem
  #41
Senior Member
 
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 14
Goutam is on a distinguished road
I am using OpenFOAM-2.1.0. I have tried to use my_simpleFoam. I did wclean and wmake and got 1 error.
readSIMPLEControls.H: no such file or directory.

I checked in src/finitevloume/lnInclude/...

There is no such file.

Could you please tell me how to solve this problem ...

Thanks
Goutam is offline   Reply With Quote

Old   March 1, 2012, 05:53
Default
  #42
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 30
akidess will become famous soon enough
Goutam, I think your question has already been answered. See post #22 and onward in this thread.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
akidess is offline   Reply With Quote

Old   March 1, 2012, 06:05
Default
  #43
Senior Member
 
Goutam Saha
Join Date: Dec 2011
Location: UK
Posts: 131
Rep Power: 14
Goutam is on a distinguished road
Quote:
Originally Posted by akidess View Post
Goutam, I think your question has already been answered. See post #22 and onward in this thread.

Thanks Akidess...

I have seen this after I reply to the post. Sorry.

Thanks again.
Goutam is offline   Reply With Quote

Old   June 19, 2012, 04:13
Default
  #44
Member
 
anonymous
Join Date: Mar 2012
Posts: 45
Rep Power: 14
libia87 is on a distinguished road
Hi!
I'm trying to add concentration following the tutorial "how to add temperature to icoFoam", but I'm using buoyantboussinesqPimpleFoam and it doesn't work, anyone knows why??
when I do the WMAKE appears that error:

Making dependency list for source file my_buoyantBoussinesqPimpleFoam.C
could not open file readTransportProperties.H for source file my_buoyantBoussinesqPimpleFoam.C
SOURCE=my_buoyantBoussinesqPimpleFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I../buoyantBoussinesqSimpleFoam -I/opt/openfoam210/src/finiteVolume/lnInclude -I/opt/openfoam210/src/turbulenceModels -I/opt/openfoam210/src/turbulenceModels/incompressible/RAS/lnInclude -I/opt/openfoam210/src/transportModels -I/opt/openfoam210/src/transportModels/incompressible/singlePhaseTransportModel -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/my_buoyantBoussinesqPimpleFoam.o
In file included from my_buoyantBoussinesqPimpleFoam.C:61:
createFields.H:47:41: error: readTransportProperties.H: No existe el fichero o el directorio
In file included from my_buoyantBoussinesqPimpleFoam.C:61:
createFields.H: In function ‘int main(int, char**)’:
createFields.H:52: error: ‘laminarTransport’ was not declared in this scope
createFields.H:64: error: ‘beta’ was not declared in this scope
createFields.H:64: error: ‘TRef’ was not declared in this scope
In file included from my_buoyantBoussinesqPimpleFoam.C:86:
TEqn.H:2: error: ‘Prt’ was not declared in this scope
TEqn.H:5: error: ‘Pr’ was not declared in this scope
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:38: warning: unused variable ‘maxDeltaT’
make: *** [Make/linux64GccDPOpt/my_buoyantBoussinesqPimpleFoam.o] Error 1
libia87 is offline   Reply With Quote

Old   August 7, 2012, 14:27
Default
  #45
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
Hello Martin,

Thanks very much for the clear explanation and the modified sources. Your mySimpleFoam solver is indeed very useful. I wonder however, if you can point me in the right direction for my task (described below):

Basically your solver is a steady-state conjugate heat transfer solver, in that it solved for the flow field first, then advects temperature using that flow field. The energy equation has a diffusion term and a source term (viscous dissipation).

Is it possible to modify the solver to do the following instead. I want to make the viscosity of the flowing material a function of the scalar T. Basically, if the scalar T is within a certain range, I want the material to have viscosity X, and if it is within another range, I want it to have viscosity Y. I of course assume that X will be roughly the same order as Y (i.e. no sharp discontinuities).

I look forward to your response.

Thanks in advance for your help!

Best Regards,
Srinath

Quote:
Originally Posted by MartinB View Post
Hi Nickolas,

you can try the attached solver (for OpenFOAM 2.0.x) and case.

Comments are added to the code and the case.

Increase of temperature is calculated via controlDict (4.585 K) and nearly matches to the appropriate formula for high viscous newtonian fluids (4.73 K).

Ah, and you can access the viscosity for your formula with "laminarTransport.nu()".

Martin
msrinath80 is offline   Reply With Quote

Old   August 7, 2012, 14:41
Default
  #46
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Srinath,

you should modify the viscosity model to be dependent on your scalar T. You can find the viscosity models here:
OpenFOAM-2.1.x/src/transportModels/incompressible/viscosityModels/
If your scalar T is temperature, then there is Arrhenius shift or WLF shift to describe temperature dependent viscosities and which can be easily implemented in OpenFOAM.
Can you post your specific function for nu(T) or nu(T, shear rate)?

Martin
MartinB is offline   Reply With Quote

Old   August 7, 2012, 14:47
Default
  #47
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
Hello again Martin,

Thanks very much for the really prompt reply. Here is my exact situation. I need the viscosity in the flow problem to change depending on my value of my scalar T. Think of 'T' as being some kind of species concentration as opposed to temperature.

If a<=T<=b, then nu = X

else if

b<=T<=c then nu = Y

Is this feasible?

Thanks once again for your help!

Best Regards,
Srinath

Quote:
Originally Posted by MartinB View Post
Hi Srinath,

you should modify the viscosity model to be dependent on your scalar T. You can find the viscosity models here:
OpenFOAM-2.1.x/src/transportModels/incompressible/viscosityModels/
If your scalar T is temperature, then there is Arrhenius shift or WLF shift to describe temperature dependent viscosities and which can be easily implemented in OpenFOAM.
Can you post your specific function for nu(T) or nu(T, shear rate)?

Martin
msrinath80 is offline   Reply With Quote

Old   August 7, 2012, 16:46
Default
  #48
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Srinath,

here is a template for fine tuning.

In srinathSimpleFoam.tar.gz you find a solver based on simpleFoam with scalar transport of T. Furthermore there is a viscosity model with name "scalarDependentViscosity" which must be compiled with "wmake libso" (or use the Allwmake script). The results are a user library for your new viscosity model and the solver itself. The srinathSimpleFoam solver already links against the viscosity model. To use it in other solvers or utilities you can include it in the controlDict with
Code:
libs ("libuserscalarDependentViscosity.so" "libOpenFOAM.so");
There is a test case attached, too. Run it with the standard sequence
Code:
blockMesh
srinathSimpleFoam
Right now only nu1 and nu2, as well as b in constant/transportProperties are used for the viscosity model. You should customize the formula in "srinathSimpleFoam/scalarDependentViscosity/scalarDependentViscosity.C" line 57ff.

To keep the solvers convergence stable you might want to change the viscosity law a bit, so that the transition from nu1 to nu2 is a bit smoother, and not "binary" as it is now.

Have fun

Martin
Attached Files
File Type: gz srinathSimpleFoam.tar.gz (3.7 KB, 123 views)
File Type: gz case_srinathSimpleFoam.tar.gz (2.8 KB, 96 views)
MartinB is offline   Reply With Quote

Old   August 7, 2012, 17:40
Default
  #49
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
Wow Martin! That's awesome. Let me look into the code and understand it and modify it (ultimately I want this to work with BirdCarreau). I will follow up with you on this thread with my developments. Thanks once again for the really quick response!

And yes, I will use some kind of a smoothed heaviside transition between the values :-)

Thanks again for your help!

Best Regards,
Srinath

Quote:
Originally Posted by MartinB View Post
Hi Srinath,

here is a template for fine tuning.

In srinathSimpleFoam.tar.gz you find a solver based on simpleFoam with scalar transport of T. Furthermore there is a viscosity model with name "scalarDependentViscosity" which must be compiled with "wmake libso" (or use the Allwmake script). The results are a user library for your new viscosity model and the solver itself. The srinathSimpleFoam solver already links against the viscosity model. To use it in other solvers or utilities you can include it in the controlDict with
Code:
libs ("libuserscalarDependentViscosity.so" "libOpenFOAM.so");
There is a test case attached, too. Run it with the standard sequence
Code:
blockMesh
srinathSimpleFoam
Right now only nu1 and nu2, as well as b in constant/transportProperties are used for the viscosity model. You should customize the formula in "srinathSimpleFoam/scalarDependentViscosity/scalarDependentViscosity.C" line 57ff.

To keep the solvers convergence stable you might want to change the viscosity law a bit, so that the transition from nu1 to nu2 is a bit smoother, and not "binary" as it is now.

Have fun

Martin
msrinath80 is offline   Reply With Quote

Old   October 21, 2012, 04:50
Default
  #50
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Hi Martin,
Thank you for sharing your mySimpleFom solver and the case. I tried to run in one of my cases but I keep on getting error massage

keyword SIMPLE is undefined in dictionary "/home/naren/OpenFOAM/naren-2.1.1/run/filmCoolingCourse1/system/fvSolution"

Any suggestion to get rid of this.

Best regards,
Suranga.
sdharmar is offline   Reply With Quote

Old   October 21, 2012, 04:58
Default
  #51
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Suranga,

in your fvSolution the dictionary entry for "SIMPLE" is missing. I think you run your case with a PIMPLE or PISO algorithm otherwise, so to use the mySimpleFoam solver you must add parameters for the SIMPLE algorithm.

You can have a look at the attached fvSolution file at the case attached to the mySimpleFoam solvers.

You might need to edit your fvSchemes, too: you must switch the ddtSchemes to steadyState, and probably you might want to change controlDict to use delta 1 as an iteration counter.

Martin
MartinB is offline   Reply With Quote

Old   October 21, 2012, 09:47
Default
  #52
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Hi Martin,

Thank you for the reply. I think I have SIMPLE written in my fvSolution dictionary. Please be kind enough to go through the listing.

solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}
T
{
solver BICCG;
preconditioner DILU;
tolerance 1e-07;
relTol 0.01

U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

k
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

epsilon
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

R
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

nuTilda
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}
}

SIMPLE
{
nNonOrthogonalCorrectors 0;

residualControl
{
p 1e-5;
U 1e-5;
T 1e-5;
"(k|epsilon|omega)" 1e-3;
}
}

relaxationFactors
{
fields
{
p 0.3;
T 0.7;
}
equations
{
U 0.7;
k 0.7;
epsilon 0.7;
R 0.7;
nuTilda 0.7;
}
}


// ************************************************** *********************** //

Still trying to figure out what's wrong with this. Thanks for your time in advance.
sdharmar is offline   Reply With Quote

Old   October 21, 2012, 09:56
Default
  #53
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
I can't see any obvious mistake... can you upload the case?
Or at least: 0/*, system/*, constant/transportProperties, altogether in tar.gz archive...

Martin
MartinB is offline   Reply With Quote

Old   October 21, 2012, 10:35
Default
  #54
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Thanks Martin,

Herewith I have attached 0 and system directories.

Thanks.
Attached Files
File Type: gz 0.tar.gz (1.2 KB, 21 views)
File Type: gz system.tar.gz (2.7 KB, 24 views)
sdharmar is offline   Reply With Quote

Old   October 21, 2012, 10:41
Default
  #55
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Sorry I couldn't attach the transportProperties to the previous reply. Here it is.


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

transportModel Newtonian;

nu nu [ 0 2 -1 0 0 0 0 ] 1e-05;
DT DT [ 0 2 -1 0 0 0 0 ] 2e-05;

CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 1;
}

BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 0;
n n [ 0 0 0 0 0 0 0 ] 1;
}


// ************************************************** *********************** //
sdharmar is offline   Reply With Quote

Old   October 21, 2012, 12:47
Default
  #56
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
I can't find any problem in your files... they seem to be fine for me.

You can send me your case, if you like, so I can try to run it here... I'll send you my eMail adress via boardmail...

Martin
MartinB is offline   Reply With Quote

Old   October 23, 2012, 02:48
Default
  #57
Senior Member
 
maddalena's Avatar
 
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23
maddalena will become famous soon enough
Hello,
may a } be missing??

Quote:
Originally Posted by sdharmar View Post
solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0.1;
}
T
{
solver BICCG;
preconditioner DILU;
tolerance 1e-07;
relTol 0.01
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

k
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

epsilon
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

R
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}

nuTilda
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.01;
}
}

SIMPLE
{
nNonOrthogonalCorrectors 0;

residualControl
{
p 1e-5;
U 1e-5;
T 1e-5;
"(k|epsilon|omega)" 1e-3;
}
}

relaxationFactors
{
fields
{
p 0.3;
T 0.7;
}
equations
{
U 0.7;
k 0.7;
epsilon 0.7;
R 0.7;
nuTilda 0.7;
}
}
maddalena is offline   Reply With Quote

Old   October 23, 2012, 03:53
Default
  #58
Senior Member
 
Martin
Join Date: Oct 2009
Location: Aachen, Germany
Posts: 255
Rep Power: 21
MartinB will become famous soon enough
Hi Maddalena,

you are right, the bracket is missing ;-)
oh, and a semicolon directly before the missing bracket...

Thanks

Martin
MartinB is offline   Reply With Quote

Old   October 24, 2012, 23:17
Default
  #59
Member
 
Suranga Dharmarathne
Join Date: Jan 2011
Location: TX, USA
Posts: 39
Rep Power: 15
sdharmar is on a distinguished road
Hi Maddalena,

Yes it worked. Thank you very much for your concern.

Best regards,
Suranga.
sdharmar is offline   Reply With Quote

Old   November 7, 2012, 15:40
Default
  #60
New Member
 
Warren Lamont
Join Date: Nov 2012
Posts: 5
Rep Power: 13
wlamont is on a distinguished road
Hey Martin B,

I want to implement a simpler version of your srinathSimpleFoam example. I want nu to be a function of T and p (T for me is temperature) and I want to implement something like 0.0000171*pow(T/273,0.7)/(p/(8314/28.96*T). Can you modify your code to do this? I tried modifying your code but I get errors. I think it is my lack of familiarity.

Thanks,

Warren
wlamont is offline   Reply With Quote

Reply

Tags
simplefoam, temperature


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Adding a new temperature dependent viscositymodel? dgadensg OpenFOAM Programming & Development 10 May 22, 2010 05:47
Adding temperature equation in settlingFoam sachin OpenFOAM Running, Solving & CFD 2 March 31, 2010 03:21
Adding temperature field to InterFoam yapalparvi OpenFOAM Running, Solving & CFD 8 October 14, 2009 20:18
Adding coriolis forces in simplefoam Xabi OpenFOAM Running, Solving & CFD 1 April 24, 2009 04:43


All times are GMT -4. The time now is 01:22.