MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_viscous Module Reference

Computes viscous stress tensors and diffusive flux contributions for the Navier–Stokes equations. More...

Functions/Subroutines

impure subroutine, public s_initialize_viscous_module
 Initialize the viscous module.
subroutine s_compute_axis_inv_re (grad_x_vf, grad_y_vf, grad_z_vf, alpha_visc, j, k, l, re_visc)
 Compute viscous stress tensor near cylindrical axis, avoiding 1/r singularity at y_cb(-1)=0 Inverse Reynolds numbers of the mixture at one cell. Non-Newtonian fluids need the local shear rate, which comes from the velocity gradients; Newtonian ones reduce to the volume-fraction-weighted harmonic mean.
subroutine, public s_compute_viscous_stress_cylindrical_boundary (q_prim_vf, grad_x_vf, grad_y_vf, grad_z_vf, tau_re_vf, ix, iy, iz)
subroutine, public s_get_viscous (ql_prim_rsx_vf, dql_prim_dx_n, dql_prim_dy_n, dql_prim_dz_n, ql_prim, qr_prim_rsx_vf, dqr_prim_dx_n, dqr_prim_dy_n, dqr_prim_dz_n, qr_prim, q_prim_qp, dq_prim_dx_qp, dq_prim_dy_qp, dq_prim_dz_qp, ix, iy, iz)
 Computes viscous terms.
subroutine s_reconstruct_cell_boundary_values_visc (v_vf, vl_x, vr_x, norm_dir, vl_prim_vf, vr_prim_vf, ix, iy, iz)
 Reconstruct left and right cell-boundary values of viscous primitive variables.
subroutine, public s_reconstruct_cell_boundary_values_visc_deriv (v_vf, vl_x, vr_x, norm_dir, vl_prim_vf, vr_prim_vf, ix, iy, iz)
 Reconstruct left and right cell-boundary values of viscous primitive variable derivatives.
subroutine s_apply_scalar_divergence_theorem (vl_vf, vr_vf, dv_ds_vf, norm_dir, ix, iy, iz, iv_in, dl, dim, buff_size_in)
 Compute cell-average spatial derivatives via the scalar divergence theorem.
subroutine s_compute_fd_gradient (var, grad_x, grad_y, grad_z)
 Computes the scalar gradient fields via finite differences.
subroutine, public s_compact_ib_viscous_gradients (q_prim_vf, markers, id, dql_x, dqr_x, dql_y, dqr_y, dql_z, dqr_z)
 With weno_Re_flux next to an immersed body, replace the WENO velocity gradient on the faces of direction id within ib_visc_band cells of a body cell by the compact one of weno_Re_flux = F: the normal difference across the face, and the mean of the two cells' central tangential differences. Ghost values extend the flow only a layer or two deep (the mirror leaves a kink at the wall), and the gradient stencil of weno_Re_flux, about five cells wide, carries that into the fluid faces next to the wall. The face j+1/2 is read by the viscous flux from dqR(j) and dqL(j+1), so both are set.
subroutine s_compact_ib_viscous_gradient (q, markers, id, dql_x, dqr_x, dql_y, dqr_y, dql_z, dqr_z)
 One velocity component of s_compact_ib_viscous_gradients. The differences are written out per direction so that a coordinate array that does not exist (z_cc in 2D) is never touched.
subroutine, public s_compact_normal_viscous_gradients (q_prim_vf, id, dql_x, dqr_x, dql_y, dqr_y, dql_z, dqr_z)
 weno_Re_flux_compact: set the face-normal velocity gradient (direction id) on every face to the difference across the face. The WENO chain (face values, cell gradient, reconstructed gradient, face mean) has zero damping at the checkerboard wavenumber, which leaves a no-slip wall's odd-mirror forcing undamped. The face j+1/2 is read by the viscous flux from dqR(j) and dqL(j+1), so both are set. Tangential gradients are unchanged.
subroutine s_compact_normal_viscous_gradient (q, id, cc, dql, dqr)
 One velocity component of s_compact_normal_viscous_gradients; cc holds the cell centres along id.
