-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge Couette and Poiseuille and do some other cleanup (#1542)
- Loading branch information
Showing
38 changed files
with
224 additions
and
364 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Exec/RegTests/CouetteFlow/CMakeLists.txt → ...egTests/Couette_Poiseuille/CMakeLists.txt
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
File renamed without changes.
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,13 @@ | ||
This directory has two problem setups: Couette flow and Poiseuille flow. | ||
These problems primarily test the implementation of the viscous terms, | ||
in particular the discretization at the boundaries. | ||
|
||
If prob_type == 1 in the inputs file, then the problem setup is for classic Couette flow. | ||
The domain is periodic in the x- and y-directions and has no slip walls on the top and bottom. | ||
The velocity is specified to be (2,0,0) (for inputs_couette_x) or | ||
(0,2,0) (for inputs_couette_y) at the top wall. | ||
|
||
If prob_type == 10 or 11 in the inputs file, then the problem setup is for classic Poiseuille flow. | ||
The domain is periodic in the x- and y-directions and has no slip walls on the top and bottom. | ||
The flow is driven by a pressure gradient in the x-direction if prob_type == 10, | ||
or in the y-direction if prob_type = 11. |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,120 @@ | ||
#include "prob.H" | ||
|
||
using namespace amrex; | ||
|
||
std::unique_ptr<ProblemBase> | ||
amrex_probinit( | ||
const amrex_real* /*problo*/, | ||
const amrex_real* /*probhi*/) | ||
{ | ||
return std::make_unique<Problem>(); | ||
} | ||
|
||
Problem::Problem() | ||
{ | ||
// Parse params | ||
amrex::ParmParse pp("prob"); | ||
pp.query("rho_0", parms.rho_0); | ||
pp.query("u_0", parms.u_0); | ||
pp.query("v_0", parms.v_0); | ||
pp.query("w_0", parms.w_0); | ||
pp.query("T_0", parms.T_0); | ||
|
||
pp.get("prob_type", parms.prob_type); | ||
|
||
init_base_parms(parms.rho_0, parms.T_0); | ||
} | ||
|
||
void | ||
Problem::init_custom_pert( | ||
const Box& bx, | ||
const Box& xbx, | ||
const Box& ybx, | ||
const Box& zbx, | ||
Array4<Real const> const& /*state*/, | ||
Array4<Real > const& state_pert, | ||
Array4<Real > const& x_vel_pert, | ||
Array4<Real > const& y_vel_pert, | ||
Array4<Real > const& z_vel_pert, | ||
Array4<Real > const& /*r_hse*/, | ||
Array4<Real > const& /*p_hse*/, | ||
Array4<Real const> const& /*z_nd*/, | ||
Array4<Real const> const& /*z_cc*/, | ||
GeometryData const& geomdata, | ||
Array4<Real const> const& /*mf_m*/, | ||
Array4<Real const> const& /*mf_u*/, | ||
Array4<Real const> const& /*mf_v*/, | ||
const SolverChoice& sc) | ||
{ | ||
const bool use_moisture = (sc.moisture_type != MoistureType::None); | ||
|
||
ParallelFor(bx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k) noexcept | ||
{ | ||
state_pert(i, j, k, RhoScalar_comp) = 0.0; | ||
|
||
if (use_moisture) { | ||
state_pert(i, j, k, RhoQ1_comp) = 0.0; | ||
state_pert(i, j, k, RhoQ2_comp) = 0.0; | ||
} | ||
}); | ||
|
||
AMREX_ALWAYS_ASSERT (parms.prob_type == 1 || parms.prob_type == 10 || parms.prob_type == 11); | ||
|
||
// Couette flow | ||
if (parms.prob_type == 1) { | ||
|
||
ParallelFor(xbx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { | ||
const auto *const prob_hi = geomdata.ProbHi(); | ||
const auto *const dx = geomdata.CellSize(); | ||
const Real z = (k + 0.5) * dx[2]; | ||
x_vel_pert(i, j, k) = parms.u_0 * z / prob_hi[2]; | ||
}); | ||
|
||
ParallelFor(ybx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { | ||
const auto *const prob_hi = geomdata.ProbHi(); | ||
const auto *const dx = geomdata.CellSize(); | ||
const Real z = (k + 0.5) * dx[2]; | ||
y_vel_pert(i, j, k) = parms.v_0 * z / prob_hi[2]; | ||
}); | ||
|
||
ParallelFor(zbx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { | ||
z_vel_pert(i, j, k) = parms.w_0; | ||
}); | ||
|
||
// Poiseuille flow | ||
} else if (parms.prob_type == 10 || parms.prob_type == 11) { | ||
|
||
ParallelFor(xbx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k) noexcept | ||
{ | ||
const Real* prob_lo = geomdata.ProbLo(); | ||
const Real* dx = geomdata.CellSize(); | ||
const Real z_h = prob_lo[2] + (k + 0.5) * dx[2]; | ||
|
||
// Set the x-velocity to be a parabolic profile with max 1 at z = 0 and 0 at z = +/-1 | ||
if (parms.prob_type == 10) { | ||
x_vel_pert(i, j, k) = 1.0 - z_h * z_h; | ||
} else { | ||
x_vel_pert(i, j, k) = 0.0; | ||
} | ||
}); | ||
|
||
ParallelFor(ybx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k) noexcept | ||
{ | ||
const Real* prob_lo = geomdata.ProbLo(); | ||
const Real* dx = geomdata.CellSize(); | ||
const Real z_h = prob_lo[2] + (k + 0.5) * dx[2]; | ||
|
||
// Set the x-velocity to be a parabolic profile with max 1 at z = 0 and 0 at z = +/-1 | ||
if (parms.prob_type == 11) { | ||
y_vel_pert(i, j, k) = 1.0 - z_h * z_h; | ||
} else { | ||
y_vel_pert(i, j, k) = 0.0; | ||
} | ||
}); | ||
|
||
ParallelFor(zbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept | ||
{ | ||
z_vel_pert(i, j, k) = 0.0; | ||
}); | ||
} // prob_type | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.