From 533f75b1d9416d80ab5cccf1bf64c141bf0a4599 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 16 Nov 2012 17:26:12 +0000 Subject: [PATCH 01/17] ENH: Removed unused header #include file --- applications/solvers/combustion/fireFoam/fireFoam.C | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 9f97843a96..021ed3c6f0 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -30,7 +30,6 @@ Description \*---------------------------------------------------------------------------*/ -#include "mapDistribute.H" #include "fvCFD.H" #include "turbulenceModel.H" #include "basicReactingCloud.H" From edd7242fbec40f91349a784149da203beacebaf7 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 16 Nov 2012 17:52:08 +0000 Subject: [PATCH 02/17] ENH: Tutorial updates --- .../system/heater/changeDictionaryDict | 31 ------------------- .../system/leftSolid/changeDictionaryDict | 30 ------------------ .../system/rightSolid/changeDictionaryDict | 30 ------------------ .../system/heater/changeDictionaryDict | 31 ------------------- .../system/leftSolid/changeDictionaryDict | 30 ------------------ .../system/rightSolid/changeDictionaryDict | 30 ------------------ .../system/heater/changeDictionaryDict | 31 ------------------- .../system/leftSolid/changeDictionaryDict | 30 ------------------ .../system/rightSolid/changeDictionaryDict | 30 ------------------ .../system/heater/changeDictionaryDict | 30 ------------------ .../system/leftSolid/changeDictionaryDict | 30 ------------------ .../system/rightSolid/changeDictionaryDict | 30 ------------------ 12 files changed, 363 deletions(-) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict index 0f936407a4..c92d4511d0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/heater/changeDictionaryDict @@ -58,37 +58,6 @@ dictionaryReplacement } } } - - pmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - char - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } - } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict index 4deb0d8e1b..8c75b7e4bd 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict @@ -49,36 +49,6 @@ dictionaryReplacement } } } - - pmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - char - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict index c97bbad50f..9c9b20e5ed 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict @@ -49,36 +49,6 @@ dictionaryReplacement } } } - - pmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - char - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict index 1222482e8f..c92d4511d0 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/heater/changeDictionaryDict @@ -58,37 +58,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } - } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict index c70f5391f6..8c75b7e4bd 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/leftSolid/changeDictionaryDict @@ -49,36 +49,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict index 913adcf784..9c9b20e5ed 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/rightSolid/changeDictionaryDict @@ -49,36 +49,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/changeDictionaryDict index 1222482e8f..c92d4511d0 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/changeDictionaryDict @@ -58,37 +58,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } - } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict index c70f5391f6..8c75b7e4bd 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict @@ -49,36 +49,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict index 913adcf784..9c9b20e5ed 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict @@ -49,36 +49,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/heater/changeDictionaryDict index 1a680f09a2..024770648c 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/heater/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/heater/changeDictionaryDict @@ -81,36 +81,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } - } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/leftSolid/changeDictionaryDict index 59116a041a..b3ef4c896e 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/leftSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/leftSolid/changeDictionaryDict @@ -72,36 +72,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/rightSolid/changeDictionaryDict index 4f01822608..741624e3d1 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/rightSolid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/rightSolid/changeDictionaryDict @@ -72,36 +72,6 @@ dictionaryReplacement } } } - - Ypmma - { - internalField uniform 0.5; - - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - - } - - Ychar - { - internalField uniform 0.5; - - boundaryField - { - ".*" - { - type calculated; - value uniform 0.5; - } - } - } } // ************************************************************************* // From d460b3484b330db014f5f23f9875b31778660ab4 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 16 Nov 2012 18:26:19 +0000 Subject: [PATCH 03/17] ENH: Updated info/error messages --- .../GeometricField/GeometricBoundaryField.C | 75 +++++++++++++------ 1 file changed, 51 insertions(+), 24 deletions(-) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 5117f8cb23..20d15fbe81 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -47,7 +47,7 @@ GeometricBoundaryField Info<< "GeometricField::" "GeometricBoundaryField::" "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const word&)" + "const DimensionedField&, const word&)" << endl; } @@ -84,8 +84,13 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const wordList&, const wordList&)" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const wordList&, " + "const wordList&" + ")" << endl; } @@ -99,8 +104,13 @@ GeometricBoundaryField ( "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const wordList&, const wordList&)" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const wordList&, " + "const wordList&" + ")" ) << "Incorrect number of patch type specifications given" << nl << " Number of patches in mesh = " << bmesh.size() << " number of patch type specifications = " @@ -160,8 +170,12 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const BoundaryMesh&, " - "const Field&, const PatchFieldList&)" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const PtrLIst >&" + ")" << endl; } @@ -188,8 +202,12 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const GeometricBoundaryField&)" + "GeometricBoundaryField" + "(" + "const DimensionedField&, " + "const typename GeometricField::" + "GeometricBoundaryField&" + ")" << endl; } @@ -220,8 +238,11 @@ GeometricBoundaryField { Info<< "GeometricField::" "GeometricBoundaryField::" - "GeometricBoundaryField(const GeometricBoundaryField&)" + "GeometricBoundaryField" + "(" + "const GeometricField::" + "GeometricBoundaryField&" + ")" << endl; } } @@ -244,7 +265,11 @@ GeometricBoundaryField Info<< "GeometricField::" "GeometricBoundaryField::" "GeometricBoundaryField" - "(const BoundaryMesh&, const Field&, const dictionary&)" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const dictionary&" + ")" << endl; } @@ -326,12 +351,13 @@ GeometricBoundaryField { FatalIOErrorIn ( - "GeometricField::\n" - "GeometricBoundaryField::GeometricBoundaryField\n" - "(\n" - " const BoundaryMesh&,\n" - " const DimensionedField&,\n" - " const dictionary&\n" + "GeometricField::" + "GeometricBoundaryField::" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const dictionary&" ")", dict ) << "Cannot find patchField entry for cyclic " @@ -344,12 +370,13 @@ GeometricBoundaryField { FatalIOErrorIn ( - "GeometricField::\n" - "GeometricBoundaryField::GeometricBoundaryField\n" - "(\n" - " const BoundaryMesh&,\n" - " const DimensionedField&,\n" - " const dictionary&\n" + "GeometricField::" + "GeometricBoundaryField::" + "GeometricBoundaryField" + "(" + "const BoundaryMesh&, " + "const DimensionedField&, " + "const dictionary&" ")", dict ) << "Cannot find patchField entry for " From 6cf770cbee5c87ae6071f1c38a0c808a8c035482 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 18 Nov 2012 22:43:56 +0000 Subject: [PATCH 04/17] CrankNicholsonDdtScheme: renamed CrankNicolsonDdtScheme --- etc/controlDict | 2 +- src/finiteVolume/Make/files | 2 +- .../derived/advective/advectiveFvPatchField.C | 6 +-- .../derived/advective/advectiveFvPatchField.H | 2 +- .../waveSurfacePressureFvPatchScalarField.C | 6 +-- .../waveSurfacePressureFvPatchScalarField.H | 2 +- .../waveTransmissiveFvPatchField.C | 2 +- .../CrankNicolsonDdtScheme.C} | 54 +++++++++---------- .../CrankNicolsonDdtScheme.H} | 32 +++++------ .../CrankNicolsonDdtSchemes.C} | 4 +- src/finiteVolume/finiteVolume/fvm/fvm.H | 2 +- .../squareBump/constant/polyMesh/boundary | 1 + .../squareBump/system/fvSchemes | 2 +- 13 files changed, 59 insertions(+), 58 deletions(-) rename src/finiteVolume/finiteVolume/ddtSchemes/{CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C => CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C} (95%) rename src/finiteVolume/finiteVolume/ddtSchemes/{CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H => CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H} (90%) rename src/finiteVolume/finiteVolume/ddtSchemes/{CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C => CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C} (94%) diff --git a/etc/controlDict b/etc/controlDict index d5c1fdb755..a34d4a1977 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -112,7 +112,7 @@ DebugSwitches ConeInjection 0; Constant 0; ConstantRateDevolatilisation 0; - CrankNicholson 0; + CrankNicolson 0; CrossPowerLaw 0; Cs 0; DIC 0; diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 0d510f9019..3428d62597 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -310,7 +310,7 @@ $(ddtSchemes)/localEulerDdtScheme/localEulerDdtSchemes.C $(ddtSchemes)/backwardDdtScheme/backwardDdtSchemes.C $(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtScheme.C $(ddtSchemes)/boundedBackwardDdtScheme/boundedBackwardDdtSchemes.C -$(ddtSchemes)/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C +$(ddtSchemes)/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C $(ddtSchemes)/boundedDdtScheme/boundedDdtSchemes.C d2dt2Schemes = finiteVolume/d2dt2Schemes diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C index 5764676b2a..86c7aaa146 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C @@ -28,7 +28,7 @@ License #include "fvPatchFieldMapper.H" #include "volFields.H" #include "EulerDdtScheme.H" -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "backwardDdtScheme.H" @@ -229,7 +229,7 @@ void Foam::advectiveFvPatchField::updateCoeffs() if ( ddtScheme == fv::EulerDdtScheme::typeName - || ddtScheme == fv::CrankNicholsonDdtScheme::typeName + || ddtScheme == fv::CrankNicolsonDdtScheme::typeName ) { this->refValue() = @@ -266,7 +266,7 @@ void Foam::advectiveFvPatchField::updateCoeffs() if ( ddtScheme == fv::EulerDdtScheme::typeName - || ddtScheme == fv::CrankNicholsonDdtScheme::typeName + || ddtScheme == fv::CrankNicolsonDdtScheme::typeName ) { this->refValue() = field.oldTime().boundaryField()[patchi]; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H index 5c62df1049..3b4e0f1b5c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.H @@ -31,7 +31,7 @@ Description This boundary condition provides an advective outflow condition, based on solving DDt(psi, U) = 0 at the boundary. - The standard (Euler, backward, CrankNicholson) time schemes are + The standard (Euler, backward, CrankNicolson) time schemes are supported. Additionally an optional mechanism to relax the value at the boundary to a specified far-field value is provided which is switched on by specifying the relaxation length-scale \c lInf and the diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index 8149855235..34d04b7d40 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -30,7 +30,7 @@ License #include "surfaceFields.H" #include "uniformDimensionedFields.H" #include "EulerDdtScheme.H" -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "backwardDdtScheme.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -45,7 +45,7 @@ namespace Foam >::names[] = { fv::EulerDdtScheme::typeName_(), - fv::CrankNicholsonDdtScheme::typeName_(), + fv::CrankNicolsonDdtScheme::typeName_(), fv::backwardDdtScheme::typeName_() }; } @@ -183,7 +183,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() switch (timeScheme) { case tsEuler: - case tsCrankNicholson: + case tsCrankNicolson: { zetap = zeta.oldTime().boundaryField()[patchI] + dZetap; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H index 3babe28eff..ad2820dd50 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H @@ -103,7 +103,7 @@ public: enum timeSchemeType { tsEuler, - tsCrankNicholson, + tsCrankNicolson, tsBackward }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C index 00bd7e339f..ca19c5d8ab 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C @@ -28,7 +28,7 @@ License #include "fvPatchFieldMapper.H" #include "volFields.H" #include "EulerDdtScheme.H" -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "backwardDdtScheme.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C similarity index 95% rename from src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C rename to src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C index dfd7c878ff..53d106a75d 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "surfaceInterpolate.H" #include "fvcDiv.H" #include "fvMatrices.H" @@ -42,7 +42,7 @@ namespace fv template template -CrankNicholsonDdtScheme::DDt0Field::DDt0Field +CrankNicolsonDdtScheme::DDt0Field::DDt0Field ( const IOobject& io, const fvMesh& mesh @@ -60,7 +60,7 @@ CrankNicholsonDdtScheme::DDt0Field::DDt0Field template template -CrankNicholsonDdtScheme::DDt0Field::DDt0Field +CrankNicolsonDdtScheme::DDt0Field::DDt0Field ( const IOobject& io, const fvMesh& mesh, @@ -74,7 +74,7 @@ CrankNicholsonDdtScheme::DDt0Field::DDt0Field template template -label CrankNicholsonDdtScheme::DDt0Field:: +label CrankNicolsonDdtScheme::DDt0Field:: startTimeIndex() const { return startTimeIndex_; @@ -83,7 +83,7 @@ startTimeIndex() const template template -GeoField& CrankNicholsonDdtScheme::DDt0Field:: +GeoField& CrankNicolsonDdtScheme::DDt0Field:: operator()() { return *this; @@ -92,7 +92,7 @@ operator()() template template -void CrankNicholsonDdtScheme::DDt0Field:: +void CrankNicolsonDdtScheme::DDt0Field:: operator=(const GeoField& gf) { GeoField::operator=(gf); @@ -101,8 +101,8 @@ operator=(const GeoField& gf) template template -CrankNicholsonDdtScheme::DDt0Field& -CrankNicholsonDdtScheme::ddt0_ +CrankNicolsonDdtScheme::DDt0Field& +CrankNicolsonDdtScheme::ddt0_ ( const word& name, const dimensionSet& dims @@ -183,7 +183,7 @@ CrankNicholsonDdtScheme::ddt0_ template template -bool CrankNicholsonDdtScheme::evaluate +bool CrankNicolsonDdtScheme::evaluate ( const DDt0Field& ddt0 ) const @@ -193,7 +193,7 @@ bool CrankNicholsonDdtScheme::evaluate template template -scalar CrankNicholsonDdtScheme::coef_ +scalar CrankNicolsonDdtScheme::coef_ ( const DDt0Field& ddt0 ) const @@ -211,7 +211,7 @@ scalar CrankNicholsonDdtScheme::coef_ template template -scalar CrankNicholsonDdtScheme::coef0_ +scalar CrankNicolsonDdtScheme::coef0_ ( const DDt0Field& ddt0 ) const @@ -229,7 +229,7 @@ scalar CrankNicholsonDdtScheme::coef0_ template template -dimensionedScalar CrankNicholsonDdtScheme::rDtCoef_ +dimensionedScalar CrankNicolsonDdtScheme::rDtCoef_ ( const DDt0Field& ddt0 ) const @@ -240,7 +240,7 @@ dimensionedScalar CrankNicholsonDdtScheme::rDtCoef_ template template -dimensionedScalar CrankNicholsonDdtScheme::rDtCoef0_ +dimensionedScalar CrankNicolsonDdtScheme::rDtCoef0_ ( const DDt0Field& ddt0 ) const @@ -251,7 +251,7 @@ dimensionedScalar CrankNicholsonDdtScheme::rDtCoef0_ template template -tmp CrankNicholsonDdtScheme::offCentre_ +tmp CrankNicolsonDdtScheme::offCentre_ ( const GeoField& ddt0 ) const @@ -281,7 +281,7 @@ const FieldField& ff template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const dimensioned& dt ) @@ -343,7 +343,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const GeometricField& vf ) @@ -432,7 +432,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const dimensionedScalar& rho, const GeometricField& vf @@ -522,7 +522,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvcDdt +CrankNicolsonDdtScheme::fvcDdt ( const volScalarField& rho, const GeometricField& vf @@ -622,7 +622,7 @@ CrankNicholsonDdtScheme::fvcDdt template tmp > -CrankNicholsonDdtScheme::fvmDdt +CrankNicolsonDdtScheme::fvmDdt ( const GeometricField& vf ) @@ -705,7 +705,7 @@ CrankNicholsonDdtScheme::fvmDdt template tmp > -CrankNicholsonDdtScheme::fvmDdt +CrankNicolsonDdtScheme::fvmDdt ( const dimensionedScalar& rho, const GeometricField& vf @@ -787,7 +787,7 @@ CrankNicholsonDdtScheme::fvmDdt template tmp > -CrankNicholsonDdtScheme::fvmDdt +CrankNicolsonDdtScheme::fvmDdt ( const volScalarField& rho, const GeometricField& vf @@ -877,8 +877,8 @@ CrankNicholsonDdtScheme::fvmDdt template -tmp::fluxFieldType> -CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp::fluxFieldType> +CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const GeometricField& U, @@ -964,8 +964,8 @@ CrankNicholsonDdtScheme::fvcDdtPhiCorr template -tmp::fluxFieldType> -CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp::fluxFieldType> +CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const volScalarField& rho, @@ -1158,7 +1158,7 @@ CrankNicholsonDdtScheme::fvcDdtPhiCorr { FatalErrorIn ( - "CrankNicholsonDdtScheme::fvcDdtPhiCorr" + "CrankNicolsonDdtScheme::fvcDdtPhiCorr" ) << "dimensions of phi are not correct" << abort(FatalError); @@ -1169,7 +1169,7 @@ CrankNicholsonDdtScheme::fvcDdtPhiCorr template -tmp CrankNicholsonDdtScheme::meshPhi +tmp CrankNicolsonDdtScheme::meshPhi ( const GeometricField& vf ) diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H similarity index 90% rename from src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H rename to src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H index 7c99436401..315072306c 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtScheme.H +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtScheme.H @@ -22,19 +22,19 @@ License along with OpenFOAM. If not, see . Class - Foam::fv::CrankNicholsonDdtScheme + Foam::fv::CrankNicolsonDdtScheme Description - Second-oder CrankNicholson implicit ddt using the current and + Second-oder CrankNicolson implicit ddt using the current and previous time-step fields as well as the previous time-step ddt. SourceFiles - CrankNicholsonDdtScheme.C + CrankNicolsonDdtScheme.C \*---------------------------------------------------------------------------*/ -#ifndef CrankNicholsonDdtScheme_H -#define CrankNicholsonDdtScheme_H +#ifndef CrankNicolsonDdtScheme_H +#define CrankNicolsonDdtScheme_H #include "ddtScheme.H" @@ -49,11 +49,11 @@ namespace fv { /*---------------------------------------------------------------------------*\ - Class CrankNicholsonDdtScheme Declaration + Class CrankNicolsonDdtScheme Declaration \*---------------------------------------------------------------------------*/ template -class CrankNicholsonDdtScheme +class CrankNicolsonDdtScheme : public fv::ddtScheme { @@ -105,10 +105,10 @@ class CrankNicholsonDdtScheme // Private Member Functions //- Disallow default bitwise copy construct - CrankNicholsonDdtScheme(const CrankNicholsonDdtScheme&); + CrankNicolsonDdtScheme(const CrankNicolsonDdtScheme&); //- Disallow default bitwise assignment - void operator=(const CrankNicholsonDdtScheme&); + void operator=(const CrankNicolsonDdtScheme&); template DDt0Field& ddt0_ @@ -149,20 +149,20 @@ class CrankNicholsonDdtScheme public: //- Runtime type information - TypeName("CrankNicholson"); + TypeName("CrankNicolson"); // Constructors //- Construct from mesh - CrankNicholsonDdtScheme(const fvMesh& mesh) + CrankNicolsonDdtScheme(const fvMesh& mesh) : ddtScheme(mesh), ocCoeff_(1.0) {} //- Construct from mesh and Istream - CrankNicholsonDdtScheme(const fvMesh& mesh, Istream& is) + CrankNicolsonDdtScheme(const fvMesh& mesh, Istream& is) : ddtScheme(mesh, is), ocCoeff_(readScalar(is)) @@ -171,7 +171,7 @@ public: { FatalIOErrorIn ( - "CrankNicholsonDdtScheme(const fvMesh& mesh, Istream& is)", + "CrankNicolsonDdtScheme(const fvMesh& mesh, Istream& is)", is ) << "coefficient = " << ocCoeff_ << " should be >= 0 and <= 1" @@ -253,7 +253,7 @@ public: template<> -tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const volScalarField& U, @@ -262,7 +262,7 @@ tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr template<> -tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr +tmp CrankNicolsonDdtScheme::fvcDdtPhiCorr ( const volScalarField& rA, const volScalarField& rho, @@ -282,7 +282,7 @@ tmp CrankNicholsonDdtScheme::fvcDdtPhiCorr // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "CrankNicholsonDdtScheme.C" +# include "CrankNicolsonDdtScheme.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C similarity index 94% rename from src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C rename to src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C index 2b101831a3..3166243a9c 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicholsonDdtScheme/CrankNicholsonDdtSchemes.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.C @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "CrankNicholsonDdtScheme.H" +#include "CrankNicolsonDdtScheme.H" #include "fvMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -32,7 +32,7 @@ namespace Foam { namespace fv { - makeFvDdtScheme(CrankNicholsonDdtScheme) + makeFvDdtScheme(CrankNicolsonDdtScheme) } } diff --git a/src/finiteVolume/finiteVolume/fvm/fvm.H b/src/finiteVolume/finiteVolume/fvm/fvm.H index 2f7ba08f03..b1363a11ae 100644 --- a/src/finiteVolume/finiteVolume/fvm/fvm.H +++ b/src/finiteVolume/finiteVolume/fvm/fvm.H @@ -29,7 +29,7 @@ Description matrix. Temporal derivatives are calculated using Euler-implicit, backward - differencing or Crank-Nicholson. Spatial derivatives are calculated + differencing or Crank-Nicolson. Spatial derivatives are calculated using Gauss' Theorem. diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary index b96b8676fd..4778c6be3c 100644 --- a/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/constant/polyMesh/boundary @@ -38,6 +38,7 @@ FoamFile frontAndBack { type empty; + inGroups 1(empty); nFaces 800; startFace 840; } diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes index 7a0b99df5d..036a75cf3c 100644 --- a/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes +++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/fvSchemes @@ -16,7 +16,7 @@ FoamFile ddtSchemes { - default CrankNicholson 0.9; + default CrankNicolson 0.9; } gradSchemes From a9888b411fcad2219422a16be84023c778fde744 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 18 Nov 2012 22:44:42 +0000 Subject: [PATCH 05/17] applications/test/ThermoMixture: New test application --- applications/test/ThermoMixture/Make/files | 4 ++ applications/test/ThermoMixture/Make/options | 5 ++ .../test/ThermoMixture/ThermoMixture.C | 62 +++++++++++++++++++ applications/test/ThermoMixture/thermoDict | 41 ++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 applications/test/ThermoMixture/Make/files create mode 100644 applications/test/ThermoMixture/Make/options create mode 100644 applications/test/ThermoMixture/ThermoMixture.C create mode 100644 applications/test/ThermoMixture/thermoDict diff --git a/applications/test/ThermoMixture/Make/files b/applications/test/ThermoMixture/Make/files new file mode 100644 index 0000000000..8a122d0e0b --- /dev/null +++ b/applications/test/ThermoMixture/Make/files @@ -0,0 +1,4 @@ + +ThermoMixture.C + +EXE = $(FOAM_APPBIN)/ThermoMixture diff --git a/applications/test/ThermoMixture/Make/options b/applications/test/ThermoMixture/Make/options new file mode 100644 index 0000000000..98bf79aaa4 --- /dev/null +++ b/applications/test/ThermoMixture/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude + +EXE_LIBS = \ + -lspecie diff --git a/applications/test/ThermoMixture/ThermoMixture.C b/applications/test/ThermoMixture/ThermoMixture.C new file mode 100644 index 0000000000..14c71e9b01 --- /dev/null +++ b/applications/test/ThermoMixture/ThermoMixture.C @@ -0,0 +1,62 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + ThermoMixture + +Description + +\*---------------------------------------------------------------------------*/ + +#include "dictionary.H" +#include "IFstream.H" +#include "constTransport.H" +#include "specieThermo.H" +#include "hConstThermo.H" +#include "perfectGas.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + typedef constTransport > > ThermoType; + + IFstream f("thermoDict"); + dictionary dict(f); + + ThermoType t1(dict.subDict("specie1")); + ThermoType t2(dict.subDict("specie2")); + + Info << "W= " << t1.W() << " " << t2.W() << " " << (t1+t2).W() << endl; + Info << "Cp= " << t1.cp(1) << " " << t2.cp(1) << " " << (t1+t2).cp(1) << endl; + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/ThermoMixture/thermoDict b/applications/test/ThermoMixture/thermoDict new file mode 100644 index 0000000000..9b439490df --- /dev/null +++ b/applications/test/ThermoMixture/thermoDict @@ -0,0 +1,41 @@ +specie1 +{ + specie + { + nMoles 1; + molWeight 1; + } + + thermodynamics + { + Cp 1; + Hf 0; + } + + transport + { + mu 1; + Pr 1; + } +} + +specie2 +{ + specie + { + nMoles 1; + molWeight 0.5; + } + + thermodynamics + { + Cp 2; + Hf 0; + } + + transport + { + mu 1; + Pr 1; + } +} From b0b9480573372d9d645c75a7ef820189b3da49c6 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 18 Nov 2012 22:47:58 +0000 Subject: [PATCH 06/17] Removed duplicate app --- applications/test/ThermoMixture/Make/files | 4 -- applications/test/ThermoMixture/Make/options | 5 -- .../test/ThermoMixture/ThermoMixture.C | 62 ------------------- applications/test/ThermoMixture/thermoDict | 41 ------------ 4 files changed, 112 deletions(-) delete mode 100644 applications/test/ThermoMixture/Make/files delete mode 100644 applications/test/ThermoMixture/Make/options delete mode 100644 applications/test/ThermoMixture/ThermoMixture.C delete mode 100644 applications/test/ThermoMixture/thermoDict diff --git a/applications/test/ThermoMixture/Make/files b/applications/test/ThermoMixture/Make/files deleted file mode 100644 index 8a122d0e0b..0000000000 --- a/applications/test/ThermoMixture/Make/files +++ /dev/null @@ -1,4 +0,0 @@ - -ThermoMixture.C - -EXE = $(FOAM_APPBIN)/ThermoMixture diff --git a/applications/test/ThermoMixture/Make/options b/applications/test/ThermoMixture/Make/options deleted file mode 100644 index 98bf79aaa4..0000000000 --- a/applications/test/ThermoMixture/Make/options +++ /dev/null @@ -1,5 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude - -EXE_LIBS = \ - -lspecie diff --git a/applications/test/ThermoMixture/ThermoMixture.C b/applications/test/ThermoMixture/ThermoMixture.C deleted file mode 100644 index 14c71e9b01..0000000000 --- a/applications/test/ThermoMixture/ThermoMixture.C +++ /dev/null @@ -1,62 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Application - ThermoMixture - -Description - -\*---------------------------------------------------------------------------*/ - -#include "dictionary.H" -#include "IFstream.H" -#include "constTransport.H" -#include "specieThermo.H" -#include "hConstThermo.H" -#include "perfectGas.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: - -int main(int argc, char *argv[]) -{ - typedef constTransport > > ThermoType; - - IFstream f("thermoDict"); - dictionary dict(f); - - ThermoType t1(dict.subDict("specie1")); - ThermoType t2(dict.subDict("specie2")); - - Info << "W= " << t1.W() << " " << t2.W() << " " << (t1+t2).W() << endl; - Info << "Cp= " << t1.cp(1) << " " << t2.cp(1) << " " << (t1+t2).cp(1) << endl; - - Info<< "\nEnd\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/test/ThermoMixture/thermoDict b/applications/test/ThermoMixture/thermoDict deleted file mode 100644 index 9b439490df..0000000000 --- a/applications/test/ThermoMixture/thermoDict +++ /dev/null @@ -1,41 +0,0 @@ -specie1 -{ - specie - { - nMoles 1; - molWeight 1; - } - - thermodynamics - { - Cp 1; - Hf 0; - } - - transport - { - mu 1; - Pr 1; - } -} - -specie2 -{ - specie - { - nMoles 1; - molWeight 0.5; - } - - thermodynamics - { - Cp 2; - Hf 0; - } - - transport - { - mu 1; - Pr 1; - } -} From 53996d445d69fe8254403335dc1343e0785f13e1 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 18 Nov 2012 22:48:47 +0000 Subject: [PATCH 07/17] waveSurfacePressure/waveSurfacePressureFvPatchScalarField: Removed trailing whitespace --- .../waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C | 2 +- .../waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index 34d04b7d40..59f859386e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -197,7 +197,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::updateCoeffs() scalar c00 = dt*dt/(dt0*(dt + dt0)); scalar c0 = c + c00; - zetap = + zetap = ( c0*zeta.oldTime().boundaryField()[patchI] - c00*zeta.oldTime().oldTime().boundaryField()[patchI] diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H index ad2820dd50..858c6f690c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.H @@ -45,7 +45,7 @@ Description local volumetric flux. \heading Patch usage - + \table Property | Description | Required | Default value phi | flux field name | no | phi From 7888a0d8bba70ec825208e437930b0125603fd8c Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 09:37:41 +0000 Subject: [PATCH 08/17] ENH: Updated comment/description --- .../snappyHexMesh/snappyHexMeshDict | 2 +- .../iglooWithFridges/system/snappyHexMeshDict | 33 +++++++++-------- .../system/snappyHexMeshDict | 27 +++++++------- .../propeller/system/snappyHexMeshDict | 32 ++++++++--------- .../system/snappyHexMeshDict | 33 +++++++++-------- .../motorBike/system/snappyHexMeshDict | 26 +++++++------- .../motorBike/system/snappyHexMeshDict | 36 +++++++++---------- .../turbineSiting/system/snappyHexMeshDict | 26 +++++++------- .../mesh/cvMesh/blob/system/snappyHexMeshDict | 31 ++++++++-------- .../cvMesh/flange/system/snappyHexMeshDict | 31 ++++++++-------- .../flange/system/snappyHexMeshDict | 26 +++++++------- .../wigleyHull/system/snappyHexMeshDict | 26 +++++++------- .../cavitatingBullet/system/snappyHexMeshDict | 28 +++++++-------- 13 files changed, 176 insertions(+), 181 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 050204d8a8..78cdb47ad0 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -337,7 +337,7 @@ addLayersControls // Advanced settings // When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // are perpendicular featureAngle 60; // At non-patched sides allow mesh to slip if extrusion direction makes diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict index 788a479390..bc90ed1c2b 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict @@ -256,35 +256,34 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.5; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. - // See relativeSizes parameter. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. + // See relativeSizes parameter. minThickness 0.25; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 60; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 5; // Number of smoothing iterations of surface normals diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict index 82b6381b1b..072870efc3 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/snappyHexMeshDict @@ -285,31 +285,30 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.3; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. finalLayerThickness 1; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. minThickness 0.1; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 30; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict index 326bafe1d4..d060b73f93 100644 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/snappyHexMeshDict @@ -335,33 +335,33 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the + // thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.3; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. minThickness 0.1; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 30; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict index b4c3ed8f64..fcf64ed65d 100644 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/snappyHexMeshDict @@ -189,34 +189,33 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.3; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.7; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. - // See relativeSizes parameter. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. + // See relativeSizes parameter. minThickness 0.25; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 60; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 5; // Number of smoothing iterations of surface normals diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/snappyHexMeshDict b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/snappyHexMeshDict index 3e9353f452..452adf13de 100644 --- a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/snappyHexMeshDict +++ b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/system/snappyHexMeshDict @@ -204,30 +204,30 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.3; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. minThickness 0.1; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 60; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict index 517ef75b9c..6b36b1ef39 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/motorBike/system/snappyHexMeshDict @@ -227,37 +227,37 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the + // thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.3; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. minThickness 0.1; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 60; - //- At non-patched sides allow mesh to slip if extrusion direction makes - // angle larger than slipFeatureAngle. + // At non-patched sides allow mesh to slip if extrusion direction makes + // angle larger than slipFeatureAngle. slipFeatureAngle 30; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict index 8054858f2a..f294a40e53 100644 --- a/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict +++ b/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict @@ -277,31 +277,31 @@ addLayersControls expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.3; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // See relativeSizes parameter. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // See relativeSizes parameter. minThickness 0.25; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 60; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 5; // Number of smoothing iterations of surface normals diff --git a/tutorials/mesh/cvMesh/blob/system/snappyHexMeshDict b/tutorials/mesh/cvMesh/blob/system/snappyHexMeshDict index da3f1895b4..c5723d829f 100644 --- a/tutorials/mesh/cvMesh/blob/system/snappyHexMeshDict +++ b/tutorials/mesh/cvMesh/blob/system/snappyHexMeshDict @@ -216,33 +216,32 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.5; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.02; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. minThickness 0.005; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 90; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals diff --git a/tutorials/mesh/cvMesh/flange/system/snappyHexMeshDict b/tutorials/mesh/cvMesh/flange/system/snappyHexMeshDict index 9da7fabcaf..12c88b16c4 100644 --- a/tutorials/mesh/cvMesh/flange/system/snappyHexMeshDict +++ b/tutorials/mesh/cvMesh/flange/system/snappyHexMeshDict @@ -216,33 +216,32 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.5; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.0003; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. minThickness 0.0001; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 90; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals diff --git a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict index a1c0e1162f..0e68672906 100644 --- a/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/flange/system/snappyHexMeshDict @@ -214,30 +214,30 @@ addLayersControls expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.3; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // See relativeSizes parameter. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // See relativeSizes parameter. minThickness 0.25; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 30; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 5; // Number of smoothing iterations of surface normals diff --git a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict index 01badbd1ec..dbb112f074 100644 --- a/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict +++ b/tutorials/multiphase/LTSInterFoam/wigleyHull/system/snappyHexMeshDict @@ -228,31 +228,31 @@ addLayersControls expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the thickness of the layer furthest away from the wall. - // See relativeSizes parameter. + // Wanted thickness of final added cell layer. If multiple layers + // is the thickness of the layer furthest away from the wall. + // See relativeSizes parameter. finalLayerThickness 0.3; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // See relativeSizes parameter. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // See relativeSizes parameter. minThickness 0.25; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 60; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 5; // Number of smoothing iterations of surface normals diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict index 5150850030..48e88d648b 100644 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/snappyHexMeshDict @@ -210,32 +210,32 @@ addLayersControls // Expansion factor for layer mesh expansionRatio 1.0; - //- Wanted thickness of final added cell layer. If multiple layers - // is the - // thickness of the layer furthest away from the wall. - // Relative to undistorted size of cell outside layer. + // Wanted thickness of final added cell layer. If multiple layers + // is the + // thickness of the layer furthest away from the wall. + // Relative to undistorted size of cell outside layer. finalLayerThickness 0.3; - //- Minimum thickness of cell layer. If for any reason layer - // cannot be above minThickness do not add layer. - // Relative to undistorted size of cell outside layer. + // Minimum thickness of cell layer. If for any reason layer + // cannot be above minThickness do not add layer. + // Relative to undistorted size of cell outside layer. minThickness 0.1; - //- If points get not extruded do nGrow layers of connected faces that are - // also not grown. This helps convergence of the layer addition process - // close to features. + // If points get not extruded do nGrow layers of connected faces that are + // also not grown. This helps convergence of the layer addition process + // close to features. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x) nGrow 0; // Advanced settings - //- When not to extrude surface. 0 is flat surface, 90 is when two faces - // make straight angle. + // When not to extrude surface. 0 is flat surface, 90 is when two faces + // are perpendicular featureAngle 30; - //- Maximum number of snapping relaxation iterations. Should stop - // before upon reaching a correct mesh. + // Maximum number of snapping relaxation iterations. Should stop + // before upon reaching a correct mesh. nRelaxIter 3; // Number of smoothing iterations of surface normals From 83f311c628a2be0ef0ae74e52f1137e2d6ea0d41 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 09:54:14 +0000 Subject: [PATCH 09/17] ENH: Removed hard-coded film coupling from pyrolysis models --- .../pyrolysisModel/pyrolysisModel.C | 80 ++----------------- .../pyrolysisModel/pyrolysisModel.H | 28 ++----- 2 files changed, 10 insertions(+), 98 deletions(-) diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C index b64afa0be6..cfa52c3e80 100644 --- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C +++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,61 +42,11 @@ defineTypeNameAndDebug(pyrolysisModel, 0); defineRunTimeSelectionTable(pyrolysisModel, mesh); defineRunTimeSelectionTable(pyrolysisModel, dictionary); -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - -void pyrolysisModel::constructMeshObjects() -{ - // construct filmDelta field if coupled to film model - if (filmCoupled_) - { - filmDeltaPtr_.reset - ( - new volScalarField - ( - IOobject - ( - "filmDelta", - time_.timeName(), - regionMesh(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - regionMesh() - ) - ); - - const volScalarField& filmDelta = filmDeltaPtr_(); - - bool foundCoupledPatch = false; - forAll(filmDelta.boundaryField(), patchI) - { - const fvPatchField& fvp = filmDelta.boundaryField()[patchI]; - if (isA >(fvp)) - { - foundCoupledPatch = true; - break; - } - } - - if (!foundCoupledPatch) - { - WarningIn("void pyrolysisModels::constructMeshObjects()") - << "filmCoupled flag set to true, but no " - << mappedFieldFvPatchField::typeName - << " patches found on " << filmDelta.name() << " field" - << endl; - } - } -} - - // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // void pyrolysisModel::readPyrolysisControls() { - filmCoupled_ = readBool(coeffs_.lookup("filmCoupled")); - reactionDeltaMin_ = - coeffs_.lookupOrDefault("reactionDeltaMin", 0.0); + // do nothing } @@ -132,24 +82,17 @@ bool pyrolysisModel::read(const dictionary& dict) pyrolysisModel::pyrolysisModel(const fvMesh& mesh) : - regionModel1D(mesh), - filmCoupled_(false), - filmDeltaPtr_(NULL), - reactionDeltaMin_(0.0) + regionModel1D(mesh) {} pyrolysisModel::pyrolysisModel(const word& modelType, const fvMesh& mesh) : - regionModel1D(mesh, "pyrolysis", modelType), - filmCoupled_(false), - filmDeltaPtr_(NULL), - reactionDeltaMin_(0.0) + regionModel1D(mesh, "pyrolysis", modelType) { if (active_) { read(); - constructMeshObjects(); } } @@ -161,15 +104,11 @@ pyrolysisModel::pyrolysisModel const dictionary& dict ) : - regionModel1D(mesh, "pyrolysis", modelType, dict), - filmCoupled_(false), - filmDeltaPtr_(NULL), - reactionDeltaMin_(0.0) + regionModel1D(mesh, "pyrolysis", modelType, dict) { if (active_) { read(dict); - constructMeshObjects(); } } @@ -192,15 +131,6 @@ scalar pyrolysisModel::addMassSources } -void pyrolysisModel::preEvolveRegion() -{ - if (filmCoupled_) - { - filmDeltaPtr_->correctBoundaryConditions(); - } -} - - scalar pyrolysisModel::solidRegionDiffNo() const { return -GREAT; diff --git a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H index 57d8caa3c4..98da338d9a 100644 --- a/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H +++ b/src/regionModels/pyrolysisModels/pyrolysisModel/pyrolysisModel.H @@ -80,18 +80,6 @@ private: protected: - // Protected Data - - //- Flag to indicate whether pyrolysis region coupled to a film region - bool filmCoupled_; - - //- Pointer to film thickness field - autoPtr filmDeltaPtr_; - - //- Film height below which reactions can occur [m] - scalar reactionDeltaMin_; - - // Protected Member Functions //- Read control parameters @@ -115,8 +103,8 @@ public: pyrolysisModel, mesh, ( - const word& modelType, - const fvMesh& mesh + const word& modelType, + const fvMesh& mesh ), (modelType, mesh) ); @@ -127,9 +115,9 @@ public: pyrolysisModel, dictionary, ( - const word& modelType, - const fvMesh& mesh, - const dictionary& dict + const word& modelType, + const fvMesh& mesh, + const dictionary& dict ), (modelType, mesh, dict) ); @@ -234,12 +222,6 @@ public: ); - // Evolution - - //- Pre-evolve region - virtual void preEvolveRegion(); - - // Helper function //- Mean diffusion number of the solid region From 640d8157c8ee15069571a18230d8102670659a99 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 09:55:44 +0000 Subject: [PATCH 10/17] ENH: Pyrolysis tutorials updates --- .../fireFoam/les/oppositeBurningPanels/constant/pyrolysisZones | 2 -- .../fireFoam/les/smallPoolFire2D/constant/pyrolysisZones | 2 -- .../fireFoam/les/smallPoolFire3D/constant/pyrolysisZones | 2 -- 3 files changed, 6 deletions(-) diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/pyrolysisZones b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/pyrolysisZones index 1895f851df..cef16b64a5 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/pyrolysisZones +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/constant/pyrolysisZones @@ -27,8 +27,6 @@ FoamFile reactingOneDimCoeffs { - filmCoupled false; - radFluxName Qr; minimumDelta 1e-12; diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisZones b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisZones index 65436e1e8d..d5ebc6e44e 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisZones +++ b/tutorials/combustion/fireFoam/les/smallPoolFire2D/constant/pyrolysisZones @@ -28,8 +28,6 @@ FoamFile reactingOneDimCoeffs { - filmCoupled false; - radFluxName Qr; minimumDelta 1e-8; diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisZones b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisZones index 65436e1e8d..d5ebc6e44e 100644 --- a/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisZones +++ b/tutorials/combustion/fireFoam/les/smallPoolFire3D/constant/pyrolysisZones @@ -28,8 +28,6 @@ FoamFile reactingOneDimCoeffs { - filmCoupled false; - radFluxName Qr; minimumDelta 1e-8; From 9902cf49330c222846915776f0feee21ba9bd8fb Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 10:12:44 +0000 Subject: [PATCH 11/17] ENH: Updated fixedTemperature to use DataEntry functionality --- .../fixedTemperatureSource.C | 31 +++++++++++++------ .../fixedTemperatureSource.H | 16 ++++++---- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C index 34db0a7e3e..26dff507d3 100644 --- a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C +++ b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.C @@ -45,7 +45,7 @@ namespace Foam template<> const char* NamedEnum::names[] = { - "constant", + "uniform", "lookup" }; } @@ -66,14 +66,17 @@ Foam::fixedTemperatureSource::fixedTemperatureSource : basicSource(name, modelType, dict, mesh), mode_(temperatureModeNames_.read(coeffs_.lookup("mode"))), - Tconstant_(0.0), + Tuniform_(NULL), TName_("T") { switch (mode_) { - case tmConstant: + case tmUniform: { - coeffs_.lookup("temperature") >> Tconstant_; + Tuniform_.reset + ( + DataEntry::New("temperature", coeffs_).ptr() + ); break; } case tmLookup: @@ -114,10 +117,11 @@ void Foam::fixedTemperatureSource::setValue { switch (mode_) { - case tmConstant: + case tmUniform: { - scalarField Tconst(cells_.size(), Tconstant_); - eqn.setValues(cells_, thermo.he(thermo.p(), Tconst, cells_)); + const scalar t = mesh_.time().value(); + scalarField Tuni(cells_.size(), Tuniform_->value(t)); + eqn.setValues(cells_, thermo.he(thermo.p(), Tuni, cells_)); break; } @@ -126,8 +130,8 @@ void Foam::fixedTemperatureSource::setValue const volScalarField& T = mesh().lookupObject(TName_); - scalarField Tlookup(T, cells_); - eqn.setValues(cells_, thermo.he(thermo.p(), Tlookup, cells_)); + scalarField Tlkp(T, cells_); + eqn.setValues(cells_, thermo.he(thermo.p(), Tlkp, cells_)); break; } @@ -152,7 +156,14 @@ bool Foam::fixedTemperatureSource::read(const dictionary& dict) { if (basicSource::read(dict)) { - coeffs_.readIfPresent("temperature", Tconstant_); + if (coeffs_.found(Tuniform_->name())) + { + Tuniform_.reset + ( + DataEntry::New(Tuniform_->name(), dict).ptr() + ); + } + coeffs_.readIfPresent("TName", TName_); return true; diff --git a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H index 3aefdb5645..7552934038 100644 --- a/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H +++ b/src/fieldSources/derived/fixedTemperatureSource/fixedTemperatureSource.H @@ -33,15 +33,18 @@ Description fixedTemperatureSourceCoeffs { fieldNames (h e hs); // names of fields to apply source - mode constant; // constant or lookup + mode uniform; // constant or lookup - // constant option - temperature 500; // fixed temperature [K] + // uniform option + temperature constant 500; // fixed temperature [K] // loolup option // TName T; // optional temperature field name } +Note: + The 'uniform' option allows the use of a time-varying uniform temperature + by means of the DataEntry type. SourceFiles basicSource.C @@ -53,6 +56,7 @@ SourceFiles #include "basicSource.H" #include "NamedEnum.H" +#include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,7 +77,7 @@ public: //- Temperature mode enum temperatureMode { - tmConstant, + tmUniform, tmLookup }; @@ -89,8 +93,8 @@ protected: //- Operation mode temperatureMode mode_; - //- Constant temperature [K] - scalar Tconstant_; + //- Uniform temperature [K] + autoPtr > Tuniform_; //- Temperature field name word TName_; From ed2860f1ecffb6166b20dab203979a326aa469af Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 14:45:28 +0000 Subject: [PATCH 12/17] ENH: Updated GeometricField creation from io and mesh via dictionary --- .../GeometricField/GeometricBoundaryField.C | 268 ++++++++++-------- .../GeometricField/GeometricField.C | 80 ++---- .../GeometricField/GeometricField.H | 16 +- 3 files changed, 187 insertions(+), 177 deletions(-) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index 20d15fbe81..c1b516e97c 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -28,8 +28,151 @@ License #include "globalMeshData.H" #include "cyclicPolyPatch.H" +template class PatchField, class GeoMesh> +void Foam::GeometricField::GeometricBoundaryField:: +readField +( + const DimensionedField& field, + const dictionary& dict +) +{ + this->setSize(bmesh_.size()); + + if (debug) + { + Info<< "GeometricField::" + "GeometricBoundaryField::readField" + "(" + "const DimensionedField&, " + "const dictionary&" + ")" + << endl; + } + + // Patch or patch-groups. (using non-wild card entries of dictionaries) + forAllConstIter(dictionary, dict, iter) + { + if (iter().isDict() && !iter().keyword().isPattern()) + { + const labelList patchIDs = bmesh_.findIndices + ( + iter().keyword(), + true + ); + + forAll(patchIDs, i) + { + label patchi = patchIDs[i]; + + this->set + ( + patchi, + PatchField::New + ( + bmesh_[patchi], + field, + iter().dict() + ) + ); + } + } + } + + // Check for wildcard patch overrides + forAll(bmesh_, patchi) + { + if (!this->set(patchi)) + { + if (bmesh_[patchi].type() == emptyPolyPatch::typeName) + { + this->set + ( + patchi, + PatchField::New + ( + emptyPolyPatch::typeName, + bmesh_[patchi], + field + ) + ); + } + else + { + bool found = dict.found(bmesh_[patchi].name()); + + if (found) + { + this->set + ( + patchi, + PatchField::New + ( + bmesh_[patchi], + field, + dict.subDict(bmesh_[patchi].name()) + ) + ); + } + } + } + } + + + // Check for any unset patches + forAll(bmesh_, patchi) + { + if (!this->set(patchi)) + { + if (bmesh_[patchi].type() == cyclicPolyPatch::typeName) + { + FatalIOErrorIn + ( + "GeometricField::" + "GeometricBoundaryField::readField" + "(" + "const DimensionedField&, " + "const dictionary&" + ")", + dict + ) << "Cannot find patchField entry for cyclic " + << bmesh_[patchi].name() << endl + << "Is your field uptodate with split cyclics?" << endl + << "Run foamUpgradeCyclics to convert mesh and fields" + << " to split cyclics." << exit(FatalIOError); + } + else + { + FatalIOErrorIn + ( + "GeometricField::" + "GeometricBoundaryField::readField" + "(" + "const DimensionedField&, " + "const dictionary&" + ")", + dict + ) << "Cannot find patchField entry for " + << bmesh_[patchi].name() << exit(FatalIOError); + } + } + } +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template class PatchField, class GeoMesh> +Foam::GeometricField::GeometricBoundaryField:: +GeometricBoundaryField +( + const BoundaryMesh& bmesh +) +: + FieldField(bmesh.size()), + bmesh_(bmesh) +{} + + template class PatchField, class GeoMesh> Foam::GeometricField::GeometricBoundaryField:: GeometricBoundaryField @@ -260,130 +403,7 @@ GeometricBoundaryField FieldField(bmesh.size()), bmesh_(bmesh) { - if (debug) - { - Info<< "GeometricField::" - "GeometricBoundaryField::" - "GeometricBoundaryField" - "(" - "const BoundaryMesh&, " - "const DimensionedField&, " - "const dictionary&" - ")" - << endl; - } - - - // Patch or patch-groups. (using non-wild card entries of dictionaries) - forAllConstIter(dictionary, dict, iter) - { - if (iter().isDict() && !iter().keyword().isPattern()) - { - const labelList patchIDs = bmesh_.findIndices - ( - iter().keyword(), - true - ); - - forAll(patchIDs, i) - { - label patchi = patchIDs[i]; - this->set - ( - patchi, - PatchField::New - ( - bmesh_[patchi], - field, - iter().dict() - ) - ); - } - } - } - - // Check for wildcard patch overrides - forAll(bmesh_, patchi) - { - if (!this->set(patchi)) - { - if (bmesh_[patchi].type() == emptyPolyPatch::typeName) - { - this->set - ( - patchi, - PatchField::New - ( - emptyPolyPatch::typeName, - bmesh_[patchi], - field - ) - ); - } - else - { - bool found = dict.found(bmesh_[patchi].name()); - - if (found) - { - this->set - ( - patchi, - PatchField::New - ( - bmesh_[patchi], - field, - dict.subDict(bmesh_[patchi].name()) - ) - ); - } - } - } - } - - - // Check for any unset patches - forAll(bmesh_, patchi) - { - if (!this->set(patchi)) - { - if (bmesh_[patchi].type() == cyclicPolyPatch::typeName) - { - FatalIOErrorIn - ( - "GeometricField::" - "GeometricBoundaryField::" - "GeometricBoundaryField" - "(" - "const BoundaryMesh&, " - "const DimensionedField&, " - "const dictionary&" - ")", - dict - ) << "Cannot find patchField entry for cyclic " - << bmesh_[patchi].name() << endl - << "Is your field uptodate with split cyclics?" << endl - << "Run foamUpgradeCyclics to convert mesh and fields" - << " to split cyclics." << exit(FatalIOError); - } - else - { - FatalIOErrorIn - ( - "GeometricField::" - "GeometricBoundaryField::" - "GeometricBoundaryField" - "(" - "const BoundaryMesh&, " - "const DimensionedField&, " - "const dictionary&" - ")", - dict - ) << "Cannot find patchField entry for " - << bmesh_[patchi].name() << exit(FatalIOError); - } - } - } + readField(field, dict); } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index 8898b162f4..2b82169561 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,70 +47,49 @@ if ((gf1).mesh() != (gf2).mesh()) \ // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // template class PatchField, class GeoMesh> -Foam::tmp -< - typename Foam::GeometricField:: - GeometricBoundaryField -> -Foam::GeometricField::readField +void Foam::GeometricField::readFields ( - const dictionary& fieldDict + const dictionary& dict ) { - DimensionedField::readField(fieldDict, "internalField"); + DimensionedField::readField(dict, "internalField"); - tmp tboundaryField - ( - new GeometricBoundaryField - ( - this->mesh().boundary(), - *this, - fieldDict.subDict("boundaryField") - ) - ); + boundaryField_.readField(*this, dict.subDict("boundaryField")); - if (fieldDict.found("referenceLevel")) + if (dict.found("referenceLevel")) { - Type fieldAverage(pTraits(fieldDict.lookup("referenceLevel"))); + Type fieldAverage(pTraits(dict.lookup("referenceLevel"))); Field::operator+=(fieldAverage); - GeometricBoundaryField& boundaryField = tboundaryField(); - - forAll(boundaryField, patchi) + forAll(boundaryField_, patchi) { - boundaryField[patchi] == boundaryField[patchi] + fieldAverage; + boundaryField_[patchi] == boundaryField_[patchi] + fieldAverage; } } - - return tboundaryField; } template class PatchField, class GeoMesh> -Foam::tmp -< - typename Foam::GeometricField:: - GeometricBoundaryField -> -Foam::GeometricField::readField(Istream& is) +void Foam::GeometricField::readFields() { - return readField + const IOdictionary dict ( - IOdictionary + IOobject ( - IOobject - ( - this->name(), - this->time().timeName(), - this->db(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - is - ) + this->name(), + this->time().timeName(), + this->db(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + this->readStream(typeName) ); + + this->close(); + + readFields(dict); } @@ -132,8 +111,7 @@ bool Foam::GeometricField::readIfPresent() } else if (this->readOpt() == IOobject::READ_IF_PRESENT && this->headerOk()) { - boundaryField_.transfer(readField(this->readStream(typeName))()); - this->close(); + readFields(); // Check compatibility between field and mesh if (this->size() != GeoMesh::size(this->mesh())) @@ -360,9 +338,9 @@ Foam::GeometricField::GeometricField timeIndex_(this->time().timeIndex()), field0Ptr_(NULL), fieldPrevIterPtr_(NULL), - boundaryField_(*this, readField(this->readStream(typeName))) + boundaryField_(mesh.boundary()) { - this->close(); + readFields(); // Check compatibility between field and mesh @@ -401,8 +379,10 @@ Foam::GeometricField::GeometricField timeIndex_(this->time().timeIndex()), field0Ptr_(NULL), fieldPrevIterPtr_(NULL), - boundaryField_(*this, readField(dict)) + boundaryField_(mesh.boundary()) { + readFields(dict); + // Check compatibility between field and mesh if (this->size() != GeoMesh::size(this->mesh())) diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index 5aef9e0fb8..ba510d77e8 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H @@ -117,6 +117,9 @@ public: // Constructors + //- Construct from a BoundaryMesh + GeometricBoundaryField(const BoundaryMesh&); + //- Construct from a BoundaryMesh, // reference to the internal field // and a patch type @@ -177,6 +180,13 @@ public: // Member functions + //- Read the boundary field + void readField + ( + const DimensionedField& field, + const dictionary& dict + ); + //- Update the boundary condition coefficients void updateCoeffs(); @@ -247,10 +257,10 @@ private: // Private Member Functions //- Read the field from the dictionary - tmp readField(const dictionary&); + void readFields(const dictionary&); - //- Read the field from the given stream - tmp readField(Istream& is); + //- Read the field - create the field dictionary on-the-fly + void readFields(); public: From 2c8acfb455f889ba401d115df6536a8a50fe1c7a Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 14:46:11 +0000 Subject: [PATCH 13/17] ENH: Tutorial updates re: temperature constraint --- .../angledDuctExplicitFixedCoeff/constant/sourcesProperties | 2 +- .../angledDuctImplicit/constant/sourcesProperties | 2 +- .../simplifiedSiwek/constant/sourcesProperties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicitFixedCoeff/constant/sourcesProperties b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicitFixedCoeff/constant/sourcesProperties index 404024507d..ddd2bf9c9f 100644 --- a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicitFixedCoeff/constant/sourcesProperties +++ b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctExplicitFixedCoeff/constant/sourcesProperties @@ -26,7 +26,7 @@ source1 fixedTemperatureSourceCoeffs { - mode constant; + mode uniform; temperature 350; } } diff --git a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/sourcesProperties b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/sourcesProperties index 404024507d..ddd2bf9c9f 100644 --- a/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/sourcesProperties +++ b/tutorials/compressible/rhoPorousMRFSimpleFoam/angledDuctImplicit/constant/sourcesProperties @@ -26,7 +26,7 @@ source1 fixedTemperatureSourceCoeffs { - mode constant; + mode uniform; temperature 350; } } diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/sourcesProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/sourcesProperties index f3eac3d8de..d351c7f360 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/sourcesProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/sourcesProperties @@ -26,7 +26,7 @@ source1 fixedTemperatureSourceCoeffs { - mode constant; + mode uniform; temperature 2000; } } From 69e76367a1bfe7ac0072fe4fe498e48569f40ec8 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 15:09:36 +0000 Subject: [PATCH 14/17] BUG: Was holding a reference to a tmp --- ...tUSpaldingWallFunctionFvPatchScalarField.C | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index 2d55b5ed79..dd33fec1f4 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -42,15 +42,15 @@ namespace RASModels tmp nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const { - const label patchi = patch().index(); + const label patchI = patch().index(); const turbulenceModel& turbModel = db().lookupObject("turbulenceModel"); - const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; const scalarField magGradU(mag(Uw.snGrad())); const tmp tnu = turbModel.nu(); const volScalarField& nu = tnu(); - const scalarField& nuw = nu.boundaryField()[patchi]; + const scalarField& nuw = nu.boundaryField()[patchI]; return max ( @@ -65,23 +65,27 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau const scalarField& magGradU ) const { + const label patchI = patch().index(); + const turbulenceModel& turbModel = db().lookupObject("turbulenceModel"); - const scalarField& y = turbModel.y()[patch().index()]; + const scalarField& y = turbModel.y()[patchI]; - const fvPatchVectorField& Uw = - turbModel.U().boundaryField()[patch().index()]; + const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchI]; const scalarField magUp(mag(Uw.patchInternalField() - Uw)); - const scalarField& nuw = turbModel.nu()().boundaryField()[patch().index()]; + const tmp tnu = turbModel.nu(); + const volScalarField& nu = tnu(); + const scalarField& nuw = nu.boundaryField()[patchI]; + const scalarField& nutw = *this; tmp tuTau(new scalarField(patch().size(), 0.0)); scalarField& uTau = tuTau(); - forAll(uTau, facei) + forAll(uTau, faceI) { - scalar ut = sqrt((nutw[facei] + nuw[facei])*magGradU[facei]); + scalar ut = sqrt((nutw[faceI] + nuw[faceI])*magGradU[faceI]); if (ut > ROOTVSMALL) { @@ -90,17 +94,17 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau do { - scalar kUu = min(kappa_*magUp[facei]/ut, 50); + scalar kUu = min(kappa_*magUp[faceI]/ut, 50); scalar fkUu = exp(kUu) - 1 - kUu*(1 + 0.5*kUu); scalar f = - - ut*y[facei]/nuw[facei] - + magUp[facei]/ut + - ut*y[faceI]/nuw[faceI] + + magUp[faceI]/ut + 1/E_*(fkUu - 1.0/6.0*kUu*sqr(kUu)); scalar df = - y[facei]/nuw[facei] - + magUp[facei]/sqr(ut) + y[faceI]/nuw[faceI] + + magUp[faceI]/sqr(ut) + 1/E_*kUu*fkUu/ut; scalar uTauNew = ut + f/df; @@ -109,7 +113,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau } while (ut > ROOTVSMALL && err > 0.01 && ++iter < 10); - uTau[facei] = max(0.0, ut); + uTau[faceI] = max(0.0, ut); } } From 98a0ae49b043d97bd5ba282f391dda93ae761a38 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 16:19:05 +0000 Subject: [PATCH 15/17] ENH: Jump conditions - only store jump on owner-side --- .../derived/fixedJump/fixedJumpFvPatchField.C | 14 ++++++++++++-- .../fixedJumpAMI/fixedJumpAMIFvPatchField.C | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index f3a7615b4a..c9d6e367cc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -62,8 +62,13 @@ Foam::fixedJumpFvPatchField::fixedJumpFvPatchField ) : jumpCyclicFvPatchField(p, iF), - jump_("jump", dict, p.size()) + jump_(p.size(), pTraits::zero) { + if (this->cyclicPatch().owner()) + { + jump_ = Field("jump", dict, p.size()); + } + if (dict.found("value")) { fvPatchField::operator= @@ -152,7 +157,12 @@ void Foam::fixedJumpFvPatchField::write(Ostream& os) const fvPatchField::write(os); os.writeKeyword("patchType") << this->interfaceFieldType() << token::END_STATEMENT << nl; - jump_.writeEntry("jump", os); + + if (this->cyclicPatch().owner()) + { + jump_.writeEntry("jump", os); + } + this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C index ad6fb925ae..cc9717ffac 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -62,8 +62,13 @@ Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField ) : jumpCyclicAMIFvPatchField(p, iF), - jump_("jump", dict, p.size()) + jump_(p.size(), pTraits::zero) { + if (this->cyclicAMIPatch().owner()) + { + jump_ = Field("jump", dict, p.size()); + } + if (dict.found("value")) { fvPatchField::operator= @@ -155,7 +160,12 @@ void Foam::fixedJumpAMIFvPatchField::write(Ostream& os) const fvPatchField::write(os); os.writeKeyword("patchType") << this->interfaceFieldType() << token::END_STATEMENT << nl; - jump_.writeEntry("jump", os); + + if (this->cyclicAMIPatch().owner()) + { + jump_.writeEntry("jump", os); + } + this->writeEntry("value", os); } From 1c405b1ff11cf59feb9c4e79d01da860d8204f8e Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 17:48:27 +0000 Subject: [PATCH 16/17] BUG: waveSurfacePressure BC - incorrect writing of density field name --- .../waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C index 59f859386e..9451e4bc26 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C @@ -239,7 +239,7 @@ void Foam::waveSurfacePressureFvPatchScalarField::write(Ostream& os) const fvPatchScalarField::write(os); writeEntryIfDifferent(os, "phi", "phi", phiName_); writeEntryIfDifferent(os, "zeta", "zeta", zetaName_); - writeEntryIfDifferent(os, "rho", "rho", zetaName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); writeEntry("value", os); } From ec5c3c448d85f75843ec458f41686f78802c988f Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 19 Nov 2012 17:56:38 +0000 Subject: [PATCH 17/17] ENH: pressureInletOutletParSlipVelocity - added run-time selection of velocty field name --- ...tOutletParSlipVelocityFvPatchVectorField.C | 24 ++++++++++++------- ...tOutletParSlipVelocityFvPatchVectorField.H | 6 +++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C index 2d0c3d4735..9ce17a2025 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,8 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(p, iF), phiName_("phi"), - rhoName_("rho") + rhoName_("rho"), + UName_("U") { refValue() = *this; refGrad() = vector::zero; @@ -60,7 +61,8 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(ptf, p, iF, mapper), phiName_(ptf.phiName_), - rhoName_(ptf.rhoName_) + rhoName_(ptf.rhoName_), + UName_(ptf.UName_) {} @@ -74,7 +76,8 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(p, iF), phiName_(dict.lookupOrDefault("phi", "phi")), - rhoName_(dict.lookupOrDefault("rho", "rho")) + rhoName_(dict.lookupOrDefault("rho", "rho")), + UName_(dict.lookupOrDefault("U", "U")) { fvPatchVectorField::operator=(vectorField("value", dict, p.size())); refValue() = *this; @@ -91,7 +94,8 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(pivpvf), phiName_(pivpvf.phiName_), - rhoName_(pivpvf.rhoName_) + rhoName_(pivpvf.rhoName_), + UName_(pivpvf.UName_) {} @@ -104,7 +108,8 @@ pressureInletOutletParSlipVelocityFvPatchVectorField : mixedFvPatchVectorField(pivpvf, iF), phiName_(pivpvf.phiName_), - rhoName_(pivpvf.rhoName_) + rhoName_(pivpvf.rhoName_), + UName_(pivpvf.UName_) {} @@ -128,7 +133,7 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::updateCoeffs() tmp n = patch().nf(); const Field& magS = patch().magSf(); - const volVectorField& U = db().lookupObject("U"); + const volVectorField& U = db().lookupObject(UName_); vectorField Uc(U.boundaryField()[patchI].patchInternalField()); Uc -= n()*(Uc & n()); @@ -169,8 +174,9 @@ void Foam::pressureInletOutletParSlipVelocityFvPatchVectorField::write ) const { fvPatchVectorField::write(os); - os.writeKeyword("phi") << phiName_ << token::END_STATEMENT << nl; - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; + writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "U", "U", UName_); writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H index f1f2f3a9d3..5a485362d5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.H @@ -41,6 +41,7 @@ Description Property | Description | Required | Default value phi | flux field name | no | phi rho | density field name | no | rho + U | velocity field name | no | U \endtable Example of the boundary condition specification: @@ -48,8 +49,6 @@ Description myPatch { type pressureInletOutletParSlipVelocity; - phi phi; - rho rho; value uniform 0; } \endverbatim @@ -96,6 +95,9 @@ class pressureInletOutletParSlipVelocityFvPatchVectorField //- Density field name word rhoName_; + //- Velocity field name + word UName_; + public: