|
[Sponsors] |
February 19, 2015, 18:07 |
Old and new values of a field
|
#1 |
New Member
Join Date: Sep 2014
Posts: 15
Rep Power: 12 |
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); 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(); Code:
A = 2*B And I got the wrong decision! What code will solve equation and won't delete old values? Thank you very much for any help ... |
|
February 24, 2015, 07:42 |
simple equation
|
#2 |
New Member
Join Date: Sep 2014
Posts: 15
Rep Power: 12 |
||
February 27, 2015, 05:06 |
|
#3 |
Senior Member
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13 |
Are you going to use always that kind of temporal discretization? If the answer is yes, you can access runTime delta T:
Code:
dimensionedScalar mydeltaT1("mydeltaT",dimensionSet(0, 0, 1, 0, 0, 0, 0),scalar(runTime.deltaTValue())); |
|
|
|