CVMix / CVMix-src

CVMix source code (including protex documentation) as well as build system and examples / tests
Other
30 stars 29 forks source link

Improve non-local term shape functions #48

Closed mnlevy1981 closed 9 years ago

mnlevy1981 commented 9 years ago

In LMD94, the nonlocal term is defined (by manipulating Eqs (10) and (20) by

Kgamma = -Cs * G(sigma) \ Q

(the minus sign is the CVMix convention and CVMix returns K*gamma/Q to the base model).

@StephenGriffies pointed out that LMD assumes G(0) = 0 => the nonlocal term is 0 at the surface... but it may be desirable to use a shape function that allows K*gamma = -Q at the surface.

I think there are two ways to accomplish this. Both start with removing cvmix_kpp_compute_nonlocal() [which returns G(sigma)*Cs] and simply computing G(sigma). From there, we can either:

1) As Steve and I discussed over the phone, we can add Cs to the cvmix_kpp_params_type. When you call cvmix_init_kpp(), if you omit the Cs argument then it computes Cs = C* * kappa * (__)^1/3 or you can set it to 1

2) Something else that I just thought of would be to create Cs as a module-wide parameter. If you choose MatchTechnique = 'ParabolicNonlocal' then Cs = 1, otherwise Cs = the value above.

In either case, you multiply Tnonlocal and Snonlocal by Cs after computing all the G(sigma) values in the column.


Relatedly, Steve has suggested two other shape functions for the nonlocal term, a linear function and a cubic function. I think the best way to implement those would be to have another MatchTechnique parameter (so MatchTechnique controls the local shape function and MatchTechnique2 or MatchTechniqueNonlocal controls the nonlocal shape function). I'll tackle that after fixing this issue with Cs, regardless of whether we go with option (1) or option (2) it should be a straight-forward update.

mnlevy1981 commented 9 years ago

Started working on this in 8c78816 but it's not quite done... the nonlocal term is now computed as

[T|S]nonlocal(kw) = CVmix_kpp_params_user%nonlocal_coeff*GAtS

where nonlocal_coeff = Cs by default but can be set to 1 by calling

cvmix_init_kpp(lnonzero_surf_nonlocal = .true.)

But there's still the matter of defining a new shape function such that G(0) = 1, I believe that currently G(0) = 0 for all MatchTechnique options.

mnlevy1981 commented 9 years ago

Double checked... actually, this code should work with

MatchTechnique = 'ParabolicNonlocal'