For learning purposes, how do I create an scalar variable like temperature divided by 2 and outputs it on files generated?
Asked
Active
Viewed 2,103 times
-2
-
This is a question specific to OpenFOAM -- which you should ask on the OpenFOAM-specific mailing lists and forums because that's where the people who know this software hang out. – Wolfgang Bangerth Aug 31 '18 at 21:10
1 Answers
0
Supposing that your variable is totally dependent of T, so you don't need to read it on "0" file.
On createFields.h add:
Info<< "Creating T2\n" << endl;
volScalarField T2
(
IOobject
(
"T2",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,dimensionedScalar("T2", dimensionSet(0,0,0,1,0,0,0),0.0 )
);
0.0 inside dimensioned scalar just initializes the variable.
Then you should add the equation to your runTimeLoop:
T2=T/2;
Vitor Abella
- 173
- 1
- 9