CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   Timestep control via CEL? (http://www.cfd-online.com/Forums/cfx/24528-timestep-control-via-cel.html)

Claudia September 12, 2007 11:45

Timestep control via CEL?
 
Hi,

is it possible to set the physical timestep via an expression? Or is it possible to control the timestep in any other way than manually? I would like to choose a larger timestep for example in the first 50 iterations and then a smaller one.

Thanks Claudia

Alex September 12, 2007 12:18

Re: Timestep control via CEL?
 
There are a number of ways to do this. You can use an expression if you like, or you can just give a list of timesteps. Check the documentation: CFX-Pre Users Guide -> Simulation Type -> Editing the Simulation Type -> Basic Settings Tab.

Claudia September 12, 2007 12:24

Re: Timestep control via CEL?
 
But this is I think only for transient simulations. My simulation is steady state.


Robin September 12, 2007 12:33

Re: Timestep control via CEL?
 
Hi Claudia,

Create a 1D interpolation function of timestep in [s] vs iteration number, which is dimensionless []. You can do so in the GUI, but here is the resulting CCL object:

LIBRARY:
CEL:
FUNCTION: myTimeStep
Argument Units = []
Option = Interpolation
Profile Function = Off
Result Units = [s]
INTERPOLATION DATA:
Data Pairs = 0,0.1,50,0.1,60,0.01
Extend Max = On
Extend Min = On
Option = One Dimensional
END
END
END
END

The above function will use a timestep of .1 for the first 50 iterations, then linearly decrease it to .01 between 50 and 60 iterations. The Extend Min and Extend Max parameters simply extend the max and min values to be used beyond the range defined in the function (if you don't enable these you'll get a failure at iteration 61 because the function would be undefined)

You would then define your timestep as either:

myTimeStep(aitern) or myTimeStep(citern)

'aitern' returns the Absolute Iteration Number (i.e. the number of iterations since it was first started) whereas 'citern' returns the Current Iteration Number (the number of iterations in the current run, reset to zero with each restart).

Regards,
Robin

Alex September 12, 2007 13:36

Re: Timestep control via CEL?
 
It works for steady state as well.

Claudia September 13, 2007 08:00

Re: Timestep control via CEL?
 
Thanks Robin,

I will test it in the next simulation. But I think this is what I looked for.

Claudia

HekLer September 13, 2007 14:02

Re: Timestep control via CEL?
 
If you don't want to use an interpolation function you can also use the CEL step() function. For example, you could create a CEL expression like this:


CEL:
EXPRESSIONS:
transition = 15
dt1 = 1.0 [s]
dt2 = 10.0 [s]
dtf = dt1*step(transition-aitern) + step(aitern-transition)*dt2
END
END


and then set the physical timescale to dtf. This will transition from dt1 to dt2 at the specified iteration.

Claudia September 14, 2007 05:00

Re: Timestep control via CEL?
 
Hi HekLer,

yes, I tried it a few days ago and it didn't work, but I think it was my fault. I will try it once more.

Thanks!

Claudia


All times are GMT -4. The time now is 12:40.