When I am setting up a transient run inside of CFX-Pre, it is fairly easy to specify a timestep list using the asterisk for repeated steps,
i.e. 5*.01 [s}, 10*.02 [s}... If I am working outside of CFX-Pre, what is the easiest way to modify the timestep list with a number of repeated steps without typing in the whole thing manually?




One way to do this uses a CCL file snippet with Power Syntax (embedded Perl commands) that does the looping necessary to set up and modify the timestep list.

An example CCL snippet (timestep.ccl) is shown below and is attached

When you define the run, you just need to add `-ccl timestep.ccl` to the solver argument list (on the Solver tab of the `Advanced Controls` panel on the `Define Run form`).

For the example shown below, there are 10 timesteps of 0.01 [s], 5 timesteps of 0.05 [s], and 1 timestep of 0.25 [s].

The file timestep.ccl contains the following lines:

#### This Section Should Be Changed By the USER ####
!$nt1 = 10;
!$dt1 = "0.01 [s]";
!$nt2 = 5;
!$dt2 = "0.05 [s]";
!$nt3 = 1;
!$dt3 = "0.25 [s]";
#### END of USER Section ####

!$dtlist = "$dt1";
!$i = 2;
!while ($i < $nt1+1) {
!$dtlist = $dtlist . ",$dt1";
!$i++;
!}
!$i = 1;
!while ($i < $nt2+1) {
!$dtlist = $dtlist . ",$dt2";
!$i++;
!}
!$i = 1;
!while ($i < $nt3+1) {
!$dtlist = $dtlist . ",$dt3";
!$i++;
!}
FLOW:
SIMULATION TYPE:TIME STEPS:
Option = Timesteps
Timesteps = $dtlist
END
END
END

It produces the following CCL for the SIMULATION TYPE (note that only the TIMESTEPS section is modified by the
CCL snippet timestep.ccl. The solver puts in line breaks as needed - they do not have to be included in
the CCL snippet. The example shown can be modified as desired to add more or fewer timesteps to the
list.

SIMULATION TYPE:
Option = Transient
INITIAL TIME:
Option = Automatic with Value
Time = 0 [s]
END
TIME DURATION:
Option = Total Time
Total Time = 0.20 [s]
END
TIME STEPS:
Option = Timesteps
Timesteps = 0.01 [s],0.01 [s],0.01 [s],0.01 [s],0.01 [s],0.01 [s],0.01
[s],0.01 [s],0.01 [s],0.01 [s],0.05 [s],0.05 [s],0.05 [s],0.05
[s],0.05 [s],0.25 [s]
END
END





Show Form
No comments yet. Be the first to add a comment!