diff --git a/TODO b/TODO new file mode 100644 index 0000000000..aab3581489 --- /dev/null +++ b/TODO @@ -0,0 +1,23 @@ +- check + new fvMesh + new fvMeshSubset +for consistency with createMesh.H + + + +- Check the following: + +doc/changes/inotify.txt + + + + + + + + + + + + + diff --git a/applications/solvers/DNS/dnsFoam/readTransportProperties.H b/applications/solvers/DNS/dnsFoam/readTransportProperties.H index 77af096bf8..0d80908542 100644 --- a/applications/solvers/DNS/dnsFoam/readTransportProperties.H +++ b/applications/solvers/DNS/dnsFoam/readTransportProperties.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H index 20fd654cef..ba1d5dcd80 100644 --- a/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H +++ b/applications/solvers/DNS/dnsFoam/readTurbulenceProperties.H @@ -7,7 +7,7 @@ "turbulenceProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/basic/laplacianFoam/createFields.H b/applications/solvers/basic/laplacianFoam/createFields.H index 3359f2896c..616afe1a88 100644 --- a/applications/solvers/basic/laplacianFoam/createFields.H +++ b/applications/solvers/basic/laplacianFoam/createFields.H @@ -23,7 +23,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/basic/scalarTransportFoam/createFields.H b/applications/solvers/basic/scalarTransportFoam/createFields.H index 54a0bc45ec..07731be3d6 100644 --- a/applications/solvers/basic/scalarTransportFoam/createFields.H +++ b/applications/solvers/basic/scalarTransportFoam/createFields.H @@ -39,7 +39,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C index 39c2158dda..7cc76e0f8d 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C @@ -50,10 +50,11 @@ PDRkEpsilon::PDRkEpsilon const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermophysicalModel + const basicThermo& thermophysicalModel, + const word& turbulenceModelName ) : - RASModel(typeName, rho, U, phi, thermophysicalModel), + RASModel(typeName, rho, U, phi, thermophysicalModel, turbulenceModelName), Cmu_ ( diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H index 483c7257dc..c5e641012c 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H @@ -112,7 +112,8 @@ public: const volScalarField& rho, const volVectorField& U, const surfaceScalarField& phi, - const basicThermo& thermophysicalModel + const basicThermo& thermophysicalModel, + const word& turbulenceModelName = turbulenceModel::typeName ); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C index 385b9e53f0..32b525859e 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C @@ -62,7 +62,7 @@ Foam::XiEqModels::SCOPEXiEq::SCOPEXiEq "combustionProperties", Su.mesh().time().constant(), Su.mesh(), - IOobject::MUST_READ + IOobject::MUST_READ_IF_MODIFIED ) ), thermo diff --git a/applications/solvers/combustion/PDRFoam/createFields.H b/applications/solvers/combustion/PDRFoam/createFields.H index 74a18ab6f5..233383ab1c 100644 --- a/applications/solvers/combustion/PDRFoam/createFields.H +++ b/applications/solvers/combustion/PDRFoam/createFields.H @@ -110,7 +110,7 @@ "PDRProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/combustion/PDRFoam/readCombustionProperties.H b/applications/solvers/combustion/PDRFoam/readCombustionProperties.H index 9f4435b251..acc5cb7868 100644 --- a/applications/solvers/combustion/PDRFoam/readCombustionProperties.H +++ b/applications/solvers/combustion/PDRFoam/readCombustionProperties.H @@ -7,7 +7,7 @@ "combustionProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/combustion/XiFoam/readCombustionProperties.H b/applications/solvers/combustion/XiFoam/readCombustionProperties.H index da0a3a94a2..58b0626fb4 100644 --- a/applications/solvers/combustion/XiFoam/readCombustionProperties.H +++ b/applications/solvers/combustion/XiFoam/readCombustionProperties.H @@ -7,7 +7,7 @@ "combustionProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H b/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H index 687d83ea94..84cf9b9756 100644 --- a/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H +++ b/applications/solvers/combustion/dieselEngineFoam/readCombustionProperties.H @@ -7,7 +7,7 @@ IOdictionary combustionProperties "combustionProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 95bda05606..9a6274bb1a 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -65,7 +65,7 @@ IOdictionary combustionProperties "combustionProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/combustion/reactingFoam/readChemistryProperties.H b/applications/solvers/combustion/reactingFoam/readChemistryProperties.H index ab51afe283..f0bcf7597f 100644 --- a/applications/solvers/combustion/reactingFoam/readChemistryProperties.H +++ b/applications/solvers/combustion/reactingFoam/readChemistryProperties.H @@ -7,7 +7,7 @@ IOdictionary chemistryProperties "chemistryProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H b/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H index ab51afe283..f0bcf7597f 100644 --- a/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H +++ b/applications/solvers/combustion/rhoReactingFoam/readChemistryProperties.H @@ -7,7 +7,7 @@ IOdictionary chemistryProperties "chemistryProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index a6d98559a7..24ce0fe938 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -29,14 +29,9 @@ License #include "volFields.H" #include "mathematicalConstants.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField +Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -52,7 +47,8 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField valueFraction() = 0.0; } -smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField + +Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField ( const smoluchowskiJumpTFvPatchScalarField& ptf, const fvPatch& p, @@ -67,7 +63,7 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField {} -smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField +Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -118,7 +114,7 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField } -smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField +Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField ( const smoluchowskiJumpTFvPatchScalarField& ptpsf, const DimensionedField& iF @@ -134,7 +130,7 @@ smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // Map from self -void smoluchowskiJumpTFvPatchScalarField::autoMap +void Foam::smoluchowskiJumpTFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) @@ -144,7 +140,7 @@ void smoluchowskiJumpTFvPatchScalarField::autoMap // Reverse-map the given fvPatchField onto this fvPatchField -void smoluchowskiJumpTFvPatchScalarField::rmap +void Foam::smoluchowskiJumpTFvPatchScalarField::rmap ( const fvPatchField& ptf, const labelList& addr @@ -155,7 +151,7 @@ void smoluchowskiJumpTFvPatchScalarField::rmap // Update the coefficients associated with the patch field -void smoluchowskiJumpTFvPatchScalarField::updateCoeffs() +void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -174,11 +170,16 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs() // Prandtl number reading consistent with rhoCentralFoam const dictionary& thermophysicalProperties = db().lookupObject("thermophysicalProperties"); - dimensionedScalar Pr = dimensionedScalar("Pr", dimless, 1.0); - if (thermophysicalProperties.found("Pr")) - { - Pr = thermophysicalProperties.lookup("Pr"); - } + + dimensionedScalar Pr + ( + dimensionedScalar::lookupOrDefault + ( + "Pr", + thermophysicalProperties, + 1.0 + ) + ); Field C2 = pmu/prho *sqrt(ppsi*constant::mathematical::piByTwo) @@ -197,7 +198,7 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs() // Write -void smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const +void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); os.writeKeyword("accommodationCoeff") @@ -211,10 +212,12 @@ void smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +namespace Foam +{ + makePatchTypeField(fvPatchScalarField, smoluchowskiJumpTFvPatchScalarField); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +} -} // End namespace Foam // ************************************************************************* // diff --git a/applications/solvers/compressible/rhoCentralFoam/readFluxScheme.H b/applications/solvers/compressible/rhoCentralFoam/readFluxScheme.H index 9f54c43ef3..13f8f02c9c 100644 --- a/applications/solvers/compressible/rhoCentralFoam/readFluxScheme.H +++ b/applications/solvers/compressible/rhoCentralFoam/readFluxScheme.H @@ -1,7 +1,6 @@ word fluxScheme("Kurganov"); -if (mesh.schemesDict().found("fluxScheme")) +if (mesh.schemesDict().readIfPresent("fluxScheme", fluxScheme)) { - fluxScheme = word(mesh.schemesDict().lookup("fluxScheme")); if ((fluxScheme == "Tadmor") || (fluxScheme == "Kurganov")) { Info<< "fluxScheme: " << fluxScheme << endl; diff --git a/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H b/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H index 435bcb7745..f9e309ffec 100644 --- a/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H +++ b/applications/solvers/compressible/rhoCentralFoam/readThermophysicalProperties.H @@ -9,14 +9,18 @@ IOdictionary thermophysicalProperties "thermophysicalProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); -dimensionedScalar Pr = dimensionedScalar("Pr", dimless, 1.0); +dimensionedScalar Pr +( + dimensionedScalar::lookupOrDefault + ( + "Pr", + thermophysicalProperties, + 1.0 + ) +); -if (thermophysicalProperties.found("Pr")) -{ - Pr = thermophysicalProperties.lookup("Pr"); -} diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H index 5285e6e3b2..efad823a91 100644 --- a/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H +++ b/applications/solvers/compressible/rhoPorousSimpleFoam/createFields.H @@ -70,22 +70,13 @@ dimensionedScalar initialMass = fvc::domainIntegrate(rho); thermalPorousZones pZones(mesh); - Switch pressureImplicitPorosity(false); + // nUCorrectors used for pressureImplicitPorosity int nUCorr = 0; - if (pZones.size()) - { - // nUCorrectors for pressureImplicitPorosity - if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors")) - { - nUCorr = readInt - ( - mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors") - ); - } + const bool pressureImplicitPorosity = + ( + pZones.size() + && mesh.solutionDict().subDict("SIMPLE").readIfPresent("nUCorrectors", nUCorr) + && (nUCorr > 0) + ); - if (nUCorr > 0) - { - pressureImplicitPorosity = true; - } - } diff --git a/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H b/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H index 1fc57fc5fd..4e19adaae4 100644 --- a/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H +++ b/applications/solvers/compressible/rhoSonicFoam/readThermodynamicProperties.H @@ -7,7 +7,7 @@ "thermodynamicProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H b/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H index 3b8c82c8e5..2064187a2f 100644 --- a/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H +++ b/applications/solvers/compressible/rhopSonicFoam/readThermodynamicProperties.H @@ -7,7 +7,7 @@ "thermodynamicProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); @@ -26,8 +26,13 @@ dimensionedScalar gamma = Cp/Cv; - dimensionedScalar Pr = dimensionedScalar("Pr", dimless, 1.0); - if (thermodynamicProperties.found("Pr")) - { - Pr = thermodynamicProperties.lookup("Pr"); - } + dimensionedScalar Pr + ( + dimensionedScalar::lookupOrDefault + ( + "Pr", + thermodynamicProperties, + 1.0 + ) + ); + diff --git a/applications/solvers/compressible/sonicDyMFoam/readThermodynamicProperties.H b/applications/solvers/compressible/sonicDyMFoam/readThermodynamicProperties.H index 1fc57fc5fd..4e19adaae4 100644 --- a/applications/solvers/compressible/sonicDyMFoam/readThermodynamicProperties.H +++ b/applications/solvers/compressible/sonicDyMFoam/readThermodynamicProperties.H @@ -7,7 +7,7 @@ "thermodynamicProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H b/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H index 1502e2033a..c30f65b445 100644 --- a/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H +++ b/applications/solvers/compressible/sonicDyMFoam/readTransportProperties.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H b/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H index d8dad7d800..82f3655f46 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H +++ b/applications/solvers/compressible/sonicLiquidFoam/readThermodynamicProperties.H @@ -7,7 +7,7 @@ "thermodynamicProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H b/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H index 1502e2033a..c30f65b445 100644 --- a/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H +++ b/applications/solvers/compressible/sonicLiquidFoam/readTransportProperties.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H index b94745d9df..3f43981907 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H @@ -7,7 +7,7 @@ IOdictionary mdEquilibrationDict "mdEquilibrationDict", runTime.system(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/electromagnetics/electrostaticFoam/createFields.H b/applications/solvers/electromagnetics/electrostaticFoam/createFields.H index 64522273b8..04c86c4edb 100644 --- a/applications/solvers/electromagnetics/electrostaticFoam/createFields.H +++ b/applications/solvers/electromagnetics/electrostaticFoam/createFields.H @@ -7,7 +7,7 @@ "physicalProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/electromagnetics/magneticFoam/createFields.H b/applications/solvers/electromagnetics/magneticFoam/createFields.H index a3712c19aa..22d4008921 100644 --- a/applications/solvers/electromagnetics/magneticFoam/createFields.H +++ b/applications/solvers/electromagnetics/magneticFoam/createFields.H @@ -21,7 +21,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/electromagnetics/mhdFoam/createFields.H b/applications/solvers/electromagnetics/mhdFoam/createFields.H index 04e05c032d..fb5a004932 100644 --- a/applications/solvers/electromagnetics/mhdFoam/createFields.H +++ b/applications/solvers/electromagnetics/mhdFoam/createFields.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H b/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H index 4363850cdf..5ddbdab95e 100644 --- a/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H +++ b/applications/solvers/electromagnetics/mhdFoam/readBPISOControls.H @@ -1,3 +1,4 @@ -const dictionary& Bpiso = mesh.solutionDict().subDict("BPISO"); + const dictionary& Bpiso = mesh.solutionDict().subDict("BPISO"); + + const int nBcorr = Bpiso.lookupOrDefault("nCorrectors", 1); -int nBcorr(readInt(Bpiso.lookup("nCorrectors"))); diff --git a/applications/solvers/financial/financialFoam/createFields.H b/applications/solvers/financial/financialFoam/createFields.H index 6cdbbe2bde..dc0da4d2a3 100644 --- a/applications/solvers/financial/financialFoam/createFields.H +++ b/applications/solvers/financial/financialFoam/createFields.H @@ -7,7 +7,7 @@ "financialProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options index 4cd6539edf..e7a1103a4f 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -6,10 +6,12 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel EXE_LIBS = \ -lbasicThermophysicalModels \ + -lbasicSolidThermo \ -lspecie \ -lcompressibleRASModels \ -lcompressibleLESModels \ diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C index 738319ec10..922b94a8d6 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -37,6 +37,7 @@ Description #include "regionProperties.H" #include "compressibleCourantNo.H" #include "solidRegionDiffNo.H" +#include "basicSolidThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options index a97ce0aae4..1664808079 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options @@ -7,6 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude @@ -14,5 +15,6 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ -lbasicThermophysicalModels \ + -lbasicSolidThermo \ -lspecie \ -lcompressibleRASModels diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C index 927bd8124d..be93fd01df 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C @@ -35,6 +35,7 @@ Description #include "fixedGradientFvPatchFields.H" #include "regionProperties.H" #include "compressibleCourantNo.H" +#include "basicSolidThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H index 3054562d5d..f8a11b7159 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H @@ -1,25 +1,11 @@ - dictionary simple = fluidRegions[i].solutionDict().subDict("SIMPLE"); + const dictionary& simple = fluidRegions[i].solutionDict().subDict("SIMPLE"); - int nNonOrthCorr = 0; - if (simple.found("nNonOrthogonalCorrectors")) - { - nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors")); - } + const int nNonOrthCorr = + simple.lookupOrDefault("nNonOrthogonalCorrectors", 0); - bool momentumPredictor = true; - if (simple.found("momentumPredictor")) - { - momentumPredictor = Switch(simple.lookup("momentumPredictor")); - } + const bool momentumPredictor = + simple.lookupOrDefault("momentumPredictor", true); - bool fluxGradp = false; - if (simple.found("fluxGradp")) - { - fluxGradp = Switch(simple.lookup("fluxGradp")); - } + const bool transonic = + simple.lookupOrDefault("transonic", false); - bool transonic = false; - if (simple.found("transonic")) - { - transonic = Switch(simple.lookup("transonic")); - } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidFields.H index 8f109a3f82..be13e670c3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidFields.H @@ -1,8 +1,5 @@ // Initialise solid field pointer lists - PtrList rhos(solidRegions.size()); - PtrList cps(solidRegions.size()); - PtrList Ks(solidRegions.size()); - PtrList Ts(solidRegions.size()); + PtrList thermos(solidRegions.size()); // Populate solid field pointer lists forAll(solidRegions, i) @@ -10,75 +7,10 @@ Info<< "*** Reading solid mesh thermophysical properties for region " << solidRegions[i].name() << nl << endl; - Info<< " Adding to rhos\n" << endl; - rhos.set + Info<< " Adding to thermos\n" << endl; + thermos.set ( i, - new volScalarField - ( - IOobject - ( - "rho", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) - ); - - Info<< " Adding to cps\n" << endl; - cps.set - ( - i, - new volScalarField - ( - IOobject - ( - "cp", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) - ); - - Info<< " Adding to Ks\n" << endl; - Ks.set - ( - i, - new volScalarField - ( - IOobject - ( - "K", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) - ); - - Info<< " Adding to Ts\n" << endl; - Ts.set - ( - i, - new volScalarField - ( - IOobject - ( - "T", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) + basicSolidThermo::New(solidRegions[i]) ); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H index 22e9b177f1..e1d58d9f65 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H @@ -1,7 +1,5 @@ - dictionary simple = solidRegions[i].solutionDict().subDict("SIMPLE"); + const dictionary& simple = solidRegions[i].solutionDict().subDict("SIMPLE"); + + const int nNonOrthCorr = + simple.lookupOrDefault("nNonOrthogonalCorrectors", 0); - int nNonOrthCorr = 0; - if (simple.found("nNonOrthogonalCorrectors")) - { - nNonOrthCorr = readInt(simple.lookup("nNonOrthogonalCorrectors")); - } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H index f9e80e3d72..1e78cc297a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H @@ -1,6 +1,14 @@ fvMesh& mesh = solidRegions[i]; + basicSolidThermo& thermo = thermos[i]; - volScalarField& rho = rhos[i]; - volScalarField& cp = cps[i]; - volScalarField& K = Ks[i]; - volScalarField& T = Ts[i]; + tmp trho = thermo.rho(); + const volScalarField& rho = trho(); + + tmp tcp = thermo.cp(); + const volScalarField& cp = tcp(); + + tmp tK = thermo.K(); + //tmp tK = thermo.directionalK(); + const volScalarField& K = tK(); + + volScalarField& T = thermo.T(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPIMPLEControls.H index 413c0225f0..71e49a33a8 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPIMPLEControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPIMPLEControls.H @@ -1,9 +1,11 @@ const dictionary& pimple = mesh.solutionDict().subDict("PIMPLE"); - int nCorr(readInt(pimple.lookup("nCorrectors"))); + const int nCorr = + pimple.lookupOrDefault("nCorrectors", 1); - int nNonOrthCorr = + const int nNonOrthCorr = pimple.lookupOrDefault("nNonOrthogonalCorrectors", 0); - bool momentumPredictor = - pimple.lookupOrDefault("momentumPredictor", true); + const bool momentumPredictor = + pimple.lookupOrDefault("momentumPredictor", true); + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H index 75d6d96d11..1f8cdb82a3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H @@ -1,27 +1,17 @@ - dictionary piso = fluidRegions[i].solutionDict().subDict("PISO"); + const dictionary& piso = fluidRegions[i].solutionDict().subDict("PISO"); - int nCorr(readInt(piso.lookup("nCorrectors"))); + const int nOuterCorr = + piso.lookupOrDefault("nOuterCorrectors", 1); - int nNonOrthCorr = 0; - if (piso.found("nNonOrthogonalCorrectors")) - { - nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors")); - } + const int nCorr = + piso.lookupOrDefault("nCorrectors", 1); - bool momentumPredictor = true; - if (piso.found("momentumPredictor")) - { - momentumPredictor = Switch(piso.lookup("momentumPredictor")); - } + const int nNonOrthCorr = + piso.lookupOrDefault("nNonOrthogonalCorrectors", 0); - bool transonic = false; - if (piso.found("transonic")) - { - transonic = Switch(piso.lookup("transonic")); - } + const bool momentumPredictor = + piso.lookupOrDefault("momentumPredictor", true); + + const bool transonic = + piso.lookupOrDefault("transonic", false); - int nOuterCorr = 1; - if (piso.found("nOuterCorrectors")) - { - nOuterCorr = readInt(piso.lookup("nOuterCorrectors")); - } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H index 42793d9b9f..f6371c47cb 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/readPIMPLEControls.H @@ -4,4 +4,6 @@ const dictionary& pimple = solutionDict.subDict("PIMPLE"); - int nOuterCorr(readInt(pimple.lookup("nOuterCorrectors"))); + const int nOuterCorr = + pimple.lookupOrDefault("nOuterCorrectors", 1); + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C index 89eaaabd48..f85e8f5440 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C @@ -36,7 +36,7 @@ Foam::regionProperties::regionProperties(const Time& runTime) "regionProperties", runTime.time().constant(), runTime.db(), - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ), diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H index 8f109a3f82..be13e670c3 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -1,8 +1,5 @@ // Initialise solid field pointer lists - PtrList rhos(solidRegions.size()); - PtrList cps(solidRegions.size()); - PtrList Ks(solidRegions.size()); - PtrList Ts(solidRegions.size()); + PtrList thermos(solidRegions.size()); // Populate solid field pointer lists forAll(solidRegions, i) @@ -10,75 +7,10 @@ Info<< "*** Reading solid mesh thermophysical properties for region " << solidRegions[i].name() << nl << endl; - Info<< " Adding to rhos\n" << endl; - rhos.set + Info<< " Adding to thermos\n" << endl; + thermos.set ( i, - new volScalarField - ( - IOobject - ( - "rho", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) - ); - - Info<< " Adding to cps\n" << endl; - cps.set - ( - i, - new volScalarField - ( - IOobject - ( - "cp", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) - ); - - Info<< " Adding to Ks\n" << endl; - Ks.set - ( - i, - new volScalarField - ( - IOobject - ( - "K", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) - ); - - Info<< " Adding to Ts\n" << endl; - Ts.set - ( - i, - new volScalarField - ( - IOobject - ( - "T", - runTime.timeName(), - solidRegions[i], - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - solidRegions[i] - ) + basicSolidThermo::New(solidRegions[i]) ); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H index ce6a1c5bb2..0c965a8322 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H @@ -1,7 +1,5 @@ const dictionary& piso = solidRegions[i].solutionDict().subDict("PISO"); - int nNonOrthCorr = 0; - if (piso.found("nNonOrthogonalCorrectors")) - { - nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors")); - } + const int nNonOrthCorr = + piso.lookupOrDefault("nNonOrthogonalCorrectors", 0); + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H index f9e80e3d72..1e78cc297a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/setRegionSolidFields.H @@ -1,6 +1,14 @@ fvMesh& mesh = solidRegions[i]; + basicSolidThermo& thermo = thermos[i]; - volScalarField& rho = rhos[i]; - volScalarField& cp = cps[i]; - volScalarField& K = Ks[i]; - volScalarField& T = Ts[i]; + tmp trho = thermo.rho(); + const volScalarField& rho = trho(); + + tmp tcp = thermo.cp(); + const volScalarField& cp = tcp(); + + tmp tK = thermo.K(); + //tmp tK = thermo.directionalK(); + const volScalarField& K = tK(); + + volScalarField& T = thermo.T(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H index 4b09671de2..77dc6f04bf 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H @@ -1,15 +1,17 @@ scalar DiNum = -GREAT; - forAll(solidRegions, regionI) + forAll(solidRegions, i) { +# include "setRegionSolidFields.H" + DiNum = max ( solidRegionDiffNo ( - solidRegions[regionI], + solidRegions[i], runTime, - rhos[regionI]*cps[regionI], - Ks[regionI] + rho*cp, + K ), DiNum ); diff --git a/applications/solvers/incompressible/boundaryFoam/createFields.H b/applications/solvers/incompressible/boundaryFoam/createFields.H index e99a990013..90a6664989 100644 --- a/applications/solvers/incompressible/boundaryFoam/createFields.H +++ b/applications/solvers/incompressible/boundaryFoam/createFields.H @@ -44,7 +44,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/incompressible/channelFoam/readTransportProperties.H b/applications/solvers/incompressible/channelFoam/readTransportProperties.H index 87c93c9195..abaee647c7 100644 --- a/applications/solvers/incompressible/channelFoam/readTransportProperties.H +++ b/applications/solvers/incompressible/channelFoam/readTransportProperties.H @@ -6,7 +6,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/incompressible/icoFoam/createFields.H b/applications/solvers/incompressible/icoFoam/createFields.H index 6a7d6b9a80..02093c3938 100644 --- a/applications/solvers/incompressible/icoFoam/createFields.H +++ b/applications/solvers/incompressible/icoFoam/createFields.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H index ef396ec9ff..8789bd0ab4 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/readControls.H @@ -1,14 +1,9 @@ #include "readTimeControls.H" #include "readPIMPLEControls.H" - bool correctPhi = false; - if (pimple.found("correctPhi")) - { - correctPhi = Switch(pimple.lookup("correctPhi")); - } + const bool correctPhi = + pimple.lookupOrDefault("correctPhi", false); + + const bool checkMeshCourantNo = + pimple.lookupOrDefault("checkMeshCourantNo", false); - bool checkMeshCourantNo = false; - if (pimple.found("checkMeshCourantNo")) - { - checkMeshCourantNo = Switch(pimple.lookup("checkMeshCourantNo")); - } diff --git a/applications/solvers/incompressible/porousSimpleFoam/createFields.H b/applications/solvers/incompressible/porousSimpleFoam/createFields.H index 6861ae0005..7ce03c1967 100644 --- a/applications/solvers/incompressible/porousSimpleFoam/createFields.H +++ b/applications/solvers/incompressible/porousSimpleFoam/createFields.H @@ -43,22 +43,13 @@ porousZones pZones(mesh); - Switch pressureImplicitPorosity(false); + // nUCorrectors used for pressureImplicitPorosity int nUCorr = 0; - if (pZones.size()) - { - // nUCorrectors for pressureImplicitPorosity - if (mesh.solutionDict().subDict("SIMPLE").found("nUCorrectors")) - { - nUCorr = readInt - ( - mesh.solutionDict().subDict("SIMPLE").lookup("nUCorrectors") - ); - } + const bool pressureImplicitPorosity = + ( + pZones.size() + && mesh.solutionDict().subDict("SIMPLE").readIfPresent("nUCorrectors", nUCorr) + && (nUCorr > 0) + ); - if (nUCorr > 0) - { - pressureImplicitPorosity = true; - } - } diff --git a/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H b/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H index d609c18614..d8a8bf8d06 100644 --- a/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H +++ b/applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H @@ -7,7 +7,7 @@ IOdictionary gravitationalProperties "gravitationalProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H b/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H index ab51afe283..f0bcf7597f 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/readChemistryProperties.H @@ -7,7 +7,7 @@ IOdictionary chemistryProperties "chemistryProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H index 179ac149ba..0ad057e229 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H index ab51afe283..f0bcf7597f 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/readChemistryProperties.H @@ -7,7 +7,7 @@ IOdictionary chemistryProperties "chemistryProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 8048acd648..909d0351f7 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -97,7 +97,7 @@ "additionalControls", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/readChemistryProperties.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/readChemistryProperties.H index ab51afe283..f0bcf7597f 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/readChemistryProperties.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/readChemistryProperties.H @@ -7,7 +7,7 @@ IOdictionary chemistryProperties "chemistryProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H b/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H index ab51afe283..f0bcf7597f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/readChemistryProperties.H @@ -7,7 +7,7 @@ IOdictionary chemistryProperties "chemistryProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/multiphase/bubbleFoam/createFields.H b/applications/solvers/multiphase/bubbleFoam/createFields.H index 9367838a52..57bb7e88d5 100644 --- a/applications/solvers/multiphase/bubbleFoam/createFields.H +++ b/applications/solvers/multiphase/bubbleFoam/createFields.H @@ -91,7 +91,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H b/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H index 1ae6219fd6..049b6c0b36 100644 --- a/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H +++ b/applications/solvers/multiphase/bubbleFoam/createRASTurbulence.H @@ -5,7 +5,7 @@ "RASProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); @@ -96,7 +96,7 @@ ) ); - if (RASProperties.lookupOrDefault("printCoeffs", false)) + if (RASProperties.lookupOrDefault("printCoeffs", false)) { Info<< "kEpsilonCoeffs" << kEpsilonDict << nl << "wallFunctionCoeffs" << wallFunctionDict << endl; diff --git a/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H b/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H index d3fbb9307a..3740f10563 100644 --- a/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H +++ b/applications/solvers/multiphase/cavitatingFoam/readThermodynamicProperties.H @@ -7,7 +7,7 @@ "thermodynamicProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H b/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H index a2e4ef3747..a5a2a183e5 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/readControls.H @@ -1,5 +1,5 @@ - #include "readPISOControls.H" - #include "readTimeControls.H" + #include "readPISOControls.H" + #include "readTimeControls.H" label nAlphaCorr ( @@ -19,14 +19,9 @@ << exit(FatalError); } - bool correctPhi = true; - if (piso.found("correctPhi")) - { - correctPhi = Switch(piso.lookup("correctPhi")); - } + const bool correctPhi = + piso.lookupOrDefault("correctPhi", true); + + const bool checkMeshCourantNo = + piso.lookupOrDefault("checkMeshCourantNo", false); - bool checkMeshCourantNo = false; - if (piso.found("checkMeshCourantNo")) - { - checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo")); - } diff --git a/applications/solvers/multiphase/interDyMFoam/readControls.H b/applications/solvers/multiphase/interDyMFoam/readControls.H index 3640d73adc..10b09bf8ff 100644 --- a/applications/solvers/multiphase/interDyMFoam/readControls.H +++ b/applications/solvers/multiphase/interDyMFoam/readControls.H @@ -1,14 +1,9 @@ # include "readTimeControls.H" # include "readPISOControls.H" - bool correctPhi = true; - if (piso.found("correctPhi")) - { - correctPhi = Switch(piso.lookup("correctPhi")); - } + const bool correctPhi = + piso.lookupOrDefault("correctPhi", true); + + const bool checkMeshCourantNo = + piso.lookupOrDefault("checkMeshCourantNo", false); - bool checkMeshCourantNo = false; - if (piso.found("checkMeshCourantNo")) - { - checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo")); - } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C index bffffd6aae..27da4ad0c0 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixtureNew.C @@ -46,7 +46,7 @@ Foam::phaseChangeTwoPhaseMixture::New "transportProperties", U.time().constant(), U.db(), - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/files b/applications/solvers/multiphase/multiphaseInterFoam/Make/files index 0204e6cabf..4820de61a5 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/Make/files +++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/files @@ -1,5 +1,5 @@ multiphaseMixture/phase/phase.C -multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C multiphaseMixture/multiphaseMixture.C multiphaseInterFoam.C diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/Make/options index 1fc821726c..6e9363f13f 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/options @@ -2,17 +2,15 @@ EXE_INC = \ -I../interFoam \ -ImultiphaseMixture \ -ImultiphaseMixture/phase \ - -ImultiphaseMixture/alphaContactAngle \ + -ImultiphaseMixture/multiphaseAlphaContactAngle \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ - -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -linterfaceProperties \ -lincompressibleTransportModels \ - -lincompressibleTransportModels \ -lincompressibleRASModels \ -lincompressibleLESModels \ - -lfiniteVolume + -lfiniteVolume \ No newline at end of file diff --git a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H index fb64496294..6ef6882196 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/createFields.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/createFields.H @@ -26,7 +26,7 @@ mesh ); -# include "createPhi.H" + #include "createPhi.H" multiphaseMixture mixture(U, phi); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C index 1a5bed606d..546e635346 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseInterFoam.C @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) #include "continuityErrs.H" - turbulence->correct(); + //turbulence->correct(); runTime.write(); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C similarity index 76% rename from applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C rename to applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C index 3cf76bab1b..9cc9b7ed07 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "alphaContactAngleFvPatchScalarField.H" +#include "multiphaseAlphaContactAngleFvPatchScalarField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" @@ -32,7 +32,8 @@ License namespace Foam { -alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps +multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps:: +interfaceThetaProps ( Istream& is ) @@ -47,7 +48,7 @@ alphaContactAngleFvPatchScalarField::interfaceThetaProps::interfaceThetaProps Istream& operator>> ( Istream& is, - alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp + multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps& tp ) { is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_; @@ -58,7 +59,7 @@ Istream& operator>> Ostream& operator<< ( Ostream& os, - const alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp + const multiphaseAlphaContactAngleFvPatchScalarField::interfaceThetaProps& tp ) { os << tp.theta0_ << token::SPACE @@ -72,7 +73,8 @@ Ostream& operator<< // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +multiphaseAlphaContactAngleFvPatchScalarField:: +multiphaseAlphaContactAngleFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF @@ -82,9 +84,10 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField {} -alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +multiphaseAlphaContactAngleFvPatchScalarField:: +multiphaseAlphaContactAngleFvPatchScalarField ( - const alphaContactAngleFvPatchScalarField& gcpsf, + const multiphaseAlphaContactAngleFvPatchScalarField& gcpsf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper @@ -95,7 +98,8 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField {} -alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +multiphaseAlphaContactAngleFvPatchScalarField:: +multiphaseAlphaContactAngleFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, @@ -109,9 +113,10 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField } -alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField +multiphaseAlphaContactAngleFvPatchScalarField:: +multiphaseAlphaContactAngleFvPatchScalarField ( - const alphaContactAngleFvPatchScalarField& gcpsf, + const multiphaseAlphaContactAngleFvPatchScalarField& gcpsf, const DimensionedField& iF ) : @@ -122,7 +127,7 @@ alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void alphaContactAngleFvPatchScalarField::write(Ostream& os) const +void multiphaseAlphaContactAngleFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); os.writeKeyword("thetaProperties") @@ -133,7 +138,7 @@ void alphaContactAngleFvPatchScalarField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField(fvPatchScalarField, alphaContactAngleFvPatchScalarField); +makePatchTypeField(fvPatchScalarField, multiphaseAlphaContactAngleFvPatchScalarField); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.H similarity index 84% rename from applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H rename to applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.H index 322d097526..ccbb146abb 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseAlphaContactAngle/multiphaseAlphaContactAngleFvPatchScalarField.H @@ -22,19 +22,19 @@ License along with OpenFOAM. If not, see . Class - Foam::alphaContactAngleFvPatchScalarField + Foam::multiphaseAlphaContactAngleFvPatchScalarField Description Contact-angle boundary condition for multi-phase interface-capturing simulations. Used in conjuction with multiphaseMixture. SourceFiles - alphaContactAngleFvPatchScalarField.C + multiphaseAlphaContactAngleFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef alphaContactAngleFvPatchScalarField_H -#define alphaContactAngleFvPatchScalarField_H +#ifndef multiphaseAlphaContactAngleFvPatchScalarField_H +#define multiphaseAlphaContactAngleFvPatchScalarField_H #include "zeroGradientFvPatchFields.H" #include "multiphaseMixture.H" @@ -45,10 +45,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class alphaContactAngleFvPatch Declaration + Class multiphaseAlphaContactAngleFvPatch Declaration \*---------------------------------------------------------------------------*/ -class alphaContactAngleFvPatchScalarField +class multiphaseAlphaContactAngleFvPatchScalarField : public zeroGradientFvPatchScalarField { @@ -132,31 +132,31 @@ private: public: //- Runtime type information - TypeName("alphaContactAngle"); + TypeName("multiphaseAlphaContactAngle"); // Constructors //- Construct from patch and internal field - alphaContactAngleFvPatchScalarField + multiphaseAlphaContactAngleFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - alphaContactAngleFvPatchScalarField + multiphaseAlphaContactAngleFvPatchScalarField ( const fvPatch&, const DimensionedField&, const dictionary& ); - //- Construct by mapping given alphaContactAngleFvPatchScalarField + //- Construct by mapping given multiphaseAlphaContactAngleFvPatchScalarField // onto a new patch - alphaContactAngleFvPatchScalarField + multiphaseAlphaContactAngleFvPatchScalarField ( - const alphaContactAngleFvPatchScalarField&, + const multiphaseAlphaContactAngleFvPatchScalarField&, const fvPatch&, const DimensionedField&, const fvPatchFieldMapper& @@ -167,14 +167,14 @@ public: { return tmp ( - new alphaContactAngleFvPatchScalarField(*this) + new multiphaseAlphaContactAngleFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - alphaContactAngleFvPatchScalarField + multiphaseAlphaContactAngleFvPatchScalarField ( - const alphaContactAngleFvPatchScalarField&, + const multiphaseAlphaContactAngleFvPatchScalarField&, const DimensionedField& ); @@ -186,7 +186,7 @@ public: { return tmp ( - new alphaContactAngleFvPatchScalarField(*this, iF) + new multiphaseAlphaContactAngleFvPatchScalarField(*this, iF) ); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 7af947d4a7..c6dba40e13 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "multiphaseMixture.H" -#include "alphaContactAngleFvPatchScalarField.H" +#include "multiphaseAlphaContactAngleFvPatchScalarField.H" #include "Time.H" #include "subCycle.H" #include "fvCFD.H" @@ -351,10 +351,11 @@ void Foam::multiphaseMixture::correctContactAngle forAll(boundary, patchi) { - if (isA(gbf[patchi])) + if (isA(gbf[patchi])) { - const alphaContactAngleFvPatchScalarField& acap = - refCast(gbf[patchi]); + const multiphaseAlphaContactAngleFvPatchScalarField& acap = + refCast + (gbf[patchi]); vectorField& nHatPatch = nHatb[patchi]; @@ -362,7 +363,7 @@ void Foam::multiphaseMixture::correctContactAngle mesh_.Sf().boundaryField()[patchi] /mesh_.magSf().boundaryField()[patchi]; - alphaContactAngleFvPatchScalarField::thetaPropsTable:: + multiphaseAlphaContactAngleFvPatchScalarField::thetaPropsTable:: const_iterator tp = acap.thetaProps().find(interfacePair(alpha1, alpha2)); diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index 1d94d47e91..2a430da5b2 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -210,7 +210,7 @@ public: //- Destructor - ~multiphaseMixture() + virtual ~multiphaseMixture() {} diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index c8e05c4209..a2a5707b9e 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -50,7 +50,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); @@ -184,7 +184,7 @@ "RASProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); @@ -276,7 +276,7 @@ ) ); - if (RASProperties.lookupOrDefault("printCoeffs", false)) + if (RASProperties.lookupOrDefault("printCoeffs", false)) { Info<< "kEpsilonCoeffs" << kEpsilonDict << nl << "wallFunctionCoeffs" << wallFunctionDict << endl; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H index 8a12690581..65761d9ec9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/createFields.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); @@ -153,7 +153,7 @@ "interfacialProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); @@ -175,10 +175,8 @@ ); word dragPhase("blended"); - if (interfacialProperties.found("dragPhase")) + if (interfacialProperties.readIfPresent("dragPhase", dragPhase)) { - dragPhase = word(interfacialProperties.lookup("dragPhase")); - bool validDrag = dragPhase == "a" || dragPhase == "b" || dragPhase == "blended"; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C index 611ce8fa16..57096ebd0c 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/kineticTheoryModel/kineticTheoryModel.C @@ -56,7 +56,7 @@ Foam::kineticTheoryModel::kineticTheoryModel "kineticTheoryProperties", Ua_.time().constant(), Ua_.mesh(), - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ), diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H b/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H index 3acbf758d0..c1b319cbc9 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/readPPProperties.H @@ -5,7 +5,7 @@ "ppProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H index 91bd5f3da2..9f256bd689 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H @@ -7,7 +7,7 @@ "mechanicalProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readSolidDisplacementFoamControls.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readSolidDisplacementFoamControls.H index 343b7bcaed..8b59cc497e 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readSolidDisplacementFoamControls.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readSolidDisplacementFoamControls.H @@ -1,5 +1,6 @@ const dictionary& stressControl = mesh.solutionDict().subDict("stressAnalysis"); -int nCorr(readInt(stressControl.lookup("nCorrectors"))); +const int nCorr = stressControl.lookupOrDefault("nCorrectors", 1); + scalar convergenceTolerance(readScalar(stressControl.lookup("D"))); Switch compactNormalStress(stressControl.lookup("compactNormalStress")); diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H index a4c3082fb5..12e10a607b 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H @@ -7,7 +7,7 @@ "thermalProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/test/DynamicField/DynamicFieldTest.C b/applications/test/DynamicField/DynamicFieldTest.C index e78747fb0f..3e5a8dfc54 100644 --- a/applications/test/DynamicField/DynamicFieldTest.C +++ b/applications/test/DynamicField/DynamicFieldTest.C @@ -43,6 +43,9 @@ int main(int argc, char *argv[]) dl.append(2); dl.append(1); Pout<< "appending : dl:" << dl << endl; + + dl[2] *= 10; + Pout<< "assigning : dl:" << dl << endl; } { diff --git a/applications/test/Hashing/hashingTests b/applications/test/Hashing/hashingTests index 162854bbef..2ccc793e74 100644 --- a/applications/test/Hashing/hashingTests +++ b/applications/test/Hashing/hashingTests @@ -1,10 +1,10 @@ -/*-------------------------------*- C++ -*---------------------------------*\ -| ========= | -| \\ / OpenFOAM | -| \\ / | -| \\ / The Open Source CFD Toolbox | -| \\/ http://www.OpenFOAM.org | -\*-------------------------------------------------------------------------*/ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/test/LduMatrix/createFields.H b/applications/test/LduMatrix/createFields.H index ea64f13026..57714aa787 100644 --- a/applications/test/LduMatrix/createFields.H +++ b/applications/test/LduMatrix/createFields.H @@ -7,7 +7,7 @@ "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/test/dataEntry/testDataEntry.C b/applications/test/dataEntry/testDataEntry.C index 583701322b..456f0d478d 100644 --- a/applications/test/dataEntry/testDataEntry.C +++ b/applications/test/dataEntry/testDataEntry.C @@ -48,7 +48,7 @@ int main(int argc, char *argv[]) "dataEntryProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/test/dictionary/testDictRegex b/applications/test/dictionary/testDictRegex index 01d4274ba8..e1833efb3f 100644 --- a/applications/test/dictionary/testDictRegex +++ b/applications/test/dictionary/testDictRegex @@ -1,10 +1,10 @@ -/*-------------------------------*- C++ -*---------------------------------*\ -| ========= | -| \\ / OpenFOAM | -| \\ / | -| \\ / The Open Source CFD Toolbox | -| \\/ http://www.OpenFOAM.org | -\*-------------------------------------------------------------------------*/ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ FoamFile { version 2.0; diff --git a/applications/test/fvSolutionCombine/fvSolutionCombine.C b/applications/test/fvSolutionCombine/fvSolutionCombine.C index a98d803bf3..19abc81611 100644 --- a/applications/test/fvSolutionCombine/fvSolutionCombine.C +++ b/applications/test/fvSolutionCombine/fvSolutionCombine.C @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) dictName, "system", runTime, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/test/regex/testRegexps b/applications/test/regex/testRegexps index 72287eea43..fca98249c6 100644 --- a/applications/test/regex/testRegexps +++ b/applications/test/regex/testRegexps @@ -1,10 +1,10 @@ -/*-------------------------------*- C++ -*---------------------------------*\ -| ========= | -| \\ / OpenFOAM | -| \\ / | -| \\ / The Open Source CFD Toolbox | -| \\/ http://www.OpenFOAM.org | -\*-------------------------------------------------------------------------*/ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/test/router/routerDict b/applications/test/router/routerDict index b21e5544fe..310c2653e3 100644 --- a/applications/test/router/routerDict +++ b/applications/test/router/routerDict @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile diff --git a/applications/test/spline/test-splines b/applications/test/spline/test-splines index 63f7bd17dd..05ab2185cd 100644 --- a/applications/test/spline/test-splines +++ b/applications/test/spline/test-splines @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ ( diff --git a/applications/test/wordRe/testRegexps b/applications/test/wordRe/testRegexps index c18cac8028..0eefa0f781 100644 --- a/applications/test/wordRe/testRegexps +++ b/applications/test/wordRe/testRegexps @@ -1,10 +1,10 @@ -/*-------------------------------*- C++ -*---------------------------------*\ -| ========= | -| \\ / OpenFOAM | -| \\ / | -| \\ / The Open Source CFD Toolbox | -| \\/ http://www.OpenFOAM.org | -\*-------------------------------------------------------------------------*/ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C b/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C index 9b305731db..8b2339233c 100644 --- a/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C +++ b/applications/utilities/errorEstimation/estimateScalarError/estimateScalarError.C @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C b/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C index 33486ec301..05a7e5c57c 100644 --- a/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C +++ b/applications/utilities/errorEstimation/icoErrorEstimate/icoErrorEstimate.C @@ -56,7 +56,7 @@ int main(int argc, char *argv[]) "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C b/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C index 57629b5980..d0f668c8c9 100644 --- a/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C +++ b/applications/utilities/errorEstimation/icoMomentError/icoMomentError.C @@ -57,7 +57,7 @@ int main(int argc, char *argv[]) "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C b/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C index 72744a9f8d..246380a029 100644 --- a/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C +++ b/applications/utilities/errorEstimation/momentScalarError/momentScalarError.C @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) "transportProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C index c2f3640f2d..3ef371188e 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMesh.C @@ -639,7 +639,7 @@ int main(int argc, char *argv[]) "motionProperties", runTime.constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ); @@ -669,7 +669,7 @@ int main(int argc, char *argv[]) "autoRefineMeshDict", runTime.system(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict index 9c57e17dbf..334ea8cd30 100644 --- a/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict +++ b/applications/utilities/mesh/advanced/autoRefineMesh/autoRefineMeshDict @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index 0b09b7859d..21c9f5867a 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -74,7 +74,7 @@ void checkSnapMesh "snapMeshDict", runTime.system(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C index 7cd57e792d..befadc88e2 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C +++ b/applications/utilities/mesh/advanced/modifyMesh/modifyMesh.C @@ -346,7 +346,7 @@ int main(int argc, char *argv[]) "modifyMeshDict", runTime.system(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/mesh/advanced/modifyMesh/modifyMeshDict b/applications/utilities/mesh/advanced/modifyMesh/modifyMeshDict index f2cf261692..b656cbffca 100644 --- a/applications/utilities/mesh/advanced/modifyMesh/modifyMeshDict +++ b/applications/utilities/mesh/advanced/modifyMesh/modifyMeshDict @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile diff --git a/applications/utilities/mesh/advanced/selectCells/edgeStats.C b/applications/utilities/mesh/advanced/selectCells/edgeStats.C index 561cef9bfd..103d963be5 100644 --- a/applications/utilities/mesh/advanced/selectCells/edgeStats.C +++ b/applications/utilities/mesh/advanced/selectCells/edgeStats.C @@ -78,7 +78,7 @@ Foam::edgeStats::edgeStats(const polyMesh& mesh) "motionProperties", mesh.time().constant(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ); diff --git a/applications/utilities/mesh/advanced/selectCells/selectCells.C b/applications/utilities/mesh/advanced/selectCells/selectCells.C index 8f79846050..f5ad8412f7 100644 --- a/applications/utilities/mesh/advanced/selectCells/selectCells.C +++ b/applications/utilities/mesh/advanced/selectCells/selectCells.C @@ -346,7 +346,7 @@ int main(int argc, char *argv[]) "selectCellsDict", runTime.system(), mesh, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); diff --git a/applications/utilities/mesh/advanced/selectCells/selectCellsDict b/applications/utilities/mesh/advanced/selectCells/selectCellsDict index 87f91eafb4..10b73f34b5 100644 --- a/applications/utilities/mesh/advanced/selectCells/selectCellsDict +++ b/applications/utilities/mesh/advanced/selectCells/selectCellsDict @@ -2,7 +2,7 @@ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C index 58070fc473..decabfeae0 100644 --- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C +++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/ccm26ToFoam.C @@ -579,12 +579,17 @@ void ReadCells int main(int argc, char *argv[]) { + argList::addNote + ( + "read CCM files as written by proSTAR/ccm\n" + " - does not handle 'interfaces' (couples), cyclics or data\n" + " - does not handle mesh regions (porosity, solids, ...)\n" + ); argList::noParallel(); - argList::validArgs.append("ccm26 file"); - -# include "setRootCase.H" -# include "createTime.H" + argList::validArgs.append("ccmFile"); + #include "setRootCase.H" + #include "createTime.H" // Foam mesh data // ~~~~~~~~~~~~~~ @@ -615,6 +620,7 @@ int main(int argc, char *argv[]) { const fileName ccmFile = args[1]; + const word ccmExt = ccmFile.ext(); if (!isFile(ccmFile)) { @@ -623,8 +629,6 @@ int main(int argc, char *argv[]) << exit(FatalError); } - word ccmExt = ccmFile.ext(); - if (ccmExt != "ccm" && ccmExt != "ccmg") { FatalErrorIn(args.executable()) diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C b/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C index ddf722d324..adcce3869d 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/create3DCellShape.C @@ -90,7 +90,7 @@ cellShape create3DCellShape // make a list of outward-pointing faces labelListList localFaces(faceLabels.size()); - forAll (faceLabels, faceI) + forAll(faceLabels, faceI) { const label curFaceLabel = faceLabels[faceI]; diff --git a/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C index 09e34235e5..2587a5d457 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C +++ b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C @@ -62,6 +62,10 @@ using namespace Foam; int main(int argc, char *argv[]) { + argList::addNote + ( + "read OpenFOAM mesh and write a pro-STAR (v4) bnd/cel/vrt format" + ); argList::noParallel(); timeSelector::addOptions(); @@ -74,7 +78,7 @@ int main(int argc, char *argv[]) argList::addBoolOption ( "noBnd", - "suppress writing the .bnd file" + "suppress writing a boundary (.bnd) file" ); # include "setRootCase.H" diff --git a/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H b/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H index 85a92405dd..d722c432e3 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H +++ b/applications/utilities/mesh/conversion/foamToStarMesh/getTimeIndex.H @@ -29,7 +29,7 @@ runTime.timeName(), "uniform", runTime, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H b/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H index 85a92405dd..d722c432e3 100644 --- a/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H +++ b/applications/utilities/mesh/conversion/foamToSurface/getTimeIndex.H @@ -29,7 +29,7 @@ runTime.timeName(), "uniform", runTime, - IOobject::MUST_READ, + IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE, false ) diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index a3f607ba0b..fa1fe3b041 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -233,6 +233,44 @@ void storeCellInZone } +// Reads mesh format +scalar readMeshFormat(IFstream& inFile) +{ + Info<< "Starting to read mesh format at line " << inFile.lineNumber() << endl; + + string line; + inFile.getLine(line); + IStringStream lineStr(line); + + scalar version; + label asciiFlag, nBytes; + lineStr >> version >> asciiFlag >> nBytes; + + Info<< "Read format version " << version << " ascii " << asciiFlag << endl; + + if (asciiFlag != 0) + { + FatalIOErrorIn("readMeshFormat(IFstream&)", inFile) + << "Can only read ascii msh files." + << exit(FatalIOError); + } + + inFile.getLine(line); + IStringStream tagStr(line); + word tag(tagStr); + + if (tag != "$EndMeshFormat") + { + FatalIOErrorIn("readMeshFormat(IFstream&)", inFile) + << "Did not find $ENDNOD tag on line " + << inFile.lineNumber() << exit(FatalIOError); + } + Info<< endl; + + return version; +} + + // Reads points and map void readPoints(IFstream& inFile, pointField& points, Map