Skip to content

Commit

Permalink
Adding additional 2d benchmarks tests (parallel planes and rotated pl…
Browse files Browse the repository at this point in the history
…anes)
  • Loading branch information
OscarAntepara committed Aug 7, 2020
1 parent 16fce07 commit 5636909
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/embedded_boundaries/eb_cylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,39 @@ void incflo::make_eb_cylinder()
Real radius = 0.0002;
int direction = 0;
Vector<Real> centervec(3);
Real rotation = 0;
int rotation_axe = 0;

// Get cylinder information from inputs file. *
ParmParse pp("cylinder");

pp.query("internal_flow", inside);
pp.query("radius", radius);
pp.query("direction", direction);
pp.query("rotation", rotation);
pp.query("rotation_axe", rotation_axe);
pp.getarr("center", centervec, 0, 3);
Array<Real, AMREX_SPACEDIM> center = {AMREX_D_DECL(centervec[0], centervec[1], centervec[2])};

rotation = (rotation/180.)*M_PI;

// Print info about cylinder
amrex::Print() << " " << std::endl;
amrex::Print() << " Internal Flow: " << inside << std::endl;
amrex::Print() << " Radius: " << radius << std::endl;
amrex::Print() << " Direction: " << direction << std::endl;
amrex::Print() << " Rotation angle(rad): " << rotation << std::endl;
amrex::Print() << " Rotation axe: " << rotation_axe << std::endl;
amrex::Print() << " Center: " << center[0] << ", " << center[1] << ", " << center[2]
<< std::endl;

// Build the Cylinder implficit function representing the curved walls
EB2::CylinderIF my_cyl(radius, direction, center, inside);

auto my_cyl_rot = EB2::rotate(my_cyl, rotation, rotation_axe);

// Generate GeometryShop
auto gshop = EB2::makeShop(my_cyl);
auto gshop = EB2::makeShop(my_cyl_rot);

// Build index space
int max_level_here = 0;
Expand Down
94 changes: 94 additions & 0 deletions test_2d/benchmark.channel_planes-x
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# SIMULATION STOP #
#.......................................#
stop_time = 0.025 # Max (simulated) time to evolve
max_step = -1 # Max number of time steps
steady_state = 0 # Steady-state solver?

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# TIME STEP COMPUTATION #
#.......................................#
incflo.fixed_dt = -1.0 # Use this constant dt if > 0
incflo.cfl = 0.45 # CFL factor

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# INPUT AND OUTPUT #
#.......................................#
amr.plot_per_exact = 0.01 # Steps between plot files
amr.check_int = 1000 # Steps between checkpoint files
amr.restart = "" # Checkpoint to restart from

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# PHYSICS #
#.......................................#
incflo.gravity = 0. 0. # Gravitational force (3D)
incflo.ro_0 = 1. # Reference density

incflo.fluid_model = "newtonian" # Fluid model (rheology)
incflo.mu = 0.001 # Dynamic viscosity coefficient

incflo.ntrac = 1 # Number of tracers
incflo.advect_tracer = true # Should we update them?
incflo.mu_s = 0.001 # Scalar diffusion coefficient

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# ADAPTIVE MESH REFINEMENT #
#.......................................#
amr.n_cell = 96 32 # Grid cells at coarsest AMRlevel
amr.max_level = 0 # Max AMR level in hierarchy
amr.grid_eff = 0.7
amr.n_error_buf = 8
amr.max_grid_size_x = 1024
amr.max_grid_size_y = 1024
amr.max_grid_size_z = 1024

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# GEOMETRY #
#.......................................#
geometry.prob_lo = 0. 0. # Lo corner coordinates
geometry.prob_hi = 1.2 0.4 # Hi corner coordinates
geometry.is_periodic = 0 0 # Periodicity x y z (0/1)

# Boundary conditions
ylo.type = "nsw"
ylo.velocity = 0. 0. 0.
yhi.type = "nsw"
yhi.velocity = 0. 0. 0.

xlo.type = "mi"
xlo.velocity = 1. 0. 0.
xlo.tracer = 1.
xhi.type = "po"
xhi.pressure = 0.0

