CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] Setting BC for a passive scalar (groovy vs fvOptions) (https://www.cfd-online.com/Forums/openfoam-community-contributions/118265-setting-bc-passive-scalar-groovy-vs-fvoptions.html)

Tobi May 23, 2013 14:53

Setting BC for a passive scalar (groovy vs fvOptions)
 
1 Attachment(s)
Hi all,

in the attachement you can se a simple geometry and the value of the passiv scalar I added.

For the inlet BC I used groovy in a not very comfortable way :)
To get the three seperated inlets I had to build a BC like that:

Code:

    inlet
    {
        type            groovyBC;
        value          $internalField;
        valueExpression "pos().y>-0.04 ? ( pos().y < -0.035 ? (pos().x<0.002 ? pos().x > -0.002 ? 1 :0 :0 ) : ( pos().y > -0.002 ? pos().y < 0.002 ? (pos().x<0.002 ? pos().x > -0.002 ? 1 :0 :0 ) : (pos().y > 0.035 ? pos().y < 0.04 ? (pos().x<0.002 ? pos().x > -0.002 ? 1 :0 :0 ) : 0: 0) : 0)) : 0";
        valiables      "";
    }

As you can see its a very strange and confusing BC-declaration.
So the question is, if its possible to do that in a easier way.

Maybe with the new fvOptions in 2.2.x like here: http://www.openfoam.org/version2.2.0...processing.php

Code:

new scalarTransport - enables the solution of a scalar transport equation,      where the scalar can be specified using via boundary conditions, or using      the new fvOptions framework. The following images show the time      evolution of three point sources added to the pitzDaily tutorial      case:
As I see in the pictures it is possible to set a passive scalar with fvOptions with no additonal work on modifying a solver!

Can someone give me an advice or hint, link or something like that?

Thanks all

Tobi


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