version 0.6.0

Namespaces

module  mod_gradient_operator_cell_to_cell
 Gradient operator from cells to cells.
 
module  mod_hessian_operator_cell_to_cell
 Hessian operator from cells to cells.
 
module  mod_laplacian_operator_cell_to_cell
 Laplacian operator from cells to cells.
 
module  mod_gradient_operator_cell_to_face
 Gradient operator from cells to faces.
 
module  mod_gradient_operator_cell_to_face_vector
 Gradient operator from cells to each face (full gradient on each face)
 

Functions

subroutine mod_compute_curl_operator_face_to_cell::compute_curl_operator_face_to_cell (field, curl)
 Curl field using second-order centered differences. More...
 
subroutine mod_divergence_operator_cell_to_cell::divergence_operator_cell_to_cell (field, divergence)
 Divergence field using second-order centered differences. More...
 
subroutine mod_divergence_operator_face_to_cell::divergence_operator_face_to_cell (field, divergence)
 Divergence field using second-order centered differences. More...
 
subroutine mod_gradient_operator_scalar_face_to_cell::gradient_operator_scalar_face_to_cell (face_scalar, gradient)
 Gradient vector on cells using second-order centered differences of a scalar field defined on faces. More...
 
subroutine mod_compute_stress_tensor::compute_stress_tensor (stress_tensor, velocity, viscosity)
 Compute stress tensor of the Navier-Stokes equation. More...
 
subroutine mod_compute_stress_tensor_divergence::compute_stress_tensor_divergence (stress_tensor, stress_tensor_divergence)
 Compute the divergence of the stress tensor of the Navier-Stokes equations. More...
 

Detailed Description

This directory provides routines that applies differential operators to a field \( \phi \). They operate on fields defined on cell nodes or face nodes, and return a field defined on cell or faces nodes, but not necessarily the same.

Implemented differential operators are:

where \( \phi \) is a scalar field and \( \mathbf{\Phi} \) is a vector field.

Function Documentation

◆ compute_curl_operator_face_to_cell()

subroutine mod_compute_curl_operator_face_to_cell::compute_curl_operator_face_to_cell ( type(t_face_field), intent(in)  field,
double precision, dimension(nx,ny,nz,spatial_dimension)  curl 
)

Curl field using second-order centered differences.

The curl of \( \mathbf{\Phi} = (\phi, \chi, \psi)\) is the vector

\begin{align} \nabla \times \mathbf{\Phi} &= \left( \frac{\partial \psi}{\partial y} - \frac{\partial \chi}{\partial z} , \frac{\partial \psi}{\partial z} - \frac{\partial \psi}{\partial x} , \frac{\partial \chi}{\partial x} - \frac{\partial \phi}{\partial y} \right) \,. \end{align}

This routine operates from face nodes to cell nodes. Gradients are computed by central difference on the middle of the edges, and then interpolated on the cell center:

\begin{align} (\nabla \times \mathbf{\Phi})_{0,0,0} &= ( R_{0,0,0},\ S_{0,0,0},\ T_{0,0,0} ) \\ T_{0,0,0} &= \Big( \frac{\partial \chi}{\partial x} \Big)_{0,0,0} - \Big( \frac{\partial \phi}{\partial y} \Big)_{0,0,0} \\ &= \frac12 \left( \Big( \frac{\partial \chi}{\partial x} \Big)_{+\frac12,0,0} + \Big( \frac{\partial \chi}{\partial x} \Big)_{-\frac12,0,0} \right) - \frac12 \left( \Big( \frac{\partial \psi}{\partial y} \Big)_{0,+\frac12,0} + \Big( \frac{\partial \psi}{\partial y} \Big)_{0,-\frac12,0} \right) \\ &= \frac14 \left( \frac{\chi_{+1,+\frac12,0} - \chi_{0,+\frac12,0}}{\delta x_{+\frac12}} \frac{\chi_{0,+\frac12,0} - \chi_{-1,+\frac12,0}}{\delta x_{-\frac12}} + \frac{\chi_{+1,-\frac12,0} - \chi_{0,-\frac12,0}}{\delta x_{+\frac12}} \frac{\chi_{0,-\frac12,0} - \chi_{-1,-\frac12,0}}{\delta x_{-\frac12}} \right) \\ &- \frac14 \left( \frac{\psi_{+\frac12,+1,0} - \psi_{+\frac12,0,0}}{\delta y_{+\frac12}} \frac{\psi_{+\frac12,0,0} - \psi_{+\frac12,-1,0}}{\delta y_{-\frac12}} + \frac{\psi_{-\frac12,+1,0} - \psi_{-\frac12,0,0}}{\delta y_{+\frac12}} \frac{\psi_{-\frac12,0,0} - \psi_{-\frac12,-1,0}}{\delta y_{-\frac12}} \right) \end{align}

