Code_Saturne
CFD tool
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions/Subroutines
codits.f90 File Reference

This function solves an advection diffusion equation with source terms for one time step for the variable $ a $. More...

Functions/Subroutines

subroutine codits
 

Detailed Description

This function solves an advection diffusion equation with source terms for one time step for the variable $ a $.

The equation reads:

\[ f_s^{imp}(a^{n+1}-a^n) + \divs \left( a^{n+1} \rho \vect {u} - \mu \grad a^{n+1} \right) = Rhs \]

This equation is rewritten as:

\[ f_s^{imp} \delta a + \divs \left( \delta a \rho \vect{u} - \mu \grad \delta a \right) = Rhs^1 \]

where $ \delta a = a^{n+1} - a^n$ and $ Rhs^1 = Rhs - \divs( a^n \rho \vect{u} - \mu \grad a^n)$

It is in fact solved with the following iterative process:

\[ f_s^{imp} \delta a^k + \divs \left(\delta a^k \rho \vect{u}-\mu\grad\delta a^k \right) = Rhs^k \]

where $Rhs^k=Rhs-f_s^{imp}(a^k-a^n) - \divs \left( a^k\rho\vect{u}-\mu\grad a^k \right)$

Be careful, it is forbidden to modify $ f_s^{imp} $ here!

Function/Subroutine Documentation

subroutine codits ( )
Parameters
[in]nvartotal number of variables
[in]nscaltotal number of scalars
[in]idtvarindicateur du schema temporel
[in]ivarindex of the current variable
[in]iconvpindicator
  • 1 convection,
  • 0 sinon
[in]idiffpindicator
  • 1 diffusion,
  • 0 sinon
[in]ireslpindicator
  • 0 conjugate gradient
  • 1 jacobi
  • 2 bi-cgstab
[in]ndircpindicator (0 if the diagonal is stepped aside)
[in]nitmapmaximum number of iteration to solve the iterative process
[in]imrgraindicator
  • 0 iterative gradient
  • 1 least square gradient
[in]nswrspnumber of reconstruction sweeps for the Right Hand Side
[in]nswrgpnumber of reconstruction sweeps for the gradients
[in]imligpclipping gradient method
  • < 0 no clipping
  • = 0 thank to neighbooring gradients
  • = 1 thank to the mean gradient
[in]ircflpindicator
  • 1 flux reconstruction,
  • 0 otherwise
[in]ischcpindicator
  • 1 centred
  • 0 2nd order
[in]isstppindicator
  • 1 without slope test
  • 0 with slope test
[in]iescapcompute the predictor indicator if 1
[in]imucppindicator
  • 0 do not multiply the convectiv term by Cp
  • 1 do multiply the convectiv term by Cp
[in]imgrpindicator
  • 0 no multi-grid
  • 1 otherwise
[in]ippindex of the variable for post-processing
[in]iwarnpverbosity
[in]blencpfraction of upwinding
[in]epsilpprecision pour resol iter
[in]epsrgprelative precision for the gradient reconstruction
[in]climgpclipping coeffecient for the computation of the gradient
[in]extrapcoefficient for extrapolation of the gradient
[in]relaxpcoefficient of relaxation
[in]thetapweightening coefficient for the theta-schema,
  • thetap = 0: explicit scheme
  • thetap = 0.5: time-centred scheme (mix between Crank-Nicolson and Adams-Bashforth)
  • thetap = 1: implicit scheme
[in]pvaravariable at the previous time step $ a^n $
[in]pvarkvariable at the previous sub-iteration $ a^k $. If you sub-iter on Navier-Stokes, then it allows to initialize by something else than pvara (usually pvar=pvara)
[in]coefapboundary condition array for the variable (Explicit part)
[in]coefbpboundary condition array for the variable (Impplicit part)
[in]cofafpboundary condition array for the diffusion of the variable (Explicit part)
[in]cofbfpboundary condition array for the diffusion of the variable (Implicit part)
[in]flumasmass flux at interior faces
[in]flumabmass flux at boundary faces
[in]viscfm$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the matrix
[in]viscbm$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $ at border faces for the matrix
[in]viscfs$ \mu_\fij \dfrac{S_\fij}{\ipf \jpf} $ at interior faces for the r.h.s.
[in]viscbs$ \mu_\fib \dfrac{S_\fib}{\ipf \centf} $ at border faces for the r.h.s.
[in]rovsdt$ f_s^{imp} $
[in]smbrpRight hand side $ Rhs^k $
[in,out]pvarcurrent variable
[in,out]dpvarlast variable increment
[in]xcpparray of specific heat (Cp)
[out]esworkprediction-stage error estimator (if iescap > 0)

Here is the call graph for this function: