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")
73 else if (bc_type_string ==
"chapman")
81 amrex::Abort(
"Chapman BC can only be applied to zeta");
84 else if (bc_type_string ==
"flather")
92 amrex::Abort(
"Flather BC can only be applied to ubar or vbar");
95 else if (bc_type_string ==
"orlanski_rad")
101 else if (bc_type_string ==
"orlanski_rad_nudg")
108 else if (bc_type_string ==
"periodic")
110 if (!geom[0].isPeriodic(ori.coordDir())) {
111 amrex::Abort(
"Periodic boundary specified in a non-periodic direction");
123 if (geom[0].isPeriodic(ori.coordDir()))
131 amrex::Abort(
"Wrong BC type for periodic boundary");
137 amrex::Print() <<
"BC Type specified for fac is " << bc_type_string << std::endl;
138 amrex::Abort(
"This BC type is unknown");
142 auto f_by_side = [
this, &f_set_var_bc] (std::string
const& bcid, Orientation ori)
144 ParmParse pp(
"remora.bc."+bcid);
145 std::string bc_type_in =
"null";
147 if (bcid==
"zlo" or bcid==
"zhi") bc_type_in =
"slipwall";
148 pp.query(
"type", bc_type_in);
149 std::string bc_type = amrex::toLower(bc_type_in);
152 f_set_var_bc(pp, icomp, ori, bc_type);
156 auto f_by_var = [
this, &f_set_var_bc] (std::string
const& varname,
int bcvar_type)
158 amrex::Vector<Orientation> orientations = {Orientation(Direction::x,Orientation::low), Orientation(Direction::y,Orientation::high),Orientation(Direction::x,Orientation::high),Orientation(Direction::y,Orientation::low)};
159 std::vector<std::string> bc_types = {
"null",
"null",
"null",
"null"};
160 ParmParse pp(
"remora.bc."+varname);
161 std::string bc_type_in =
"null";
164 bc_types = {
"outflow",
"outflow",
"outflow",
"outflow"};
165 for (
int i=0; i<4; i++) {
166 auto ori = orientations[i];
167 if (geom[0].isPeriodic(ori.coordDir())) {
168 bc_types[i] =
"periodic";
172 pp.queryarr(
"type", bc_types);
173 AMREX_ASSERT(bc_types.size() == 4);
174 for (
int i=0; i<4; i++) {
175 std::string bc_type = amrex::toLower(bc_types[i]);
176 auto ori = orientations[i];
177 f_set_var_bc(pp, bcvar_type, ori, bc_type);
190 for (OrientationIter oit; oit; ++oit) {
191 Orientation ori = oit();
211 ParmParse pp(
"remora");
214 f_by_side(
"xlo", Orientation(Direction::x,Orientation::low));
215 f_by_side(
"xhi", Orientation(Direction::x,Orientation::high));
216 f_by_side(
"ylo", Orientation(Direction::y,Orientation::low));
217 f_by_side(
"yhi", Orientation(Direction::y,Orientation::high));
232 f_by_side(
"zlo", Orientation(Direction::z,Orientation::low));
233 f_by_side(
"zhi", Orientation(Direction::z,Orientation::high));
245 for (OrientationIter oit; oit; ++oit) {
246 Orientation ori = oit();
247 int dir = ori.coordDir();
248 Orientation::Side side = ori.faceDir();
250 for (
int i = 0; i < 2; i++) {
254 if (side == Orientation::low) {
266 if (side == Orientation::low) {
274 if (side == Orientation::low) {
282 if (side == Orientation::low) {
290 if (side == Orientation::low) {
307 if (side == Orientation::low) {
315 if (side == Orientation::low) {
323 if (side == Orientation::low) {
331 if (side == Orientation::low) {
339 amrex::Abort(
"Velocity boundary condition not validly specified");
344 if (side == Orientation::low) {
359 for (OrientationIter oit; oit; ++oit) {
360 Orientation ori = oit();
361 int dir = ori.coordDir();
362 Orientation::Side side = ori.faceDir();
363 for (
int i = 0; i <
NCONS; i++) {
367 if (side == Orientation::low) {
375 if (side == Orientation::low) {
383 if (side == Orientation::low) {
391 if (side == Orientation::low) {
399 if (side == Orientation::low) {
407 if (side == Orientation::low) {
415 if (side == Orientation::low) {
423 if (side == Orientation::low) {
431 if (side == Orientation::low) {
439 amrex::Abort(
"Scalar/tracer boundary condition not validly specified");
453 for (OrientationIter oit; oit; ++oit) {
454 Orientation ori = oit();
455 int dir = ori.coordDir();
456 Orientation::Side side = ori.faceDir();
457 for (
int i = 0; i < 2; i++) {
461 if (side == Orientation::low) {
464 if (i==1 and dir!=2) {
471 if (i==1 and dir!=2) {
479 if (side == Orientation::low) {
489 if (side == Orientation::low) {
499 if (side == Orientation::low) {
509 if (side == Orientation::low) {
512 if (i==1 and dir!=2) {
521 if (i==1 and dir!=2) {
530 if (side == Orientation::low) {
540 if (side == Orientation::low) {
550 if (side == Orientation::low) {
553 if (i==1 and dir!=2) {
562 if (i==1 and dir!=2) {
571 amrex::Abort(
"ubar or vbar boundary condition not validly specified");
584 for (OrientationIter oit; oit; ++oit) {
585 Orientation ori = oit();
586 int dir = ori.coordDir();
587 Orientation::Side side = ori.faceDir();
588 for (
int i = 0; i < 2; i++) {
592 if (side == Orientation::low) {
600 if (side == Orientation::low) {
608 if (side == Orientation::low) {
616 if (side == Orientation::low) {
624 if (side == Orientation::low) {
632 if (side == Orientation::low) {
640 if (side == Orientation::low) {
648 if (side == Orientation::low) {
656 amrex::Abort(
"Free surface (zeta) boundary condition not validly specified");
669 for (OrientationIter oit; oit; ++oit) {
670 Orientation ori = oit();
671 int dir = ori.coordDir();
672 Orientation::Side side = ori.faceDir();
673 if (side == Orientation::low) {
687 for (OrientationIter oit; oit; ++oit) {
688 Orientation ori = oit();
689 int dir = ori.coordDir();
690 Orientation::Side side = ori.faceDir();
691 if (side == Orientation::low) {
703 sizeof(amrex::BCRec)*(
NCONS+AMREX_SPACEDIM+8));
707 sizeof(amrex::BCRec)*(
NCONS+AMREX_SPACEDIM+8));