Merge branch 'master' of github.com:OpenFOAM/OpenFOAM-2.3.x

This commit is contained in:
andy 2014-07-30 14:55:40 +01:00
commit 9cc6cd612a
16 changed files with 137 additions and 94 deletions

View file

@ -1,3 +1,5 @@
// Solve the Momentum equation
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)

View file

@ -9,8 +9,8 @@ HbyA = rAU*UEqn.H();
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*
(
fvc::interpolate(psi)
*(
(mesh.Sf() & fvc::interpolate(HbyA))
+ rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)
)
@ -30,8 +30,6 @@ while (pimple.correctNonOrthogonal())
fvOptions(psi, p, rho.name())
);
fvOptions.constrain(pEqn);
pEqn.solve();
if (pimple.finalNonOrthogonalIter())

View file

@ -1,13 +1,16 @@
EXE_INC = \
-I.. \
-I../../rhoPimpleFoam/rhoPimpleDyMFoam \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/cfdTools \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
EXE_LIBS = \
-lfluidThermophysicalModels \
@ -15,8 +18,11 @@ EXE_LIBS = \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lfiniteVolume \
-lmeshTools \
-lsampling \
-lfvOptions \
-lfiniteVolume \
-ldynamicMesh
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-ldynamicMesh \
-lmeshTools

View file

@ -11,17 +11,16 @@ surfaceScalarField phid
"phid",
fvc::interpolate(psi)
*(
(
(fvc::interpolate(HbyA) & mesh.Sf())
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
)
(mesh.Sf() & fvc::interpolate(HbyA))
+ rhorAUf*fvc::ddtCorr(rho, U, rhoUf)/fvc::interpolate(rho)
)
);
fvc::makeRelative(phid, psi, U);
fvOptions.makeRelative(fvc::interpolate(psi), phid);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
// Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
@ -32,13 +31,15 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
fvOptions(psi, p, rho.name())
);
fvOptions.constrain(pEqn);
pEqn.solve();
phi = pEqn.flux();
if (pimple.finalNonOrthogonalIter())
{
phi = pEqn.flux();
}
}
#include "rhoEqn.H"
#include "compressibleContinuityErrs.H"
U = HbyA - rAU*fvc::grad(p);

View file

@ -24,6 +24,9 @@ License
Application
sonicDyMFoam
Group
grpCompressibleSolvers grpMovingMeshSolvers
Description
Transient solver for trans-sonic/supersonic, laminar or turbulent flow
of a compressible gas with mesh motion..
@ -31,9 +34,9 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "psiThermo.H"
#include "turbulenceModel.H"
#include "motionSolver.H"
#include "pimpleControl.H"
#include "fvIOoptionList.H"
@ -43,30 +46,68 @@ int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "createRhoUf.H"
#include "createDynamicFvMesh.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
#include "readControls.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "createPcorrTypes.H"
#include "createRhoUf.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
autoPtr<motionSolver> motionPtr = motionSolver::New(mesh);
while (runTime.loop())
while (runTime.run())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readPISOControls.H"
#include "readControls.H"
#include "compressibleCourantNo.H"
mesh.movePoints(motionPtr->newPoints());
#include "setDeltaT.H"
{
// Store divrhoU from the previous time-step/mesh for the correctPhi
volScalarField divrhoU
(
"divrhoU",
fvc::div(fvc::absolute(phi, rho, U))
);
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
// Store momentum to set rhoUf for introduced faces.
volVectorField rhoU("rhoU", rho*U);
// Do any mesh changes
mesh.update();
if (mesh.changing() && correctPhi)
{
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & rhoUf;
#include "correctPhi.H"
// Make the fluxes relative to the mesh-motion
fvc::makeRelative(phi, rho, U);
}
}
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
#include "rhoEqn.H"
Info<< "rhoEqn max/min : " << max(rho).value()
<< " " << min(rho).value() << endl;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
@ -86,8 +127,6 @@ int main(int argc, char *argv[])
}
}
rho = thermo.rho();
runTime.write();
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"

View file

@ -24,6 +24,9 @@ License
Application
sonicFoam
Group
grpCompressibleSolvers
Description
Transient solver for trans-sonic/supersonic, laminar or turbulent flow
of a compressible gas.
@ -43,12 +46,13 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "createFields.H"
#include "createFvOptions.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;

View file

