-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
central entropy output added #203
Conversation
src/phoebus_driver.cpp
Outdated
@@ -1068,6 +1069,10 @@ void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin) { | |||
Real gam1[3][3]; | |||
Real gam2[3][3]; | |||
Real gam3[3][3]; | |||
const Real z = coords.Xc<3>(k, j, i); | |||
const Real sigma = 2 * coords.CellWidthFA(X3DIR, k, j, i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this depends on the mesh width on the block you're on which makes me a bit uncomfortable. I suggest making sigma a free parameter that is set-able in the input deck.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm that's a weird thing to have in input deck... plus out of context from everything else, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an analysis parameter. Just make a n "analysis" input block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/phoebus_driver.cpp
Outdated
@@ -1068,6 +1069,10 @@ void UserWorkBeforeOutput(MeshBlock *pmb, ParameterInput *pin) { | |||
Real gam1[3][3]; | |||
Real gam2[3][3]; | |||
Real gam3[3][3]; | |||
const Real z = coords.Xc<3>(k, j, i); | |||
const Real sigma = 2 * coords.CellWidthFA(X3DIR, k, j, i); | |||
const Real s0 = s * std::exp(-z * z / sigma / sigma); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively (or possibly additionally) we should probably normalize our Gaussian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -207,6 +207,7 @@ std::shared_ptr<StateDescriptor> Initialize(ParameterInput *pin) { | |||
physics->AddField(p::entropy::name(), mprim_scalar); | |||
physics->AddField(p::cs::name(), mprim_scalar); | |||
physics->AddField(diag::ratio_divv_cs::name(), mprim_scalar); | |||
physics->AddField(diag::entropy_z_0::name(), mprim_scalar); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might make more sense to register this var in the analysis initialize function. But this is fine for now.
auto analysis_pkg = std::make_shared<StateDescriptor>("analysis"); | ||
Params ¶ms = analysis_pkg->AllParams(); | ||
Real sigma = pin->GetOrAddReal("analysis", "sigma", 2e-3); | ||
params.Add("sigma", sigma); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a check that sigma > 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
PR Summary
added output for entropy at z=0
PR Checklist
scripts/bash/format.sh
.