Skip to content

Commit

Permalink
Updates for release.
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi committed Nov 4, 2024
1 parent 08ff588 commit d2e3f3e
Show file tree
Hide file tree
Showing 16 changed files with 348 additions and 336 deletions.
15 changes: 15 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# 24.11
-- AMReX submodule set to 24.11 release hash (4a6e7c8)

-- AMR functionality (#1916-1920)

-- GAD functionality (#1912, #1875)

-- Remove QKE (#1905)

-- NOAH-MP interface (#1835)

-- Line and plane sampling (#1897)

-- AMReX & KOKKOS docs (#1889)

# 24.10
-- Add WENO7 advection operators (#1858)

Expand Down
275 changes: 138 additions & 137 deletions Source/ERF_read_waves.cpp

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Source/Utils/ERF_InteriorGhostCells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ realbdy_compute_interior_ghost_rhs (const Real& bdy_time_interval,
Vector<Vector<FArrayBox>>& bdy_data_ylo,
Vector<Vector<FArrayBox>>& bdy_data_yhi)
{
BL_PROFILE_REGION("wrfbdy_compute_interior_ghost_RHS()");
BL_PROFILE_REGION("realbdy_compute_interior_ghost_RHS()");

// NOTE: We pass the full width into this routine.
// For relaxation, the last cell is a halo
Expand Down Expand Up @@ -395,11 +395,11 @@ realbdy_compute_interior_ghost_rhs (const Real& bdy_time_interval,
continue;
}

wrfbdy_set_rhs_in_spec_region(delta_t, icomp, 1,
width, set_width, dom_lo, dom_hi,
tbx_xlo, tbx_xhi, tbx_ylo, tbx_yhi,
arr_xlo, arr_xhi, arr_ylo, arr_yhi,
data_arr, rhs_arr);
realbdy_set_rhs_in_spec_region(delta_t, icomp, 1,
width, set_width, dom_lo, dom_hi,
tbx_xlo, tbx_xhi, tbx_ylo, tbx_yhi,
arr_xlo, arr_xhi, arr_ylo, arr_yhi,
data_arr, rhs_arr);
} // mfi
} // ivar
} // set_width
Expand Down Expand Up @@ -455,11 +455,11 @@ realbdy_compute_interior_ghost_rhs (const Real& bdy_time_interval,
continue;
}

wrfbdy_compute_laplacian_relaxation(icomp, 1,
width2, set_width, dom_lo, dom_hi, F1, F2,
tbx_xlo, tbx_xhi, tbx_ylo, tbx_yhi,
arr_xlo, arr_xhi, arr_ylo, arr_yhi,
data_arr, rhs_arr);
realbdy_compute_laplacian_relaxation(icomp, 1,
width2, set_width, dom_lo, dom_hi, F1, F2,
tbx_xlo, tbx_xhi, tbx_ylo, tbx_yhi,
arr_xlo, arr_xhi, arr_ylo, arr_yhi,
data_arr, rhs_arr);

/*
// UNIT TEST DEBUG
Expand Down
12 changes: 4 additions & 8 deletions Source/Utils/ERF_Interpolation.H
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ InterpolateInX (int i, int j, int k, const amrex::Array4<const amrex::Real>& qty
amrex::Real scaled_upw = 0.;
//
// The value that comes in has not been normalized so we do that here
if (upw != 0.)
scaled_upw = (upw > 0) ? 1. : -1.;
if (upw != 0.) { scaled_upw = (upw > 0) ? 1. : -1.; }

avg1 = (qty(i, j, k, qty_index) + qty(i-1, j, k, qty_index));
diff1 = (qty(i, j, k, qty_index) - qty(i-1, j, k, qty_index));
Expand Down Expand Up @@ -80,8 +79,7 @@ InterpolateInY (int i, int j, int k, const amrex::Array4<const amrex::Real>& qty
amrex::Real scaled_upw = 0.;

// The value that comes in has not been normalized so we do that here
if (upw != 0.)
scaled_upw = (upw > 0) ? 1. : -1.;
if (upw != 0.) { scaled_upw = (upw > 0) ? 1. : -1.; }

avg1 = (qty(i, j , k, qty_index) + qty(i, j-1, k, qty_index));
diff1 = (qty(i, j , k, qty_index) - qty(i, j-1, k, qty_index));
Expand Down Expand Up @@ -110,8 +108,7 @@ InterpolateInZ (int i, int j, int k, const amrex::Array4<const amrex::Real>& qty
amrex::Real diff1 = 0.; amrex::Real diff2 = 0.; amrex::Real diff3 = 0.;
amrex::Real scaled_upw = 0.;
// The value that comes in has not been normalized so we do that here
if (upw != 0.)
scaled_upw = (upw > 0) ? 1. : -1.;
if (upw != 0.) { scaled_upw = (upw > 0) ? 1. : -1.; }

avg1 = (qty(i, j, k , qty_index) + qty(i, j, k-1, qty_index));
diff1 = (qty(i, j, k , qty_index) - qty(i, j, k-1, qty_index));
Expand Down Expand Up @@ -139,8 +136,7 @@ InterpolatePertFromCell (int i, int j, int k,
amrex::Real scaled_upw = 0.;

// The value that comes in has not been normalized so we do that here
if (upw != 0.)
scaled_upw = upw / std::abs(upw);
if (upw != 0.) { scaled_upw = (upw > 0) ? 1. : -1.; }

if (coordDir == Coord::x) {
avg1 = (qty(i , j, k, qty_index) + qty(i-1, j, k, qty_index));
Expand Down
70 changes: 35 additions & 35 deletions Source/Utils/ERF_Utils.H
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,23 @@ Time_Avg_Vel_atCC (const amrex::Real& dt,
AMREX_GPU_HOST
AMREX_FORCE_INLINE
void
wrfbdy_set_rhs_in_spec_region (const amrex::Real& dt,
const int& icomp,
const int& num_var,
const int& width,
const int& set_width,
const amrex::Dim3& dom_lo,
const amrex::Dim3& dom_hi,
const amrex::Box& bx_xlo,
const amrex::Box& bx_xhi,
const amrex::Box& bx_ylo,
const amrex::Box& bx_yhi,
const amrex::Array4<const amrex::Real>& arr_xlo,
const amrex::Array4<const amrex::Real>& arr_xhi,
const amrex::Array4<const amrex::Real>& arr_ylo,
const amrex::Array4<const amrex::Real>& arr_yhi,
const amrex::Array4<const amrex::Real>& data_arr,
const amrex::Array4<amrex::Real>& rhs_arr)
realbdy_set_rhs_in_spec_region (const amrex::Real& dt,
const int& icomp,
const int& num_var,
const int& width,
const int& set_width,
const amrex::Dim3& dom_lo,
const amrex::Dim3& dom_hi,
const amrex::Box& bx_xlo,
const amrex::Box& bx_xhi,
const amrex::Box& bx_ylo,
const amrex::Box& bx_yhi,
const amrex::Array4<const amrex::Real>& arr_xlo,
const amrex::Array4<const amrex::Real>& arr_xhi,
const amrex::Array4<const amrex::Real>& arr_ylo,
const amrex::Array4<const amrex::Real>& arr_yhi,
const amrex::Array4<const amrex::Real>& data_arr,
const amrex::Array4<amrex::Real>& rhs_arr)
{
int Spec_z = set_width;
amrex::ParallelFor(bx_xlo, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
Expand Down Expand Up @@ -235,24 +235,24 @@ wrfbdy_set_rhs_in_spec_region (const amrex::Real& dt,
AMREX_GPU_HOST
AMREX_FORCE_INLINE
void
wrfbdy_compute_laplacian_relaxation (const int& icomp,
const int& num_var,
const int& width,
const int& set_width,
const amrex::Dim3& dom_lo,
const amrex::Dim3& dom_hi,
const amrex::Real& F1,
const amrex::Real& F2,
const amrex::Box& bx_xlo,
const amrex::Box& bx_xhi,
const amrex::Box& bx_ylo,
const amrex::Box& bx_yhi,
const amrex::Array4<const amrex::Real>& arr_xlo,
const amrex::Array4<const amrex::Real>& arr_xhi,
const amrex::Array4<const amrex::Real>& arr_ylo,
const amrex::Array4<const amrex::Real>& arr_yhi,
const amrex::Array4<const amrex::Real>& data_arr,
const amrex::Array4<amrex::Real>& rhs_arr)
realbdy_compute_laplacian_relaxation (const int& icomp,
const int& num_var,
const int& width,
const int& set_width,
const amrex::Dim3& dom_lo,
const amrex::Dim3& dom_hi,
const amrex::Real& F1,
const amrex::Real& F2,
const amrex::Box& bx_xlo,
const amrex::Box& bx_xhi,
const amrex::Box& bx_ylo,
const amrex::Box& bx_yhi,
const amrex::Array4<const amrex::Real>& arr_xlo,
const amrex::Array4<const amrex::Real>& arr_xhi,
const amrex::Array4<const amrex::Real>& arr_ylo,
const amrex::Array4<const amrex::Real>& arr_yhi,
const amrex::Array4<const amrex::Real>& data_arr,
const amrex::Array4<amrex::Real>& rhs_arr)
{
// RHS computation
int Spec_z = set_width;
Expand Down
34 changes: 17 additions & 17 deletions Source/WindFarmParametrization/ERF_InitWindFarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ WindFarm::read_tables (std::string windfarm_loc_table,
}

void
WindFarm::read_windfarm_locations_table(const std::string windfarm_loc_table,
bool x_y, bool lat_lon,
const Real windfarm_x_shift,
const Real windfarm_y_shift)
WindFarm::read_windfarm_locations_table (const std::string windfarm_loc_table,
bool x_y, bool lat_lon,
const Real windfarm_x_shift,
const Real windfarm_y_shift)
{
if(x_y) {
init_windfarm_x_y(windfarm_loc_table);
Expand Down Expand Up @@ -150,7 +150,7 @@ WindFarm::init_windfarm_x_y (const std::string windfarm_loc_table)


void
WindFarm::read_windfarm_spec_table(const std::string windfarm_spec_table)
WindFarm::read_windfarm_spec_table (const std::string windfarm_spec_table)
{
//The first line is the number of pairs entries for the power curve and thrust coefficient.
//The second line gives first the height in meters of the turbine hub, second, the diameter in
Expand Down Expand Up @@ -198,7 +198,7 @@ WindFarm::read_windfarm_spec_table(const std::string windfarm_spec_table)
}

void
WindFarm::read_windfarm_blade_table(const std::string windfarm_blade_table)
WindFarm::read_windfarm_blade_table (const std::string windfarm_blade_table)
{
std::ifstream filename(windfarm_blade_table);
std::string line;
Expand Down Expand Up @@ -231,7 +231,7 @@ WindFarm::read_windfarm_blade_table(const std::string windfarm_blade_table)
}

void
WindFarm::read_windfarm_spec_table_extra(const std::string windfarm_spec_table_extra)
WindFarm::read_windfarm_spec_table_extra (const std::string windfarm_spec_table_extra)
{
// Open the file
std::ifstream file(windfarm_spec_table_extra);
Expand Down Expand Up @@ -270,8 +270,8 @@ WindFarm::read_windfarm_spec_table_extra(const std::string windfarm_spec_table_e


void
WindFarm::read_windfarm_airfoil_tables(const std::string windfarm_airfoil_tables,
const std::string windfarm_blade_table)
WindFarm::read_windfarm_airfoil_tables (const std::string windfarm_airfoil_tables,
const std::string windfarm_blade_table)
{
DIR* dir;
struct dirent* entry;
Expand Down Expand Up @@ -350,8 +350,8 @@ WindFarm::read_windfarm_airfoil_tables(const std::string windfarm_airfoil_tables
}

void
WindFarm::fill_Nturb_multifab(const Geometry& geom,
MultiFab& mf_Nturb)
WindFarm::fill_Nturb_multifab (const Geometry& geom,
MultiFab& mf_Nturb)
{

amrex::Gpu::DeviceVector<Real> d_xloc(xloc.size());
Expand Down Expand Up @@ -398,10 +398,10 @@ WindFarm::fill_Nturb_multifab(const Geometry& geom,
}

void
WindFarm::fill_SMark_multifab(const Geometry& geom,
MultiFab& mf_SMark,
const Real& sampling_distance_by_D,
const Real& turb_disk_angle)
WindFarm::fill_SMark_multifab (const Geometry& geom,
MultiFab& mf_SMark,
const Real& sampling_distance_by_D,
const Real& turb_disk_angle)
{
amrex::Gpu::DeviceVector<Real> d_xloc(xloc.size());
amrex::Gpu::DeviceVector<Real> d_yloc(yloc.size());
Expand Down Expand Up @@ -482,7 +482,7 @@ WindFarm::fill_SMark_multifab(const Geometry& geom,
}

void
WindFarm::write_turbine_locations_vtk()
WindFarm::write_turbine_locations_vtk ()
{
if (ParallelDescriptor::IOProcessor()){
FILE* file_turbloc_vtk;
Expand All @@ -501,7 +501,7 @@ WindFarm::write_turbine_locations_vtk()


void
WindFarm::write_actuator_disks_vtk(const Geometry& geom)
WindFarm::write_actuator_disks_vtk (const Geometry& geom)
{

if (ParallelDescriptor::IOProcessor()){
Expand Down
54 changes: 27 additions & 27 deletions Source/WindFarmParametrization/ERF_WindFarm.H
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class WindFarm : public NullWindFarm {

public:

WindFarm(){}
WindFarm (){}

virtual ~WindFarm() = default;
virtual ~WindFarm () = default;

WindFarm (int nlev,
const WindFarmType& a_windfarm_type)
Expand Down Expand Up @@ -50,37 +50,37 @@ public:
const amrex::Real windfarm_x_shift = 0.0,
const amrex::Real windfarm_y_shift = 0.0);

void init_windfarm_lat_lon(const std::string windfarm_loc_table,
const amrex::Real windfarm_x_shift,
const amrex::Real windfarm_y_shift);
void init_windfarm_lat_lon (const std::string windfarm_loc_table,
const amrex::Real windfarm_x_shift,
const amrex::Real windfarm_y_shift);

void init_windfarm_x_y(const std::string windfarm_loc_table);
void init_windfarm_x_y (const std::string windfarm_loc_table);

void read_windfarm_locations_table(const std::string windfarm_loc_table,
bool x_y, bool lat_lon,
const amrex::Real windfarm_x_shift = 0.0,
const amrex::Real windfarm_y_shift = 0.0);
void read_windfarm_locations_table (const std::string windfarm_loc_table,
bool x_y, bool lat_lon,
const amrex::Real windfarm_x_shift = 0.0,
const amrex::Real windfarm_y_shift = 0.0);

void read_windfarm_spec_table(const std::string windfarm_spec_table);
void read_windfarm_spec_table (const std::string windfarm_spec_table);

void read_windfarm_blade_table(const std::string windfarm_blade_table);
void read_windfarm_blade_table (const std::string windfarm_blade_table);

void read_windfarm_airfoil_tables(const std::string windfarm_airfoil_tables,
const std::string windfarm_blade_table);
void read_windfarm_airfoil_tables (const std::string windfarm_airfoil_tables,
const std::string windfarm_blade_table);

void read_windfarm_spec_table_extra(const std::string windfarm_spec_table_extra);
void read_windfarm_spec_table_extra (const std::string windfarm_spec_table_extra);

void fill_Nturb_multifab(const amrex::Geometry& geom,
amrex::MultiFab& mf_Nturb);
void fill_Nturb_multifab (const amrex::Geometry& geom,
amrex::MultiFab& mf_Nturb);

void fill_SMark_multifab(const amrex::Geometry& geom,
amrex::MultiFab& mf_SMark,
const amrex::Real& sampling_distance_by_D,
const amrex::Real& turb_disk_angle);
void fill_SMark_multifab (const amrex::Geometry& geom,
amrex::MultiFab& mf_SMark,
const amrex::Real& sampling_distance_by_D,
const amrex::Real& turb_disk_angle);

void write_turbine_locations_vtk();
void write_turbine_locations_vtk ();

void write_actuator_disks_vtk(const amrex::Geometry& geom);
void write_actuator_disks_vtk (const amrex::Geometry& geom);

void advance (const amrex::Geometry& a_geom,
const amrex::Real& dt_advance,
Expand All @@ -97,10 +97,10 @@ public:
U_old, V_old, W_old, mf_Nturb, mf_SMark, time);
}

void set_turb_spec(const amrex::Real& a_rotor_rad, const amrex::Real& a_hub_height,
const amrex::Real& a_thrust_coeff_standing, const amrex::Vector<amrex::Real>& a_wind_speed,
const amrex::Vector<amrex::Real>& a_thrust_coeff,
const amrex::Vector<amrex::Real>& a_power) override
void set_turb_spec (const amrex::Real& a_rotor_rad, const amrex::Real& a_hub_height,
const amrex::Real& a_thrust_coeff_standing, const amrex::Vector<amrex::Real>& a_wind_speed,
const amrex::Vector<amrex::Real>& a_thrust_coeff,
const amrex::Vector<amrex::Real>& a_power) override
{
m_windfarm_model[0]->set_turb_spec(a_rotor_rad, a_hub_height, a_thrust_coeff_standing,
a_wind_speed, a_thrust_coeff, a_power);
Expand Down
4 changes: 2 additions & 2 deletions Source/WindFarmParametrization/EWP/ERF_EWP.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class EWP : public NullWindFarm {

public:

EWP(){}
EWP (){}

virtual ~EWP() = default;
virtual ~EWP () = default;

void advance (const amrex::Geometry& geom,
const amrex::Real& dt_advance,
Expand Down
Loading

0 comments on commit d2e3f3e

Please sign in to comment.