CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   CrankNicolson time discretisation (https://www.cfd-online.com/Forums/openfoam-programming-development/157593-cranknicolson-time-discretisation.html)

GerhardHolzinger August 3, 2015 04:43

CrankNicolson time discretisation
 
I am trying to warp my head around the time integration basics of OpenFOAM.

The semi-discretised governing equations end up in such a form:

ddt(x) + S * x = b

Thus, when dealing with time, we need to discretize the time derivative (1st term on LHS) and make a choice which time level to assign to the second term on the LHS.

The discretisation of the time derivative is controlled by the setting ddtSchemes in fvSchemes. In the programmers manual the formulas for Euler and backward differencing are given. However, we could also choose CrankNicolson, for which no formula is given.

Here is my problem, whenever I google CrankNicolson I find explanations dealing with the second term of the LHS. In nearly all explanations of the Crank-Nicolson method the time derivative is discretized with an implicit Euler scheme.

However, in OpenFOAM the ddt-schemes are used to discretize the time derivatives, and I am unable to find the formula that is used.

wwzhao May 3, 2017 23:31

Hi, Gerhard

Did you find the answer?

I've also confused with the CrankNicolson schemes in OpenFOAM, as it only operates on time derivatives.

When using CrankNicolson, how is the diffusion term and advection term discretized by a blending form of forward Euler and backward Euler? Did I miss something?


Best,
Weiwen

piu58 May 4, 2017 00:21

There exist a decent wiki page about the Crank-Nicolson method.

calf.Z November 15, 2019 08:27

When I use CrankNicolson 0.9, the courant number will blow up. When I change CrankNicolson 0.9 to backward, it becomes normal. How should I use CrankNicolson properly to eliminate instability?


All times are GMT -4. The time now is 22:06.