Skip to content

Draft: Extending custom reference states to active and passive scalar fields.#586

Draft
cianwilson wants to merge 8 commits intomainfrom
cianwilson/chi-reference-states
Draft

Draft: Extending custom reference states to active and passive scalar fields.#586
cianwilson wants to merge 8 commits intomainfrom
cianwilson/chi-reference-states

Conversation

@cianwilson
Copy link
Copy Markdown
Member

Still in development. No need to review yet.

This is done by creating a new input file type, based on the reference state file but for scalar fields alone.

These can be set using chi_a_custom_reference_file and chi_p_custom_reference_file for active and passive scalar fields respectively. Other new namelist parameters are:

    override_chi_a_constant, override_chi_p_constant,
    chi_a_constants, chi_p_constants,
    with_custom_chi_a_constants, with_custom_chi_p_constants,
    with_custom_chi_a_functions, with_custom_chi_p_functions

which do the equivalent of their reference state parameters but for active and passive scalar fields.

Currently it is possible to set reference states for:

    constants = ['dchirefdr_scale', 'kappa_chi_scale', 'source_chi_scale', 'buoy_chi_scale']
    functions = ['dchirefdr', 'kappa_chi', 'source_chi', 'd_ln_kappa_chi', 'buoy_chi']

The buoyancy constant and function will be ignored for passive scalar fields.

Hooked up the dchiref in the assembly of the scalar fields as well as the source terms.

Also fixed some typos and deprecation warnings.

This is untested and undocumented so far. More to come.

This is done by creating a new input file type, based on the reference state file but for scalar fields alone.

These can be set using `chi_a_custom_reference_file` and `chi_p_custom_reference_file` for active and passive scalar fields
respectively.  Other new namelist parameters are:
```
    override_chi_a_constant, override_chi_p_constant,
    chi_a_constants, chi_p_constants,
    with_custom_chi_a_constants, with_custom_chi_p_constants,
    with_custom_chi_a_functions, with_custom_chi_p_functions
```
which do the equivalent of their reference state parameters but for active and passive scalar fields.

Currently it is possible to set reference states for:
```
    constants = ['dchirefdr_scale', 'kappa_chi_scale', 'source_chi_scale', 'buoy_chi_scale']
    functions = ['dchirefdr', 'kappa_chi', 'source_chi', 'd_ln_kappa_chi', 'buoy_chi']
```
The buoyancy constant and function will be ignored for passive scalar fields.

Hooked up the dchiref in the assembly of the scalar fields as well as the source terms.

Also fixed some typos and deprecation warnings.

This is untested and undocumented so far.  More to come.
@cianwilson cianwilson self-assigned this Apr 7, 2026
The test currently compares running an augmented source T case with an augmented source chi case with and without advecting a reference state.

I haven't been able to get the same answer generated with and without advecting the reference state yet.

Implementing this test involved allowing rmin and rmax to be available always to generic input generation
(rayleigh_spectral_input.py).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant