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/)
-   -   How should I implement this scalar transport equation (https://www.cfd-online.com/Forums/openfoam-programming-development/133387-how-should-i-implement-scalar-transport-equation.html)

sharonyue April 14, 2014 09:38

How should I implement this scalar transport equation
 
Hi guys,

I wanna solve this equation:
\frac{{\partial j}}{{\partial t}} + \nabla  \cdot \left( {jU} \right) = {C_1} \cdot f\left( \varepsilon  \right) \cdot j - {C_2} \cdot \varphi \left( \varepsilon  \right) \cdot {j^{\frac{{11}}{9}}}

I code it like this:
Code:

    fvScalarMatrix nEqn
    (
            fvm::ddt(j) 
      +  fvm::div(phi1,j)
          ==
          C1*j* epsilon
          -fvm::Sp(C2*pow(j, 2.0/9.0)* epsilon, j)
    );

But it's result is wired. Thanks in advance.

bieshuxuhe April 14, 2014 21:32

hello!

maybe you could give more information , for example:
C1>0 or C1<0, epsilon?

sharonyue April 14, 2014 21:37

Quote:

Originally Posted by bieshuxuhe (Post 486143)
hello!

maybe you could give more information , for example:
C1>0 or C1<0, epsilon?

C1, C2, epsilon is all positive~ can I deal with this with some sophisticated approach?

bieshuxuhe April 14, 2014 22:53

I suppose that :
1 "j+jSmall" is "j"
2 there is no limit of the value of "j"

then , modify the source term " -C2*pow((j+jSmall),11.0/9.0)* epsilon " to :
Code:

- 11.0/9.0*C2*fvm::Sp(epsilon,j)
+ 2.0/9.0*C2*epsilon*pow(j,11.0/9.0)

maybe this will be fine!
of cource maybe there is some other reason for wired result, not only the discretization of source term.


All times are GMT -4. The time now is 15:44.