auto reconstructPar
It is very troublesome to do reconstructPar after calculation of interFoam, pimpleFoam or other unsteady solvers.
So I created a codeStream script executing reconstructPar at each writeTime.
If you have some trouble of reconstructPar, please try this.
Just add follow to controlDict.
And put autoReconstructParProperties in constant.
So I created a codeStream script executing reconstructPar at each writeTime.
If you have some trouble of reconstructPar, please try this.
Just add follow to controlDict.
Code:
functions ( autoReconstructPar { functionObjectLibs ("libutilityFunctionObjects.so"); type coded; redirectType autoReconstructPar; outputControl outputTime; codeOptions #{ #}; code #{ IOdictionary autoReconstructParProperties ( IOobject ( "autoReconstructParProperties", mesh().time().constant(), mesh(), IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); bool autoReconstructPar =autoReconstructParProperties.lookupOrDefault<Switch>("autoReconstructPar", false); bool backGroundExecution =autoReconstructParProperties.lookupOrDefault<Switch>("backGroundExecution", true); string reconstructParFields=autoReconstructParProperties.lookup("reconstructParFields"); if (Pstream::parRun()) { if (autoReconstructPar) { if (Pstream::master()) { if (backGroundExecution) { Info<< "Execute reconstructPar on background." <<endl; system("reconstructPar -time " + mesh().time().timeName() +" -fields \'" + reconstructParFields +"\'>.rec.log&"); } else { system("reconstructPar -time " + mesh().time().timeName() +" -fields \'" + reconstructParFields +"\'"); } } } } #}; } );
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object autoReconstructParProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // autoReconstructPar true; backGroundExecution true; reconstructParFields "(p alpha1 U)";
Total Comments 0