CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (http://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Table defined BC (http://www.cfd-online.com/Forums/openfoam-pre-processing/98663-table-defined-bc.html)

danvica March 15, 2012 15:32

Table defined BC
 
Is it possible to define a patch using its caracteristic data ?

For example, on an outlet we could know the p/U relation:

p=0.1bar ---> U=0.1l/s
p=0.5bar ---> U=0.4l/s
p=1.0bar ---> U=0.7l/s
....

It would be usefull in complex system. You can avoid simulating external part already characterized.

Can this be implemented ?

Daniele

danvica March 15, 2012 15:58

Sorry to make questions before deep searching.

I think the best thing is to use groovyBC in following way.

Let's say we approximate the p/U relation with:

U=p/10+5 (note: just a random linear relation)

and the outlet flow is just in the x direction,
then:

For 0/U:

Code:

outlet         
{
    type            groovyBC;
    variables "Ux=p/10+5";
    valueExpression "vector(Ux,0,0)";
    value          uniform (0 0 0);
}

Is it correct ? Is there a better way ? Is there any stabilty problem ?

Daniele

gschaider March 15, 2012 16:38

Quote:

Originally Posted by danvica (Post 349700)
Sorry to make questions before deep searching.

I think the best thing is to use groovyBC in following way.

Let's say we approximate the p/U relation with:

U=p/10+5 (note: just a random linear relation)

and the outlet flow is just in the x direction,
then:

For 0/U:

Code:

outlet         
{
    type            groovyBC;
    variables "Ux=p/10+5";
    valueExpression "vector(Ux,0,0)";
    value          uniform (0 0 0);
}

Is it correct ? Is there a better way ? Is there any stabilty problem ?

Daniele

Specifying the velocity on the outlet is always a bit problematic but if you leave it another boundary with a Neuman-condition you might be fine

In the variables-string a ; is missing

The valueExpression might be more elegant if you write it like "Ux*normal()". That way it works no matter how the boundary is oriented (not 100% sure. You might night a - there)

Concerning your original posting: expressions in swak4Foam can have lookup-tables where you specify a function by value pairs and values are interpolated between these. For an exmple on the usage see the wobbler-case in the examples

calim_cfd March 15, 2012 16:40

it's hard, at least of me, to say.. but is your simulation ss or transient? i kinda of a need a very specific reason b4 implementing things.. so i can't tell..

as for stability.,, i guess you cannot fix pressure and flowrate, U, at the same patch and model.... so i guess you got pick one var to fix..

danvica March 15, 2012 18:17

Many thanks ! Sure, I know fixing an outlet U is problematic. I'll make some simple bc tests and report here.

daniele


All times are GMT -4. The time now is 07:35.