CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   STAR-CCM+ (http://www.cfd-online.com/Forums/star-ccm/)
-   -   Starting turbulence models later after a few hundred iterations. (http://www.cfd-online.com/Forums/star-ccm/93329-starting-turbulence-models-later-after-few-hundred-iterations.html)

hamzamotiwala October 12, 2011 02:56

Starting turbulence models later after a few hundred iterations.
 
Hey everyone,

Is there a way to turn on the turbulence models automatically after a few 100 iterations?

Its something similar to turning on a Heat Exchanger model (if you are familiar with it).

Is it possible in someway with the help of field functions or something?

Thanks,
Hamza

abdul099 October 13, 2011 16:59

No, to turn on the model, you have to stop the simulation, therefore you can't do it with a field function.
What you can do is to record a java macro and adjust the number of iterations before switching on the turbulence model.

hamzamotiwala October 25, 2011 08:50

hey abdul,

thanks for the idea...but doesnt recording the macro mean that i need to make a recording upto that many iterations?

and is it automatic, i mean the recording..does the recording turn on and off on its own if i send the simulation to the cluster?

because to run the simulation locally would take some time even for just a few 100 iterations....

rwryne October 25, 2011 09:00

Quote:

Originally Posted by hamzamotiwala (Post 329357)
hey abdul,

thanks for the idea...but doesnt recording the macro mean that i need to make a recording upto that many iterations?

and is it automatic, i mean the recording..does the recording turn on and off on its own if i send the simulation to the cluster?

because to run the simulation locally would take some time even for just a few 100 iterations....

Recording the macro is just to get you started, like to get the correct commands for turning on/off the turbulence. You then have to modify the script it generates to add logic that checks for the current iteration and turns it on.

You can then submit the job to the cluster using the script

hamzamotiwala October 25, 2011 09:10

Thanks Ryne,

Will try that out and get back to you..since I have never done something like this before...I might need assistance...:)

abdul099 October 25, 2011 19:32

Just record a macro and run the simulation for let's say 5 steps, and then switch on the turbulence model. Than have a look at the macro. There will be somewhere a line containing either the number of steps until you stopped the simulation or just a run(); command. Don't know without looking it up. Just modify this line, by either changing the number or when there's the run-command, change it to run(500); or which number of iterations you want before switching on the turbulence mode.

To run it on the cluster, you just have to submit your job with the macro. There's the -batch command line option. Just add the path to your macro directly after the -batch, e.g. -batch turbulencemodelstartmacro.java

hamzamotiwala October 28, 2011 04:16

Hey guys,

I tired recording a macro and then modifying it but there was no information about the iterations when the turbulence model was turned on and off. Its just something like turnturbulenceon(false/true)..

Ryne when you said that I need to add logic to the code, did you mean I should write my own code to detect the iterations?

because I couldnt find any numbers in the code denoting the iterations.

rwryne October 28, 2011 08:51

Quote:

Originally Posted by hamzamotiwala (Post 329844)
Hey guys,

I tired recording a macro and then modifying it but there was no information about the iterations when the turbulence model was turned on and off. Its just something like turnturbulenceon(false/true)..

Ryne when you said that I need to add logic to the code, did you mean I should write my own code to detect the iterations?

because I couldnt find any numbers in the code denoting the iterations.

Yes, you would have to add a logical statement checking the iteration count yourself.

A simpler method would be what abdul recommended:
Run(500 iterations)
Turn Turbulence On
Run(4500 iterations)


gocfd November 29, 2011 13:53

Under the solvers, ramp up the turbulence model URF and keep initial value to zero and define start iteration to 100 and probably can define end iteration to 200 or so.

hamzamotiwala December 7, 2011 09:53

Quote:

Originally Posted by gocfd (Post 334004)
Under the solvers, ramp up the turbulence model URF and keep initial value to zero and define start iteration to 100 and probably can define end iteration to 200 or so.


Is ramping similar to freezing the solver?

gocfd December 7, 2011 11:40

As long as URF value for turbulence is zero, the value of turbulence variables (depends on turbulence model) wan't be updated (remains constant as of initial values). Even though it is different from freezing the solver, it works in most of the cases.

hamzamotiwala December 9, 2011 05:25

Quote:

Originally Posted by gocfd (Post 335041)
As long as URF value for turbulence is zero, the value of turbulence variables (depends on turbulence model) wan't be updated (remains constant as of initial values). Even though it is different from freezing the solver, it works in most of the cases.

Ok. I asked because I thought URF usually decides how much percentage of the previous iteration it takes to calculate the new step and setting the value to 0 would mean that I would be calculating the turbulence value for every iteration from scratch all the time. or am I completely wrong here about URFs?


All times are GMT -4. The time now is 03:14.