Skip to content
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

Merged
merged 9 commits into from
Mar 7, 2024
Merged

central entropy output added #203

merged 9 commits into from
Mar 7, 2024

Conversation

mari2895
Copy link
Collaborator

@mari2895 mari2895 commented Mar 7, 2024

PR Summary

added output for entropy at z=0

PR Checklist

  • Adds a test for any bugs fixed. Adds tests for new features.
  • Format your changes by calling scripts/bash/format.sh.
  • Explain what you did.

@mari2895 mari2895 self-assigned this Mar 7, 2024
@@ -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);
Copy link
Collaborator

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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);
Copy link
Collaborator

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

Copy link
Collaborator Author

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);
Copy link
Collaborator

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 &params = analysis_pkg->AllParams();
Real sigma = pin->GetOrAddReal("analysis", "sigma", 2e-3);
params.Add("sigma", sigma);
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Yurlungur Yurlungur merged commit b884fa0 into main Mar 7, 2024
2 checks passed
@Yurlungur Yurlungur deleted the mg/entropy0 branch March 7, 2024 23:46
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.

3 participants