SRFSimpleFoam, SRFPimpleFoam: Use absolute U for the production term in turbulence models

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1788
This commit is contained in:
Henry Weller
2015-07-19 19:05:06 +01:00
parent 5f865a4472
commit 7810d4327c
3 changed files with 29 additions and 29 deletions

View File

@ -45,13 +45,6 @@ scalar pRefValue = 0.0;
setRefCell(p, pimple.dict(), pRefCell, pRefValue); setRefCell(p, pimple.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name()); mesh.setFluxRequired(p.name());
singlePhaseTransportModel laminarTransport(Urel, phi);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(Urel, phi, laminarTransport)
);
Info<< "Creating SRF model\n" << endl; Info<< "Creating SRF model\n" << endl;
autoPtr<SRF::SRFModel> SRF autoPtr<SRF::SRFModel> SRF
( (
@ -71,3 +64,10 @@ volVectorField U
), ),
Urel + SRF->U() Urel + SRF->U()
); );
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);

View File

@ -65,26 +65,12 @@ int main(int argc, char *argv[])
#include "pEqn.H" #include "pEqn.H"
} }
U = Urel + SRF->U();
laminarTransport.correct(); laminarTransport.correct();
turbulence->correct(); turbulence->correct();
if (runTime.outputTime()) runTime.write();
{
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"

View File

@ -45,12 +45,26 @@ scalar pRefValue = 0.0;
setRefCell(p, simple.dict(), pRefCell, pRefValue); setRefCell(p, simple.dict(), pRefCell, pRefValue);
mesh.setFluxRequired(p.name()); mesh.setFluxRequired(p.name());
singlePhaseTransportModel laminarTransport(Urel, phi); Info<< "Creating SRF model\n" << endl;
autoPtr<SRF::SRFModel> SRF(SRF::SRFModel::New(Urel));
// Construct the absolute velocity
volVectorField U
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
Urel + SRF->U()
);
singlePhaseTransportModel laminarTransport(U, phi);
autoPtr<incompressible::RASModel> turbulence autoPtr<incompressible::RASModel> turbulence
( (
incompressible::RASModel::New(Urel, phi, laminarTransport) incompressible::RASModel::New(U, phi, laminarTransport)
); );
Info<< "Creating SRF model\n" << endl;
autoPtr<SRF::SRFModel> SRF(SRF::SRFModel::New(Urel));