CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   linear distributed initial temperature (https://www.cfd-online.com/Forums/openfoam-pre-processing/225998-linear-distributed-initial-temperature.html)

PSander April 14, 2020 10:59

linear distributed initial temperature
 
I need to calculate the heatflux of a pipe filled with a fluid, which is surrounded by soil.
The initial temperature of the soil should be linear distributed along the vertical axis, for example 303°K at the surface and 293°K at the bottom, which means that in between temperature has to be linear distributed.
What kind of boundary condition allows me to handle the behavoir of the temperature?
I found some threads about groovyBC or codedfixedvalue, but I'm not sure how to implement them and if they are actually useful for this purpose.

Thank you in adavance for your help!

thiagopl April 14, 2020 14:03

Hi PSander,


To set a internalField with a linear behaviour you can use funkySetFields. For this you need the swak4Foam. You can follow the steps bellow to install it. It worked for me recently.

Code:

sudo apt-get install bison
sudo apt-get install mercurial
hg clone http://hg.code.sf.net/p/openfoam-extend/swak4Foam -u develop
cd swak4Foam
./maintainanceScripts/compileRequirements.sh
./Allwmake


Once installed check this example which creates a linear internalField for pressure. It is analogous of what you want.

PSander April 15, 2020 10:45

Thank you a lot thiagopl, this was exactly what I was looking for.
It does what it is meant to do but unfortunately when I used my model, one boundary condition (turbulentTemperatureCoupledBaffleMixed) between soil and pipe produced a Fatal Error:

--> FOAM FATAL IO ERROR:
Unknown patchField type compressible::turbulentTemperatureCoupledBaffleMix ed for patch type mappedWall

Valid patchField types are :...
-->


I've modified this condition to check it, and it worked indeed, however, I would like to remain with turbulentTemperatureCoupledBaffleMixed if it's posible. Is there a solution to implement it or what would you recommend me to do?


All times are GMT -4. The time now is 00:57.