[x] My change requires a change to the documentation.
[ ] I have updated the documentation in the Wiki accordingly.
[ ] I have added tests to cover my changes.
[x] All new and existing tests passed.
Please review the CONTRIBUTING.md file for detailed guidelines.
Description
To enable support for equations of state that depend on passive scalars, the passive scalars must be passed to (nearly) all EOS calls. The main difficulty here is that EOS calls are made inside the Riemann solver. This requires that the face centered values of the scalar primitive values must also be passed to the Riemann solver. Which, in turn, requires that the scalars be interpolated to the face centers at the same time as the hydro variables. Thus PasiveScalars::CalculateFluxes was essentially merged into Hydro::CalculateFluxes (I have left PasiveScalars::CalculateFluxes in the code even-though it is unused). Otherwise I've done my best to keep the scalars as separated from hydro as I can. Although, I think we should combine the hydro and scalar ConservedToPrimitive and PrimitiveToConserved functions as they are always called together (outside of pgens and if NSCALARS>0). If your EOS needs to do an inversion (e.g. find Temperature) it would be useful to store this in the passive scalars to estimate the solution for the next EOS inversion.
Currently 4th-order is not properly supported for an EOS which depends on passive scalars. In EquationOfState::ConservedToPrimitiveCellAverage there is one call to ConservedToPrimitive that uses the 4th-order cell-centered values, but I am currently only passing it the cell-averaged scalars. The only way I see of fixing that is to merge PasiveScalarPrimitiveCellAverage into ConservedToPrimitiveCellAverage so that the 4th-order cell-centered scalars are accessible at this stage. However, I didn't want to make this change without approval from @felker.
You may want to categorize major vs. minor changes and list them:
Change nearly all EOS function and Riemann solver signatures to include passive scalars, enabling scalar dependent EOS.
Merged PasiveScalars::CalculateFluxes into Hydro::CalculateFluxes
The Riemann solvers are now responsible for computing the scalar fluxes
Removed CalculateScalarFlux from task list as it is now part of hydro fluxes (dependancies updated)
Testing and validation
All current tests past using --cxx=clang++-apple on my MacBook Pro (with Apple Arm64 CPU).
...
To-do
[ ] Add EOS module that depends on passive scalars
[ ] Add corresponding shock tube tests for regression testing
[ ] Double check passive scalar fluxes are properly updated for SR/GR
[ ] Make sure doxygen comments are updated
[ ] Fix 4th-order
[ ] Cleanup now unused scalar code (and mass_flux_fc)
[ ] Maybe find a cleaner way of passing empty scalar arrays when NSCALARS is zero
Add support for equations of state that depend on passive scalars. Closes #359
Prerequisite checklist
Please review the
CONTRIBUTING.md
file for detailed guidelines.Description
To enable support for equations of state that depend on passive scalars, the passive scalars must be passed to (nearly) all EOS calls. The main difficulty here is that EOS calls are made inside the Riemann solver. This requires that the face centered values of the scalar primitive values must also be passed to the Riemann solver. Which, in turn, requires that the scalars be interpolated to the face centers at the same time as the hydro variables. Thus
PasiveScalars::CalculateFluxes
was essentially merged intoHydro::CalculateFluxes
(I have leftPasiveScalars::CalculateFluxes
in the code even-though it is unused). Otherwise I've done my best to keep the scalars as separated from hydro as I can. Although, I think we should combine the hydro and scalarConservedToPrimitive
andPrimitiveToConserved
functions as they are always called together (outside of pgens and ifNSCALARS>0
). If your EOS needs to do an inversion (e.g. find Temperature) it would be useful to store this in the passive scalars to estimate the solution for the next EOS inversion.Currently 4th-order is not properly supported for an EOS which depends on passive scalars. In
EquationOfState::ConservedToPrimitiveCellAverage
there is one call to ConservedToPrimitive that uses the 4th-order cell-centered values, but I am currently only passing it the cell-averaged scalars. The only way I see of fixing that is to mergePasiveScalarPrimitiveCellAverage
intoConservedToPrimitiveCellAverage
so that the 4th-order cell-centered scalars are accessible at this stage. However, I didn't want to make this change without approval from @felker.You may want to categorize major vs. minor changes and list them:
PasiveScalars::CalculateFluxes
intoHydro::CalculateFluxes
CalculateScalarFlux
from task list as it is now part of hydro fluxes (dependancies updated)Testing and validation
All current tests past using
--cxx=clang++-apple
on my MacBook Pro (with Apple Arm64 CPU)....
To-do
mass_flux_fc
)NSCALARS
is zero