# Old and new values of a field

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 19, 2015, 18:07 Old and new values of a field #1 New Member   Join Date: Sep 2014 Posts: 15 Rep Power: 5 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 Code: A = 2*B 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 ...

 February 24, 2015, 07:42 simple equation #2 New Member   Join Date: Sep 2014 Posts: 15 Rep Power: 5 So, what will be the best way to solve the equations without any derivatives in OpenFOAM? For example look at the equation (A and B - volScalarFields). Do you use this code to solve it: Code: A=2*B; ?? Is that correct code? Please help!

 February 27, 2015, 05:06 #3 Senior Member   anonymous Join Date: Aug 2014 Posts: 204 Rep Power: 6 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())); And then solve manually the set of equations.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

All times are GMT -4. The time now is 21:16.