firedrakeproject / gusto

Three dimensional atmospheric dynamical core using the Gung Ho numerics.
http://firedrakeproject.org/gusto/
MIT License
12 stars 11 forks source link

Conservative transport with physics #504

Closed ta440 closed 3 months ago

ta440 commented 6 months ago

This resolves an incompatibility when using conservative transport and a physics scheme. The conservative transport needs a mass weighted (multiplied by density) form of the mass and transport terms, whilst a physics scheme does not use these. To resolve this, we introduce a mass_weighted label. When there is a term with both transport and mass_weighted labels, then we firstly check if there is a physics scheme, and raise an error if so (this means we are solving all the terms at once, when we need to split the transport and physics e.g. use SplitPrescribedTransport instead of PrescribedTransport). Else, we replace the terms with their mass-weighted counterparts to enable conservative transport. A test of this functionality is added in the integration-tests/model/test_coupled_transport_with_physics.py file.