CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Verification & Validation (http://www.cfd-online.com/Forums/openfoam-verification-validation/)
-   -   Hyperbolic equasion solver or How OF works (http://www.cfd-online.com/Forums/openfoam-verification-validation/125755-hyperbolic-equasion-solver-how-works.html)

j-avdeev October 30, 2013 09:07

Hyperbolic equasion solver or How OF works?
 
5 Attachment(s)
Hello,
I have working hyperbolic equasion solver (hyper1Foam in attachment - works in OF 2.1.0).

Main equation:
\frac{\partial\psi }{\partial t}+C{\frac{\partial \psi}{\partial x}}=0
accordingly
Code:

        solve
        (
            fvm::ddt(psi)
            +
            fvm::div(phi,psi)
        );

and in fvShemes

Code:

ddtSchemes
{
    ddt(psi) Euler;
}
divSchemes
{
    div(phi,psi) Gauss linear;
}

Working geometry - coube 1x1x1 diveded on 5 equal parts along oZ axe.

Main equation in discretized form:

[LaTeX Error: Syntax error]
C_i=\frac{V\phi_i}{\Delta t}
where
\psi_i - old ~value ~of ~phi ~in ~cell ~i
\psi^n_i - new ~value

In my case
V = const = 1/5 = 0.2 ~~ volume ~of ~single ~cell
\Delta t = 0.1 ~time ~step

And when I insert result of phi from one of time directories...

for ~\phi_i = 0,434805
\frac{0.2 *0,749653 - 0.2*0,434805}{0.1 } + (0,2/0,1)*0,434805*{\frac{0,206803 - 1}{0.2}} =
=-2,81916421585

Not zero!
I khow that hyperbolic equation will not =0, because it is iterational method. Is it residual?

I want to understand - how OpenFOAM count values of phi from one iteration to another - how to get new phi from old values:
phi_new = ... ... ...

And what initial values of phi?

Results: Table of results on GoogleDocs

j-avdeev October 30, 2013 09:12

second file of equatins


All times are GMT -4. The time now is 12:17.