[mesa-users] Post-processing of mixing regions
Kevin Moore
klmoore at soe.ucsc.edu
Tue Apr 22 15:36:56 EDT 2014
Oh, right right - do1_mlt() is called all the time from set_newton_vars() in eval_equations() in star/private/hydro_newton_procs.f (because this is all unsplit, it has to be part of the Newton solve). The proposed changes sound good to me.
On Apr 22, 2014, at 12:07 PM, Bill Paxton <paxton at kitp.ucsb.edu> wrote:
>
> On Apr 22, 2014, at 11:50 AM, Kevin Moore wrote:
>
>> Aha, thanks Bill - that’s exactly what I was looking for!
>>
>> I think it makes more sense to have mlt_mixing_type and mixing_type refer to the model at the same part of the time step. They’re both output in profiles by default, and the only thing I’ve wanted both for is to do the exercise I’m doing now - making sure that I understand how mixing regions are altered outside of the MLT module. As long as the documentation points out when these are evaluated, it should be fine.
>
> okay. by "documentation" for now we mean comments in the code! but I'll add some as well as changing things so that mlt_mixing_type and friends will be left with their values from the start of the step.
>
>> Just to make sure I understand how gradT works, the value of actual_gradT is set when the MLT module is called so should reflect the actual dlnT/dlnP in the model at the beginning of the time step.
>
> no. actual_gradT is set by each time we call the MLT (from star/private/mlt_info). so at the end of the step, actual_gradT is the a finite difference approximation to dlnT/dlnP at the end of the step.
>
> does that make sense now?
>
> let's review --- here's the code from mlt_info where we set variables in star_info to results from calling MLT.
> s% mlt_mixing_type(k) = mixing_type
> s% grada_at_face(k) = grada_face
> s% gradr(k) = mlt_basics(mlt_gradr)
> s% mlt_mixing_length(k) = mlt_basics(mlt_Lambda)
> s% mlt_D(k) = mlt_basics(mlt_D)
> s% mlt_vc(k) = mlt_basics(mlt_convection_velocity)
> s% mlt_Gamma(k) = mlt_basics(mlt_Gamma)
> s% scale_height(k) = mlt_basics(mlt_scale_height)
> s% mlt_cdc(k) = mlt_basics(mlt_D)*pow2(pi4*r*r*rho_face)
> s% gradL(k) = mlt_basics(mlt_gradL)
> s% conv_dP_term(k) = mlt_basics(mlt_conv_dP_term)
> s% gradT(k) = mlt_basics(mlt_gradT)
>
> plus some partials of these.
>
> in addition, we set these
> s% actual_gradT(k) = &
> ((s% T(k-1) - s% T(k))/T_face) / ((s% P(k-1) - s% P(k))/P_face)
> s% csound_at_face(k) = sqrt(gamma1_face*P_face/rho_face)
>
>
> Currently all of these are set on each call to the MLT, so at the end of the step, they all have the end-of-step values.
>
> The proposed change is to set the following ONLY AT THE START OF THE STEP:
> s% mlt_mixing_type(k) = mixing_type
> s% mlt_mixing_length(k) = mlt_basics(mlt_Lambda)
> s% mlt_D(k) = mlt_basics(mlt_D)
> s% mlt_vc(k) = mlt_basics(mlt_convection_velocity)
> s% mlt_Gamma(k) = mlt_basics(mlt_Gamma)
> s% mlt_cdc(k) = mlt_basics(mlt_D)*pow2(pi4*r*r*rho_face)
>
> The following will continue to be updated on each call to the MLT (i.e. at each iteration and at end of step):
> s% grada_at_face(k) = grada_face
> s% gradr(k) = mlt_basics(mlt_gradr)
> s% scale_height(k) = mlt_basics(mlt_scale_height)
> s% gradL(k) = mlt_basics(mlt_gradL)
> s% conv_dP_term(k) = mlt_basics(mlt_conv_dP_term)
> s% gradT(k) = mlt_basics(mlt_gradT)
> s% actual_gradT(k) = &
> ((s% T(k-1) - s% T(k))/T_face) / ((s% P(k-1) - s% P(k))/P_face)
> s% csound_at_face(k) = sqrt(gamma1_face*P_face/rho_face)
>
>
> That way, the "mlt_" prefix will mean "value from MLT at start of step".
> Items without that prefix will have "value from last call on MLT" -- i.e., "end of step value" for profiles etc.
>
>
> -B
>
>
>
>
>
>
>
More information about the Mesa-users
mailing list