Skip to content

Commit

Permalink
initial commits for bulk viscosity in compressible FHD
Browse files Browse the repository at this point in the history
  • Loading branch information
isriva committed Sep 20, 2023
1 parent c39702f commit b2f3450
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src_compressible/compressible_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ AMREX_GPU_MANAGED int compressible::do_2D;
AMREX_GPU_MANAGED int compressible::all_correl;
AMREX_GPU_MANAGED int compressible::nspec_surfcov = 0;
AMREX_GPU_MANAGED bool compressible::do_reservoir = false;
AMREX_GPU_MANAGED amrex::Real compressible::zeta_ratio = -1.0;

void InitializeCompressibleNamespace()
{
Expand Down Expand Up @@ -70,6 +71,11 @@ void InitializeCompressibleNamespace()
do_reservoir = true;
}

// bulk viscosity ratio
pp.query("zeta_ratio",zeta_ratio);
if ((amrex::Math::abs(visc_type) == 3) and (zeta_ratio < 0.0)) amrex::Abort("need non-negative zeta_ratio (ratio of bulk to shear viscosity) for visc_type = 3 (use bulk viscosity)");
if ((amrex::Math::abs(visc_type) == 3) and (zeta_ratio >= 0.0)) amrex::Print() << "bulk viscosity model selected; bulk viscosity ratio is: " << zeta_ratio << "\n";

return;
}

Expand Down
1 change: 1 addition & 0 deletions src_compressible/compressible_namespace.H
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ namespace compressible {
extern AMREX_GPU_MANAGED int all_correl;
extern AMREX_GPU_MANAGED int nspec_surfcov;
extern AMREX_GPU_MANAGED bool do_reservoir;
extern AMREX_GPU_MANAGED amrex::Real zeta_ratio;

}

6 changes: 6 additions & 0 deletions src_compressible/transCoeffs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ void calculateTransportCoeffs(const MultiFab& prim_in,
}
}

// set bulk viscosity
if (amrex::Math::abs(visc_type) == 3) {
zeta(i,j,k) = zeta_ratio * eta(i,j,k);
}


});
}
}

0 comments on commit b2f3450

Please sign in to comment.