CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   2 different uniform field initialization in one domain (https://www.cfd-online.com/Forums/openfoam-programming-development/163787-2-different-uniform-field-initialization-one-domain.html)

rvl565 December 5, 2015 22:50

2 different uniform field initialization in one domain
 
Hi,

I was wondering if there is any way to have half of a 2D rectangular domain have a uniform field value and the other half have another uniform value. for example. Say if I have a 2X2 square 2D domain. I want the top half that is y>1 to have temperature 300Kelvin and the bottom half that is y<1 to have 280K.
Thanks !

rapierrz December 6, 2015 00:40

Hello RacMat,

You can use of funkySetField in swak4Foam package and define two field for

your field for example :

for Temperature field:

internalFields
{
field T;
expression "300";
condition "pos().y>1";
keepPatches 1;
}

internalFields
{
field T;
expression "280";
condition "pos().y<1";
keepPatches 1;
}


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