CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

A way to update groovyBC variables during the solution

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 28, 2013, 17:38
Default A way to update groovyBC variables during the solution
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
hi
I was searching for the cause of not changing the results when I change groovyBC variables for all two days and nights!
I had run till a important time that a change in BC occurs but it need to change a variable for better simulation.i was changing related variables but nothing seem to change! I simplified it and deleted everything but surprisingly it was not fixed.
at last i found that it should be run from starting so that groovyBC can update its variables.
then i search for a way to update groovyBC variables and expressions after stopping the solution during a run.is such thing available?or i have to start from zero folder again and again?
thanks.

Last edited by immortality; January 29, 2013 at 05:14.
immortality is offline   Reply With Quote

Old   January 29, 2013, 05:20
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
is any help available?is it possible by any of groovyBC or pyFOAM utilities?does such thing exist?
immortality is offline   Reply With Quote

Old   January 29, 2013, 14:54
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,914
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
hi
I was searching for the cause of not changing the results when I change groovyBC variables for all two days and nights!
I had run till a important time that a change in BC occurs but it need to change a variable for better simulation.i was changing related variables but nothing seem to change! I simplified it and deleted everything but surprisingly it was not fixed.
at last i found that it should be run from starting so that groovyBC can update its variables.
then i search for a way to update groovyBC variables and expressions after stopping the solution during a run.is such thing available?or i have to start from zero folder again and again?
thanks.
I assume you're talking about the variables of groovyBC? These are evaluated at every timstep anew. For additional tests you can add these two settings to the groovyBC:

