DyM solvers: correct Uf using phi after construction

This commit is contained in:
Henry
2013-12-11 17:26:34 +00:00
parent 1c9fbf6997
commit a8c917fd4b
13 changed files with 24 additions and 25 deletions

View File

@ -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())

View File

@ -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())

View File

@ -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());
} }

View File

@ -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

View File

@ -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())

View File

@ -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));
} }
} }

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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