Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

This commit is contained in:
Andrew Heather
2017-06-29 14:18:41 +01:00
7 changed files with 43 additions and 25 deletions

View File

@ -109,18 +109,10 @@ K = 0.5*magSqr(U);
if (pressureControl.limit(p)) if (pressureControl.limit(p))
{ {
p.correctBoundaryConditions(); p.correctBoundaryConditions();
}
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ; thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
rho = thermo.rho(); rho = thermo.rho();
}
else if (pimple.SIMPLErho())
{
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
rho = thermo.rho();
}
else
{
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
}
if (thermo.dpdt()) if (thermo.dpdt())
{ {

View File

@ -1,4 +1,11 @@
if (!pimple.SIMPLErho())
{
rho = thermo.rho(); rho = thermo.rho();
}
// Thermodynamic density needs to be updated by psi*d(p) after the
// pressure solution
const volScalarField psip0(psi*p);
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
@ -92,9 +99,11 @@ K = 0.5*magSqr(U);
if (pressureControl.limit(p)) if (pressureControl.limit(p))
{ {
p.correctBoundaryConditions(); p.correctBoundaryConditions();
rho = thermo.rho();
} }
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
rho = thermo.rho();
{ {
rhoUf = fvc::interpolate(rho*U); rhoUf = fvc::interpolate(rho*U);
surfaceVectorField n(mesh.Sf()/mesh.magSf()); surfaceVectorField n(mesh.Sf()/mesh.magSf());

View File

@ -498,7 +498,6 @@ DebugSwitches
flowRateInletVelocity 0; flowRateInletVelocity 0;
fluxCorrectedVelocity 0; fluxCorrectedVelocity 0;
foamChemistryReader 0; foamChemistryReader 0;
foamFile 0;
forceCoeffs 0; forceCoeffs 0;
forces 0; forces 0;
fourth 0; fourth 0;

View File

@ -37,6 +37,7 @@ License
#include "sigInt.H" #include "sigInt.H"
#include "sigQuit.H" #include "sigQuit.H"
#include "sigSegv.H" #include "sigSegv.H"
#include "endian.H"
#include <cctype> #include <cctype>
@ -53,6 +54,22 @@ Foam::string::size_type Foam::argList::usageMin = 20;
Foam::string::size_type Foam::argList::usageMax = 80; Foam::string::size_type Foam::argList::usageMax = 80;
Foam::word Foam::argList::postProcessOptionName("postProcess"); Foam::word Foam::argList::postProcessOptionName("postProcess");
// file-scope
// Hint about machine endian, OpenFOAM label and scalar sizes
static const std::string archHint =
(
#ifdef WM_LITTLE_ENDIAN
"LSB"
#elif defined (WM_BIG_ENDIAN)
"MSB"
#else
"???"
#endif
";label=" + std::to_string(8*sizeof(Foam::label))
+ ";scalar=" + std::to_string(8*sizeof(Foam::scalar))
);
Foam::argList::initValidTables::initValidTables() Foam::argList::initValidTables::initValidTables()
{ {
argList::addOption argList::addOption
@ -622,6 +639,7 @@ void Foam::argList::parse
{ {
IOobject::writeBanner(Info, true) IOobject::writeBanner(Info, true)
<< "Build : " << Foam::FOAMbuild << nl << "Build : " << Foam::FOAMbuild << nl
<< "Arch : " << archHint << nl
<< "Exec : " << argListStr_.c_str() << nl << "Exec : " << argListStr_.c_str() << nl
<< "Date : " << dateString.c_str() << nl << "Date : " << dateString.c_str() << nl
<< "Time : " << timeString.c_str() << nl << "Time : " << timeString.c_str() << nl
@ -1229,6 +1247,7 @@ void Foam::argList::printUsage() const
<<"Using: OpenFOAM-" << Foam::FOAMversion <<"Using: OpenFOAM-" << Foam::FOAMversion
<< " (see www.OpenFOAM.com)" << nl << " (see www.OpenFOAM.com)" << nl
<< "Build: " << Foam::FOAMbuild << nl << "Build: " << Foam::FOAMbuild << nl
<< "Arch: " << archHint << nl
<< endl; << endl;
} }

View File

@ -199,7 +199,7 @@ void Foam::fvMesh::storeOldVol(const scalarField& V)
*this, *this,
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
true false
), ),
*this, *this,
dimVolume dimVolume
@ -281,8 +281,8 @@ Foam::fvMesh::fvMesh(const IOobject& io)
time().timeName(), time().timeName(),
*this, *this,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::AUTO_WRITE, IOobject::NO_WRITE,
true false
), ),
*this *this
); );
@ -869,6 +869,11 @@ bool Foam::fvMesh::writeObject
// solver smooth restart using second order time schemes. // solver smooth restart using second order time schemes.
//ok = phiPtr_->oldTime().write(); //ok = phiPtr_->oldTime().write();
} }
if (V0Ptr_ && V0Ptr_->writeOpt() == IOobject::AUTO_WRITE)
{
// For second order restarts we need to write V0
ok = V0Ptr_->write();
}
return ok && polyMesh::writeObject(fmt, ver, cmp); return ok && polyMesh::writeObject(fmt, ver, cmp);
} }

View File

@ -26,8 +26,7 @@ setFormat raw;
// Surface output format. Choice of // Surface output format. Choice of
// null : suppress output // null : suppress output
// foamFile : separate points, faces and values file // foam : separate points, faces and values file
// dx : DX scalar or vector format
// vtk : VTK ascii format // vtk : VTK ascii format
// raw : x y z value format for use with e.g. gnuplot 'splot'. // raw : x y z value format for use with e.g. gnuplot 'splot'.
// //

View File

@ -15,11 +15,6 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
DebugSwitches
{
SolverPerformance 2;
}
application simpleFoam; application simpleFoam;
startFrom startTime; startFrom startTime;