Conversation
…ments will initialize to LTE
| enum class PackageControl { inactive = -1, shutdown = 0, active = 1, initial = 2 }; | ||
|
|
||
| template <class PKG> | ||
| inline PackageControl CheckPackageStatus(PKG &pkg, const Real time) { |
There was a problem hiding this comment.
Not a problem for today... but something like this might be a bit more nuanced for non operator-split physics. For example, I don't think we would want to turn off physics in between the the 1st and 2nd stage of RK2. Not an issue at the moment, just thinking aloud.
There was a problem hiding this comment.
This is only called before entering Step, so there won't be any switching mid RK-stage
There was a problem hiding this comment.
I have expanded this use to physics that is done in the rk substeps, in those cases i also only turn on/off for the first stage
| const Real &sie = vmesh(b, gas::prim::sie(0), k, j, i); | ||
| const Real T = eos_d.TemperatureFromDensityInternalEnergy(rho, sie); | ||
| const Real Erad = arad * SQR(SQR(T)); | ||
| vmesh(b, rad::cons::energy(0), k, j, i) = Erad; |
There was a problem hiding this comment.
I wonder if we should mask such initialization on material with optical depth >~ 1>?
There was a problem hiding this comment.
I worry that a batch of zones could skirt whatever criterion you impose and then you'd get bad numerical behavior of neighboring zones at the floor and not at the floor.
|
I will add this machinery also to the cooling package |
…oments. Still need a jaybenne mesh initializer function
| // What to call here to set the field? | ||
| // Need a pmesh version of this | ||
| // jaybenne::InitializeRadiation(md.get(), true) | ||
| } |
There was a problem hiding this comment.
If jaybenne had a mesh version of this function in addition to the meshblock version, we could turn imc on/off easily. @RyanWollaeger @pdmullen let's add that to jaybenne
| //! \fn TaskListStatus SelfGravity::PoissonDriver | ||
| //! \brief | ||
| void SolvePoisson(TaskCollection &tc, Mesh *pmesh) { | ||
| void SolvePoisson(TaskCollection &tc, Mesh *pmesh, const Real time, const int stage) { |
There was a problem hiding this comment.
I noticed this doesn't return TaskListStatus, but should it @pdmullen ?
There was a problem hiding this comment.
I think not. All we are doing is passing the TaskCollection tc to SolvePoisson and having that function add a region with its own tasks.
When we call Execute on the final TaskCollection, that returns TaskListStatus (see StepTasks.Execute()).
The comment is wrong in the //! \fn though.
Background
This adds the machinery to turn on/off and initialize/shutdown a package during a simulation. To start, I have enrolled moments and raytrace into this.
When moments comes on, it will set all variables to LTE values.
We should do the same for IMC and pretty much all of the packages.
I have tested this locally, and it works correctly, even through restarts.
Description of Changes
Checklist
// This file was created in part or in whole by generative AI