CODI

solve additional COnvection-DIffusion-problems (CODI)

COnvection DIffusion Equation

Suppose there is a scalar item \(\Phi\) and there exists a MESHFREE-index for \(\Phi\), such as %ind_PHI%. MESHFREE offers the possibility to solve a general type of equation for %ind_PHI% at the end of every time step of the following form:
\begin{align} d \Phi/dt + \nabla^T({\bf v}_\text{Imp} \cdot \Phi) + {\bf v}^T \cdot \nabla \Phi + A \cdot \Phi = \rho \cdot \nabla^T (D \cdot \nabla \Phi) + Q\end{align}
In USER_common_variables, this can be defined by:
CODI_Integration($Material$,%ind_PHI%) = (TypeOfIntegration) CODI_Vimplicit($Material$,%ind_PHI%) = (vImp_x, vImp_y, vImp_z) CODI_V($Material$,%ind_PHI%) = (v_x, v_y, v_z) CODI_A($Material$,%ind_PHI%) = A CODI_rho($Material$,%ind_PHI%) = rho CODI_D($Material$,%ind_PHI%) = D CODI_Q($Material$,%ind_PHI%) = Q
Note:
  • The transport terms set by CODI_V and CODI_Vimplicit are modeled relative to the fluid velocity by default. I.e. in the LAGRANGE case, where the points are already moving with the fluid velocity, CODI_V and CODI_Vimplicit are solved numerically on the moving point cloud. In the EULER/EULERIMPL case, the points are not moved, but the motion is modeled via the numerical solution of the transport terms. Therefore, here the fluid velocity is added to the velocities in CODI_V and CODI_Vimplicit to have the same behavior as in the LAGRANGE case.
  • In the EULER/EULERIMPL case, there is still the option that only the velocities in CODI_V and CODI_Vimplicit are used. With the keyword %CODI_EULER_ONLY_UserDefinedVelocity% (see CODI_Integration), the fluid velocity can be ignored via the following command:
    CODI_Integration($Material$,%ind_PHI%) = (%CODI_implicit%, -1, 2, %CODI_EULER_ONLY_UserDefinedVelocity%)
  • If the user given velocity is divergence free (\( \nabla^T \mathbf{v} = 0\)), then CODI_V should be used. If the user given velocity is not divergence free, then CODI_Vimplicit should be used since \( \nabla^T({\bf v}_\text{Imp} \cdot \Phi) = {\bf v}_{\text{Imp}}^T \cdot \nabla \Phi + \Phi \, \nabla^T \mathbf{v}_{\text{Imp}}.\)

PDEs and ODEs

All statements are optional, e.g. when the following reduced set of CODI statements is given,
CODI_A($Material$,%ind_PHI%) = A CODI_Q($Material$,%ind_PHI%) = Q
then for each point the ordinary differential equation \( d\Phi/dt + A\cdot\Phi = Q\) will be solved. The other terms are neglected. Note: The ODE functionality provides the option to solve ordinary differential equations with respect to a given initial value and reference the result of the time integration in Equations by ode().

Boundary Conditions

In addition to the CODI statements, boundary conditions need to be defined for %ind_PHI% by BCON to complete the setup of the PDE. I.e. they are mandatory if CODI_V, CODI_Vimplicit, or CODI_D is defined for %ind_PHI%. In case of a reduced set of CODI statements that represents an ordinary differential equation, the defined boundary conditions will be ignored. Note: If no boundary conditions are provided, a lower order Neumann type boundary condition is assumed.

Restriction of Solution

In order to assure some minimum and maximum conditions, the solution \(\Phi\) can be restricted by:
CODI_min_max ($Material$,%ind_PHI%) = (min_PHI, max_PHI, OPTIONAL:AllowedSlopePHI )
MESHFREE simply cuts the solution of \(\Phi\) after solving the differential equation. If AllowedSlopePHI is given, then the solution is adapted such that \( \lVert \nabla \Phi \rVert_2 \le \text{AllowedSlopePHI}\) with \( \text{AllowedSlopePHI}>0\).

Restriction of execution of CODI items to certain time steps

CODI_executeNow($Material$,%ind_PHI%) = ( [some_functional] ) # if some_functional==0, the CODI item for # $Material$ and %ind_PHI% will not be executed.
see CODI_executeNow .

Function Value Assignment

Besides differential equations, one can also assign a value to \(\Phi\) by an algebraic equation, see CODI_eq .
CODI_eq($Material$,%ind_PHI%) = ( RightHandSideExpression, OPTIONAL:extendToInactivePoints , OPTIONAL:[trigger_evaluation] )

Special Handling for Linear Systems

See CODI_min_max_RejectLinearSolution for criteria to reject the solution of a sparse linear system.
List of members:
CODI_A See CODI
CODI_D See CODI
CODI_eq Strict function value assignment
CODI_executeNow trigger CODI execution for selected time steps only
CODI_Integration Time integration options for COnvection-DIffusion-problems (CODI)
CODI_min_max set lower and upper bound for any MESHFREE variable
CODI_min_max_RejectLinearSolution rejection of the solution of a sparse linear system if minimum-maximum criteria are not fulfilled
CODI_Q See CODI
CODI_rho See CODI
CODI_V See CODI
CODI_Vimplicit See CODI