Franko |
February 19, 2015 17:07 |
Old and new values of a field
Hi, I have a problem with using old value of a field.
I have A and B - dimensionless volScalarFields
I also have
Code:
dimensionedScalar c ("c", dimensionSet(0, 0, 1, 0, 0, 0 ,0), 1.0);
In the beginning, I know and ,
I want to solve two equations below in OpenFOAM (n - number of time layer):
1) ;
2)
(I want to find from the first equation and then from the second one)
I used this code with Euler scheme:
Code:
A = 2*B;
fvScalarMatrix BEqn
(
c*fvm::ddt(A,B) + fvm::Sp(1,B)
);
BEqn.solve();
The problem here with row This row let me find but it also deleted old values because OpenFOAM took the second equation as
And I got the wrong decision!
What code will solve equation and won't delete old values?
Thank you very much for any help ...
|