Uabs (for postprocessing) only constructed when needed.

This commit is contained in:
mattijs
2008-05-09 17:01:21 +01:00
parent 8f40fc3df1
commit 4467097cbd
2 changed files with 17 additions and 18 deletions

View File

@ -26,22 +26,6 @@
mesh mesh
); );
// Create absolute velocity field (post-processing only)
// Will be updated before first use, so can be initialised by Urel
Info<< "Creating field Uabs\n" << endl;
volVectorField Uabs
(
IOobject
(
"Uabs",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Urel
);
Info<< "Reading/calculating face flux field phi\n" << endl; Info<< "Reading/calculating face flux field phi\n" << endl;
surfaceScalarField phi surfaceScalarField phi
( (

View File

@ -112,9 +112,24 @@ int main(int argc, char *argv[])
turbulence->correct(); turbulence->correct();
Uabs = Urel + SRF->U();
runTime.write(); if (runTime.outputTime())
{
volVectorField Uabs
(
IOobject
(
"Uabs",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Urel + SRF->U()
);
runTime.write();
}
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s"