Skip to content

Commit

Permalink
Merge branch 'development' into new_class_for_gmres
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren committed Nov 23, 2024
2 parents a628645 + 17bb541 commit ceb0eef
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
10 changes: 8 additions & 2 deletions Exec/Make.ERF
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,14 @@ endif
#turn on NetCDF macro define
ifeq ($(USE_NETCDF), TRUE)
DEFINES += -DERF_USE_NETCDF
includes += $(shell pkg-config --cflags netcdf)
LIBRARIES += $(shell pkg-config --libs netcdf)
has_netcdf_mpi := $(shell pkg-config --cflags netcdf-mpi > /dev/null 2>&1; echo $$?)
ifeq ($(has_netcdf_mpi),0)
includes += $(shell pkg-config --cflags netcdf-mpi)
LIBRARIES += $(shell pkg-config --libs netcdf-mpi)
else
includes += $(shell pkg-config --cflags netcdf)
LIBRARIES += $(shell pkg-config --libs netcdf)
endif
endif

ifeq ($(USE_TERRAIN_VELOCITY), TRUE)
Expand Down
13 changes: 12 additions & 1 deletion Source/BoundaryConditions/ERF_BoundaryConditions_cons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ void ERFPhysBCFunct_cons::impose_lateral_cons_bcs (const Array4<Real>& dest_arr,
{
Box bx_xlo(bx); bx_xlo.setBig (0,dom_lo.x-1);
Box bx_xhi(bx); bx_xhi.setSmall(0,dom_hi.x+1);

//
// If we are setting Dirichlet values, set them in all ghost cells on an inflow face
// "bx" is already grown in the x- and y-directions so here we just grow it in z
//
bx_xlo.grow(2,ng[2]);
bx_xhi.grow(2,ng[2]);
ParallelFor(
bx_xlo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
{
Expand Down Expand Up @@ -109,6 +114,12 @@ void ERFPhysBCFunct_cons::impose_lateral_cons_bcs (const Array4<Real>& dest_arr,
{
Box bx_ylo(bx); bx_ylo.setBig (1,dom_lo.y-1);
Box bx_yhi(bx); bx_yhi.setSmall(1,dom_hi.y+1);
//
// If we are setting Dirichlet values, set them in all ghost cells on an inflow face
// "bx" is already grown in the x- and y-directions so here we just grow it in z
//
bx_ylo.grow(2,ng[2]);
bx_yhi.grow(2,ng[2]);

ParallelFor(
bx_ylo, ncomp, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n)
Expand Down
4 changes: 2 additions & 2 deletions Source/Diffusion/ERF_ComputeTurbulentViscosity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ void ComputeTurbulentViscosityLES (const MultiFab& Tau11, const MultiFab& Tau22,
- cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp) )*dzInv;
}
Real E = amrex::max(cell_data(i,j,k,RhoKE_comp)/cell_data(i,j,k,Rho_comp),Real(0.0));
Real stratification = l_abs_g * dtheta_dz * l_inv_theta0; // stratification
Real stratification = l_abs_g * dtheta_dz * l_inv_theta0;
Real length;
if (stratification <= eps) {
length = DeltaMsf;
} else {
length = 0.76 * std::sqrt(E / stratification);
length = 0.76 * std::sqrt(E / amrex::max(stratification,eps));
// mixing length should be _reduced_ for stable stratification
length = amrex::min(length, DeltaMsf);
// following WRF, make sure the mixing length isn't too small
Expand Down
14 changes: 14 additions & 0 deletions Source/SourceTerms/ERF_ApplySpongeZoneBCs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ ApplySpongeZoneBCsForCC (
const int use_yhi_sponge_damping = spongeChoice.use_yhi_sponge_damping;
const int use_zlo_sponge_damping = spongeChoice.use_zlo_sponge_damping;
const int use_zhi_sponge_damping = spongeChoice.use_zhi_sponge_damping;
if (!use_xlo_sponge_damping &&
!use_xhi_sponge_damping &&
!use_ylo_sponge_damping &&
!use_yhi_sponge_damping &&
!use_zlo_sponge_damping &&
!use_zhi_sponge_damping)
return;

const Real xlo_sponge_end = spongeChoice.xlo_sponge_end;
const Real xhi_sponge_start = spongeChoice.xhi_sponge_start;
Expand Down Expand Up @@ -136,6 +143,13 @@ ApplySpongeZoneBCsForMom (
const int use_yhi_sponge_damping = spongeChoice.use_yhi_sponge_damping;
const int use_zlo_sponge_damping = spongeChoice.use_zlo_sponge_damping;
const int use_zhi_sponge_damping = spongeChoice.use_zhi_sponge_damping;
if (!use_xlo_sponge_damping &&
!use_xhi_sponge_damping &&
!use_ylo_sponge_damping &&
!use_yhi_sponge_damping &&
!use_zlo_sponge_damping &&
!use_zhi_sponge_damping)
return;

const Real xlo_sponge_end = spongeChoice.xlo_sponge_end;
const Real xhi_sponge_start = spongeChoice.xhi_sponge_start;
Expand Down

0 comments on commit ceb0eef

Please sign in to comment.