From e98214b0ada18616662c40450a5273845db27da0 Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 27 Jun 2017 15:47:53 -0700 Subject: [PATCH 1/6] BUG: Updating rho at the end of the pEq for rhoPimpleDyMFoam and limiting is needed --- .../rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index ed802ba6d2..d1dcc87b41 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -1,4 +1,11 @@ -rho = thermo.rho(); +if (!pimple.SIMPLErho()) +{ + 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()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); @@ -92,9 +99,11 @@ K = 0.5*magSqr(U); if (pressureControl.limit(p)) { p.correctBoundaryConditions(); - rho = thermo.rho(); } +thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ; +rho = thermo.rho(); + { rhoUf = fvc::interpolate(rho*U); surfaceVectorField n(mesh.Sf()/mesh.magSf()); From c5c48205febecc882408ba050d0940d2824fd8c6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 28 Jun 2017 12:46:01 +0100 Subject: [PATCH 2/6] BUG: pitzDaily: remove DebugSwitches --- .../incompressible/simpleFoam/pitzDaily/system/controlDict | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict b/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict index 1335867e72..59da172c16 100644 --- a/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict +++ b/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict @@ -15,11 +15,6 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -DebugSwitches -{ - SolverPerformance 2; -} - application simpleFoam; startFrom startTime; From a2d8e6e4f5f6a66f1585d9f4a7ce6e34209edb19 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 28 Jun 2017 16:11:24 +0200 Subject: [PATCH 3/6] STYLE: remove old references to 'dx' and 'foamFile' --- etc/controlDict | 1 - .../combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/etc/controlDict b/etc/controlDict index a2302326dc..72112b0ddc 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -498,7 +498,6 @@ DebugSwitches flowRateInletVelocity 0; fluxCorrectedVelocity 0; foamChemistryReader 0; - foamFile 0; forceCoeffs 0; forces 0; fourth 0; diff --git a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict index b5fb7d735a..9ad795924b 100644 --- a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict +++ b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/sampleDict @@ -26,8 +26,7 @@ setFormat raw; // Surface output format. Choice of // null : suppress output -// foamFile : separate points, faces and values file -// dx : DX scalar or vector format +// foam : separate points, faces and values file // vtk : VTK ascii format // raw : x y z value format for use with e.g. gnuplot 'splot'. // From cec7eb951846c10816328b51825f3b62422ac87a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 28 Jun 2017 17:41:15 +0200 Subject: [PATCH 4/6] ENH: add basic arch information to the output (issue #361) - end user can easily see which arch (endian, label/scalar size) was used from the log output, or via -help usage --- src/OpenFOAM/global/argList/argList.C | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 72215bc0a0..5219b7a20b 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -37,6 +37,7 @@ License #include "sigInt.H" #include "sigQuit.H" #include "sigSegv.H" +#include "endian.H" #include @@ -53,6 +54,22 @@ Foam::string::size_type Foam::argList::usageMin = 20; Foam::string::size_type Foam::argList::usageMax = 80; 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() { argList::addOption @@ -622,6 +639,7 @@ void Foam::argList::parse { IOobject::writeBanner(Info, true) << "Build : " << Foam::FOAMbuild << nl + << "Arch : " << archHint << nl << "Exec : " << argListStr_.c_str() << nl << "Date : " << dateString.c_str() << nl << "Time : " << timeString.c_str() << nl @@ -1228,7 +1246,8 @@ void Foam::argList::printUsage() const Info<< nl <<"Using: OpenFOAM-" << Foam::FOAMversion << " (see www.OpenFOAM.com)" << nl - <<"Build: " << Foam::FOAMbuild << nl + << "Build: " << Foam::FOAMbuild << nl + << "Arch: " << archHint << nl << endl; } From 29d613dae440a4d5e30293c9d6545c8de09060e1 Mon Sep 17 00:00:00 2001 From: sergio Date: Wed, 28 Jun 2017 12:11:24 -0700 Subject: [PATCH 5/6] BUG: Changing V0 not to be registered in order to avoid mapping. But writing it down by fvMesh.writeObject(). --- src/finiteVolume/fvMesh/fvMesh.C | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 6ce30fd57f..a904f8092b 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -199,7 +199,7 @@ void Foam::fvMesh::storeOldVol(const scalarField& V) *this, IOobject::NO_READ, IOobject::NO_WRITE, - true + false ), *this, dimVolume @@ -281,8 +281,8 @@ Foam::fvMesh::fvMesh(const IOobject& io) time().timeName(), *this, IOobject::MUST_READ, - IOobject::AUTO_WRITE, - true + IOobject::NO_WRITE, + false ), *this ); @@ -869,6 +869,11 @@ bool Foam::fvMesh::writeObject // solver smooth restart using second order time schemes. //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); } From 00a5b61bd2d451f0cdeef31cec3e5f557717c5dd Mon Sep 17 00:00:00 2001 From: sergio Date: Wed, 28 Jun 2017 14:36:25 -0700 Subject: [PATCH 6/6] ENH: making pcEqn.H similar to pEqn.H. STY: Fixing syntax in rhoPimpleDyMFoam/pEqn.H --- .../solvers/compressible/rhoPimpleFoam/pcEqn.H | 14 +++----------- .../rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H | 2 +- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H index 55be311749..867fb9f641 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pcEqn.H @@ -109,19 +109,11 @@ K = 0.5*magSqr(U); if (pressureControl.limit(p)) { p.correctBoundaryConditions(); - thermo.correctRho(psi*p - psip0, rhoMin, rhoMax); - 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); } +thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ; +rho = thermo.rho(); + if (thermo.dpdt()) { dpdt = fvc::ddt(p); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index d1dcc87b41..df14de0e76 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -101,7 +101,7 @@ if (pressureControl.limit(p)) p.correctBoundaryConditions(); } -thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ; +thermo.correctRho(psi*p - psip0, rhoMin, rhoMax); rho = thermo.rho(); {