@ -1,6 +1,3 @@
{
solve(fvm::ddt(rho) + fvc::div(phi));
}
{
scalar sumLocalContErr =
(sum(mag(rho - rho0 - psi*(p - p0)))/sum(rho)).value();

View file

@ -40,13 +40,14 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
pimpleControl pimple(mesh);
#include "readThermodynamicProperties.H"
#include "readTransportProperties.H"
#include "createFields.H"
#include "initContinuityErrs.H"
pimpleControl pimple(mesh);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -108,6 +109,7 @@ int main(int argc, char *argv[])
phi += pEqn.flux();
solve(fvm::ddt(rho) + fvc::div(phi));
#include "compressibleContinuityErrs.H"
U -= rAU*fvc::grad(p);

View file

@ -83,7 +83,7 @@ Foam::turbulentDispersionModels::Gosman::F() const
);
return
- 0.75
0.75
*drag.CdRe()
*pair_.dispersed()
*pair_.continuous().nu()

View file

@ -74,7 +74,7 @@ Foam::turbulentDispersionModels::constantTurbulentDispersionCoefficient::
F() const
{
return
- Ctd_
Ctd_
*pair_.dispersed()
*pair_.continuous().rho()
*pair_.continuous().turbulence().k()

View file

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -21,32 +21,30 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
coupledFvPatch is an abstract base class for patches that couple regions
of the computational domain e.g. cyclic and processor-processor links.
\*---------------------------------------------------------------------------*/
#include "coupledFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(coupledFvPatch, 0);
defineTypeNameAndDebug(coupledFvPatch, 0);
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
coupledFvPatch::~coupledFvPatch()
Foam::coupledFvPatch::~coupledFvPatch()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::vectorField> Foam::coupledFvPatch::delta() const
{
return Cf() - Cn();
}
} // End namespace Foam
// ************************************************************************* //

View file

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,13 +39,12 @@ namespace Foam
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Make patch weighting factors
void Foam::cyclicFvPatch::makeWeights(scalarField& w) const
{
const cyclicFvPatch& nbrPatch = neighbFvPatch();
const scalarField deltas(nf() & fvPatch::delta());
const scalarField nbrDeltas(nbrPatch.nf() & nbrPatch.fvPatch::delta());
const scalarField deltas(nf()&coupledFvPatch::delta());
const scalarField nbrDeltas(nbrPatch.nf()&nbrPatch.coupledFvPatch::delta());
forAll(deltas, facei)
{
@ -57,11 +56,10 @@ void Foam::cyclicFvPatch::makeWeights(scalarField& w) const
}
// Return delta (P to N) vectors across coupled patch
Foam::tmp<Foam::vectorField> Foam::cyclicFvPatch::delta() const
{
const vectorField patchD(fvPatch::delta());
const vectorField nbrPatchD(neighbFvPatch().fvPatch::delta());
const vectorField patchD(coupledFvPatch::delta());
const vectorField nbrPatchD(neighbFvPatch().coupledFvPatch::delta());
tmp<vectorField> tpdv(new vectorField(patchD.size()));
vectorField& pdv = tpdv();

View file

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,6 +36,7 @@ namespace Foam
addToRunTimeSelectionTable(fvPatch, cyclicACMIFvPatch, polyPatch);
}
// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
void Foam::cyclicACMIFvPatch::updateAreas() const
@ -82,13 +83,13 @@ void Foam::cyclicACMIFvPatch::makeWeights(scalarField& w) const
const cyclicACMIFvPatch& nbrPatch = neighbFvPatch();
const fvPatch& nbrPatchNonOverlap = nonOverlapPatch();
const scalarField deltas(nf() & fvPatch::delta());
const scalarField deltas(nf() & coupledFvPatch::delta());
const scalarField nbrDeltas
(
interpolate
(
nbrPatch.nf() & nbrPatch.fvPatch::delta(),
nbrPatch.nf() & nbrPatch.coupledFvPatch::delta(),
nbrPatchNonOverlap.nf() & nbrPatchNonOverlap.delta()
)
);
@ -124,13 +125,13 @@ Foam::tmp<Foam::vectorField> Foam::cyclicACMIFvPatch::delta() const
const cyclicACMIFvPatch& nbrPatchCoupled = neighbFvPatch();
const fvPatch& nbrPatchNonOverlap = nonOverlapPatch();
const vectorField patchD(fvPatch::delta());
const vectorField patchD(coupledFvPatch::delta());
vectorField nbrPatchD
(
interpolate
(
nbrPatchCoupled.fvPatch::delta(),
nbrPatchCoupled.coupledFvPatch::delta(),
nbrPatchNonOverlap.delta()
)
);
@ -175,7 +176,7 @@ Foam::tmp<Foam::vectorField> Foam::cyclicACMIFvPatch::delta() const
}
else
{
return fvPatch::delta();
return coupledFvPatch::delta();
}
}

