Add to matrix the viscous stress term of Navier equation. More...
Functions/Subroutines | |
subroutine | mod_set_mu_velocity_gradient::set_mu_velocity_gradient (mu_velocity_gradient, viscosity, viscosity_edge) |
Compute stress coefficients from the viscosity array. | |
subroutine | mod_discretize_div_tensor_term::discretize_div_tensor_term (matrix, viscosity, density_face, divergence, time_step_n, time_step, cfl_navier_diffusion, velocity_nm1, velocity_n, explicit_div_tensor_term_n, navier_stencil, navier_ls_map, viscosity_edge) |
Add viscous stress term into Navier equation. | |
The following routines adds the viscous stress term into the Navier-Stokes equation, using a central scheme.
The viscous stress term is:
\begin{equation*} \nabla \cdot \mathbf{S} (\mathbf{u}) = \nabla \cdot \Big( \mu \big( \nabla\mathbf{u} + ^\mathsf{t}\!\nabla\mathbf{u} \big) \Big) - \frac{2}{3} \nabla \big( \mu \nabla \cdot \mathbf{u} \big) \end{equation*}
where \(\mathbf{u}\) is the velocity vector, \(\mu\) is the dynamic viscosity, and \(\mathbf{S}\) is the viscous stress tensor. Once discretized and vectorized, this term becomes a matrix product of some matrix \(\mathtt{D}\) and the velocity column-matrix \(\mathtt{U}\) where \(\mathtt{D}\) depends on the viscosity \(\mu\). For implicit formulation, the matrix \(-\mathtt{D}\) is added to the Navier linear system, whereas for explicit formulation, the product \(\mathtt{DU}\) is done.
To add the matrix \(-\mathtt{D}\) into some linear system, just do:
subroutine mod_discretize_div_tensor_term::discretize_div_tensor_term | ( | double precision, dimension(:), intent(inout) | matrix, |
double precision, dimension(:,:,:), intent(in) | viscosity, | ||
type(t_face_field), intent(in) | density_face, | ||
double precision, dimension(:,:,:), intent(in) | divergence, | ||
double precision, intent(in) | time_step_n, | ||
double precision, intent(in) | time_step, | ||
double precision, intent(inout) | cfl_navier_diffusion, | ||
type(t_face_field), intent(in) | velocity_nm1, | ||
type(t_face_field), intent(in) | velocity_n, | ||
type(t_face_field), intent(inout) | explicit_div_tensor_term_n, | ||
type(t_face_stencil), intent(in) | navier_stencil, | ||
type(t_face_ls_map), intent(in) | navier_ls_map, | ||
type(t_edge_field), intent(in), optional | viscosity_edge ) |
This routine calls the set_mu_velocity_gradient
routine to compute the stress coefficients from the viscosity
argument and calls the add_face_div_symmetric_tensor_term_centered_o2
routine to build the matrix \(-\mathtt{D}\) and add it into the argument a
or build the RHS.
subroutine mod_set_mu_velocity_gradient::set_mu_velocity_gradient | ( | type(t_face_vector_gradient), intent(inout) | mu_velocity_gradient, |
double precision, dimension(nx,ny,nz), intent(in) | viscosity, | ||
type(t_edge_field), intent(in), optional | viscosity_edge ) |
The viscosity is interpolated by routines interpolate_viscosity_xy,
…_xz,
…_yz.
Discretization is done on one cell behind physical boundaries for diagonal terms of the tensor