-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
User function to patch flow variables after restart from plot file (#398
) * Added function declaration for patching ignition kernel * Corrected for running on HIP * Made changes to EB Backward facing step flame case * Updated Pelephysics * Clang Tidyied * Compiled and check EB_BFSF * Added documentation * Modified ignition patching to flow variable patching * Formatted * Corrected input file for EBBFS * cleaned up some of the print statements * Changed input file EBBF to be reactive * Incorporating Bruce's suggestions * Making changes suggested by Bruce * clang tidy --------- Co-authored-by: Bruce Perry <[email protected]>
- Loading branch information
1 parent
5c77f2e
commit e79f505
Showing
16 changed files
with
86 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
Exec/RegTests/EB_BackwardStepFlame/PeleLMeX_PatchFlowVariables.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
#include "PeleLMeX.H" | ||
using namespace amrex; | ||
|
||
void | ||
patchFlowVariables( | ||
const amrex::Geometry& geom, ProbParm const& lprobparm, amrex::MultiFab& a_mf) | ||
{ | ||
|
||
amrex::Print() << "\nPatching flow variables.."; | ||
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> prob_lo = | ||
geom.ProbLoArray(); | ||
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> dx = geom.CellSizeArray(); | ||
|
||
for (amrex::MFIter mfi(a_mf, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { | ||
const amrex::Box& bx = mfi.tilebox(); | ||
auto const& temp_arr = a_mf.array(mfi, TEMP); | ||
amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { | ||
amrex::Real x[3] = { | ||
prob_lo[0] + static_cast<amrex::Real>(i + 0.5) * dx[0], | ||
prob_lo[1] + static_cast<amrex::Real>(j + 0.5) * dx[1], | ||
prob_lo[2] + static_cast<amrex::Real>(k + 0.5) * dx[2]}; | ||
|
||
amrex::ignore_unused(x); | ||
/*User can define how to patch flow variables here.*/ | ||
temp_arr(i, j, k) = lprobparm.T_mean; | ||
}); | ||
} | ||
|
||
amrex::Print() << "Done\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef PELELM_PATCHFLOWVARIABLES_H | ||
#define PELELM_PATCHFLOWVARIABLES_H | ||
|
||
class PeleLM; | ||
|
||
void patchFlowVariables( | ||
const amrex::Geometry& geom, | ||
ProbParm const& prob_parm, | ||
amrex::MultiFab& a_mf); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <PeleLMeX.H> | ||
#include <PeleLMeX_K.H> | ||
#include <PeleLMeX_PatchFlowVariables.H> | ||
|
||
using namespace amrex; | ||
|
||
void | ||
patchFlowVariables( | ||
const amrex::Geometry& /*geom*/, | ||
ProbParm const& /*prob_parm*/, | ||
amrex::MultiFab& /*a_mf*/) | ||
{ | ||
Abort("Using patchFlowVariables requires providing a definition in local " | ||
"PatchFlowVariables.cpp"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters