How to handle non-constant coefficients on the RHS (esp. for parallel problems)

41 views
Skip to first unread message

Ben Brown

unread,
Jun 25, 2014, 6:00:46 PM6/25/14
to dedal...@googlegroups.com
All,
      I have a problem where there is a non-constant coefficient (background temperature) on the right hand side.  This is an old problem that we've solved a number of times, but I can't recall or find the solution.  Here the RHS NCC appears in an EOS for entropy (s):

T0 = z0 - z_basis.grid
conv_problem.add_equation(("Cv_inv*s - T_1/T_0 + (gamma-1)*ln_rho_1 = "
                           "-T_1*T_1/T_0/(T_0 + T_1)"))
conv_problem.parameters['T_0']  = T0


See the "T_0" term in two spots of the denominator of the RHS.

This works fine on a single processor, but breaks for parallel jobs, as now the T_0 on the RHS needs to be a locally defined quantity.  It would seem like one solution to this is to define:

T0 = z0 - z_basis.grid
z_local = domain.grid(1)
T0_local = z0-z_local

conv_problem.add_equation(("Cv_inv*s - T_1/T_0 + (gamma-1)*ln_rho_1 = "
                           "-T_1*T_1/T_0_local/(T_0_local + T_1)"))
conv_problem.parameters['T_0']  = T0
conv_problem.parameters['T_0_local']  = T0_local

but T0_local is not globally sized, so the parser throws an error when running a parallel job.


What's the right way to do this?  Is it by defining T0_local as a field and using that?  If so, should it still be set by .parameters[], or by a different method (like .vars)?

Thanks, and sorry for revisiting this old problem,
--Ben

Daniel Lecoanet

unread,
Jun 25, 2014, 6:07:51 PM6/25/14
to Ben Brown, dedal...@googlegroups.com
Hey Ben,

Define T0_r (T0 on the RHS) as a field:

z = domain.grid(1)
T0_r = domain.new_field()
T0_r['g'] = Lz + 1 - z

conv_problem.parameters['T0_r'] = T0_r

Daniel


--
You received this message because you are subscribed to the Google Groups "Dedalus Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-dev...@googlegroups.com.
To post to this group, send email to dedal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-dev/CAHqBLzwGHysh7Mfy6DJ6%2BgEoJzpU90HPtAe0ZorpNxUC1%2Bcbjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ben Brown

unread,
Jun 25, 2014, 8:05:45 PM6/25/14
to Daniel Lecoanet, dedal...@googlegroups.com
Daniel,
     Thanks!  That seems to work, though Dedalus does throw an interesting warning:

2014-06-25 17:00:55,063 Dedalus2  0/64 WARNING : Non-scalar and non-array parameters not currently implemented for LHS.

(and all other cores throw the same warning).  The line that triggers this is:

conv_problem.parameters['T_0_r']  = T0_r

T_0_r only appears on the RHS in the equations, and in param_names.


Do I assume that this is really and truely just a warning, namely, as long as T0_r is only used on the RHS everything is fine?  Or is this indicating that there is a real a conflict of some sort?

Also, any way to only have core 0 throw this particular warning?
--Ben

Daniel Lecoanet

unread,
Jun 25, 2014, 9:01:31 PM6/25/14
to Ben Brown, dedal...@googlegroups.com
Yes this is just a warning.  I don't know how to switch it from warning (every core) to info (only core 0).  Is there an easy way to do this Keaton?

Daniel

Keaton Burns

unread,
Jun 25, 2014, 9:04:52 PM6/25/14
to Daniel Lecoanet, Ben Brown, dedal...@googlegroups.com
Yep it’s just a warning while the LHS NCC / RHS parameters are still split.

There’s an option in the config file for setting the log level of non-root processes, if you increase it to “error” then you’ll only see warning from the root process. 


Reply all
Reply to author
Forward
0 new messages