diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/createFields.H b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/createFields.H index 3e4e11ae3..864b1dd93 100644 --- a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/createFields.H +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/createFields.H @@ -56,3 +56,19 @@ ( SRF::SRFModel::New(Urel) ); + + // Create Uabs as a permanent field to make it available for on-the-fly + // post-processing operations + volVectorField Uabs + ( + IOobject + ( + "Uabs", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + Urel + SRF->U() + ); + diff --git a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C index 99b8e1f2c..4e8768b30 100644 --- a/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C +++ b/tutorials/incompressible/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C @@ -112,24 +112,10 @@ int main(int argc, char *argv[]) turbulence->correct(); + // Recalculate Uabs + Uabs = Urel + SRF->U(); - if (runTime.outputTime()) - { - volVectorField Uabs - ( - IOobject - ( - "Uabs", - runTime.timeName(), - mesh, - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - Urel + SRF->U() - ); - - runTime.write(); - } + runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"