Skip to content

Commit

Permalink
Use one source for gravity to avoid inconsistencies (Exawind#1070)
Browse files Browse the repository at this point in the history
  • Loading branch information
moprak-nrel authored May 23, 2024
1 parent 2c00d88 commit 2a0db27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions amr-wind/wind_energy/ABLStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@ void ABLStats::initialize()
pp.query("normal_direction", m_normal_dir);
AMREX_ASSERT((0 <= m_normal_dir) && (m_normal_dir < AMREX_SPACEDIM));
pp.query("kappa", m_kappa);
pp.get("reference_temperature", m_ref_theta);
pp.query("stats_do_energy_budget", m_do_energy_budget);
}

{
amrex::ParmParse pp("incflo");
amrex::Vector<amrex::Real> gravity{0.0, 0.0, -9.81};
pp.queryarr("gravity", gravity);
m_gravity = utils::vec_mag(gravity.data());
pp.get("reference_temperature", m_ref_theta);
pp.query("stats_do_energy_budget", m_do_energy_budget);
}

// Get normal direction and associated stuff
Expand Down
6 changes: 5 additions & 1 deletion amr-wind/wind_energy/ABLWallFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ namespace amr_wind {
ABLWallFunction::ABLWallFunction(const CFDSim& sim)
: m_sim(sim), m_mesh(sim.mesh())
{
{
amrex::ParmParse pp("incflo");
pp.queryarr("gravity", m_gravity);
}

amrex::ParmParse pp("ABL");

pp.query("kappa", m_mo.kappa);
Expand All @@ -25,7 +30,6 @@ ABLWallFunction::ABLWallFunction(const CFDSim& sim)
pp.query("mo_beta_h", m_mo.beta_h);
pp.query("surface_roughness_z0", m_mo.z0);
pp.query("normal_direction", m_direction);
pp.queryarr("gravity", m_gravity);
AMREX_ASSERT((0 <= m_direction) && (m_direction < AMREX_SPACEDIM));

if (pp.contains("log_law_height")) {
Expand Down

0 comments on commit 2a0db27

Please sign in to comment.