impure subroutine, public s_finalize_viscous_module ()
 Finalize the viscous module.

Variables

type(int_bounds_info) iv
type(int_bounds_info) is1_viscous
type(int_bounds_info) is2_viscous
type(int_bounds_info) is3_viscous
real(wp), dimension(:,:), allocatable res_viscous
integer, parameter ib_visc_band = 2
 Faces within this many cells of an immersed-boundary cell take the compact velocity gradient.

Detailed Description

Computes viscous stress tensors and diffusive flux contributions for the Navier–Stokes equations.

Function/Subroutine Documentation

◆ s_apply_scalar_divergence_theorem()

subroutine m_viscous::s_apply_scalar_divergence_theorem ( type(scalar_field), dimension(iv%beg:iv%end), intent(in) vl_vf,
type(scalar_field), dimension(iv%beg:iv%end), intent(in) vr_vf,
type(scalar_field), dimension(iv%beg:iv%end), intent(inout) dv_ds_vf,
integer, intent(in) norm_dir,
type(int_bounds_info), intent(in) ix,
type(int_bounds_info), intent(in) iy,
type(int_bounds_info), intent(in) iz,
type(int_bounds_info), intent(in) iv_in,
real(wp), dimension(-buff_size_in:dim + buff_size_in), intent(in) dl,
integer, intent(in) dim,
integer, intent(in) buff_size_in )

Compute cell-average spatial derivatives via the scalar divergence theorem.

Definition at line 2791 of file m_viscous.fpp.f90.

Here is the caller graph for this function:

◆ s_compact_ib_viscous_gradient()

subroutine m_viscous::s_compact_ib_viscous_gradient ( type(scalar_field), intent(in) q,
type(integer_field), intent(in) markers,
integer, intent(in) id,
type(scalar_field), intent(inout) dql_x,
type(scalar_field), intent(inout) dqr_x,
type(scalar_field), intent(inout) dql_y,
type(scalar_field), intent(inout) dqr_y,
type(scalar_field), intent(inout) dql_z,
type(scalar_field), intent(inout) dqr_z )

One velocity component of s_compact_ib_viscous_gradients. The differences are written out per direction so that a coordinate array that does not exist (z_cc in 2D) is never touched.

Definition at line 3597 of file m_viscous.fpp.f90.

Here is the caller graph for this function:

◆ s_compact_ib_viscous_gradients()

subroutine, public m_viscous::s_compact_ib_viscous_gradients ( type(scalar_field), dimension(sys_size), intent(in) q_prim_vf,
type(integer_field), intent(in) markers,
integer, intent(in) id,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dql_x,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dqr_x,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dql_y,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dqr_y,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dql_z,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dqr_z )

With weno_Re_flux next to an immersed body, replace the WENO velocity gradient on the faces of direction id within ib_visc_band cells of a body cell by the compact one of weno_Re_flux = F: the normal difference across the face, and the mean of the two cells' central tangential differences. Ghost values extend the flow only a layer or two deep (the mirror leaves a kink at the wall), and the gradient stencil of weno_Re_flux, about five cells wide, carries that into the fluid faces next to the wall. The face j+1/2 is read by the viscous flux from dqR(j) and dqL(j+1), so both are set.

Definition at line 3580 of file m_viscous.fpp.f90.

Here is the call graph for this function:

◆ s_compact_normal_viscous_gradient()

subroutine m_viscous::s_compact_normal_viscous_gradient ( type(scalar_field), intent(in) q,
integer, intent(in) id,
real(wp), dimension(-buff_size:), intent(in) cc,
type(scalar_field), intent(inout) dql,
type(scalar_field), intent(inout) dqr )

One velocity component of s_compact_normal_viscous_gradients; cc holds the cell centres along id.

Definition at line 3777 of file m_viscous.fpp.f90.

Here is the caller graph for this function:

◆ s_compact_normal_viscous_gradients()

