From c8ad8c0b0ed430e25641332035d9e6711f1c91e2 Mon Sep 17 00:00:00 2001 From: Ben Wilfong <48168887+wilfonba@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:19:16 -0500 Subject: [PATCH] requested changes --- docs/documentation/case.md | 6 ++++++ src/post_process/m_start_up.f90 | 4 +--- src/pre_process/m_start_up.fpp | 5 ++--- src/simulation/m_global_parameters.fpp | 1 - src/simulation/m_riemann_solvers.fpp | 6 +++--- src/simulation/m_start_up.fpp | 5 ++--- toolchain/mfc/run/case_dicts.py | 6 +++++- toolchain/mfc/test/cases.py | 2 +- 8 files changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/documentation/case.md b/docs/documentation/case.md index aaf463322..ab9635763 100644 --- a/docs/documentation/case.md +++ b/docs/documentation/case.md @@ -371,6 +371,8 @@ Details of implementation of viscosity in MFC can be found in [Coralic (2015)](r | `n_start` | Integer | Save file from which to start simulation | | `t_save` | Real | Time duration between data output | | `t_stop` | Real | Simulation stop time | +| `surface_tension` | Logical | Activate surface tension. Requires `surface_tension = T` | +| `viscous` | Logical | Activate viscosity Requires `viscous = T` | - \* Options that work only with `model_eqns = 2`. - † Options that work only with ``cyl_coord = 'F'``. @@ -445,6 +447,10 @@ If this option is false, velocity gradient is computed using finite difference s - `weno_avg` it activates the arithmetic average of the left and right, WENO-reconstructed, cell-boundary values. This option requires `weno_Re_flux` to be true because cell boundary values are only utilized when employing the scalar divergence method in the computation of velocity gradients. +- `surface_tension` activates surface tension when set to `'T'`. Requires `sigma` to be set. + +- `viscous` activates viscosity when set to `'T'`. Requires `Re(1)` and `Re(2)` to be set. + #### Constant Time-Stepping - `dt` specifies the constant time step size that is used in simulation. diff --git a/src/post_process/m_start_up.f90 b/src/post_process/m_start_up.f90 index 17e69bc72..47832450a 100644 --- a/src/post_process/m_start_up.f90 +++ b/src/post_process/m_start_up.f90 @@ -83,7 +83,7 @@ subroutine s_read_input_file polydisperse, poly_sigma, file_per_process, relax, & relax_model, cf_wrt, sigma, adv_n, ib, & cfl_adap_dt, cfl_const_dt, t_save, t_stop, n_start, & - cfl_target + cfl_target, surface_tension ! Inquiring the status of the post_process.inp file file_loc = 'post_process.inp' @@ -114,8 +114,6 @@ subroutine s_read_input_file if (cfl_adap_dt .or. cfl_const_dt) cfl_dt = .true. - if (.not. f_is_default(sigma)) surface_tension = .true. - else call s_mpi_abort('File post_process.inp is missing. Exiting ...') end if diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fpp index 362e10901..641752644 100644 --- a/src/pre_process/m_start_up.fpp +++ b/src/pre_process/m_start_up.fpp @@ -141,7 +141,8 @@ contains sigR, sigV, dist_type, rhoRV, R0_type, & file_per_process, relax, relax_model, & palpha_eps, ptgalpha_eps, ib, num_ibs, patch_ib, & - sigma, adv_n, cfl_adap_dt, cfl_const_dt, n_start, n_start_old + sigma, adv_n, cfl_adap_dt, cfl_const_dt, n_start, & + n_start_old, surface_tension ! Inquiring the status of the pre_process.inp file file_loc = 'pre_process.inp' @@ -170,8 +171,6 @@ contains if (cfl_adap_dt .or. cfl_const_dt) cfl_dt = .true. - if (.not. f_is_default(sigma)) surface_tension = .true. - else call s_mpi_abort('File pre_process.inp is missing. Exiting ...') end if diff --git a/src/simulation/m_global_parameters.fpp b/src/simulation/m_global_parameters.fpp index e31eed308..63fc21c73 100644 --- a/src/simulation/m_global_parameters.fpp +++ b/src/simulation/m_global_parameters.fpp @@ -981,7 +981,6 @@ contains if (fluid_pp(i)%Re(2) > 0) Re_size(2) = Re_size(2) + 1 end do - if (any(Re_size > 0d0)) viscous = .true. if (Re_size(1) > 0d0) shear_stress = .true. if (Re_size(2) > 0d0) bulk_stress = .true. diff --git a/src/simulation/m_riemann_solvers.fpp b/src/simulation/m_riemann_solvers.fpp index 7c0b03c9d..682859b70 100644 --- a/src/simulation/m_riemann_solvers.fpp +++ b/src/simulation/m_riemann_solvers.fpp @@ -4363,7 +4363,7 @@ contains ! to convert mixture or species variables to the mixture variables ! s_convert_to_mixture_variables => null() - if (shear_stress) then + if (viscous) then @:DEALLOCATE_GLOBAL(Re_avg_rsx_vf) end if @:DEALLOCATE_GLOBAL(vel_src_rsx_vf) @@ -4376,7 +4376,7 @@ contains if (n == 0) return - if (shear_stress) then + if (viscous) then @:DEALLOCATE_GLOBAL(Re_avg_rsy_vf) end if @:DEALLOCATE_GLOBAL(vel_src_rsy_vf) @@ -4389,7 +4389,7 @@ contains if (p == 0) return - if (shear_stress) then + if (viscous) then @:DEALLOCATE_GLOBAL(Re_avg_rsz_vf) end if @:DEALLOCATE_GLOBAL(vel_src_rsz_vf) diff --git a/src/simulation/m_start_up.fpp b/src/simulation/m_start_up.fpp index b0ac1eb01..633f0e8ce 100644 --- a/src/simulation/m_start_up.fpp +++ b/src/simulation/m_start_up.fpp @@ -164,7 +164,8 @@ contains pi_fac, adv_n, adap_dt, bf_x, bf_y, bf_z, & k_x, k_y, k_z, w_x, w_y, w_z, p_x, p_y, p_z, & g_x, g_y, g_z, n_start, t_save, t_stop, & - cfl_adap_dt, cfl_const_dt, cfl_target + cfl_adap_dt, cfl_const_dt, cfl_target, & + viscous, surface_tension ! Checking that an input file has been provided by the user. If it ! has, then the input file is read in, otherwise, simulation exits. @@ -198,8 +199,6 @@ contains if (cfl_adap_dt .or. cfl_const_dt) cfl_dt = .true. - if (.not. f_is_default(sigma)) surface_tension = .true. - else call s_mpi_abort(trim(file_path)//' is missing. Exiting ...') end if diff --git a/toolchain/mfc/run/case_dicts.py b/toolchain/mfc/run/case_dicts.py index 7738ca65d..49be5732b 100644 --- a/toolchain/mfc/run/case_dicts.py +++ b/toolchain/mfc/run/case_dicts.py @@ -87,7 +87,8 @@ def analytic(self): 'num_ibs': ParamType.INT, 'cfl_dt': ParamType.LOG, 'n_start': ParamType.INT, - 'n_start_old': ParamType.INT + 'n_start_old': ParamType.INT, + 'surface_tension': ParamType.LOG, }) for ib_id in range(1, 10+1): @@ -225,6 +226,8 @@ def analytic(self): 't_save': ParamType.REAL, 'cfl_target': ParamType.REAL, 'low_Mach': ParamType.INT, + 'surface_tension': ParamType.LOG, + 'viscous': ParamType.LOG, }) for var in [ 'diffusion', 'reactions' ]: @@ -336,6 +339,7 @@ def analytic(self): 't_save': ParamType.REAL, 't_stop': ParamType.REAL, 'n_start': ParamType.INT, + 'surface_tension': ParamType.LOG, }) for cmp_id in range(1,3+1): diff --git a/toolchain/mfc/test/cases.py b/toolchain/mfc/test/cases.py index cf7208a01..99a9371ac 100644 --- a/toolchain/mfc/test/cases.py +++ b/toolchain/mfc/test/cases.py @@ -648,7 +648,7 @@ def alter_viscosity(dimInfo): # Viscosity & bubbles checks if len(dimInfo[0]) > 0: stack.push("Viscosity -> Bubbles", - {"fluid_pp(1)%Re(1)": 50, "bubbles": 'T'}) + {"fluid_pp(1)%Re(1)": 50, "bubbles": 'T', "viscous": 'T'}) stack.push('', { 'nb' : 1, 'fluid_pp(1)%gamma' : 0.16, 'fluid_pp(1)%pi_inf': 3515.0,