View file

@ -51,7 +51,7 @@ void Foam::cyclicAMIFvPatch::makeWeights(scalarField& w) const
{
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
const scalarField deltas(nf() & fvPatch::delta());
const scalarField deltas(nf() & coupledFvPatch::delta());
tmp<scalarField> tnbrDeltas;
if (applyLowWeightCorrection())
@ -59,13 +59,14 @@ void Foam::cyclicAMIFvPatch::makeWeights(scalarField& w) const
tnbrDeltas =
interpolate
(
nbrPatch.nf() & nbrPatch.fvPatch::delta(),
nbrPatch.nf() & nbrPatch.coupledFvPatch::delta(),
scalarField(this->size(), 1.0)
);
}
else
{
tnbrDeltas = interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta());
tnbrDeltas =
interpolate(nbrPatch.nf() & nbrPatch.coupledFvPatch::delta());
}
const scalarField& nbrDeltas = tnbrDeltas();
@ -92,7 +93,7 @@ Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
if (coupled())
{
const vectorField patchD(fvPatch::delta());
const vectorField patchD(coupledFvPatch::delta());
tmp<vectorField> tnbrPatchD;
if (applyLowWeightCorrection())
@ -100,13 +101,13 @@ Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
tnbrPatchD =
interpolate
(
nbrPatch.fvPatch::delta(),
nbrPatch.coupledFvPatch::delta(),
vectorField(this->size(), vector::zero)
);
}
else
{
tnbrPatchD = interpolate(nbrPatch.fvPatch::delta());
tnbrPatchD = interpolate(nbrPatch.coupledFvPatch::delta());
}
const vectorField& nbrPatchD = tnbrPatchD();
@ -140,7 +141,7 @@ Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
}
else
{
return fvPatch::delta();
return coupledFvPatch::delta();
}
}

View file

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,20 +27,18 @@ License
#include "addToRunTimeSelectionTable.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(processorFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, processorFvPatch, polyPatch);
defineTypeNameAndDebug(processorFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, processorFvPatch, polyPatch);
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void processorFvPatch::makeWeights(scalarField& w) const
void Foam::processorFvPatch::makeWeights(scalarField& w) const
{
if (Pstream::parRun())
{
@ -56,7 +54,8 @@ void processorFvPatch::makeWeights(scalarField& w) const
- procPolyPatch_.neighbFaceCellCentres())
);
w = neighbFaceCentresCn/((nf()&fvPatch::delta()) + neighbFaceCentresCn);
w = neighbFaceCentresCn
/((nf()&coupledFvPatch::delta()) + neighbFaceCentresCn);
}
else
{
@ -65,7 +64,7 @@ void processorFvPatch::makeWeights(scalarField& w) const
}
tmp<vectorField> processorFvPatch::delta() const
Foam::tmp<Foam::vectorField> Foam::processorFvPatch::delta() const
{
if (Pstream::parRun())
{
@ -73,7 +72,7 @@ tmp<vectorField> processorFvPatch::delta() const
if (parallel())
{
return
fvPatch::delta()
coupledFvPatch::delta()
- (
procPolyPatch_.neighbFaceCentres()
- procPolyPatch_.neighbFaceCellCentres()
@ -82,7 +81,7 @@ tmp<vectorField> processorFvPatch::delta() const
else
{
return
fvPatch::delta()
coupledFvPatch::delta()
- transform
(
forwardT(),
@ -95,12 +94,12 @@ tmp<vectorField> processorFvPatch::delta() const
}
else
{
return fvPatch::delta();
return coupledFvPatch::delta();
}
}
tmp<labelField> processorFvPatch::interfaceInternalField
Foam::tmp<Foam::labelField> Foam::processorFvPatch::interfaceInternalField
(
const labelUList& internalData
) const
@ -109,7 +108,7 @@ tmp<labelField> processorFvPatch::interfaceInternalField
}
void processorFvPatch::initInternalFieldTransfer
void Foam::processorFvPatch::initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList& iF
@ -119,7 +118,7 @@ void processorFvPatch::initInternalFieldTransfer
}
tmp<labelField> processorFvPatch::internalFieldTransfer
Foam::tmp<Foam::labelField> Foam::processorFvPatch::internalFieldTransfer
(
const Pstream::commsTypes commsType,
const labelUList&
@ -129,8 +128,4 @@ tmp<labelField> processorFvPatch::internalFieldTransfer
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,6 +40,7 @@ namespace Foam
addToRunTimeSelectionTable(fvPatch, fvPatch, polyPatch);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fvPatch::fvPatch(const polyPatch& p, const fvBoundaryMesh& bm)