CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   2 BC on one Boundary (https://www.cfd-online.com/Forums/openfoam-solving/176444-2-bc-one-boundary.html)

shengqiming August 18, 2016 12:20

2 BC on one Boundary
 
Hi all,

i want 2 different Boundary Condition for one Boundary. For example:half has T=300 and half has T=350. Is that possible?
Or can i set Two regions and then remove the internal Boundary to reach my goal?

Best regards
Qiming

arsalan.dryi August 18, 2016 13:44

Hi Sheng,

You can use groovyBC from swak4Foam package, this is straightforward and easy to use.
see this page for detailed information: https://openfoamwiki.net/index.php/Contrib/groovyBC

Regards,
Arsalan.

shengqiming August 19, 2016 03:43

Hi Arsalan,

thank you for your quick reply. I have installed Swak4FOAM, but i know little about that. I wiil learn from that website. Can you show me how to set that BC if you have time?


best regards

arsalan.dryi August 19, 2016 04:31

Well for an exact solution I need more information about your problem, but as an simple example of setting different variable values on a patch by groovyBC we need a piece of code as follows:

Code:

    wall
    {
        type            groovyBC;
        valueExpression "pos().x<0.05 ? 1 : pos().x<0.075 ? 2 : 0";
    }

in this situation, the variable values on the wall for x<0.05 are set to "1", for 0.05<x<0.75 are set to "2" and otherwise are set to "0".

Regards,
Arsalan.

shengqiming August 19, 2016 06:11

Thank you very much Arsalan. I will try this after i finish my lunch.

Best regards,
Qiming


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