# Add cylinder
incflo.geometry = "cylinder"

cylinder.internal_flow = true
cylinder.radius = 0.135
cylinder.height = -1.0
cylinder.rotation = 0
cylinder.rotation_axe = 2

cylinder.direction = 0
cylinder.center = 0.6 0.2 0.0

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# INITIAL CONDITIONS #
#.......................................#
incflo.probtype = 31
incflo.ic_u = 1.0 #
incflo.ic_v = 0.0 #
incflo.ic_p = 0.0 #

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# VERBOSITY #
#.......................................#
incflo.verbose = 1 # incflo itself
mac_proj.verbose = 1 # MAC Projector
nodal_proj.verbose = 1 # Nodal Projector
scalar_diffusion.verbose = 1 # Scalar Diffusion
tensor_diffusion.verbose = 1 # Tensor Diffusion

amr.plt_vfrac = 1
amr.plt_ccse_regtest = 1
94 changes: 94 additions & 0 deletions test_2d/benchmark.channel_planes_rotated-x
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# SIMULATION STOP #
#.......................................#
stop_time = 0.025 # Max (simulated) time to evolve
max_step = -1 # Max number of time steps
steady_state = 0 # Steady-state solver?

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# TIME STEP COMPUTATION #
#.......................................#
incflo.fixed_dt = -1.0 # Use this constant dt if > 0
incflo.cfl = 0.45 # CFL factor

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# INPUT AND OUTPUT #
#.......................................#
amr.plot_per_exact = 0.01 # Steps between plot files
amr.check_int = 1000 # Steps between checkpoint files
amr.restart = "" # Checkpoint to restart from

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# PHYSICS #
#.......................................#
incflo.gravity = 0. 0. # Gravitational force (3D)
incflo.ro_0 = 1. # Reference density

incflo.fluid_model = "newtonian" # Fluid model (rheology)
incflo.mu = 0.001 # Dynamic viscosity coefficient

incflo.ntrac = 1 # Number of tracers
incflo.advect_tracer = true # Should we update them?
incflo.mu_s = 0.001 # Scalar diffusion coefficient

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# ADAPTIVE MESH REFINEMENT #
#.......................................#
amr.n_cell = 96 32 # Grid cells at coarsest AMRlevel
amr.max_level = 0 # Max AMR level in hierarchy
amr.grid_eff = 0.7
amr.n_error_buf = 8
amr.max_grid_size_x = 1024
amr.max_grid_size_y = 1024
amr.max_grid_size_z = 1024

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# GEOMETRY #
#.......................................#
geometry.prob_lo = 0. 0. # Lo corner coordinates
geometry.prob_hi = 1.2 0.4 # Hi corner coordinates
geometry.is_periodic = 0 0 # Periodicity x y z (0/1)

# Boundary conditions
ylo.type = "nsw"
ylo.velocity = 0. 0. 0.
yhi.type = "nsw"
yhi.velocity = 0. 0. 0.

xlo.type = "mi"
xlo.velocity = 1. 0. 0.
xlo.tracer = 1.
xhi.type = "po"
xhi.pressure = 0.0

# Add cylinder
incflo.geometry = "cylinder"

cylinder.internal_flow = true
cylinder.radius = 0.135
cylinder.height = -1.0
cylinder.rotation = 1
cylinder.rotation_axe = 2

cylinder.direction = 0
cylinder.center = 0.6 0.2 0.0

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# INITIAL CONDITIONS #
#.......................................#
incflo.probtype = 31
incflo.ic_u = 1.0 #
incflo.ic_v = 0.0 #
incflo.ic_p = 0.0 #

#¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨#
# VERBOSITY #
#.......................................#
incflo.verbose = 1 # incflo itself
mac_proj.verbose = 1 # MAC Projector
nodal_proj.verbose = 1 # Nodal Projector
scalar_diffusion.verbose = 1 # Scalar Diffusion
tensor_diffusion.verbose = 1 # Tensor Diffusion

amr.plt_vfrac = 1
amr.plt_ccse_regtest = 1

0 comments on commit 5636909

Please sign in to comment.