# openFoam - How to create an intermediate scalar variable and output it?

For learning purposes, how do I create an scalar variable like temperature divided by 2 and outputs it on files generated?

• 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. Aug 31, 2018 at 21:10

Supposing that your variable is totally dependent of T, so you don't need to read it on "0" file.

Info<< "Creating T2\n" << endl;
volScalarField T2
(
IOobject
(
"T2",
runTime.timeName(),
mesh,

T2=T/2;