Use multiple executioners in Moose

134 views
Skip to first unread message

walkand...@gmail.com

unread,
Sep 7, 2017, 8:39:43 AM9/7/17
to moose-users
Deal all,
    I'm simulating a very stiff PDEs system in moose.
    I want to use a very small dt at the first 10000 time step for example,and then, change the dt to a little bit larger value(or enable the adaptive time stepper) when the system is not so stiff.

    So what I want to do  is:
    [Executioner]
       type = Transient
        solve_type = 'PJFNK'
        petsc_options_iname = '-pc_type -pc_hypre_type'
       petsc_options_value = 'hypre boomeramg'
       nl_rel_tol = 1e-8
       nl_abs_tol = 1e-9
      [./first_stage]
        dt=1.e-10
       num_steps = 100000
      [../]
      
      [./second_stage]
        [./TimeStepper]
          type = SolutionTimeAdaptiveDT
          dt = 1.e-10  
        [../]
      [../]
    []

*****************************************
But it seems doesn't work in moose.

Any helpful suggestions or other ideas?

Thank you

Best regards

Cody Permann

unread,
Sep 7, 2017, 10:34:01 AM9/7/17
to moose-users
Actually, what you are asking for is multiple TimeSteppers, not Executioners. MOOSE currently doesn't support having multiple TimeSteppers in a single simulation, at least not directly. However, there are many options that can get you to a solution.

1) Don't worry about adding multiple TimeSteppers. Use one of the adaptive TimeSteppers and just let it go. If your problem is stiff in the beginning, it'll prevent the adaptive stepper from increasing the step size too much to where it can no longer converge a step. Later, it'll allow the growth. It may not give you the minimum number of steps for a particular simulation, but it should get it done with minimal fuss.

2) Consider using one of the TimeSteppers that allows you to control step size over time. We have a FunctionDT TimeStepper, we have a a time "knot" stepper, etc. 

3) Advanced: Break you simulation into two parts and use the "Restart" system to continue part 2 after the stiff part of your simulation has completed.

There may be other solution, but these are the ones I can think of off the top of my head. Hope this gets you moving in the right direction.

Cody

--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/moose-users/af97c6d3-59ed-48d7-9b8f-ed3bf67b5f86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

princessandsuperman

unread,
Sep 7, 2017, 10:35:24 AM9/7/17
to moose-users
IterationAdaptiveDT allows you to set the time_t and time_dt parameters to specify a set of dt's for specific times to force dt at specific points.

walkand...@gmail.com

unread,
Sep 8, 2017, 4:39:55 AM9/8/17
to moose-users
Thank you sincerely for the reply, Cody.

在 2017年9月7日星期四 UTC+2下午4:34:01,Cody Permann写道:
Actually, what you are asking for is multiple TimeSteppers, not Executioners. MOOSE currently doesn't support having multiple TimeSteppers in a single simulation, at least not directly. However, there are many options that can get you to a solution.

1) Don't worry about adding multiple TimeSteppers. Use one of the adaptive TimeSteppers and just let it go. If your problem is stiff in the beginning, it'll prevent the adaptive stepper from increasing the step size too much to where it can no longer converge a step. Later, it'll allow the growth. It may not give you the minimum number of steps for a particular simulation, but it should get it done with minimal fuss.
 
Well, during my simulation, I will have a unstable time period in the first several time steps, that's why I need a small dt for the first stage. I tried the adaptive stepper with a small dtmax, but it will divergent after several time steps. So I prefer to use a constant small dt for the unstable time period. 

2) Consider using one of the TimeSteppers that allows you to control step size over time. We have a FunctionDT TimeStepper, we have a a time "knot" stepper, etc. 

This seems very helpful, I will try it.
 
3) Advanced: Break you simulation into two parts and use the "Restart" system to continue part 2 after the stiff part of your simulation has completed.

There may be other solution, but these are the ones I can think of off the top of my head. Hope this gets you moving in the right direction.

en, this is also a good idea. I think I can try it.

Thank you!

walkand...@gmail.com

unread,
Sep 8, 2017, 4:44:28 AM9/8/17
to moose-users
Thank you sincerely for the reply, princessandsuperman,

在 2017年9月7日星期四 UTC+2下午4:35:24,princessandsuperman写道:
IterationAdaptiveDT allows you to set the time_t and time_dt parameters to specify a set of dt's for specific times to force dt at specific points.

This is also a good iead, I will try it.
So if I use 
***********************************
time_t=  '1.0        2.0     3.0    4.0'
time_dt='1e-10  1e-8  1e-5  1e-3'
******************************************
Is this means:
for   0.0<time<=1.0--------->dt=1.e-10
       1.0<time<=2.0--------->dt=1.e-8
       2.0<time<=3.0--------->dt=1.e-5
       3.0<time<=4.0--------->dt=1.e-3

?

Best regards 

Cody Permann

unread,
Sep 8, 2017, 11:38:37 AM9/8/17
to moose...@googlegroups.com
On Fri, Sep 8, 2017 at 2:44 AM <walkand...@gmail.com> wrote:
Thank you sincerely for the reply, princessandsuperman,

在 2017年9月7日星期四 UTC+2下午4:35:24,princessandsuperman写道:
IterationAdaptiveDT allows you to set the time_t and time_dt parameters to specify a set of dt's for specific times to force dt at specific points.

This is also a good iead, I will try it.
So if I use 
***********************************
time_t=  '1.0        2.0     3.0    4.0'
time_dt='1e-10  1e-8  1e-5  1e-3'
******************************************
Is this means:
for   0.0<time<=1.0--------->dt=1.e-10
       1.0<time<=2.0--------->dt=1.e-8
       2.0<time<=3.0--------->dt=1.e-5
       3.0<time<=4.0--------->dt=1.e-3

?

Good question, I believe we have two different steppers one that does linear interpolation between each set of points, and one that does a step function approach: (i.e. constant at each point). Depending on your physics, switching from one time step size to another quickly could cause issues which is why many prefer the linear interpolation approach. You can just have two points with the same DT value if you want it to remain flat, then have a quick transition to your next time so you can effectively get what you want either way.

Cody
 
--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/moose-users.

walkand...@gmail.com

unread,
Sep 8, 2017, 2:31:25 PM9/8/17
to moose-users


在 2017年9月8日星期五 UTC+2下午5:38:37,Cody Permann写道:


On Fri, Sep 8, 2017 at 2:44 AM <walkand...@gmail.com> wrote:
Thank you sincerely for the reply, princessandsuperman,

在 2017年9月7日星期四 UTC+2下午4:35:24,princessandsuperman写道:
IterationAdaptiveDT allows you to set the time_t and time_dt parameters to specify a set of dt's for specific times to force dt at specific points.

This is also a good iead, I will try it.
So if I use 
***********************************
time_t=  '1.0        2.0     3.0    4.0'
time_dt='1e-10  1e-8  1e-5  1e-3'
******************************************
Is this means:
for   0.0<time<=1.0--------->dt=1.e-10
       1.0<time<=2.0--------->dt=1.e-8
       2.0<time<=3.0--------->dt=1.e-5
       3.0<time<=4.0--------->dt=1.e-3

?

Good question, I believe we have two different steppers one that does linear interpolation between each set of points, and one that does a step function approach: (i.e. constant at each point). Depending on your physics, switching from one time step size to another quickly could cause issues which is why many prefer the linear interpolation approach. You can just have two points with the same DT value if you want it to remain flat, then have a quick transition to your next time so you can effectively get what you want either way.

Cody

Thank you Cody, this is great helpful!
Thank you!
Reply all
Reply to author
Forward
0 new messages