From 97d0dbc723cfaf02c30a86769d02917bb17e4a3e Mon Sep 17 00:00:00 2001 From: Michael B Kuhn <31661049+mbkuhn@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:34:55 -0600 Subject: [PATCH] Regression tests for two-phase solver with Nalu-Wind domains containing solid bodies (#73) * update meshes repository for new tests * update git ignore --- .gitignore | 2 + test/CMakeLists.txt | 2 + test/meshes | 2 +- .../dam-break-block/dam-break-block-amr.inp | 61 +++++++ .../dam-break-block/dam-break-block-nalu.yaml | 140 +++++++++++++++ .../dam-break-block/dam-break-block.yaml | 19 ++ .../stokes-waves-cylinder-amr.inp | 76 ++++++++ .../stokes-waves-cylinder-nalu.yaml | 162 ++++++++++++++++++ .../stokes-waves-cylinder.yaml | 19 ++ 9 files changed, 482 insertions(+), 1 deletion(-) create mode 100644 test/test_files/dam-break-block/dam-break-block-amr.inp create mode 100644 test/test_files/dam-break-block/dam-break-block-nalu.yaml create mode 100644 test/test_files/dam-break-block/dam-break-block.yaml create mode 100644 test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-amr.inp create mode 100644 test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-nalu.yaml create mode 100644 test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml diff --git a/.gitignore b/.gitignore index 06b3fdb..66982fc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ spack* compile_commands.json .cache +.vscode +build* \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0a1d738..d591018 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -66,3 +66,5 @@ add_test_r(hybrid-multi-cylinder) add_test_r(flat-surface) add_test_r(sloshing-tank) add_test_r(linear-waves) +add_test_r(stokes-waves-cylinder) +add_test_r(dam-break-block) diff --git a/test/meshes b/test/meshes index 229215a..7ee683b 160000 --- a/test/meshes +++ b/test/meshes @@ -1 +1 @@ -Subproject commit 229215ac3752fc5a680eb4888094f12c667e9b53 +Subproject commit 7ee683b02412ba35e64144702feb33228acd2fd7 diff --git a/test/test_files/dam-break-block/dam-break-block-amr.inp b/test/test_files/dam-break-block/dam-break-block-amr.inp new file mode 100644 index 0000000..904374e --- /dev/null +++ b/test/test_files/dam-break-block/dam-break-block-amr.inp @@ -0,0 +1,61 @@ +time.stop_time = 2 # Max (simulated) time to evolve +time.max_step = 2000 # Max number of time steps + +time.fixed_dt = 0.001 # Use this constant dt if > 0 +time.cfl = 0.95 # CFL factor + +time.plot_interval = 10 # Steps between plot files +time.checkpoint_interval = -100 # Steps between checkpoint files + +io.int_outputs = iblank_cell + +incflo.use_godunov = 1 +incflo.godunov_type = "weno_z" +transport.model = TwoPhaseTransport +transport.viscosity_fluid1=1.e-5 +transport.viscosity_fluid2=1.e-5 + +transport.laminar_prandtl = 0.7 +transport.turbulent_prandtl = 0.3333 +turbulence.model = Laminar + +incflo.physics = MultiPhase DamBreak +MultiPhase.density_fluid1=1000. +MultiPhase.density_fluid2=1. +DamBreak.location = -0.8 0.0 -0.3125 +DamBreak.width = 0.5 +DamBreak.height = 0.8 +ICNS.source_terms = GravityForcing + +amr.n_cell = 64 16 32 # Grid cells at coarsest AMRlevel +amr.max_level = 0 # Max AMR level in hierarchy + +geometry.prob_lo = -1.4 -0.375 -0.3125 # Lo corner coordinates +geometry.prob_hi = 1.1 0.375 1.1875 # Hi corner coordinates +geometry.is_periodic = 0 0 0 # Periodicity x y z (0/1) + +Overset.disable_coupled_mac_proj = true +Overset.disable_coupled_nodal_proj = true + +xlo.type = "slip_wall" +xlo.vof_type = "zero_gradient" +xhi.type = "slip_wall" +xhi.vof_type = "zero_gradient" + +ylo.type = "slip_wall" +ylo.vof_type = "zero_gradient" +yhi.type = "slip_wall" +yhi.vof_type = "zero_gradient" + +zlo.type = "slip_wall" +zlo.vof_type = "zero_gradient" +zhi.type = "slip_wall" +zhi.vof_type = "mass_inflow" +zhi.vof = 0.0 + +incflo.verbose=0 + +nodal_proj.num_pre_smooth = 20 +nodal_proj.num_post_smooth = 20 +mac_proj.num_pre_smooth = 20 +mac_proj.num_post_smooth = 20 diff --git a/test/test_files/dam-break-block/dam-break-block-nalu.yaml b/test/test_files/dam-break-block/dam-break-block-nalu.yaml new file mode 100644 index 0000000..5d1edcd --- /dev/null +++ b/test/test_files/dam-break-block/dam-break-block-nalu.yaml @@ -0,0 +1,140 @@ +Simulations: + - name: sim1 + time_integrator: ti_1 + optimizer: opt1 + +linear_solvers: + + - name: solve_scalar + type: hypre + method: hypre_gmres + preconditioner: boomerAMG + tolerance: 1e-5 + max_iterations: 200 + kspace: 5 + output_level: 0 + + - name: solve_cont + type: hypre + method: hypre_gmres + preconditioner: boomerAMG + tolerance: 1e-5 + max_iterations: 200 + kspace: 5 + output_level: 0 + +realms: + + - name: realm_1 + mesh: meshes/block_within_cube.exo + use_edges: yes + automatic_decomposition_type: rcb + check_for_missing_bcs: yes + + equation_systems: + name: theEqSys + max_iterations: 3 + decoupled_overset_solve: yes + + solver_system_specification: + volume_of_fluid: solve_scalar + velocity: solve_scalar + pressure: solve_cont + + systems: + - VolumeOfFluid: + name: myVOF + max_iterations: 1 + convergence_tolerance: 1e-8 + - LowMachEOM: + name: myLowMach + max_iterations: 1 + convergence_tolerance: 1e-8 + + initial_conditions: + + - constant: ic_1 + target_name: fluid-HEX + value: + volume_of_fluid: 0.0 + velocity: [0.0, 0.0, 0.0] + pressure: 0.0 + + material_properties: + target_name: fluid-HEX + specifications: + - name: density + type: volume_of_fluid + primary_value: 1000.0 + secondary_value: 1. + + - name: viscosity + type: constant + value: 1.0e-5 + + boundary_conditions: + + - wall_boundary_condition: bc_wall + target_name: block + wall_user_data: + velocity: [0.0, 0.0, 0.0] + - overset_boundary_condition: bc_overset + overset_connectivity_type: tioga + overset_user_data: + mesh_group: + - overset_name: oset_n + mesh_parts: [fluid-HEX] + wall_parts: [block] + ovset_parts: [ovst_bdy] + + solution_options: + name: myOptions + use_balanced_buoyancy_force: yes + + options: + - hybrid_factor: + velocity: 0.05 + volume_of_fluid: 0.0 + + - upw_factor: + velocity: 0.0 + + - limiter: + volume_of_fluid: yes + + - consistent_mass_matrix_png: + pressure: no + + - source_terms: + momentum: + - buoyancy_density + + - user_constants: + reference_density: 0.00 + gravity: [0.0, 0.0, -9.81] + + output: + output_data_base_name: out/damBreak.e + output_frequency: 10 + output_node_set: yes + output_variables: + - density + - volume_of_fluid + - velocity + - pressure + - dvolume_of_fluiddx + - dpressuredx + - iblank +Time_Integrators: + - StandardTimeIntegrator: + name: ti_1 + start_time: 0.0 + termination_time: 2.0 + time_step: 0.001 + time_stepping_type: fixed + time_step_count: 0 + second_order_accuracy: yes + + + realms: + - realm_1 diff --git a/test/test_files/dam-break-block/dam-break-block.yaml b/test/test_files/dam-break-block/dam-break-block.yaml new file mode 100644 index 0000000..31a5bb7 --- /dev/null +++ b/test/test_files/dam-break-block/dam-break-block.yaml @@ -0,0 +1,19 @@ + +exawind: + nalu_wind_inp: + - dam-break-block-nalu.yaml + amr_wind_inp: dam-break-block-amr.inp + num_timesteps: 10 + additional_picard_iterations: 2 + + nalu_vars: + - volume_of_fluid + - velocity + - density + - pressure + amr_cell_vars: + - vof + - velocity + - density + amr_node_vars: + - p diff --git a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-amr.inp b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-amr.inp new file mode 100644 index 0000000..127f766 --- /dev/null +++ b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-amr.inp @@ -0,0 +1,76 @@ +time.stop_time = 200 # Max (simulated) time to evolve +time.max_step = -10 # Max number of time steps + +time.initial_dt = -0.05 # Use this constant dt if > 0 +time.fixed_dt = 0.01 +time.cfl = 0.95 # CFL factor +time.plot_interval = 10 # Steps between plot files +incflo.do_initial_proj = 0 +incflo.initial_iterations = 0 + +io.outputs = density vof velocity p gp reference_pressure ow_velocity ow_levelset +io.int_outputs = iblank_cell iblank_node + +incflo.use_godunov = 1 +incflo.godunov_type="weno_z" +incflo.diffusion_type = 0 +transport.model = TwoPhaseTransport +transport.laminar_prandtl = 0.7 +transport.turbulent_prandtl = 0.3333 +turbulence.model = Laminar + +transport.viscosity_fluid1=1e-3 +transport.viscosity_fluid2=1e-5 + +incflo.physics = MultiPhase OceanWaves +OceanWaves.label = Wave1 +OceanWaves.Wave1.type = StokesWaves +OceanWaves.Wave1.order=5 +OceanWaves.Wave1.wave_height=0.3327 # nominal: 0.37 +OceanWaves.Wave1.wave_period=1.536 # nominal: 1.533 +OceanWaves.Wave1.water_depth=10.0 +OceanWaves.Wave1.relax_zone_gen_length=4.801496963 +OceanWaves.Wave1.numerical_beach_length=9.602993926 +OceanWaves.Wave1.numerical_beach_length_factor=2.0 +OceanWaves.Wave1.zero_sea_level=0.0 +MultiPhase.density_fluid1=1000. +MultiPhase.density_fluid2=1. +ICNS.source_terms = GravityForcing + +ICNS.use_perturb_pressure = true +ICNS.reconstruct_true_pressure = true +VOF.replace_masked = true +Overset.disable_coupled_mac_proj = true +Overset.disable_coupled_nodal_proj = true + +amr.n_cell = 128 48 56 +amr.max_level = 1 + +geometry.prob_lo = -9.602993926 -5.25 -10.0 # Lo corner coordinates +geometry.prob_hi = 19.205987852 5.25 2.4007484815 # Hi corner coordinates +geometry.is_periodic = 0 0 0 # Periodicity x y z (0/1) + +tagging.labels = refine0 +tagging.refine0.type = GeometryRefinement +tagging.refine0.shapes = c0 b0 +tagging.refine0.level = 0 + +tagging.refine0.c0.type = cylinder +tagging.refine0.c0.start = 0.0 0.0 -2.0 +tagging.refine0.c0.end = 0.0 0.0 1.5 +tagging.refine0.c0.outer_radius = 0.5 + +tagging.refine0.b0.type = box +tagging.refine0.b0.origin = -10.0 -5.5 -0.5 +tagging.refine0.b0.xaxis = 30.0 0.0 0.0 +tagging.refine0.b0.yaxis = 0.0 11.0 0.0 +tagging.refine0.b0.zaxis = 0.0 0.0 1.0 + +xlo.type = "wave_generation" +xhi.type = "pressure_outflow" +ylo.type = "slip_wall" +yhi.type = "slip_wall" +zlo.type = "slip_wall" +zhi.type = "slip_wall" + +incflo.verbose = 0 # incflo_level \ No newline at end of file diff --git a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-nalu.yaml b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-nalu.yaml new file mode 100644 index 0000000..2791c67 --- /dev/null +++ b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder-nalu.yaml @@ -0,0 +1,162 @@ +Simulations: + - name: sim1 + time_integrator: ti_1 + optimizer: opt1 + +linear_solvers: + + - name: solve_scalar + type: hypre + method: hypre_gmres + preconditioner: boomerAMG + tolerance: 1e-5 + max_iterations: 200 + kspace: 5 + output_level: 0 + + - name: solve_cont + type: hypre + method: hypre_gmres + preconditioner: boomerAMG + tolerance: 1e-5 + max_iterations: 200 + kspace: 5 + output_level: 0 + +realms: + + - name: realm_1 + mesh: meshes/cylinder_oc5diam_medium.e + use_edges: yes + automatic_decomposition_type: rcb + check_for_missing_bcs: yes + + equation_systems: + name: theEqSys + max_iterations: 3 + decoupled_overset_solve: yes + + solver_system_specification: + volume_of_fluid: solve_scalar + velocity: solve_scalar + pressure: solve_cont + + systems: + - VolumeOfFluid: + name: myVOF + max_iterations: 1 + convergence_tolerance: 1e-8 + - LowMachEOM: + name: myLowMach + max_iterations: 1 + convergence_tolerance: 1e-8 + + initial_conditions: + + - user_function: ic_1 + target_name: oset + user_function_name: + volume_of_fluid: sloshing_tank + user_function_parameters: + volume_of_fluid: [0.0, 0.0, 0.25, 0.1] + + - constant: ic_1 + target_name: oset + value: + velocity: [0.0, 0.0, 0.0] + pressure: 0.0 + + material_properties: + target_name: oset + specifications: + - name: density + type: volume_of_fluid + primary_value: 1000.0 + secondary_value: 1. + + - name: viscosity + type: volume_of_fluid + primary_value: 1.0e-3 + secondary_value: 1.0e-5 + + boundary_conditions: + + - wall_boundary_condition: bc_wall + target_name: surface_2 + wall_user_data: + velocity: [0.0, 0.0, 0.0] + + - overset_boundary_condition: bc_overset + overset_connectivity_type: tioga + overset_user_data: + mesh_group: + - overset_name: oset_n + mesh_parts: [oset] + wall_parts: [surface_2] + ovset_parts: [surface_1] + + solution_options: + name: myOptions + use_balanced_buoyancy_force: no + + options: + - hybrid_factor: + velocity: 0.05 + volume_of_fluid: 0.0 + + - upw_factor: + velocity: 0.0 + + - limiter: + volume_of_fluid: yes + + - consistent_mass_matrix_png: + pressure: no + + - source_terms: + momentum: + - buoyancy_density + + - user_constants: + reference_density: 0.00 + gravity: [0.0, 0.0, -9.81] + + post_processing: + - type: surface + physics: surface_force_and_moment + output_file_name: cylinder_forces.dat + frequency: 5 + parameters: [0, 0, 0] + target_name: + - surface_2 + + output: + output_data_base_name: out/stokesWavesCylinder.e + output_frequency: 20 + output_node_set: yes + output_variables: + - density + - volume_of_fluid + - velocity + - pressure + - dvolume_of_fluiddx + - dpressuredx + - iblank + + restart: + restart_data_base_name: rst/stokesWavesCylinder.rst + restart_frequency: 500 + +Time_Integrators: + - StandardTimeIntegrator: + name: ti_1 + start_time: 0.0 + termination_time: 200.0 + time_step: 0.01 + time_stepping_type: fixed + time_step_count: 0 + second_order_accuracy: yes + + + realms: + - realm_1 diff --git a/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml new file mode 100644 index 0000000..e779952 --- /dev/null +++ b/test/test_files/stokes-waves-cylinder/stokes-waves-cylinder.yaml @@ -0,0 +1,19 @@ + +exawind: + nalu_wind_inp: + - stokes-waves-cylinder-nalu.yaml + amr_wind_inp: stokes-waves-cylinder-amr.inp + num_timesteps: 5 + additional_picard_iterations: 1 + + nalu_vars: + - volume_of_fluid + - velocity + - density + - pressure + amr_cell_vars: + - vof + - velocity + - density + amr_node_vars: + - p