subroutine, public m_viscous::s_compact_normal_viscous_gradients ( type(scalar_field), dimension(sys_size), intent(in) q_prim_vf,
integer, intent(in) id,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dql_x,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dqr_x,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dql_y,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dqr_y,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dql_z,
type(scalar_field), dimension(eqn_idx%mom%beg:eqn_idx%mom%end), intent(inout) dqr_z )

weno_Re_flux_compact: set the face-normal velocity gradient (direction id) on every face to the difference across the face. The WENO chain (face values, cell gradient, reconstructed gradient, face mean) has zero damping at the checkerboard wavenumber, which leaves a no-slip wall's odd-mirror forcing undamped. The face j+1/2 is read by the viscous flux from dqR(j) and dqL(j+1), so both are set. Tangential gradients are unchanged.

Definition at line 3761 of file m_viscous.fpp.f90.

Here is the call graph for this function:

◆ s_compute_axis_inv_re()

subroutine m_viscous::s_compute_axis_inv_re ( type(scalar_field), dimension(num_dims), intent(in) grad_x_vf,
type(scalar_field), dimension(num_dims), intent(in) grad_y_vf,
type(scalar_field), dimension(num_dims), intent(in) grad_z_vf,
real(wp), dimension(num_fluids), intent(in) alpha_visc,
integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) l,
real(wp), dimension(2), intent(out) re_visc )

Compute viscous stress tensor near cylindrical axis, avoiding 1/r singularity at y_cb(-1)=0 Inverse Reynolds numbers of the mixture at one cell. Non-Newtonian fluids need the local shear rate, which comes from the velocity gradients; Newtonian ones reduce to the volume-fraction-weighted harmonic mean.

Definition at line 511 of file m_viscous.fpp.f90.

Here is the caller graph for this function:

◆ s_compute_fd_gradient()

subroutine m_viscous::s_compute_fd_gradient ( type(scalar_field), intent(in) var,
type(scalar_field), intent(inout) grad_x,
type(scalar_field), intent(inout) grad_y,
type(scalar_field), intent(inout) grad_z )

Computes the scalar gradient fields via finite differences.

Definition at line 3018 of file m_viscous.fpp.f90.

Here is the caller graph for this function:

◆ s_compute_viscous_stress_cylindrical_boundary()

subroutine, public m_viscous::s_compute_viscous_stress_cylindrical_boundary ( type(scalar_field), dimension(sys_size), intent(in) q_prim_vf,
type(scalar_field), dimension(num_dims), intent(in) grad_x_vf,
type(scalar_field), dimension(num_dims), intent(in) grad_y_vf,
type(scalar_field), dimension(num_dims), intent(in) grad_z_vf,
type(scalar_field), dimension(1:sys_size), intent(inout) tau_re_vf,
type(int_bounds_info), intent(in) ix,
type(int_bounds_info), intent(in) iy,
type(int_bounds_info), intent(in) iz )

Definition at line 610 of file m_viscous.fpp.f90.

Here is the call graph for this function:

◆ s_finalize_viscous_module()

impure subroutine, public m_viscous::s_finalize_viscous_module

Finalize the viscous module.

Definition at line 3838 of file m_viscous.fpp.f90.

◆ s_get_viscous()

subroutine, public m_viscous::s_get_viscous ( real(wp), dimension(idwbuff(1)%beg:,idwbuff(2)%beg:,idwbuff(3)%beg:,1:), intent(inout) ql_prim_rsx_vf,
type(vector_field), dimension(1:num_dims), intent(inout) dql_prim_dx_n,
type(vector_field), dimension(1:num_dims), intent(inout) dql_prim_dy_n,
type(vector_field), dimension(1:num_dims), intent(inout) dql_prim_dz_n,
type(vector_field), dimension(num_dims), intent(inout) ql_prim,
real(wp), dimension(idwbuff(1)%beg:,idwbuff(2)%beg:,idwbuff(3)%beg:,1:), intent(inout) qr_prim_rsx_vf,
type(vector_field), dimension(1:num_dims), intent(inout) dqr_prim_dx_n,
type(vector_field), dimension(1:num_dims), intent(inout) dqr_prim_dy_n,
type(vector_field), dimension(1:num_dims), intent(inout) dqr_prim_dz_n,
type(vector_field), dimension(num_dims), intent(inout) qr_prim,
type(vector_field), intent(in) q_prim_qp,
type(vector_field), dimension(1), intent(inout) dq_prim_dx_qp,
type(vector_field), dimension(1), intent(inout) dq_prim_dy_qp,
type(vector_field), dimension(1), intent(inout) dq_prim_dz_qp,
type(int_bounds_info), intent(in) ix,
type(int_bounds_info), intent(in) iy,
type(int_bounds_info), intent(in) iz )

