CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   nonlinear equation with non-constant (nonlinear) and direction dependent diffusion (http://www.cfd-online.com/Forums/openfoam-solving/112419-nonlinear-equation-non-constant-nonlinear-direction-dependent-diffusion.html)

ziemowitzima January 28, 2013 12:50

nonlinear equation with non-constant (nonlinear) and direction dependent diffusion
 
Dear Foamers,

I am trying to solve/implement nonlinear equation with non-constant (nonlinear) and direction dependent diffusion.
It looks like that:

Equation is solved for y in rectangular (u,z) domain:
\frac{\partial y}{\partial t} + \frac{\partial  \psi}{\partial z}  =  \frac{\partial^2 y}{\partial z^2} +  \left[ \frac{1+(\frac{\partial  y}{\partial z})^2}{(\frac{\partial y}{\partial  u})^2}\right]  \frac{\partial^2 y}{\partial u^2}
 - 2 \left[ \frac{\frac{\partial y}{\partial z}}{\frac{\partial  y}{\partial u}}\right] \frac{\partial^2 y}{\partial z \partial u}

I decided to solve it as follows:

fvScalarMatrix yEqn
(
fvm::ddt(y)
- U.component(1)
- fvm::laplacian(nu + (A/C)*nu2, y)
+ D/C
);

where:
nu and nu2 are defined to act in z and u directions respectively
nu = (1 0 0 0 0 0 0 0 0) and nu2 = (0 0 0 0 1 0 0 0 0 0),
and
A = 1+\left(\frac{\partial y}{\partial z}\right)^2
C = \left(\frac{\partial y}{\partial  u}\right)^2
and
D = 2 \left[ \frac{\partial y}{\partial z}\frac{\partial  y}{\partial u}\right] \frac{\partial^2 y}{\partial z \partial u}
and
v = -\frac{\partial  \psi}{\partial z}, (vertical velocity)
where A, C and D are solved explicitly.
But solver had a problem with it, because C were getting too large.

So I decided to multiply above equation by C and get:

fvScalarMatrix yEqn
(
C*fvm::ddt(y)
- C*U.component(1)
- fvm::laplacian(C*nu + A*nu2, y)
+ D
);

Here I got solution, somehow similar to the one it should converge, but not exactly.
Problem seems to be in "C*fvm::ddt(y)" term, because it gives me the same answer if I have just "fvm::ddt(y)" ...

Any idea, what can be here wrong, or how to make it better ?

Thanks
ZMM


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