Code:
debugCommonDriver true;
debug true;
The first setting produces loads of output to the terminal. The second one should write the values of the variables into the outputfiles (but I haven't used that in a long time)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   January 31, 2013, 14:57
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
I forgot to put ; after valueExpression so far.but no error has shown.what may be the cause?
I add these expressions in all groovyBC boundary conditions and get a run?
thanks.
immortality is offline   Reply With Quote

Old   January 31, 2013, 16:27
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,914
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
I forgot to put ; after valueExpression so far.but no error has shown.what may be the cause?
I add these expressions in all groovyBC boundary conditions and get a run?
thanks.
OpenFOAM doesn't complain about the missing ; as it found the expected string. The next parameters until another ; are ignored because OF believes that they are part of valueExpression
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 1, 2013, 06:04
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
thanks.
Should i add two expressions you told me to every groovyBC conditions?
I have the problem yet.i have run untill an important time(that moving shock faces to wall and reflects) before it happens i want to change a variable relating to time of opening of the wall(to find a proper value) but no change occurs unless i delete all time step folders and start from begining.is it a true situaion?
You mean groovyBC should read 0 folder in each time step again?
Thank you.
immortality is offline   Reply With Quote

Old   February 1, 2013, 09:52
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,914
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by immortality View Post
thanks.
Should i add two expressions you told me to every groovyBC conditions?
No! Only the one you have problems with. They produce a lot of output and are only necessary if you can't spot the problem by looking at it

Quote:
Originally Posted by immortality View Post
I have the problem yet.i have run untill an important time(that moving shock faces to wall and reflects) before it happens i want to change a variable relating to time of opening of the wall(to find a proper value) but no change occurs unless i delete all time step folders and start from begining.is it a true situaion?
You mean groovyBC should read 0 folder in each time step again?
Thank you.
OpenFOAM only reads the fields once (according to startFrom/startTime) and then works with whatever is in memory. If you restart from t=100 then changes you made in t=0 are irrelevant (if that is what you mean)

If you have problems with implementing dynamic boundary conditions first test them on a tiny "toy-case" that is similar to the real case
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   February 1, 2013, 10:17
Default
  #8
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
thanks.yes I mean that you say.then changing groovyBC variables has no effect on the problem when we are at 100th time step.does it?
I have examined groovyBC by replayTransientBC.the trend seems ok.
but something takes place that i think must not be related to groovyBC,the BC is updated after 2 or 3 time steps.is it because time steps are lower than reaching the new condition(wall) to next cell?then i should decrease the size of cells more,shouldn't i?
immortality is offline   Reply With Quote

Old   February 3, 2013, 06:29
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
1)I found this expression when I used replayTransientBC in my groovyBC's:
Code:
evaluateDuringConstruction 0;
can it be the answer of problem if i change it to 1?(then it updates during run and reads from 0 folder that groovyBC's have specified?)
immortality is offline   Reply With Quote

Old   February 3, 2013, 06:35
Default
  #10
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
2)after applying replayTransientBC my p in 0 folder look like this.is it ok?or i should set values for refValue and refGradient and valueFraction?
Code:
right
    {
        type            groovyBC;
        refValue        uniform 0;
        refGradient     uniform 0;
        valueFraction   uniform 1;
        value           uniform 1.02338e+06;
        valueExpression "p0_2*pow(par2,-3.5)";
        gradientExpression "0";
        fractionExpression "(t1<time()&&time()<t1+c1)||(t2<time()&&time()<t2+c1)||(t3<time()&&time()<t3+c1)||(t4<time()&&time()<t4+c1)||(t5<time()&&time()<t5+c1)||(t6<time()&&time()<t6+c1)||(t7<time()&&time()<t7+c1)||(t8<time()&&time()<t8+c1)||(t9<time()&&time()<t9+c1)||(t10<time()&&time()<t10+c1)||(t11<time()&&time()<t11+c1)?1:0";
        evaluateDuringConstruction 0;
        variables       
43
(
"ymax=max(pos().y);"
"ymin=min(pos().y);"
"r=0.02325;"
"rpm=32151;"
"omega=rpm*pi/30;"
"v_r=r*omega;"
"w_cell=.004;"
"n=1;"
"w_w0=n*w_cell;"
"w_w1=(115.63-46)*r*pi/180;"
"w_w2=(180-159.28)*r*pi/180;"
"w_w3=(21.6-0)*r*pi/180;"
"w_w4=(83-61.6)*r*pi/180;"
"w_w5=(180-128)*r*pi/180;"
"w_p1=(160.28-116.63)*r*pi/180;"
"w_p2=(71.1-21.6)*r*pi/180;"
"w_p3=(46-0)*r*pi/180;"
"w_p4=(129-84)*r*pi/180;"
"c1=w_p2/v_r;"
"c2=(w_p2+w_w4)/v_r;"
"c3=(w_p2+w_w4+w_p4)/v_r;"
"c4=(w_p2+w_w4+w_p4+w_w5+w_w3)/v_r;"
"t1=(w_w0+w_w3-pos().y)/v_r;"
"t2=t1+c4;"
"t3=t1+2*c4;"
"t4=t1+3*c4;"
"t5=t1+4*c4;"
"t6=t1+5*c4;"
"t7=t1+6*c4;"
"t8=t1+7*c4;"
"t9=t1+8*c4;"
"t10=t1+9*c4;"
"t11=t1+10*c4;"
"p0_1=303975;"
"T0_1=440;"
"p0_3=932190;"
"T0_3=1248;"
"p0_2=1023382.5;"
"T0_4=973;"
"gamma=1.4;"
"R=287.14;"
"par1=1-(gamma-1)*magSqr(internalField(U))/(2*gamma*R*T0_1);"
"par2=1+(gamma-1)/2*magSqr(internalField(U))/(gamma*R*internalField(T));"
)
;
        timelines       (
);
        lookuptables    (
);
    }
3)what does valueFraction means when i have set fractionExpession?whats its usage?
thanks.
immortality is offline   Reply With Quote

Old   February 4, 2013, 01:56
Default
  #11
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
any answer is thanked and appreciated.
immortality is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
grid dependancy gueynard a. Main CFD Forum 19 June 27, 2014 21:22
Update the environment variables for 1.5-dev chilledkroete OpenFOAM Installation 5 November 9, 2010 05:13
Very slow to update solution Shane FLUENT 1 August 14, 2006 20:29
PHI file structure Eugene Phoenics 9 November 2, 2001 23:00
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 02:16


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