mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
DyM solvers: correct Uf using phi after construction
This commit is contained in:
@ -91,10 +91,7 @@ K = 0.5*magSqr(U);
|
|||||||
{
|
{
|
||||||
rhoUf = fvc::interpolate(rho*U);
|
rhoUf = fvc::interpolate(rho*U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
rhoUf +=
|
rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
|
||||||
mesh.Sf()
|
|
||||||
*(fvc::absolute(phi, rho, U) - (mesh.Sf() & rhoUf))
|
|
||||||
/sqr(mesh.magSf());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -107,10 +107,7 @@ K = 0.5*magSqr(U);
|
|||||||
{
|
{
|
||||||
rhoUf = fvc::interpolate(rho*U);
|
rhoUf = fvc::interpolate(rho*U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
rhoUf +=
|
rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
|
||||||
mesh.Sf()
|
|
||||||
*(fvc::absolute(phi, rho, U) - (mesh.Sf() & rhoUf))
|
|
||||||
/sqr(mesh.magSf());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -42,8 +42,5 @@ U.correctBoundaryConditions();
|
|||||||
{
|
{
|
||||||
rhoUf = fvc::interpolate(rho*U);
|
rhoUf = fvc::interpolate(rho*U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
rhoUf +=
|
rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
|
||||||
mesh.Sf()
|
|
||||||
*(fvc::absolute(phi, rho, U) - (mesh.Sf() & rhoUf))
|
|
||||||
/sqr(mesh.magSf());
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ fvOptions.correct(U);
|
|||||||
{
|
{
|
||||||
Uf = fvc::interpolate(U);
|
Uf = fvc::interpolate(U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf());
|
Uf += n*(phi/mesh.magSf() - (n & Uf));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
|
|||||||
@ -93,10 +93,7 @@ K = 0.5*magSqr(U);
|
|||||||
{
|
{
|
||||||
rhoUf = fvc::interpolate(rho*U);
|
rhoUf = fvc::interpolate(rho*U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
rhoUf +=
|
rhoUf += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf));
|
||||||
mesh.Sf()
|
|
||||||
*(fvc::absolute(phi, rho, U) - (mesh.Sf() & rhoUf))
|
|
||||||
/sqr(mesh.magSf());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -85,6 +85,6 @@
|
|||||||
{
|
{
|
||||||
Uf = fvc::interpolate(U);
|
Uf = fvc::interpolate(U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
Uf += mesh.Sf()*(phiv - (mesh.Sf() & Uf))/sqr(mesh.magSf());
|
Uf += n*(phiv/mesh.magSf() - (n & Uf));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@
|
|||||||
{
|
{
|
||||||
Uf = fvc::interpolate(U);
|
Uf = fvc::interpolate(U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf());
|
Uf += n*(phi/mesh.magSf() - (n & Uf));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
|
|||||||
@ -55,10 +55,10 @@ int main(int argc, char *argv[])
|
|||||||
pimpleControl pimple(mesh);
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createUf.H"
|
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "createPrghCorrTypes.H"
|
#include "createPrghCorrTypes.H"
|
||||||
#include "correctPhi.H"
|
#include "correctPhi.H"
|
||||||
|
#include "createUf.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
{
|
{
|
||||||
Uf = fvc::interpolate(U);
|
Uf = fvc::interpolate(U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf());
|
Uf += n*(phi/mesh.magSf() - (n & Uf));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
|
|||||||
@ -65,10 +65,10 @@ int main(int argc, char *argv[])
|
|||||||
pimpleControl pimple(mesh);
|
pimpleControl pimple(mesh);
|
||||||
|
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createUf.H"
|
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "createPcorrTypes.H"
|
#include "createPcorrTypes.H"
|
||||||
#include "../interFoam/interDyMFoam/correctPhi.H"
|
#include "../interFoam/interDyMFoam/correctPhi.H"
|
||||||
|
#include "createUf.H"
|
||||||
#include "CourantNo.H"
|
#include "CourantNo.H"
|
||||||
#include "setInitialDeltaT.H"
|
#include "setInitialDeltaT.H"
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
{
|
{
|
||||||
Uf = fvc::interpolate(U);
|
Uf = fvc::interpolate(U);
|
||||||
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
Uf += mesh.Sf()*(phi - (mesh.Sf() & Uf))/sqr(mesh.magSf());
|
Uf += n*(phi/mesh.magSf() - (n & Uf));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make the fluxes relative to the mesh motion
|
// Make the fluxes relative to the mesh motion
|
||||||
|
|||||||
@ -46,9 +46,14 @@ surfaceVectorField rhoUf
|
|||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
linearInterpolate(rho*U)
|
fvc::interpolate(rho*U)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
|
rhoUf += n*(phi/mesh.magSf() - (n & rhoUf));
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -46,9 +46,15 @@ surfaceVectorField Uf
|
|||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
linearInterpolate(U)
|
fvc::interpolate(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
{
|
||||||
|
surfaceVectorField n(mesh.Sf()/mesh.magSf());
|
||||||
|
Uf += n*(phi/mesh.magSf() - (n & Uf));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user