11 auto f_set_var_bc = [
this] (ParmParse& pp,
int bcvar_type, Orientation ori, std::string bc_type_string) {
12 if (bc_type_string ==
"symmetry")
18 else if (bc_type_string ==
"outflow")
24 else if (bc_type_string ==
"inflow")
33 pp.getarr(
"velocity", v, 0, AMREX_SPACEDIM);
37 if (pp.query(
"scalar", scalar_in))
41 else if (bc_type_string ==
"noslipwall")
53 if (pp.queryarr(
"velocity", v, 0, AMREX_SPACEDIM))
55 v[ori.coordDir()] = 0.0_rt;
60 else if (bc_type_string ==
"slipwall")
66 else if (bc_type_string ==
"clamped")
72 else if (bc_type_string ==
"chapman")
79 amrex::Abort(
"Chapman BC can only be applied to zeta");
82 else if (bc_type_string ==
"flather")
89 amrex::Abort(
"Flather BC can only be applied to ubar or vbar");
92 else if (bc_type_string ==
"orlanski_rad")
98 else if (bc_type_string ==
"orlanski_rad_nudg")
104 else if (bc_type_string ==
"periodic")
106 if (!geom[0].isPeriodic(ori.coordDir())) {
107 amrex::Abort(
"Periodic boundary specified in a non-periodic direction");
119 if (geom[0].isPeriodic(ori.coordDir()))
127 amrex::Abort(
"Wrong BC type for periodic boundary");
133 amrex::Print() <<
"BC Type specified for fac is " << bc_type_string << std::endl;
134 amrex::Abort(
"This BC type is unknown");
138 auto f_by_side = [
this, &f_set_var_bc] (std::string
const& bcid, Orientation ori)
140 ParmParse pp(
"remora.bc."+bcid);
141 std::string bc_type_in =
"null";
143 if (bcid==
"zlo" or bcid==
"zhi") bc_type_in =
"slipwall";
144 pp.query(
"type", bc_type_in);
145 std::string bc_type = amrex::toLower(bc_type_in);
148 f_set_var_bc(pp, icomp, ori, bc_type);
152 auto f_by_var = [
this, &f_set_var_bc] (std::string
const& varname,
int bcvar_type)
154 amrex::Vector<Orientation> orientations = {Orientation(Direction::x,Orientation::low), Orientation(Direction::y,Orientation::high),Orientation(Direction::x,Orientation::high),Orientation(Direction::y,Orientation::low)};
155 std::vector<std::string> bc_types = {
"null",
"null",
"null",
"null"};
156 ParmParse pp(
"remora.bc."+varname);
157 std::string bc_type_in =
"null";
160 bc_types = {
"outflow",
"outflow",
"outflow",
"outflow"};
161 for (
int i=0; i<4; i++) {
162 auto ori = orientations[i];
163 if (geom[0].isPeriodic(ori.coordDir())) {
164 bc_types[i] =
"periodic";
168 pp.queryarr(
"type", bc_types);
169 AMREX_ASSERT(bc_types.size() == 4);
170 for (
int i=0; i<4; i++) {
171 std::string bc_type = amrex::toLower(bc_types[i]);
172 auto ori = orientations[i];
173 f_set_var_bc(pp, bcvar_type, ori, bc_type);
186 for (OrientationIter oit; oit; ++oit) {
187 Orientation ori = oit();
207 ParmParse pp(
"remora");
210 f_by_side(
"xlo", Orientation(Direction::x,Orientation::low));
211 f_by_side(
"xhi", Orientation(Direction::x,Orientation::high));
212 f_by_side(
"ylo", Orientation(Direction::y,Orientation::low));
213 f_by_side(
"yhi", Orientation(Direction::y,Orientation::high));
228 f_by_side(
"zlo", Orientation(Direction::z,Orientation::low));
229 f_by_side(
"zhi", Orientation(Direction::z,Orientation::high));
241 for (OrientationIter oit; oit; ++oit) {
242 Orientation ori = oit();
243 int dir = ori.coordDir();
244 Orientation::Side side = ori.faceDir();
246 for (
int i = 0; i < 2; i++) {
250 if (side == Orientation::low) {
262 if (side == Orientation::low) {
270 if (side == Orientation::low) {
278 if (side == Orientation::low) {
286 if (side == Orientation::low) {
303 if (side == Orientation::low) {
311 if (side == Orientation::low) {
319 if (side == Orientation::low) {
327 if (side == Orientation::low) {
335 amrex::Abort(
"Velocity boundary condition not validly specified");
340 if (side == Orientation::low) {
355 for (OrientationIter oit; oit; ++oit) {
356 Orientation ori = oit();
357 int dir = ori.coordDir();
358 Orientation::Side side = ori.faceDir();
359 for (
int i = 0; i <
NCONS; i++) {
363 if (side == Orientation::low) {
371 if (side == Orientation::low) {
379 if (side == Orientation::low) {
387 if (side == Orientation::low) {
395 if (side == Orientation::low) {
403 if (side == Orientation::low) {
411 if (side == Orientation::low) {
419 if (side == Orientation::low) {
427 if (side == Orientation::low) {
435 amrex::Abort(
"Scalar/tracer boundary condition not validly specified");
449 for (OrientationIter oit; oit; ++oit) {
450 Orientation ori = oit();
451 int dir = ori.coordDir();
452 Orientation::Side side = ori.faceDir();
453 for (
int i = 0; i < 2; i++) {
457 if (side == Orientation::low) {
460 if (i==1 and dir!=2) {
467 if (i==1 and dir!=2) {
475 if (side == Orientation::low) {
485 if (side == Orientation::low) {
495 if (side == Orientation::low) {
505 if (side == Orientation::low) {
508 if (i==1 and dir!=2) {
517 if (i==1 and dir!=2) {
526 if (side == Orientation::low) {
536 if (side == Orientation::low) {
546 if (side == Orientation::low) {
549 if (i==1 and dir!=2) {
558 if (i==1 and dir!=2) {
567 amrex::Abort(
"ubar or vbar boundary condition not validly specified");
580 for (OrientationIter oit; oit; ++oit) {
581 Orientation ori = oit();
582 int dir = ori.coordDir();
583 Orientation::Side side = ori.faceDir();
584 for (
int i = 0; i < 2; i++) {
588 if (side == Orientation::low) {
596 if (side == Orientation::low) {
604 if (side == Orientation::low) {
612 if (side == Orientation::low) {
620 if (side == Orientation::low) {
628 if (side == Orientation::low) {
636 if (side == Orientation::low) {
644 if (side == Orientation::low) {
652 amrex::Abort(
"Free surface (zeta) boundary condition not validly specified");
665 for (OrientationIter oit; oit; ++oit) {
666 Orientation ori = oit();
667 int dir = ori.coordDir();
668 Orientation::Side side = ori.faceDir();
669 if (side == Orientation::low) {
683 for (OrientationIter oit; oit; ++oit) {
684 Orientation ori = oit();
685 int dir = ori.coordDir();
686 Orientation::Side side = ori.faceDir();
687 if (side == Orientation::low) {
699 sizeof(amrex::BCRec)*(
NCONS+AMREX_SPACEDIM+8));
703 sizeof(amrex::BCRec)*(
NCONS+AMREX_SPACEDIM+8));