From e08fade81cea83b440772cc6c412c21347bff31f Mon Sep 17 00:00:00 2001 From: RasmitDevkota Date: Tue, 14 Nov 2023 10:09:04 -0500 Subject: [PATCH 1/6] forcing term --- src/simulation/m_rhs.fpp | 44 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/src/simulation/m_rhs.fpp b/src/simulation/m_rhs.fpp index 6d781fdc0..61edf0a18 100644 --- a/src/simulation/m_rhs.fpp +++ b/src/simulation/m_rhs.fpp @@ -650,6 +650,14 @@ contains integer :: i, j, k, l, q, ii, id !< Generic loop iterators integer :: term_index + real(kind(0d0)) :: x + real(kind(0d0)) :: y + real(kind(0d0)) :: z + real(kind(0d0)) :: F_mag + real(kind(0d0)) :: F_scale_x + real(kind(0d0)) :: F_scale_y + real(kind(0d0)) :: F_scale_z + ! Configuring Coordinate Direction Indexes ========================= ix%beg = -buff_size; iy%beg = 0; iz%beg = 0 @@ -845,7 +853,7 @@ contains ! =============================================================== if (alt_soundspeed) then -!$acc parallel loop collapse(3) gang vector default(present) + !$acc parallel loop collapse(3) gang vector default(present) do l = 0, p do k = 0, n do j = 0, m @@ -1037,7 +1045,7 @@ contains end do end do else -!$acc parallel loop collapse(3) gang vector default(present) + !$acc parallel loop collapse(3) gang vector default(present) do l = 0, p do k = 0, n do j = 0, m @@ -1132,7 +1140,7 @@ contains end do !Non-polytropic qbmm needs to account for change in bubble radius due to a change in nb if(qbmm .and. (.not. polytropic) ) then - !$acc parallel loop collapse(5) gang vector default(present) private(nb_q, nR, nR2, R, R2, nb_dot, nR_dot, nR2_dot, var) + !$acc parallel loop collapse(5) gang vector default(present) private(nb_q, nR, nR2, R, R2, nb_dot, nR_dot, nR2_dot, var) do i = 1, nb do q = 1, nnode do l = 0, p @@ -1256,7 +1264,7 @@ contains end if end do else -!$acc parallel loop collapse(4) gang vector default(present) + !$acc parallel loop collapse(4) gang vector default(present) do j = advxb, advxe do l = 0, p do k = 0, n @@ -1848,6 +1856,34 @@ contains end if ! id loop call nvtxEndRange + ! F_mag = 1d0/100000d0 + F_mag = 0d0 + + do l = 0, p + do k = 0, n + do j = 0, m + x = real(x_cc(j), kind(0d0))/x_cc(m) + y = real(y_cc(k), kind(0d0))/y_cc(n) + ! F_scale_x = x * 1d0/real(t_step + 1, kind(0d0)) + ! F_scale_y = y * 1d0/real(t_step + 1, kind(0d0)) + F_scale_x = x * 1d0/(101d0 ** 2) * & + (real(t_step + 1, kind(0d0)) - 101) ** 2 + F_scale_y = y * 1d0/(101d0 ** 2) * & + (real(t_step + 1, kind(0d0)) - 101) ** 2 + + rhs_vf(momxb + id - 1)%sf(j, k, l) = & + rhs_vf(momxb + id - 1)%sf(j, k, l) + & + (F_mag * F_scale_x) ** 2 + (F_mag * F_scale_y) ** 2 + + rhs_vf(E_idx)%sf(j, k, l) = & + rhs_vf(E_idx)%sf(j, k, l) + & + (F_mag * F_scale_x) ** 2 + (F_mag * F_scale_y) ** 2 + end do + end do + end do + + ! print *, t_step, " - ", id, " - ", rhs_vf(momxb + id)%sf(0, 0, 0), " - ", rhs_vf(E_idx)%sf(0, 0, 0) + ! RHS additions for hypoelasticity call nvtxStartRange("RHS_Hypoelasticity") From 3e5307bcd9029664eafe9225f22ba45e19c4c2b3 Mon Sep 17 00:00:00 2001 From: RasmitDevkota Date: Tue, 14 Nov 2023 10:10:48 -0500 Subject: [PATCH 2/6] added 3D_TaylorGreen_Vortex patch --- src/pre_process/m_patches.fpp | 81 +++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/src/pre_process/m_patches.fpp b/src/pre_process/m_patches.fpp index 2f7329357..38df1accb 100644 --- a/src/pre_process/m_patches.fpp +++ b/src/pre_process/m_patches.fpp @@ -719,6 +719,87 @@ contains end subroutine s_2D_TaylorGreen_Vortex ! ----------------------------------- + !> 3D Taylor Green vortex used to generate turbulence + ! @param patch_id is the patch identifier + subroutine s_3D_TaylorGreen_Vortex(patch_id, patch_id_fp, q_prim_vf) ! ---------------------------- + + integer, intent(IN) :: patch_id + integer, intent(INOUT), dimension(0:m, 0:n, 0:p) :: patch_id_fp + type(scalar_field), dimension(1:sys_size) :: q_prim_vf + + real(kind(0d0)) :: pi_inf, gamma, lit_gamma !< equation of state parameters + real(kind(0d0)) :: L0, U0 !< Taylor Green Vortex parameters + real(kind(0d0)) :: c, Ma !< Speed of sound and Mach number + + integer :: i, j, k !< generic loop iterators + + pi_inf = fluid_pp(1)%pi_inf + gamma = fluid_pp(1)%gamma + lit_gamma = (1d0 + gamma)/gamma + + ! Transferring the patch's centroid and length information + x_centroid = patch_icpp(patch_id)%x_centroid + y_centroid = patch_icpp(patch_id)%y_centroid + length_x = patch_icpp(patch_id)%length_x + length_y = patch_icpp(patch_id)%length_y + + ! Computing the beginning and the end x- and y-coordinates + ! of the patch based on its centroid and lengths + x_boundary%beg = x_centroid - 0.5d0*length_x + x_boundary%end = x_centroid + 0.5d0*length_x + y_boundary%beg = y_centroid - 0.5d0*length_y + y_boundary%end = y_centroid + 0.5d0*length_y + + ! Since the patch doesn't allow for its boundaries to be + ! smoothed out, the pseudo volume fraction is set to 1 to + ! ensure that only the current patch contributes to the fluid + ! state in the cells that this patch covers. + eta = 1d0 + ! U0 is the characteristic velocity of the vortex + U0 = patch_icpp(patch_id)%vel(1) + ! L0 is the characteristic length of the vortex + L0 = patch_icpp(patch_id)%vel(2) + ! Ma is the Mach number + c = (lit_gamma * patch_icpp(patch_id)%pres/patch_icpp(patch_id)%alpha_rho(1)) ** 0.5 + Ma = U0 / c + ! Checking whether the patch covers a particular cell in the + ! domain and verifying whether the current patch has the + ! permission to write to that cell. If both queries check out, + ! the primitive variables of the current patch are assigned + ! to this cell. + do k = 0, p + do j = 0, n + do i = 0, m + if (x_boundary%beg <= x_cc(i) .and. & + x_boundary%end >= x_cc(i) .and. & + y_boundary%beg <= y_cc(j) .and. & + y_boundary%end >= y_cc(j) .and. & + z_boundary%beg <= z_cc(j) .and. & + z_boundary%end >= z_cc(j) .and. & + patch_icpp(patch_id)%alter_patch(patch_id_fp(i, j, k))) then + + call s_assign_patch_primitive_variables(patch_id, i, j, k, & + eta, q_prim_vf, patch_id_fp) + + @:analytical() + + ! Assign Parameters ========================================================= + q_prim_vf(mom_idx%beg )%sf(i,j,k) = U0*SIN(x_cc(i)/L0)*COS(y_cc(j)/L0)*COS(z_cc(j)/L0) + q_prim_vf(mom_idx%end )%sf(i,j,k) = -U0*COS(x_cc(i)/L0)*SIN(y_cc(j)/L0)*COS(z_cc(j)/L0) + q_prim_vf(E_idx )%sf(i,j,k) = patch_icpp(patch_id)%pres + & + q_prim_vf(1)%sf(i,j,0) * (U0 ** 2) * & + (1/(lit_gamma * Ma ** 2) + & + (COS(2*x_cc(i)) + COS(2*y_cc(j))) * & + (COS(2*z_cc(j)) + 2))/16 + ! ================================================================================ + + end if + end do + end do + end do + + end subroutine s_3D_TaylorGreen_Vortex ! ----------------------------------- + !> This patch assigns the primitive variables as analytical !! functions such that the code can be verified. !! @param patch_id is the patch identifier From 550f6b93d60adfc76dbf0284dd51b6d69681801d Mon Sep 17 00:00:00 2001 From: RasmitDevkota Date: Tue, 14 Nov 2023 10:12:18 -0500 Subject: [PATCH 3/6] added s_check_3D_TaylorGreen_vortex_patch_geometry --- src/pre_process/m_check_patches.fpp | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/pre_process/m_check_patches.fpp b/src/pre_process/m_check_patches.fpp index ec0421a6c..ed10fc520 100644 --- a/src/pre_process/m_check_patches.fpp +++ b/src/pre_process/m_check_patches.fpp @@ -84,6 +84,8 @@ contains call s_check_2D_TaylorGreen_vortex_patch_geometry(i) elseif (patch_icpp(i)%geometry == 21) then call s_check_model_geometry(i) + elseif (patch_icpp(i)%geometry == 22) then + call s_check_3D_TaylorGreen_vortex_patch_geometry(i) else call s_mpi_abort('Unsupported choice of the '// & 'geometry of active patch '//trim(iStr)//& @@ -302,6 +304,40 @@ contains end subroutine s_check_2D_TaylorGreen_vortex_patch_geometry! -------------- + !> This subroutine verifies that the geometric parameters of + !! the Taylor Green vortex patch have been entered by the user + !! consistently. + !! @param patch_id Patch identifier + subroutine s_check_3D_TaylorGreen_vortex_patch_geometry(patch_id) ! -------- + + integer, intent(IN) :: patch_id + call s_int_to_str(patch_id, iStr) + + ! Constraints on the TaylorGreen vortex patch geometric parameters + if (p == 0 & + .or. & + patch_icpp(patch_id)%x_centroid == dflt_real & + .or. & + patch_icpp(patch_id)%y_centroid == dflt_real & + .or. & + patch_icpp(patch_id)%z_centroid == dflt_real & + .or. & + patch_icpp(patch_id)%length_x <= 0d0 & + .or. & + patch_icpp(patch_id)%length_y <= 0d0 & + .or. & + patch_icpp(patch_id)%length_z <= 0d0 & + .or. & + patch_icpp(patch_id)%vel(2)<= 0d0) then + + call s_mpi_abort('Inconsistency(ies) detected in '// & + 'geometric parameters of Taylor Green '// & + 'vortex patch '//trim(iStr)//'. Exiting ...') + + end if + + end subroutine s_check_3D_TaylorGreen_vortex_patch_geometry! -------------- + !> This subroutine verifies that the geometric parameters of !! the analytical patch have consistently been inputted by !! the user. From 4c0ab0d83b201fcea436278fd298a142ea7bece4 Mon Sep 17 00:00:00 2001 From: RasmitDevkota Date: Tue, 14 Nov 2023 10:12:50 -0500 Subject: [PATCH 4/6] 2D and 3D turbulent TGV --- examples/2D_TaylorGreenVortex/case_turb.py | 112 ++++++++++++++++++++ examples/3D_TaylorGreenVortex/case.py | 117 +++++++++++++++++++++ 2 files changed, 229 insertions(+) create mode 100644 examples/2D_TaylorGreenVortex/case_turb.py create mode 100644 examples/3D_TaylorGreenVortex/case.py diff --git a/examples/2D_TaylorGreenVortex/case_turb.py b/examples/2D_TaylorGreenVortex/case_turb.py new file mode 100644 index 000000000..3d530187f --- /dev/null +++ b/examples/2D_TaylorGreenVortex/case_turb.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 + +import math +import json + +gamma = 1.4 +Re_lit = 1600 +Ma = 0.1 + +# Dimensions of the Vortex +l = 1.0 +L = math.pi*l + +pres_i = 1.E+05 +alpha_rho1_i = 1.22 + +# Turbulent Mach Number +c = (gamma * pres_i/alpha_rho1_i) ** 0.5 +vel1_i = Ma * c + +Mu = alpha_rho1_i * vel1_i * l/Re_lit # Define the fluid's dynamic viscosity + +# Numerical setup +Nx = 255 +dx = 2 * L/(1.*(Nx+1)) + +C = 0.3 +mydt = C * dx / c +Nt = 1000 + +# Configuring case dictionary +print(json.dumps({ + # Logistics ================================================ + 'run_time_info' : 'T', + # ========================================================== + + # Computational Domain Parameters ========================== + # Periodic Domain from -pi*l to pi*l + 'x_domain%beg' : -L, + 'x_domain%end' : L, + 'y_domain%beg' : -L, + 'y_domain%end' : L, + 'm' : Nx, + 'n' : Nx, + 'p' : 0, + 'dt' : mydt, + 't_step_start' : 0, + 't_step_stop' : math.ceil(Nt), + 't_step_save' : math.ceil(Nt/10), + # ========================================================== + + # Simulation Algorithm Parameters ========================== + 'num_patches' : 1, + 'model_eqns' : 2, + 'alt_soundspeed' : 'F', + 'num_fluids' : 1, + 'adv_alphan' : 'T', + 'mpp_lim' : 'F', + 'mixture_err' : 'T', + 'time_stepper' : 3, + 'weno_order' : 5, + 'weno_eps' : 1.E-16, + 'mapped_weno' : 'T', + 'null_weights' : 'F', + 'mp_weno' : 'F', + 'weno_Re_flux' : 'T', + 'weno_avg' : 'T', + 'riemann_solver' : 2, + 'wave_speeds' : 1, + 'avg_state' : 2, + 'perturb_flow' : 'T', + 'perturb_flow_fluid' : 1, + 'bc_x%beg' : -1, + 'bc_x%end' : -1, + 'bc_y%beg' : -1, + 'bc_y%end' : -1, + # ========================================================== + + # Formatted Database Files Structure Parameters ============ + 'format' : 1, + 'precision' : 2, + 'prim_vars_wrt' :'T', + 'parallel_io' :'F', + 'omega_wrt(3)' :'T', + 'fd_order' :'1', + 'E_wrt' :'T', + # ========================================================== + + # Patch 1: Base ============================================ + # Uncomment the configuration of the Taylor Green Vortex in + # 2D analytical patch under m_patch.f90 + 'patch_icpp(1)%geometry' : 20, + 'patch_icpp(1)%x_centroid' : 0.0, + 'patch_icpp(1)%y_centroid' : 0.0, + 'patch_icpp(1)%length_x' : 2.0*L, + 'patch_icpp(1)%length_y' : 2.0*L, + 'patch_icpp(1)%vel(1)' : vel1_i, # Define the characteristic velocity of the vortex + 'patch_icpp(1)%vel(2)' : l, # Define the characteristic length of the vortex + 'patch_icpp(1)%pres' : 1.E+05, + 'patch_icpp(1)%alpha_rho(1)' : 1.22, + 'patch_icpp(1)%alpha(1)' : 1., + # ========================================================== + + + # Fluids Physical Parameters =============================== + 'fluid_pp(1)%gamma' : 1.E+00/(gamma-1.E+00), + 'fluid_pp(1)%pi_inf' : 0.0, + # Shear viscosity of STD air + 'fluid_pp(1)%Re(1)' : 1/Mu, + # ========================================================== +})) +# ============================================================================== \ No newline at end of file diff --git a/examples/3D_TaylorGreenVortex/case.py b/examples/3D_TaylorGreenVortex/case.py new file mode 100644 index 000000000..6c2e43e12 --- /dev/null +++ b/examples/3D_TaylorGreenVortex/case.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python3 + +import math +import json + +gamma = 1.4 +Re_lit = 1600 +Ma = 0.1 + +# Dimensions of the Vortex +l = 1.0 +L = math.pi*l + +pres_i = 1.E+05 +alpha_rho1_i = 1.22 + +# Turbulent Mach Number +c = (gamma * pres_i/alpha_rho1_i) ** 0.5 +vel1_i = Ma * c + +Mu = alpha_rho1_i * vel1_i * l/Re_lit # Define the fluid's dynamic viscosity + +# Numerical setup +Nx = 255 +dx = 2 * L/(1.*(Nx+1)) + +C = 0.3 +mydt = C * dx / c +Nt = 1000 + +# Configuring case dictionary +print(json.dumps({ + # Logistics ================================================ + 'run_time_info' : 'T', + # ========================================================== + + # Computational Domain Parameters ========================== + # Periodic Domain from -pi*l to pi*l + 'x_domain%beg' : -L, + 'x_domain%end' : L, + 'y_domain%beg' : -L, + 'y_domain%end' : L, + 'z_domain%beg' : -L, + 'z_domain%end' : L, + 'm' : Nx, + 'n' : Nx, + 'p' : Nx, + 'dt' : mydt, + 't_step_start' : 0, + 't_step_stop' : math.ceil(Nt), + 't_step_save' : math.ceil(Nt/10), + # ========================================================== + + # Simulation Algorithm Parameters ========================== + 'num_patches' : 1, + 'model_eqns' : 2, + 'alt_soundspeed' : 'F', + 'num_fluids' : 1, + 'adv_alphan' : 'T', + 'mpp_lim' : 'F', + 'mixture_err' : 'T', + 'time_stepper' : 3, + 'weno_order' : 5, + 'weno_eps' : 1.E-16, + 'mapped_weno' : 'T', + 'null_weights' : 'F', + 'mp_weno' : 'F', + 'weno_Re_flux' : 'T', + 'weno_avg' : 'T', + 'riemann_solver' : 2, + 'wave_speeds' : 1, + 'avg_state' : 2, + 'perturb_flow' : 'T', + 'perturb_flow_fluid' : 1, + 'bc_x%beg' : -1, + 'bc_x%end' : -1, + 'bc_y%beg' : -1, + 'bc_y%end' : -1, + 'bc_z%beg' : -1, + 'bc_z%end' : -1, + # ========================================================== + + # Formatted Database Files Structure Parameters ============ + 'format' : 1, + 'precision' : 2, + 'prim_vars_wrt' :'T', + 'parallel_io' :'T', + 'omega_wrt(3)' :'T', + 'fd_order' : 2, + # ========================================================== + + # Patch 1: Base ============================================ + # Uncomment the configuration of the Taylor Green Vortex in + # 2D analytical patch under m_patch.f90 + 'patch_icpp(1)%geometry' : 22, + 'patch_icpp(1)%x_centroid' : 0.0, + 'patch_icpp(1)%y_centroid' : 0.0, + 'patch_icpp(1)%z_centroid' : 0.0, + 'patch_icpp(1)%length_x' : 2.0*L, + 'patch_icpp(1)%length_y' : 2.0*L, + 'patch_icpp(1)%length_z' : 2.0*L, + 'patch_icpp(1)%vel(1)' : vel1_i, # Define the characteristic velocity of the vortex + 'patch_icpp(1)%vel(2)' : l, # Define the characteristic length of the vortex + 'patch_icpp(1)%pres' : 1.E+05, + 'patch_icpp(1)%alpha_rho(1)' : 1.22, + 'patch_icpp(1)%alpha(1)' : 1., + # ========================================================== + + + # Fluids Physical Parameters =============================== + 'fluid_pp(1)%gamma' : 1.E+00/(gamma-1.E+00), + 'fluid_pp(1)%pi_inf' : 0.0, + # Shear viscosity of STD air + 'fluid_pp(1)%Re(1)' : 1/Mu, + # ========================================================== +})) +# ============================================================================== \ No newline at end of file From 604b38991ede86982d7b82ea7ade458902e87707 Mon Sep 17 00:00:00 2001 From: RasmitDevkota Date: Sun, 3 Dec 2023 20:20:52 -0500 Subject: [PATCH 5/6] created perturb_flow_mag parameter --- docs/documentation/case.md | 12 +++++++++--- src/pre_process/m_checker.f90 | 10 +++++++--- src/pre_process/m_global_parameters.fpp | 2 ++ src/pre_process/m_initial_condition.fpp | 2 +- src/pre_process/m_mpi_proxy.fpp | 4 ++-- src/pre_process/m_start_up.fpp | 2 +- toolchain/mfc/run/case_dicts.py | 2 +- 7 files changed, 23 insertions(+), 11 deletions(-) diff --git a/docs/documentation/case.md b/docs/documentation/case.md index fd97d3b43..c31f8c034 100644 --- a/docs/documentation/case.md +++ b/docs/documentation/case.md @@ -505,8 +505,10 @@ Implementation of the parameterse into the model follow [Ando (2010)](references | Parameter | Type | Description | | ---: | :----: | :--- | | `perturb_flow` | Logical | Perturb the initlal velocity field by random noise | +| `perturb_flow_fluid` | Integer | Fluid density whose flow is to be perturbed | +| `perturb_flow_mag` | Real | Set the magnitude of flow perturbations | | `perturb_sph` | Logical | Perturb the initial partial density by random noise | -| `perturb_sph_fluid` | Integer | Fluid component whose partial density to be perturbed | +| `perturb_sph_fluid` | Integer | Fluid component whose partial density is to be perturbed | | `vel_profile` | Logical | Set the mean streamwise velocity to hyperbolic tangent profile | | `instability_wave` | Logical | Perturb the initial velocity field by instability waves | @@ -514,9 +516,13 @@ The table lists velocity field parameters. The parameters are optionally used to - `perturb_flow` activates the perturbation of initial velocity by random noise. -- `perturb_sph` activates the perturbation of intial partial density by random noise. +- `perturb_flow_fluid` specifies the fluid component whose flow is to be perturbed. -- `perturb_sph_fluid` specifies the fluid component whose the partial density to be perturbed. +- `perturb_flow` activates the perturbation of initial velocity by random noise. + +- `perturb_sph` activates the perturbation of initial partial density by random noise. + +- `perturb_sph_fluid` specifies the fluid component whose partial density is to be perturbed. - `vel_profile` activates setting the mean streamwise velocity to hyperbolic tangent profile. This option works only for 2D and 3D cases. diff --git a/src/pre_process/m_checker.f90 b/src/pre_process/m_checker.f90 index 91ea228bd..15ecc7161 100644 --- a/src/pre_process/m_checker.f90 +++ b/src/pre_process/m_checker.f90 @@ -543,11 +543,15 @@ subroutine s_check_inputs() call s_mpi_abort('Unsupported choice for the value of '// & 'num_patches. Exiting ...') ! Constraints on perturbing the initial condition - elseif ((perturb_flow .and. perturb_flow_fluid == dflt_int) & + elseif ((perturb_flow & + .and. & + (perturb_flow_fluid == dflt_int .or. perturb_flow_mag == dflt_real)) & .or. & - ((perturb_flow .neqv. .true.) .and. (perturb_flow_fluid /= dflt_int))) then + ((perturb_flow .neqv. .true.) & + .and. & + (perturb_flow_fluid /= dflt_int .or. perturb_flow_mag /= dflt_real))) then call s_mpi_abort('Unsupported choice of the combination of '// & - 'values for perturb_flow and perturb_flow_fluid. '// & + 'values for perturb_flow, perturb_flow_fluid, and perturb_flow_mag. '// & 'Exiting ...') elseif ((perturb_flow_fluid > num_fluids) & .or. & diff --git a/src/pre_process/m_global_parameters.fpp b/src/pre_process/m_global_parameters.fpp index 3958b4ffd..a28d5808a 100644 --- a/src/pre_process/m_global_parameters.fpp +++ b/src/pre_process/m_global_parameters.fpp @@ -103,6 +103,7 @@ module m_global_parameters ! Perturb density of surrounding air so as to break symmetry of grid logical :: perturb_flow integer :: perturb_flow_fluid !< Fluid to be perturbed with perturb_flow flag + real(kind(0d0)) :: perturb_flow_mag !< Magnitude of perturbation with perturb_flow flag logical :: perturb_sph integer :: perturb_sph_fluid !< Fluid to be perturbed with perturb_sph flag real(kind(0d0)), dimension(num_fluids_max) :: fluid_rho @@ -254,6 +255,7 @@ contains instability_wave = .false. perturb_flow = .false. perturb_flow_fluid = dflt_int + perturb_flow_mag = dflt_real perturb_sph = .false. perturb_sph_fluid = dflt_int fluid_rho = dflt_real diff --git a/src/pre_process/m_initial_condition.fpp b/src/pre_process/m_initial_condition.fpp index c15be1c38..2fd267811 100644 --- a/src/pre_process/m_initial_condition.fpp +++ b/src/pre_process/m_initial_condition.fpp @@ -324,7 +324,7 @@ contains ! q_prim_vf(perturb_flow_fluid)%sf(i,j,k) = q_prim_vf(perturb_flow_fluid)%sf(i,j,k) + rand_real ! Perturb velocity call random_number(rand_real) - rand_real = rand_real*1.d-2 + rand_real = rand_real*perturb_flow_mag q_prim_vf(mom_idx%beg)%sf(i, j, k) = (1.d0 + rand_real)*q_prim_vf(mom_idx%beg)%sf(i, j, k) q_prim_vf(mom_idx%end)%sf(i, j, k) = rand_real*q_prim_vf(mom_idx%beg)%sf(i, j, k) if (bubbles) then diff --git a/src/pre_process/m_mpi_proxy.fpp b/src/pre_process/m_mpi_proxy.fpp index 7e43a5242..22be385e6 100644 --- a/src/pre_process/m_mpi_proxy.fpp +++ b/src/pre_process/m_mpi_proxy.fpp @@ -65,8 +65,8 @@ contains & 'y_domain%end', 'z_domain%beg', 'z_domain%end', 'a_x', 'a_y', & & 'a_z', 'x_a', 'x_b', 'y_a', 'y_b', 'z_a', 'z_b', 'bc_x%beg', & & 'bc_x%end', 'bc_y%beg', 'bc_y%end', 'bc_z%beg', 'bc_z%end', & - & 'pref', 'rhoref', 'poly_sigma', 'R0ref', 'Web', 'Ca', 'Re_inv', & - & 'sigR', 'sigV', 'rhoRV' ] + & 'perturb_flow_mag', 'pref', 'rhoref', 'poly_sigma', 'R0ref', & + & 'Web', 'Ca', 'Re_inv', 'sigR', 'sigV', 'rhoRV' ] call MPI_BCAST(${VAR}$, 1, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) #:endfor diff --git a/src/pre_process/m_start_up.fpp b/src/pre_process/m_start_up.fpp index 2633ec626..c78234356 100644 --- a/src/pre_process/m_start_up.fpp +++ b/src/pre_process/m_start_up.fpp @@ -115,7 +115,7 @@ contains weno_order, bc_x, bc_y, bc_z, num_patches, & hypoelasticity, patch_icpp, fluid_pp, & precision, parallel_io, vel_profile, instability_wave, & - perturb_flow, perturb_flow_fluid, & + perturb_flow, perturb_flow_fluid, perturb_flow_mag, & perturb_sph, perturb_sph_fluid, fluid_rho, & cyl_coord, loops_x, loops_y, loops_z, & rhoref, pref, bubbles, R0ref, nb, & diff --git a/toolchain/mfc/run/case_dicts.py b/toolchain/mfc/run/case_dicts.py index 1a753d1b9..5180bc8f4 100644 --- a/toolchain/mfc/run/case_dicts.py +++ b/toolchain/mfc/run/case_dicts.py @@ -13,7 +13,7 @@ PRE_PROCESS = COMMON + [ 'old_grid', 'old_ic', 't_step_old', 't_step_start', 'vel_profile', - 'instability_wave', 'perturb_flow', 'perturb_flow_fluid', + 'instability_wave', 'perturb_flow', 'perturb_flow_fluid', 'perturb_flow_mag', 'perturb_sph', 'perturb_sph_fluid', 'fluid_rho', 'num_patches', 'qbmm', 'dist_type', 'R0_type', 'sigR', 'sigV', 'rhoRV' ] From cd95bbeed70867679dd85361b4155fdab8fb3a22 Mon Sep 17 00:00:00 2001 From: RasmitDevkota Date: Sun, 3 Dec 2023 20:22:16 -0500 Subject: [PATCH 6/6] updated 2D and 3D Taylor-Green Vortices with perturb_flow_mag parameter --- examples/2D_TaylorGreenVortex/case_turb.py | 1 + examples/3D_TaylorGreenVortex/case.py | 1 + 2 files changed, 2 insertions(+) diff --git a/examples/2D_TaylorGreenVortex/case_turb.py b/examples/2D_TaylorGreenVortex/case_turb.py index 3d530187f..cc4cdb1c3 100644 --- a/examples/2D_TaylorGreenVortex/case_turb.py +++ b/examples/2D_TaylorGreenVortex/case_turb.py @@ -70,6 +70,7 @@ 'avg_state' : 2, 'perturb_flow' : 'T', 'perturb_flow_fluid' : 1, + 'perturb_flow_mag' : 1.E2, 'bc_x%beg' : -1, 'bc_x%end' : -1, 'bc_y%beg' : -1, diff --git a/examples/3D_TaylorGreenVortex/case.py b/examples/3D_TaylorGreenVortex/case.py index 6c2e43e12..75c5bc5ef 100644 --- a/examples/3D_TaylorGreenVortex/case.py +++ b/examples/3D_TaylorGreenVortex/case.py @@ -72,6 +72,7 @@ 'avg_state' : 2, 'perturb_flow' : 'T', 'perturb_flow_fluid' : 1, + 'perturb_flow_mag' : 1.E2, 'bc_x%beg' : -1, 'bc_x%end' : -1, 'bc_y%beg' : -1,