And likewise for the other components.

The cell-centered vector field is a rank-4 array, whose last dimension corresponds to the vector component.

◆ compute_stress_tensor()

subroutine mod_compute_stress_tensor::compute_stress_tensor ( type(stress_tensor_type), intent(inout)  stress_tensor,
type(t_face_field), intent(in)  velocity,
double precision, dimension(nx,ny,nz), intent(in)  viscosity 
)

The viscosity is interpolated by routines interpolate_viscosity_xy, …_xz, …_yz.

Grid localisaton of the different terms of the tensor depends on the type of node on which derivative is computed at second order (cell, face, edge)

Todo:
extrapolation on ghost boundary cells

◆ compute_stress_tensor_divergence()

subroutine mod_compute_stress_tensor_divergence::compute_stress_tensor_divergence ( type(stress_tensor_type), intent(in)  stress_tensor,
type(t_face_field), intent(inout)  stress_tensor_divergence 
)

Grid localisaton of the different terms of the tensor depends on the type of node on which derivative is computed at second order (cell, face, edge)

Divergence is compute on the faces.

Todo:
extrapolation on ghost boundary cells

◆ divergence_operator_cell_to_cell()

subroutine mod_divergence_operator_cell_to_cell::divergence_operator_cell_to_cell ( double precision, dimension(:,:,:,:), intent(in)  field,
double precision, dimension(:,:,:), intent(inout)  divergence 
)

Divergence field using second-order centered differences.

The divergence of \( \mathbf{\Phi} = (\phi, \chi, \psi)\) is the scalar

\begin{align} \nabla \cdot \mathbf{\Phi} &= \frac{\partial \psi}{\partial x} + \frac{\partial \psi}{\partial y} + \frac{\partial \chi}{\partial z} \,. \end{align}

This routine operates from face nodes to cell nodes:

\begin{align} (\nabla \cdot \mathbf{\Phi})_{0,0,0} &= \frac{ \phi_{+\frac12,0,0} - \phi_{-\frac12,0,0} }{\delta x_0} + \frac{ \chi_{0,+\frac12,0} - \chi_{0,-\frac12,0} }{\delta y_0} + \frac{ \psi_{0,0,+\frac12} - \psi_{0,0,-\frac12} }{\delta z_0} \,. \end{align}

◆ divergence_operator_face_to_cell()

subroutine mod_divergence_operator_face_to_cell::divergence_operator_face_to_cell ( type(t_face_field), intent(in)  field,
double precision, dimension(nx,ny,nz), intent(inout)  divergence 
)

Divergence field using second-order centered differences.

The divergence of \( \mathbf{\Phi} = (\phi, \chi, \psi)\) is the scalar

\begin{align} \nabla \cdot \mathbf{\Phi} &= \frac{\partial \psi}{\partial x} + \frac{\partial \psi}{\partial y} + \frac{\partial \chi}{\partial z} \,. \end{align}

This routine operates from face nodes to cell nodes:

\begin{align} (\nabla \cdot \mathbf{\Phi})_{0,0,0} &= \frac{ \phi_{+\frac12,0,0} - \phi_{-\frac12,0,0} }{\delta x_0} + \frac{ \chi_{0,+\frac12,0} - \chi_{0,-\frac12,0} }{\delta y_0} + \frac{ \psi_{0,0,+\frac12} - \psi_{0,0,-\frac12} }{\delta z_0} \,. \end{align}

◆ gradient_operator_scalar_face_to_cell()

subroutine mod_gradient_operator_scalar_face_to_cell::gradient_operator_scalar_face_to_cell ( type(t_face_field), intent(in)  face_scalar,
double precision, dimension(nx,ny,nz,spatial_dimension), intent(inout)  gradient 
)

Gradient vector using second-order centered differences of a scalar field defined on faces.