Computes viscous terms.

Definition at line 1141 of file m_viscous.fpp.f90.

Here is the call graph for this function:

◆ s_initialize_viscous_module()

impure subroutine, public m_viscous::s_initialize_viscous_module

Initialize the viscous module.

Definition at line 437 of file m_viscous.fpp.f90.

Here is the caller graph for this function:

◆ s_reconstruct_cell_boundary_values_visc()

subroutine m_viscous::s_reconstruct_cell_boundary_values_visc ( type(scalar_field), dimension(iv%beg:iv%end), intent(in) v_vf,
real(wp), dimension(idwbuff(1)%beg:,idwbuff(2)%beg:,idwbuff(3)%beg:,1:), intent(inout) vl_x,
real(wp), dimension(idwbuff(1)%beg:,idwbuff(2)%beg:,idwbuff(3)%beg:,1:), intent(inout) vr_x,
integer, intent(in) norm_dir,
type(scalar_field), dimension(iv%beg:iv%end), intent(inout) vl_prim_vf,
type(scalar_field), dimension(iv%beg:iv%end), intent(inout) vr_prim_vf,
type(int_bounds_info), intent(in) ix,
type(int_bounds_info), intent(in) iy,
type(int_bounds_info), intent(in) iz )

Reconstruct left and right cell-boundary values of viscous primitive variables.

Definition at line 2313 of file m_viscous.fpp.f90.

Here is the caller graph for this function:

◆ s_reconstruct_cell_boundary_values_visc_deriv()

subroutine, public m_viscous::s_reconstruct_cell_boundary_values_visc_deriv ( type(scalar_field), dimension(iv%beg:iv%end), intent(in) v_vf,
real(wp), dimension(idwbuff(1)%beg:,idwbuff(2)%beg:,idwbuff(3)%beg:,iv%beg:), intent(inout) vl_x,
real(wp), dimension(idwbuff(1)%beg:,idwbuff(2)%beg:,idwbuff(3)%beg:,iv%beg:), intent(inout) vr_x,
integer, intent(in) norm_dir,
type(scalar_field), dimension(iv%beg:iv%end), intent(inout) vl_prim_vf,
type(scalar_field), dimension(iv%beg:iv%end), intent(inout) vr_prim_vf,
type(int_bounds_info), intent(in) ix,
type(int_bounds_info), intent(in) iy,
type(int_bounds_info), intent(in) iz )

Reconstruct left and right cell-boundary values of viscous primitive variable derivatives.

Definition at line 2553 of file m_viscous.fpp.f90.

Variable Documentation

◆ ib_visc_band

integer, parameter m_viscous::ib_visc_band = 2

Faces within this many cells of an immersed-boundary cell take the compact velocity gradient.

Definition at line 432 of file m_viscous.fpp.f90.

◆ is1_viscous

type(int_bounds_info) m_viscous::is1_viscous

Definition at line 403 of file m_viscous.fpp.f90.

◆ is2_viscous

type(int_bounds_info) m_viscous::is2_viscous

Definition at line 403 of file m_viscous.fpp.f90.

◆ is3_viscous

type(int_bounds_info) m_viscous::is3_viscous

Definition at line 403 of file m_viscous.fpp.f90.

◆ iv

type(int_bounds_info) m_viscous::iv

Definition at line 402 of file m_viscous.fpp.f90.

◆ res_viscous

real(wp), dimension(:,:), allocatable m_viscous::res_viscous

Definition at line 417 of file m_viscous.fpp.f90.