|
[Sponsors] |
November 23, 2011, 09:39 |
groovyBC for pressureInlet
|
#1 |
New Member
Join Date: Apr 2011
Location: Magdeburg, Germany
Posts: 23
Rep Power: 15 |
Hello,
I got a two phase flow in a plate with two inlets. The second inlet should open at a specified time like: Code:
inlet { type totalPressure; p0 uniform 100000; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } inlet2 { type groovyBC; valueExpression "(time()<t0) ? 0 : 1*(pinlet)"; //zeroGradient for time()<t0 (wall), constant value for time()>t0 (pressureInlet) variables "t0=0.1;pinlet@inlet=p;p=100000;"; value uniform 100000; } outlet { type fixedValue; value uniform 0.000000; } outlet2 { type fixedValue; value uniform 0.000000; } wall { type zeroGradient; } frontback { type empty; } Kind regards, Nico |
|
November 23, 2011, 14:59 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
b) I think your comment with inlet2 is incorrect. To get that kind of behaviour you should manipulate fractionExpression c) I don't see the problem with dependence of fields. Instead of the time-condition "time()<t0" write something like "max(pInlet)>pThres" and off you go (to have a "valve" that stays open once the condition is reached - even if the pressure drops afterwards - you'll need the stored variables in the swak-veriosn of groovBC) |
||
November 24, 2011, 09:53 |
|
#3 |
New Member
Join Date: Apr 2011
Location: Magdeburg, Germany
Posts: 23
Rep Power: 15 |
Hello Bernhard,
at first, thank you for your reply. Sorry, I posted the wrong code, I actually used that for inlet2, like you already said: Code:
inlet2 { type groovyBC; valueExpression "1*(pinlet)"; fractionExpression "(time()<t0) ? 0 : 1"; variables "t0=0.1;pinlet@inlet=p;p=100000;"; timelines ( ) } re c) the problem is that I can only adress the whole field, is that right? I need to extract a specific value of the field, for example a face value at the inlet patch. |
|
November 24, 2011, 18:07 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
"targetPos=vector(1,2,3);dist=mag(targetPos-pos());minDist=min(dist);pTemp=(dist==minDist) ? p : -1;pUsed=max(pTemp)" should work. Hold on. That won't work exactly like this because as soon as a remote variable is used it is boiled down to a single value. But what should work is "pUsed@inlet2= ...." The right hand side you get by substituting the other variables in the expression of the above "recipie". Will be a bit larger, but I guess you get the idea PS: the "1*(pinlet)" above is necessary? Hopefully not anymore in the swak-Variant of groovy |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] groovyBC for oscillatory flow | liybzd | OpenFOAM Community Contributions | 5 | November 12, 2018 08:53 |
[swak4Foam] reactingMultiPhaseEulerFoam problems with groovyBC | zanilu70 | OpenFOAM Community Contributions | 4 | December 13, 2016 07:46 |
[swak4Foam] Change in alpha and U with groovyBC in twoPhaseEulerFoam | dani2702 | OpenFOAM Community Contributions | 0 | November 17, 2016 04:30 |
[swak4Foam] groovyBC issue - k and epsilon | sagnikmazumdar | OpenFOAM Community Contributions | 24 | March 1, 2015 08:16 |
[swak4Foam] groovyBC and Eqn.setReference() | benk | OpenFOAM Community Contributions | 3 | June 2, 2011 09:49 |