From 9b9c336ed8965bfec6bbcc21f60f928f68d2fdfd Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 09:01:38 +0000 Subject: [PATCH 01/23] BUG: Corrected spellig mistake for input property --- .../general/porosityModel/porosityModel/porosityModel.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 6266e5bb49..77de5b1ffe 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -87,7 +87,7 @@ Foam::porosityModel::porosityModel { if (zoneName_ == word::null) { - dict.lookup("actuve") >> active_; + dict.lookup("active") >> active_; dict_.lookup("cellZone") >> zoneName_; } From aefbb0558286ad242bf7b574b9d4769e2c9a6e02 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 09:26:35 +0000 Subject: [PATCH 02/23] ENH: Updated mu->thermo:mu --- .../general/porosityModel/DarcyForchheimer/DarcyForchheimer.C | 2 +- .../kinematicSingleLayer/kinematicSingleLayer.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C index 4860c4849b..b0857fa78e 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C @@ -56,7 +56,7 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer D_("D", dimless/sqr(dimLength), tensor::zero), F_("F", dimless/dimLength, tensor::zero), rhoName_(coeffs_.lookupOrDefault("rho", "rho")), - muName_(coeffs_.lookupOrDefault("mu", "mu")), + muName_(coeffs_.lookupOrDefault("mu", "thermo:mu")), nuName_(coeffs_.lookupOrDefault("nu", "nu")) { // local-to-global transformation tensor diff --git a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C index 9d053dc3de..d0a12c305c 100644 --- a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C @@ -765,7 +765,7 @@ kinematicSingleLayer::kinematicSingleLayer ( IOobject ( - "mu", // must have same name as mu to enable mapping + "thermo:mu", // must have same name as mu to enable mapping time().timeName(), regionMesh(), IOobject::NO_READ, From da6bec31523a3f3512bb4d008bb03b73a41c1945 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 09:27:07 +0000 Subject: [PATCH 03/23] ENH: Tutorial updates --- .../fireFoam/les/oppositeBurningPanels/system/fvSchemes | 2 +- .../les/oppositeBurningPanels/system/panelRegion/fvSchemes | 2 +- .../verticalChannel/constant/reactingCloud1Properties | 2 +- .../simplifiedSiwek/constant/coalCloud1Properties | 2 +- .../simplifiedSiwek/constant/limestoneCloud1Properties | 2 +- .../cylinder/constant/reactingCloud1Properties | 2 +- .../hotBoxes/constant/reactingCloud1Properties | 2 +- .../splashPanel/constant/reactingCloud1Properties | 2 +- .../reactingParcelFoam/filter/constant/reactingCloud1Properties | 2 +- .../parcelInBox/constant/reactingCloud1Properties | 2 +- .../verticalChannel/constant/reactingCloud1Properties | 2 +- .../sprayFoam/aachenBomb/constant/sprayCloudProperties | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes index e683569e7a..ce5f53c2cf 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/fvSchemes @@ -50,7 +50,7 @@ laplacianSchemes default Gauss linear corrected; laplacian(muEff,U) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; - laplacian(alphaEff,h) Gauss linear corrected; + laplacian(thermo:alpha,h) Gauss linear corrected; laplacian((((rho*(1|A(U)))*rho)*gh)) Gauss linear corrected; laplacian(interpolate((rho*(1|A(U)))),p) Gauss linear corrected; laplacian(gammaRad,G) Gauss linear corrected; diff --git a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes index ba8fe34509..afb9f402f1 100644 --- a/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes +++ b/tutorials/combustion/fireFoam/les/oppositeBurningPanels/system/panelRegion/fvSchemes @@ -32,7 +32,7 @@ divSchemes laplacianSchemes { default none; - laplacian(alpha,h) Gauss linear uncorrected; + laplacian(thermo:alpha,h) Gauss linear uncorrected; } interpolationSchemes diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties index 5c93f36555..aa8b02241a 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/reactingCloud1Properties @@ -44,7 +44,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index fc5042f2c1..bc122d0a37 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index 29cfd8d563..0517933f4d 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -35,7 +35,7 @@ solution interpolationSchemes { rho cell; - mu cell; + thermo:mu cell; U cellPoint; Cp cell; T cell; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties index 875e31a59c..68e6be961f 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/constant/reactingCloud1Properties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties index 78f4e7bb5d..a4d326c041 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/constant/reactingCloud1Properties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties index 6704aad914..42ddef8235 100644 --- a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/constant/reactingCloud1Properties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/filter/constant/reactingCloud1Properties index 613b407de1..cb6c2dd3be 100644 --- a/tutorials/lagrangian/reactingParcelFoam/filter/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/filter/constant/reactingCloud1Properties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/reactingParcelFoam/parcelInBox/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/parcelInBox/constant/reactingCloud1Properties index 10bb7ccc33..56b0a2d3e7 100644 --- a/tutorials/lagrangian/reactingParcelFoam/parcelInBox/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/parcelInBox/constant/reactingCloud1Properties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/constant/reactingCloud1Properties index aac578722d..b4d1d9abdf 100644 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/constant/reactingCloud1Properties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties index 153a5fc0b2..0ce1e3bbc8 100644 --- a/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties +++ b/tutorials/lagrangian/sprayFoam/aachenBomb/constant/sprayCloudProperties @@ -38,7 +38,7 @@ solution { rho cell; U cellPoint; - mu cell; + thermo:mu cell; T cell; Cp cell; p cell; From 70d61bfe09610713a4705280f76f35b01eac1dbb Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 09:50:36 +0000 Subject: [PATCH 04/23] ENH: Updated Allwmake scripts --- applications/solvers/compressible/rhoPimpleFoam/Allwmake | 3 +-- applications/solvers/incompressible/simpleFoam/Allwmake | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/applications/solvers/compressible/rhoPimpleFoam/Allwmake b/applications/solvers/compressible/rhoPimpleFoam/Allwmake index f6f8ad3635..ac06b7350a 100755 --- a/applications/solvers/compressible/rhoPimpleFoam/Allwmake +++ b/applications/solvers/compressible/rhoPimpleFoam/Allwmake @@ -4,7 +4,6 @@ set -x wmake wmake rhoPimplecFoam -wmake rhoPorousMRFPimpleFoam -wmake rhoPorousMRFLTSPimpleFoam +wmake rhoLTSPimpleFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/incompressible/simpleFoam/Allwmake b/applications/solvers/incompressible/simpleFoam/Allwmake index c73703955a..801fd3b767 100755 --- a/applications/solvers/incompressible/simpleFoam/Allwmake +++ b/applications/solvers/incompressible/simpleFoam/Allwmake @@ -5,7 +5,6 @@ set -x wmake wmake SRFSimpleFoam -wmake MRFSimpleFoam wmake porousSimpleFoam # ----------------------------------------------------------------- end-of-file From 1300a4a8919453f56c56186089a7cd51f9756d3c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 10:13:01 +0000 Subject: [PATCH 05/23] ENH: Updated supersonicFreestream and waveTransmissive BCs --- .../supersonicFreestreamFvPatchVectorField.C | 26 ++++++++++-- .../supersonicFreestreamFvPatchVectorField.H | 12 ++++++ .../waveTransmissiveFvPatchField.C | 40 +++++++------------ 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C index 32c9fc4264..2f2195c8ff 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.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 @@ -38,6 +38,9 @@ supersonicFreestreamFvPatchVectorField ) : mixedFvPatchVectorField(p, iF), + TName_("T"), + pName_("p"), + psiName_("thermo:psi"), UInf_(vector::zero), pInf_(0), TInf_(0), @@ -59,6 +62,9 @@ supersonicFreestreamFvPatchVectorField ) : mixedFvPatchVectorField(ptf, p, iF, mapper), + TName_(ptf.TName_), + pName_(ptf.pName_), + psiName_(ptf.psiName_), UInf_(ptf.UInf_), pInf_(ptf.pInf_), TInf_(ptf.TInf_), @@ -75,6 +81,9 @@ supersonicFreestreamFvPatchVectorField ) : mixedFvPatchVectorField(p, iF), + TName_(dict.lookupOrDefault("T", "T")), + pName_(dict.lookupOrDefault("p", "p")), + psiName_(dict.lookupOrDefault("psi", "thermo:psi")), UInf_(dict.lookup("UInf")), pInf_(readScalar(dict.lookup("pInf"))), TInf_(readScalar(dict.lookup("TInf"))), @@ -120,6 +129,9 @@ supersonicFreestreamFvPatchVectorField ) : mixedFvPatchVectorField(sfspvf), + TName_(sfspvf.TName_), + pName_(sfspvf.pName_), + psiName_(sfspvf.psiName_), UInf_(sfspvf.UInf_), pInf_(sfspvf.pInf_), TInf_(sfspvf.TInf_), @@ -135,6 +147,9 @@ supersonicFreestreamFvPatchVectorField ) : mixedFvPatchVectorField(sfspvf, iF), + TName_(sfspvf.TName_), + pName_(sfspvf.pName_), + psiName_(sfspvf.psiName_), UInf_(sfspvf.UInf_), pInf_(sfspvf.pInf_), TInf_(sfspvf.TInf_), @@ -152,13 +167,13 @@ void Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs() } const fvPatchField& pT = - patch().lookupPatchField("T"); + patch().lookupPatchField(TName_); const fvPatchField& pp = - patch().lookupPatchField("p"); + patch().lookupPatchField(pName_); const fvPatchField& ppsi = - patch().lookupPatchField("psi"); + patch().lookupPatchField(psiName_); // Need R of the free-stream flow. Assume R is independent of location // along patch so use face 0 @@ -288,6 +303,9 @@ void Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs() void Foam::supersonicFreestreamFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); + writeEntryIfDifferent(os, "T", "T", TName_); + writeEntryIfDifferent(os, "p", "p", pName_); + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl; os.writeKeyword("pInf") << pInf_ << token::END_STATEMENT << nl; os.writeKeyword("TInf") << TInf_ << token::END_STATEMENT << nl; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H index 402fc365f3..6f6ea27bcb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.H @@ -40,6 +40,9 @@ Description \table Property | Description | Required | Default value + TName | Temperature field name | no | T + pName | Pressure field name | no | p + psiName | Compressibility field name | no | thermo:psi UInf | free-stream velocity | yes | pInf | free-stream pressure | yes | TInf | free-stream temperature | yes | @@ -88,6 +91,15 @@ class supersonicFreestreamFvPatchVectorField { // Private data + //- Name of temperature field, default = "T" + word TName_; + + //- Name of pressure field, default = "p" + word pName_; + + //- Name of compressibility field field, default = "thermo:psi" + word psiName_; + //- Velocity of the free stream vector UInf_; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C index ca19c5d8ab..a4a64c22d4 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/waveTransmissive/waveTransmissiveFvPatchField.C @@ -41,7 +41,7 @@ Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ) : advectiveFvPatchField(p, iF), - psiName_("psi"), + psiName_("thermo:psi"), gamma_(0.0) {} @@ -70,7 +70,7 @@ Foam::waveTransmissiveFvPatchField::waveTransmissiveFvPatchField ) : advectiveFvPatchField(p, iF, dict), - psiName_(dict.lookupOrDefault("psi", "psi")), + psiName_(dict.lookupOrDefault("psi", "thermo:psi")), gamma_(readScalar(dict.lookup("gamma"))) {} @@ -108,27 +108,21 @@ Foam::waveTransmissiveFvPatchField::advectionSpeed() const { // Lookup the velocity and compressibility of the patch const fvPatchField& psip = - this->patch().template lookupPatchField - ( - psiName_ - ); + this->patch().template + lookupPatchField(psiName_); const surfaceScalarField& phi = this->db().template lookupObject(this->phiName_); fvsPatchField phip = - this->patch().template lookupPatchField - ( - this->phiName_ - ); + this->patch().template + lookupPatchField(this->phiName_); if (phi.dimensions() == dimDensity*dimVelocity*dimArea) { const fvPatchScalarField& rhop = - this->patch().template lookupPatchField - ( - this->rhoName_ - ); + this->patch().template + lookupPatchField(this->rhoName_); phip /= rhop; } @@ -145,18 +139,12 @@ void Foam::waveTransmissiveFvPatchField::write(Ostream& os) const { fvPatchField::write(os); - if (this->phiName_ != "phi") - { - os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl; - } - if (this->rhoName_ != "rho") - { - os.writeKeyword("rho") << this->rhoName_ << token::END_STATEMENT << nl; - } - if (psiName_ != "psi") - { - os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl; - } + this->template + writeEntryIfDifferent(os, "phi", "phi", this->phiName_); + this->template + writeEntryIfDifferent(os, "rho", "rho", this->rhoName_); + this->template + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; From d55ca0946587f5ee6ca3a8c1b32810372913da48 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 10:13:14 +0000 Subject: [PATCH 06/23] ENH: Tutorial update --- tutorials/compressible/sonicFoam/ras/nacaAirfoil/0/p | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/0/p b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/0/p index 4628c438e8..846f03a390 100644 --- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/0/p +++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/0/p @@ -31,7 +31,7 @@ boundaryField field p; phi phi; rho rho; - psi psi; + psi thermo:psi; gamma 1.3; fieldInf 100000; lInf 1; From 80a7c92759a6985bc697491804fa659d980af8bd Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 10:27:57 +0000 Subject: [PATCH 07/23] ENH: Updated fixedRho BC --- .../BCs/rho/fixedRhoFvPatchScalarField.C | 71 +++++++++++-------- .../BCs/rho/fixedRhoFvPatchScalarField.H | 52 +++++++++++++- 2 files changed, 91 insertions(+), 32 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C index cf9450a657..5eefe82ff5 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.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 @@ -27,27 +27,22 @@ License #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" -#include "surfaceFields.H" -#include "fvCFD.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField +Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF) + fixedValueFvPatchScalarField(p, iF), + pName_("p"), + psiName_("thermo:psi") {} -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField +Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField ( const fixedRhoFvPatchScalarField& ptf, const fvPatch& p, @@ -55,43 +50,51 @@ fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper) + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + pName_(ptf.pName_), + psiName_(ptf.psiName_) {} -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField +Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict) + fixedValueFvPatchScalarField(p, iF, dict), + pName_(dict.lookupOrDefault("p", "p")), + psiName_(dict.lookupOrDefault("psi", "thermo:psi")) {} -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField +Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField ( - const fixedRhoFvPatchScalarField& tppsf + const fixedRhoFvPatchScalarField& frpsf ) : - fixedValueFvPatchScalarField(tppsf) + fixedValueFvPatchScalarField(frpsf), + pName_(frpsf.pName_), + psiName_(frpsf.psiName_) {} -fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField +Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField ( - const fixedRhoFvPatchScalarField& tppsf, + const fixedRhoFvPatchScalarField& frpsf, const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF) + fixedValueFvPatchScalarField(frpsf, iF), + pName_(frpsf.pName_), + psiName_(frpsf.psiName_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void fixedRhoFvPatchScalarField::updateCoeffs() +void Foam::fixedRhoFvPatchScalarField::updateCoeffs() { if (updated()) { @@ -99,10 +102,10 @@ void fixedRhoFvPatchScalarField::updateCoeffs() } const fvPatchField& psip = - patch().lookupPatchField("psi"); + patch().lookupPatchField(psiName_); const fvPatchField& pp = - patch().lookupPatchField("p"); + patch().lookupPatchField(pName_); operator==(psip*pp); @@ -110,16 +113,24 @@ void fixedRhoFvPatchScalarField::updateCoeffs() } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const +{ + fvPatchScalarField::write(os); -makePatchTypeField -( - fvPatchScalarField, - fixedRhoFvPatchScalarField -); + writeEntryIfDifferent(os, "p", "p", this->pName_); + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); + writeEntry("value", os); +} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -} // End namespace Foam +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + fixedRhoFvPatchScalarField + ); +} // ************************************************************************* // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H index 697ae723a5..6efbb4947d 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.H @@ -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 @@ -24,9 +24,42 @@ License Class Foam::fixedRhoFvPatchScalarField +Group + grpInletBoundaryConditions + Description Foam::fixedRhoFvPatchScalarField + This boundary condition provides a fixed density inlet condition for + compressible solvers, where the density of calculated using: + + \f{ + \rho = \psi p + \f] + + where + \vartable + p | pressure [Pa] + \rho | density [kg/m3] + \endvartable + + + \heading Patch usage + + \table + Property | Description | Required | Default value + pName | Pressure field name | no | p + psiName | Compressibility field name | no | thermo:psi + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type fixedRho; + } + \endverbatim + SourceFiles fixedRhoFvPatchScalarField.C @@ -43,7 +76,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class fixedRhoFvPatchScalarField Declaration + Class fixedRhoFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class fixedRhoFvPatchScalarField @@ -51,6 +84,17 @@ class fixedRhoFvPatchScalarField public fixedValueFvPatchScalarField { +private: + + // Private data + + //- Pressure field name, default = "p" + word pName_; + + //- Compressibility field name, default = "thermo:psi" + word psiName_; + + public: //- Runtime type information @@ -125,6 +169,10 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; }; From 26b17afe447b37824352144dad7e71ae9e75a3c0 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 10:28:19 +0000 Subject: [PATCH 08/23] ENH: Tutorial updates --- tutorials/compressible/sonicFoam/laminar/forwardStep/0/p | 2 +- tutorials/compressible/sonicFoam/ras/prism/0/p | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/0/p b/tutorials/compressible/sonicFoam/laminar/forwardStep/0/p index e4c6d12711..bdbc4f96ce 100644 --- a/tutorials/compressible/sonicFoam/laminar/forwardStep/0/p +++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/0/p @@ -32,7 +32,7 @@ boundaryField field p; phi phi; rho rho; - psi psi; + psi thermo:psi; gamma 1.4; fieldInf 1; lInf 3; diff --git a/tutorials/compressible/sonicFoam/ras/prism/0/p b/tutorials/compressible/sonicFoam/ras/prism/0/p index a922f0a8a5..c1cc7124ff 100644 --- a/tutorials/compressible/sonicFoam/ras/prism/0/p +++ b/tutorials/compressible/sonicFoam/ras/prism/0/p @@ -32,7 +32,7 @@ boundaryField field p; phi phi; rho rho; - psi psi; + psi thermo:psi; gamma 1.3; fieldInf 100000; lInf 1; From 9e8295f2f57590c7efb837cb8c99285bcf4bbe32 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 10:32:13 +0000 Subject: [PATCH 09/23] ENH: Updated totalTemperature BC --- .../totalTemperature/totalTemperatureFvPatchScalarField.C | 6 +++--- .../totalTemperature/totalTemperatureFvPatchScalarField.H | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C index 55c7140f37..f53442df8e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C @@ -40,7 +40,7 @@ Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField fixedValueFvPatchScalarField(p, iF), UName_("U"), phiName_("phi"), - psiName_("psi"), + psiName_("thermo:psi"), gamma_(0.0), T0_(p.size(), 0.0) {} @@ -73,7 +73,7 @@ Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField fixedValueFvPatchScalarField(p, iF), UName_(dict.lookupOrDefault("U", "U")), phiName_(dict.lookupOrDefault("phi", "phi")), - psiName_(dict.lookupOrDefault("psi", "psi")), + psiName_(dict.lookupOrDefault("psi", "thermo:psi")), gamma_(readScalar(dict.lookup("gamma"))), T0_("T0", dict, p.size()) { @@ -179,7 +179,7 @@ void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const fvPatchScalarField::write(os); writeEntryIfDifferent(os, "U", "U", UName_); writeEntryIfDifferent(os, "phi", "phi", phiName_); - writeEntryIfDifferent(os, "psi", "psi", psiName_); + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl; T0_.writeEntry("T0", os); writeEntry("value", os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H index d793696ade..6a032dfee9 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.H @@ -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 @@ -36,7 +36,7 @@ Description Property | Description | Required | Default value U | Velocity field name | no | U phi | Flux field name | no | phi - psi | Compressibility field name | no | psi + psi | Compressibility field name | no | thermo:psi gamma | ratio of specific heats (Cp/Cv) | yes | T0 | reference temperature | yes | \endtable From 365210a8fd2ef8c79e70893e54251cbeba4e8ae6 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 10:52:12 +0000 Subject: [PATCH 10/23] ENH: Updated maxwellSlipU BC --- .../BCs/U/maxwellSlipUFvPatchVectorField.C | 103 +++++++++++------- .../BCs/U/maxwellSlipUFvPatchVectorField.H | 15 +++ 2 files changed, 78 insertions(+), 40 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 61861b33fa..6ec81dd4dc 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -30,20 +30,20 @@ License #include "volFields.H" #include "fvcGrad.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF ) : mixedFixedValueSlipFvPatchVectorField(p, iF), + TName_("T"), + rhoName_("rho"), + psiName_("thermo:psi"), + muName_("thermo:mu"), + tauMCName_("tauMC"), accommodationCoeff_(1.0), Uwall_(p.size(), vector(0.0, 0.0, 0.0)), thermalCreep_(true), @@ -51,23 +51,28 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField {} -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( - const maxwellSlipUFvPatchVectorField& tdpvf, + const maxwellSlipUFvPatchVectorField& mspvf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : - mixedFixedValueSlipFvPatchVectorField(tdpvf, p, iF, mapper), - accommodationCoeff_(tdpvf.accommodationCoeff_), - Uwall_(tdpvf.Uwall_), - thermalCreep_(tdpvf.thermalCreep_), - curvature_(tdpvf.curvature_) + mixedFixedValueSlipFvPatchVectorField(mspvf, p, iF, mapper), + TName_(mspvf.TName_), + rhoName_(mspvf.rhoName_), + psiName_(mspvf.psiName_), + muName_(mspvf.muName_), + tauMCName_(mspvf.tauMCName_), + accommodationCoeff_(mspvf.accommodationCoeff_), + Uwall_(mspvf.Uwall_), + thermalCreep_(mspvf.thermalCreep_), + curvature_(mspvf.curvature_) {} -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( const fvPatch& p, const DimensionedField& iF, @@ -75,6 +80,11 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ) : mixedFixedValueSlipFvPatchVectorField(p, iF), + TName_(dict.lookupOrDefault("T", "T")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + psiName_(dict.lookupOrDefault("psi", "thermo:psi")), + muName_(dict.lookupOrDefault("mu", "thermo:mu")), + tauMCName_(dict.lookupOrDefault("tauMC", "tauMC")), accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))), Uwall_("Uwall", dict, p.size()), thermalCreep_(dict.lookupOrDefault("thermalCreep", true)), @@ -88,9 +98,12 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField { FatalIOErrorIn ( - "maxwellSlipUFvPatchScalarField::" - "maxwellSlipUFvPatchScalarField" - "(const fvPatch&, const scalarField&, const dictionary&)", + "maxwellSlipUFvPatchScalarField::maxwellSlipUFvPatchScalarField" + "(" + "const fvPatch&, " + "const DimensionedField&, " + "const dictionary&" + ")", dict ) << "unphysical accommodationCoeff_ specified" << "(0 < accommodationCoeff_ <= 1)" << endl @@ -119,23 +132,28 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField } -maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField +Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField ( - const maxwellSlipUFvPatchVectorField& tdpvf, + const maxwellSlipUFvPatchVectorField& mspvf, const DimensionedField& iF ) : - mixedFixedValueSlipFvPatchVectorField(tdpvf, iF), - accommodationCoeff_(tdpvf.accommodationCoeff_), - Uwall_(tdpvf.Uwall_), - thermalCreep_(tdpvf.thermalCreep_), - curvature_(tdpvf.curvature_) + mixedFixedValueSlipFvPatchVectorField(mspvf, iF), + TName_(mspvf.TName_), + rhoName_(mspvf.rhoName_), + psiName_(mspvf.psiName_), + muName_(mspvf.muName_), + tauMCName_(mspvf.tauMCName_), + accommodationCoeff_(mspvf.accommodationCoeff_), + Uwall_(mspvf.Uwall_), + thermalCreep_(mspvf.thermalCreep_), + curvature_(mspvf.curvature_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void maxwellSlipUFvPatchVectorField::updateCoeffs() +void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs() { if (updated()) { @@ -143,11 +161,11 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() } const fvPatchScalarField& pmu = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); const fvPatchScalarField& prho = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); const fvPatchField& ppsi = - patch().lookupPatchField("psi"); + patch().lookupPatchField(psiName_); Field C1 ( @@ -163,7 +181,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() if (thermalCreep_) { const volScalarField& vsfT = - this->db().objectRegistry::lookupObject("T"); + this->db().objectRegistry::lookupObject(TName_); label patchi = this->patch().index(); const fvPatchScalarField& pT = vsfT.boundaryField()[patchi]; Field gradpT(fvc::grad(vsfT)().boundaryField()[patchi]); @@ -175,7 +193,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() if (curvature_) { const fvPatchTensorField& ptauMC = - patch().lookupPatchField("tauMC"); + patch().lookupPatchField(tauMCName_); vectorField n(patch().nf()); refValue() -= C1/prho*transform(I - n*n, (n & ptauMC)); @@ -185,9 +203,15 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() } -void maxwellSlipUFvPatchVectorField::write(Ostream& os) const +void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); + writeEntryIfDifferent(os, "T", "T", TName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); + writeEntryIfDifferent(os, "mu", "thermo:mu", muName_); + writeEntryIfDifferent(os, "tauMC", "tauMC", tauMCName_); + os.writeKeyword("accommodationCoeff") << accommodationCoeff_ << token::END_STATEMENT << nl; Uwall_.writeEntry("Uwall", os); @@ -204,14 +228,13 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -makePatchTypeField -( - fvPatchVectorField, - maxwellSlipUFvPatchVectorField -); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam +namespace Foam +{ + makePatchTypeField + ( + fvPatchVectorField, + maxwellSlipUFvPatchVectorField + ); +} // ************************************************************************* // diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H index df441c5d91..afebd9a9bf 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.H @@ -54,6 +54,21 @@ class maxwellSlipUFvPatchVectorField { // Private data + //- Temperature field name, default = "T" + word TName_; + + //- Density field name, default = "rho" + word rhoName_; + + //- Compressibility field name, default = "thermo:psi" + word psiName_; + + //- Dynamic viscosity field name, default = "thermo:mu" + word muName_; + + //- tauMC field name, default = "tauMC" + word tauMCName_; + // Accommodation coefficient scalar accommodationCoeff_; From 28c883564a641279958a3d2908f7264f7f95d026 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 11:07:05 +0000 Subject: [PATCH 11/23] ENH: Tutorial updates --- tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/p | 4 ++-- tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p | 2 +- .../les/pitzDaily/constant/thermophysicalProperties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/p b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/p index 982367ad38..9de87d0b3f 100644 --- a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/p +++ b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/p @@ -1235,7 +1235,7 @@ boundaryField field p; phi phi; rho rho; - psi psi; + psi thermo:psi; gamma 1.4; fieldInf 101325; lInf 0.025; @@ -1275,7 +1275,7 @@ boundaryField U U; phi phi; rho none; - psi psi; + psi thermo:psi; gamma 1.4; p0 uniform 101325; value nonuniform List diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p index fa4008822f..0f1e50b4b8 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/0/p @@ -31,7 +31,7 @@ boundaryField field p; phi phi; rho rho; - psi psi; + psi thermo:psi; gamma 1.3; fieldInf 1e5; lInf 0.3; diff --git a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties index 014d7ffc49..955bebb2d5 100644 --- a/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties +++ b/tutorials/compressible/rhoPimpleFoam/les/pitzDaily/constant/thermophysicalProperties @@ -42,7 +42,7 @@ gasThermoTypes thermoType { - $.gasThermoTypes.constant; + ${:gasThermoTypes.constant}; } mixture From b2252f36b1ee1d374e6c5b9d9b84152f409ea2fd Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 12:05:45 +0000 Subject: [PATCH 12/23] ENH: Added run-time selectable sources to combustion solvers --- applications/solvers/combustion/XiFoam/EaEqn.H | 4 ++++ .../solvers/combustion/XiFoam/Make/options | 16 ++++++++++------ applications/solvers/combustion/XiFoam/UEqn.H | 3 +++ applications/solvers/combustion/XiFoam/XiFoam.C | 1 + applications/solvers/combustion/XiFoam/bEqn.H | 17 +++++++++++++++-- .../solvers/combustion/XiFoam/createFields.H | 2 ++ applications/solvers/combustion/XiFoam/ftEqn.H | 8 +++++++- applications/solvers/combustion/XiFoam/pEqn.H | 13 +++++++++++++ .../solvers/combustion/engineFoam/Make/options | 16 +++++++++++----- .../solvers/combustion/engineFoam/UEqn.H | 2 ++ .../solvers/combustion/engineFoam/engineFoam.C | 1 + .../solvers/combustion/engineFoam/pEqn.H | 13 +++++++++++++ .../solvers/combustion/fireFoam/Make/options | 4 ++++ applications/solvers/combustion/fireFoam/UEqn.H | 3 +++ .../solvers/combustion/fireFoam/YEEqn.H | 8 ++++++++ .../solvers/combustion/fireFoam/createFields.H | 3 +++ .../solvers/combustion/fireFoam/fireFoam.C | 1 + applications/solvers/combustion/fireFoam/pEqn.H | 5 +++++ .../solvers/combustion/fireFoam/rhoEqn.H | 7 ++++++- .../solvers/combustion/reactingFoam/EEqn.H | 4 ++++ .../combustion/reactingFoam/Make/options | 10 ++++++++-- .../solvers/combustion/reactingFoam/UEqn.H | 3 +++ .../solvers/combustion/reactingFoam/YEqn.H | 4 ++++ .../combustion/reactingFoam/createFields.H | 2 ++ .../solvers/combustion/reactingFoam/pEqn.H | 13 +++++++++++++ .../combustion/reactingFoam/reactingFoam.C | 1 + .../combustion/rhoReactingFoam/Make/options | 13 +++++++++---- .../combustion/rhoReactingFoam/createFields.H | 2 ++ .../solvers/combustion/rhoReactingFoam/pEqn.H | 13 +++++++++++++ .../rhoReactingFoam/rhoReactingFoam.C | 1 + 30 files changed, 172 insertions(+), 21 deletions(-) diff --git a/applications/solvers/combustion/XiFoam/EaEqn.H b/applications/solvers/combustion/XiFoam/EaEqn.H index 6840c4eb6d..5493722c93 100644 --- a/applications/solvers/combustion/XiFoam/EaEqn.H +++ b/applications/solvers/combustion/XiFoam/EaEqn.H @@ -16,9 +16,13 @@ : -dpdt ) - fvm::laplacian(turbulence->alphaEff(), hea) + + sources(rho, hea) ); EaEqn.relax(); + + sources.constrain(EaEqn); + EaEqn.solve(); thermo.correct(); diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options index 3a07a7de58..fdebdc8ce8 100644 --- a/applications/solvers/combustion/XiFoam/Make/options +++ b/applications/solvers/combustion/XiFoam/Make/options @@ -1,14 +1,20 @@ EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude\ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ - -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude EXE_LIBS = \ + -lfiniteVolume \ + -lfieldSources \ + -lsampling \ + -lmeshTools \ -lengine \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ @@ -16,6 +22,4 @@ EXE_LIBS = \ -lfluidThermophysicalModels \ -lreactionThermophysicalModels \ -lspecie \ - -llaminarFlameSpeedModels \ - -lmeshTools \ - -lfiniteVolume + -llaminarFlameSpeedModels diff --git a/applications/solvers/combustion/XiFoam/UEqn.H b/applications/solvers/combustion/XiFoam/UEqn.H index b9bc567aae..643a99f134 100644 --- a/applications/solvers/combustion/XiFoam/UEqn.H +++ b/applications/solvers/combustion/XiFoam/UEqn.H @@ -5,10 +5,13 @@ + turbulence->divDevRhoReff(U) == rho*g + + sources(rho, U) ); UEqn.relax(); + sources.constrain(UEqn); + if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); diff --git a/applications/solvers/combustion/XiFoam/XiFoam.C b/applications/solvers/combustion/XiFoam/XiFoam.C index 1573ede331..a3e90f7169 100644 --- a/applications/solvers/combustion/XiFoam/XiFoam.C +++ b/applications/solvers/combustion/XiFoam/XiFoam.C @@ -56,6 +56,7 @@ Description #include "ignition.H" #include "Switch.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index ff19598ba1..49c2c63ae7 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -34,7 +34,7 @@ if (ign.ignited()) // Calculate turbulent flame speed flux // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - surfaceScalarField phiSt(fvc::interpolate(rhou*StCorr*Su*Xi)*nf); + surfaceScalarField phiSt("phiSt", fvc::interpolate(rhou*StCorr*Su*Xi)*nf); scalar StCoNum = max ( @@ -50,9 +50,11 @@ if (ign.ignited()) ( fvm::ddt(rho, b) + mvConvection->fvmDiv(phi, b) - + fvm::div(phiSt, b, "div(phiSt,b)") + + fvm::div(phiSt, b) - fvm::Sp(fvc::div(phiSt), b) - fvm::laplacian(turbulence->alphaEff(), b) + == + sources(rho, b) ); @@ -64,6 +66,9 @@ if (ign.ignited()) // Solve for b // ~~~~~~~~~~~ bEqn.relax(); + + sources.constrain(bEqn); + bEqn.solve(); Info<< "min(b) = " << min(b).value() << endl; @@ -153,9 +158,13 @@ if (ign.ignited()) == - fvm::SuSp(-rho*Rc*Su0/Su, Su) - fvm::SuSp(rho*(sigmas + Rc), Su) + + sources(rho, Su) ); SuEqn.relax(); + + sources.constrain(SuEqn); + SuEqn.solve(); // Limit the maximum Su @@ -234,9 +243,13 @@ if (ign.ignited()) ), Xi ) + + sources(rho, Xi) ); XiEqn.relax(); + + sources.constrain(XiEqn); + XiEqn.solve(); // Correct boundedness of Xi diff --git a/applications/solvers/combustion/XiFoam/createFields.H b/applications/solvers/combustion/XiFoam/createFields.H index 17103885e5..3b7cd9b7ae 100644 --- a/applications/solvers/combustion/XiFoam/createFields.H +++ b/applications/solvers/combustion/XiFoam/createFields.H @@ -138,3 +138,5 @@ fields.add(b); fields.add(thermo.he()); fields.add(thermo.heu()); + + IObasicSourceList sources(mesh); diff --git a/applications/solvers/combustion/XiFoam/ftEqn.H b/applications/solvers/combustion/XiFoam/ftEqn.H index 96dbc3f06b..da1d76fe69 100644 --- a/applications/solvers/combustion/XiFoam/ftEqn.H +++ b/applications/solvers/combustion/XiFoam/ftEqn.H @@ -13,10 +13,16 @@ if (composition.contains("ft")) { volScalarField& ft = composition.Y("ft"); - solve + fvScalarMatrix ftEqn ( fvm::ddt(rho, ft) + mvConvection->fvmDiv(phi, ft) - fvm::laplacian(turbulence->alphaEff(), ft) + == + sources(rho, ft) ); + + sources.constrain(ftEqn); + + ftEqn.solve(); } diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index 1543ca539a..99d445e6e9 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -16,6 +16,8 @@ if (pimple.transonic()) ) ); + sources.relativeFlux(fvc::interpolate(psi), phid); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -23,8 +25,12 @@ if (pimple.transonic()) fvm::ddt(psi, p) + fvm::div(phid, p) - fvm::laplacian(rho*rAU, p) + == + sources(psi, p, rho.name()) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -45,6 +51,8 @@ else ) ); + sources.relativeFlux(phiHbyA); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -52,8 +60,12 @@ else fvm::ddt(psi, p) + fvc::div(phiHbyA) - fvm::laplacian(rho*rAU, p) + == + sources(psi, p, rho.name()) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -68,6 +80,7 @@ else U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); +sources.correct(U); K = 0.5*magSqr(U); if (thermo.dpdt()) diff --git a/applications/solvers/combustion/engineFoam/Make/options b/applications/solvers/combustion/engineFoam/Make/options index ff38fdf051..c7b3219f2d 100644 --- a/applications/solvers/combustion/engineFoam/Make/options +++ b/applications/solvers/combustion/engineFoam/Make/options @@ -1,14 +1,21 @@ EXE_INC = \ - -I../XiFoam \ + -I$(FOAM_SOLVERS)/combustion/XiFoam \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/engine/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ - -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude EXE_LIBS = \ + -lfiniteVolume \ + -lfieldSources \ + -lsampling \ + -lmeshTools \ -lengine \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ @@ -16,5 +23,4 @@ EXE_LIBS = \ -lfluidThermophysicalModels \ -lreactionThermophysicalModels \ -lspecie \ - -llaminarFlameSpeedModels \ - -lfiniteVolume + -llaminarFlameSpeedModels diff --git a/applications/solvers/combustion/engineFoam/UEqn.H b/applications/solvers/combustion/engineFoam/UEqn.H index f110051946..de3dc757cc 100644 --- a/applications/solvers/combustion/engineFoam/UEqn.H +++ b/applications/solvers/combustion/engineFoam/UEqn.H @@ -3,6 +3,8 @@ fvm::ddt(rho, U) + fvm::div(phi, U) + turbulence->divDevRhoReff(U) + == + sources(rho, U) ); if (pimple.momentumPredictor()) diff --git a/applications/solvers/combustion/engineFoam/engineFoam.C b/applications/solvers/combustion/engineFoam/engineFoam.C index 0ee3df6b7b..65cd0356ed 100644 --- a/applications/solvers/combustion/engineFoam/engineFoam.C +++ b/applications/solvers/combustion/engineFoam/engineFoam.C @@ -59,6 +59,7 @@ Description #include "OFstream.H" #include "mathematicalConstants.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index 7b005cc311..2a45a1d7e0 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -13,6 +13,8 @@ if (pimple.transonic()) *((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U)) ); + sources.relativeFlux(fvc::interpolate(psi), phid); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -20,8 +22,12 @@ if (pimple.transonic()) fvm::ddt(psi, p) + fvm::div(phid, p) - fvm::laplacian(rho*rAU, p) + == + sources(psi, p, rho.name()) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -39,6 +45,8 @@ else *((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U)) ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -46,8 +54,12 @@ else fvm::ddt(psi, p) + fvc::div(phiHbyA) - fvm::laplacian(rho*rAU, p) + == + sources(psi, p, rho.name()) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -62,6 +74,7 @@ else U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); +sources.correct(U); K = 0.5*magSqr(U); if (thermo.dpdt()) diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options index b7498e50f5..73804d8283 100644 --- a/applications/solvers/combustion/fireFoam/Make/options +++ b/applications/solvers/combustion/fireFoam/Make/options @@ -1,6 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ + -I${LIB_SRC}/sampling/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ @@ -29,7 +31,9 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lfieldSources \ -lmeshTools \ + -lsampling \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lspecie \ diff --git a/applications/solvers/combustion/fireFoam/UEqn.H b/applications/solvers/combustion/fireFoam/UEqn.H index 31d01e4327..90e633fc36 100644 --- a/applications/solvers/combustion/fireFoam/UEqn.H +++ b/applications/solvers/combustion/fireFoam/UEqn.H @@ -5,10 +5,13 @@ + turbulence->divDevRhoReff(U) == parcels.SU(U) + + sources(rho, U) ); UEqn.relax(); + sources.constrain(UEqn); + if (pimple.momentumPredictor()) { solve diff --git a/applications/solvers/combustion/fireFoam/YEEqn.H b/applications/solvers/combustion/fireFoam/YEEqn.H index f979d3bb7d..a23f99dab7 100644 --- a/applications/solvers/combustion/fireFoam/YEEqn.H +++ b/applications/solvers/combustion/fireFoam/YEEqn.H @@ -30,9 +30,13 @@ tmp > mvConvection parcels.SYi(i, Yi) + surfaceFilm.Srho(i) + combustion->R(Yi) + + sources(rho, Yi) ); YiEqn.relax(); + + sources.constrain(YiEqn); + YiEqn.solve(mesh.solver("Yi")); Yi.max(0.0); @@ -69,9 +73,13 @@ tmp > mvConvection + radiation->Sh(thermo) + parcels.Sh(he) + surfaceFilm.Sh() + + sources(rho, he) ); EEqn.relax(); + + sources.constrain(EEqn); + EEqn.solve(); thermo.correct(); diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index 8159ee73aa..9ebd05196c 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -146,3 +146,6 @@ ( additionalControlsDict.lookup("solvePrimaryRegion") ); + + IObasicSourceList sources(mesh); + diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 021ed3c6f0..3f30495a99 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -40,6 +40,7 @@ Description #include "solidChemistryModel.H" #include "psiCombustionModel.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 4c33f5633e..4a0145a693 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -21,6 +21,7 @@ surfaceScalarField phiHbyA + phig ); +sources.relativeFlux(phiHbyA); while (pimple.correctNonOrthogonal()) { @@ -33,8 +34,11 @@ while (pimple.correctNonOrthogonal()) == parcels.Srho() + surfaceFilm.Srho() + + sources(psi, p_rgh, rho.name()) ); + sources.constrain(p_rghEqn, rho.name()); + p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -42,6 +46,7 @@ while (pimple.correctNonOrthogonal()) phi = phiHbyA + p_rghEqn.flux(); U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf); U.correctBoundaryConditions(); + sources.correct(U); } } diff --git a/applications/solvers/combustion/fireFoam/rhoEqn.H b/applications/solvers/combustion/fireFoam/rhoEqn.H index f939060181..c465309edb 100644 --- a/applications/solvers/combustion/fireFoam/rhoEqn.H +++ b/applications/solvers/combustion/fireFoam/rhoEqn.H @@ -30,14 +30,19 @@ Description \*---------------------------------------------------------------------------*/ { - solve + fvScalarMatrix rhoEqn ( fvm::ddt(rho) + fvc::div(phi) == parcels.Srho(rho) + surfaceFilm.Srho() + + sources(rho) ); + + sources.constrain(rhoEqn); + + rhoEqn.solve(); } // ************************************************************************* // diff --git a/applications/solvers/combustion/reactingFoam/EEqn.H b/applications/solvers/combustion/reactingFoam/EEqn.H index e1bf055604..5568c7e5be 100644 --- a/applications/solvers/combustion/reactingFoam/EEqn.H +++ b/applications/solvers/combustion/reactingFoam/EEqn.H @@ -19,9 +19,13 @@ // - fvm::laplacian(turbulence->muEff(), he) // unit lewis no. == reaction->Sh() + + sources(rho, he) ); EEqn.relax(); + + sources.constrain(EEqn); + EEqn.solve(); thermo.correct(); diff --git a/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options index 46b69a63cd..d29dc0ed9a 100644 --- a/applications/solvers/combustion/reactingFoam/Make/options +++ b/applications/solvers/combustion/reactingFoam/Make/options @@ -1,14 +1,21 @@ EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/combustionModels/lnInclude EXE_LIBS = \ + -lfiniteVolume \ + -lfieldSources \ + -lmeshTools \ + -lsampling \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ @@ -17,5 +24,4 @@ EXE_LIBS = \ -lfluidThermophysicalModels \ -lchemistryModel \ -lODE \ - -lfiniteVolume \ -lcombustionModels diff --git a/applications/solvers/combustion/reactingFoam/UEqn.H b/applications/solvers/combustion/reactingFoam/UEqn.H index b9bc567aae..643a99f134 100644 --- a/applications/solvers/combustion/reactingFoam/UEqn.H +++ b/applications/solvers/combustion/reactingFoam/UEqn.H @@ -5,10 +5,13 @@ + turbulence->divDevRhoReff(U) == rho*g + + sources(rho, U) ); UEqn.relax(); + sources.constrain(UEqn); + if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); diff --git a/applications/solvers/combustion/reactingFoam/YEqn.H b/applications/solvers/combustion/reactingFoam/YEqn.H index ccc4b135a5..2f0d29fd84 100644 --- a/applications/solvers/combustion/reactingFoam/YEqn.H +++ b/applications/solvers/combustion/reactingFoam/YEqn.H @@ -28,9 +28,13 @@ tmp > mvConvection - fvm::laplacian(turbulence->muEff(), Yi) == reaction->R(Yi) + + sources(rho, Yi) ); YiEqn.relax(); + + sources.constrain(YiEqn); + YiEqn.solve(mesh.solver("Yi")); Yi.max(0.0); diff --git a/applications/solvers/combustion/reactingFoam/createFields.H b/applications/solvers/combustion/reactingFoam/createFields.H index 32bdd372ee..21769875ea 100644 --- a/applications/solvers/combustion/reactingFoam/createFields.H +++ b/applications/solvers/combustion/reactingFoam/createFields.H @@ -99,3 +99,5 @@ volScalarField dQ mesh, dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) ); + +IObasicSourceList sources(mesh); diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 1543ca539a..34c8bde310 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -16,6 +16,8 @@ if (pimple.transonic()) ) ); + sources.relativeFlux(fvc::interpolate(psi), phid); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -23,8 +25,12 @@ if (pimple.transonic()) fvm::ddt(psi, p) + fvm::div(phid, p) - fvm::laplacian(rho*rAU, p) + == + sources(psi, p, rho.name()) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -45,6 +51,8 @@ else ) ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -52,8 +60,12 @@ else fvm::ddt(psi, p) + fvc::div(phiHbyA) - fvm::laplacian(rho*rAU, p) + == + sources(psi, p, rho.name()) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -68,6 +80,7 @@ else U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); +sources.correct(U); K = 0.5*magSqr(U); if (thermo.dpdt()) diff --git a/applications/solvers/combustion/reactingFoam/reactingFoam.C b/applications/solvers/combustion/reactingFoam/reactingFoam.C index cd7d371651..c68f94ebf7 100644 --- a/applications/solvers/combustion/reactingFoam/reactingFoam.C +++ b/applications/solvers/combustion/reactingFoam/reactingFoam.C @@ -34,6 +34,7 @@ Description #include "psiCombustionModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/combustion/rhoReactingFoam/Make/options b/applications/solvers/combustion/rhoReactingFoam/Make/options index 6dbd401b63..0d1336e1ac 100644 --- a/applications/solvers/combustion/rhoReactingFoam/Make/options +++ b/applications/solvers/combustion/rhoReactingFoam/Make/options @@ -1,17 +1,23 @@ EXE_INC = \ - -I../reactingFoam \ + -I$(FOAM_SOLVERS)/combustion/reactingFoam \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/ODE/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(FOAM_SOLVERS)/combustion/reactingFoam \ -I$(LIB_SRC)/combustionModels/lnInclude EXE_LIBS = \ + -lfiniteVolume \ + -lfieldSources \ + -lmeshTools \ + -lsampling \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ -lcompressibleLESModels \ @@ -20,5 +26,4 @@ EXE_LIBS = \ -lfluidThermophysicalModels \ -lchemistryModel \ -lODE \ - -lfiniteVolume \ -lcombustionModels diff --git a/applications/solvers/combustion/rhoReactingFoam/createFields.H b/applications/solvers/combustion/rhoReactingFoam/createFields.H index e99639e189..4c517fb646 100644 --- a/applications/solvers/combustion/rhoReactingFoam/createFields.H +++ b/applications/solvers/combustion/rhoReactingFoam/createFields.H @@ -101,3 +101,5 @@ volScalarField dQ mesh, dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) ); + +IObasicSourceList sources(mesh); diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H index 85dbbf7f7e..55880747b2 100644 --- a/applications/solvers/combustion/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -18,6 +18,8 @@ + fvc::ddtPhiCorr(rAU, rho, U, phi) ); + sources.relativeFlux(phiHbyA); + surfaceScalarField phid("phid", fvc::interpolate(thermo.psi())*phiHbyA); phiHbyA *= fvc::interpolate(rho); @@ -34,8 +36,12 @@ ( pDDtEqn - fvm::laplacian(rho*rAU, p) + == + sources(psi, p, rho.name()) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -56,10 +62,14 @@ ) ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + fvScalarMatrix pDDtEqn ( fvc::ddt(rho) + psi*correction(fvm::ddt(p)) + fvc::div(phiHbyA) + == + sources(psi, p, rho.name()) ); while (pimple.correctNonOrthogonal()) @@ -70,6 +80,8 @@ - fvm::laplacian(rho*rAU, p) ); + sources.constrain(pEqn, rho.name()); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -87,6 +99,7 @@ U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); + sources.correct(U); K = 0.5*magSqr(U); if (thermo.dpdt()) diff --git a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C index 3ac060612d..0a91aa4b03 100644 --- a/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C +++ b/applications/solvers/combustion/rhoReactingFoam/rhoReactingFoam.C @@ -35,6 +35,7 @@ Description #include "turbulenceModel.H" #include "multivariateScheme.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From fd7527bf3ba8aa0e939571131c1d04c91bbe5560 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 12:59:09 +0000 Subject: [PATCH 13/23] ENH: Updated radiation model selection - defaults to 'none' if radiationProperties not found --- .../radiationModel/noRadiation/noRadiation.C | 2 +- .../radiationModel/radiationModel.C | 76 +++++++++---------- .../radiationModel/radiationModel.H | 6 +- .../radiationModel/radiationModelNew.C | 32 ++++---- 4 files changed, 56 insertions(+), 60 deletions(-) diff --git a/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C index 604a5dbbe3..69666b7c63 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/noRadiation/noRadiation.C @@ -52,7 +52,7 @@ Foam::radiation::noRadiation::noRadiation const volScalarField& T ) : - radiationModel(dict, T) + radiationModel(T) {} diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C index 55e2e1fb53..5948101185 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C @@ -43,6 +43,33 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +Foam::IOobject Foam::radiation::radiationModel::createIOobject +( + const fvMesh& mesh +) const +{ + IOobject io + ( + "radiationProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (io.headerOk()) + { + io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; + return io; + } + else + { + io.readOpt() = IOobject::NO_READ; + return io; + } +} + + void Foam::radiation::radiationModel::initialise() { if (radiation_) @@ -62,35 +89,6 @@ void Foam::radiation::radiationModel::initialise() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::radiation::radiationModel::radiationModel(const volScalarField& T) -: - IOdictionary - ( - IOobject - ( - "radiationProperties", - T.time().constant(), - T.mesh(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ), - mesh_(T.mesh()), - time_(T.time()), - T_(T), - radiation_(false), - coeffs_(dictionary::null), - solverFreq_(0), - firstIter_(true), - absorptionEmission_(NULL), - scatter_(NULL) -{} - - -Foam::radiation::radiationModel::radiationModel -( - const dictionary& dict, - const volScalarField& T -) : IOdictionary ( @@ -101,8 +99,7 @@ Foam::radiation::radiationModel::radiationModel T.mesh(), IOobject::NO_READ, IOobject::NO_WRITE - ), - dict + ) ), mesh_(T.mesh()), time_(T.time()), @@ -122,17 +119,7 @@ Foam::radiation::radiationModel::radiationModel const volScalarField& T ) : - IOdictionary - ( - IOobject - ( - "radiationProperties", - T.time().constant(), - T.mesh(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ), + IOdictionary(createIOobject(T.mesh())), mesh_(T.mesh()), time_(T.time()), T_(T), @@ -143,6 +130,11 @@ Foam::radiation::radiationModel::radiationModel absorptionEmission_(NULL), scatter_(NULL) { + if (readOpt() == IOobject::NO_READ) + { + radiation_ = false; + } + initialise(); } diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H index 5f5a92887b..1218dac9e9 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H @@ -109,6 +109,9 @@ private: // Private Member Functions + //- Create IO object if dictionary is present + IOobject createIOobject(const fvMesh& mesh) const; + //- Initialise void initialise(); @@ -156,9 +159,6 @@ public: //- Null constructor radiationModel(const volScalarField& T); - //- Construct with dictionary - radiationModel(const dictionary& dict, const volScalarField& T); - //- Construct from components radiationModel(const word& type, const volScalarField& T); diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C index ae13f11d1a..9a95b0c88f 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModelNew.C @@ -33,23 +33,27 @@ Foam::radiation::radiationModel::New const volScalarField& T ) { - // get model name, but do not register the dictionary - const word modelType + IOobject radIO ( - IOdictionary - ( - IOobject - ( - "radiationProperties", - T.time().constant(), - T.mesh(), - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).lookup("radiationModel") + "radiationProperties", + T.time().constant(), + T.mesh(), + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false ); + word modelType("none"); + if (radIO.headerOk()) + { + IOdictionary(radIO).lookup("radiationModel") >> modelType; + } + else + { + Info<< "Radiation model not active: radiationProperties not found" + << endl; + } + Info<< "Selecting radiationModel " << modelType << endl; TConstructorTable::iterator cstrIter = From b3a28977290a8e1e197b6c08bbbcddf2e8fdad5b Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 13:06:30 +0000 Subject: [PATCH 14/23] ENH: Replaced buoyantSimpleRadiationFoam by buoyantSimpleFoam - radiation now included by default --- .../heatTransfer/buoyantSimpleFoam/Allwmake | 8 -- .../heatTransfer/buoyantSimpleFoam/EEqn.H | 3 + .../buoyantSimpleFoam/Make/options | 8 +- .../buoyantSimpleFoam/buoyantSimpleFoam.C | 7 +- .../buoyantSimpleRadiationFoam/EEqn.H | 22 ----- .../buoyantSimpleRadiationFoam/Make/files | 3 - .../buoyantSimpleRadiationFoam/Make/options | 18 ---- .../buoyantSimpleRadiationFoam.C | 86 ------------------- 8 files changed, 14 insertions(+), 141 deletions(-) delete mode 100755 applications/solvers/heatTransfer/buoyantSimpleFoam/Allwmake delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/EEqn.H delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/files delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/options delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Allwmake b/applications/solvers/heatTransfer/buoyantSimpleFoam/Allwmake deleted file mode 100755 index 0fe8e8f4ad..0000000000 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Allwmake +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # run from this directory -set -x - -wmake -wmake buoyantSimpleRadiationFoam - -# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H index e4c79b40cc..0d1f41d0c3 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H @@ -10,10 +10,13 @@ : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) ) - fvm::laplacian(turbulence->alphaEff(), he) + == + radiation->Sh(thermo) ); EEqn.relax(); EEqn.solve(); thermo.correct(); + radiation->correct(); } diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options index 74ddd12446..f26046adb2 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options @@ -1,14 +1,18 @@ EXE_INC = \ + -I.. \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/RAS \ -I$(LIB_SRC)/finiteVolume/cfdTools \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lmeshTools \ -lfluidThermophysicalModels \ -lspecie \ + -lradiationModels \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ - -lfiniteVolume + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index fc47fc90a1..38f3a7c647 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -22,10 +22,11 @@ License along with OpenFOAM. If not, see . Application - buoyantSimpleFoam + buoyantSimpleRadiationFoam Description - Steady-state solver for buoyant, turbulent flow of compressible fluids + Steady-state solver for buoyant, turbulent flow of compressible fluids, + including radiation, for ventilation and heat-transfer. \*---------------------------------------------------------------------------*/ @@ -33,6 +34,7 @@ Description #include "psiThermo.H" #include "RASModel.H" #include "fixedGradientFvPatchFields.H" +#include "radiationModel.H" #include "simpleControl.H" #include "IOMRFZoneList.H" @@ -46,6 +48,7 @@ int main(int argc, char *argv[]) #include "readGravitationalAcceleration.H" #include "createFields.H" #include "createZones.H" + #include "createRadiationModel.H" #include "initContinuityErrs.H" simpleControl simple(mesh); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/EEqn.H deleted file mode 100644 index 0d1f41d0c3..0000000000 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/EEqn.H +++ /dev/null @@ -1,22 +0,0 @@ -{ - volScalarField& he = thermo.he(); - - fvScalarMatrix EEqn - ( - fvm::div(phi, he) - + ( - he.name() == "e" - ? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho)) - : fvc::div(phi, volScalarField("K", 0.5*magSqr(U))) - ) - - fvm::laplacian(turbulence->alphaEff(), he) - == - radiation->Sh(thermo) - ); - - EEqn.relax(); - EEqn.solve(); - - thermo.correct(); - radiation->correct(); -} diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/files b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/files deleted file mode 100644 index a8347c5525..0000000000 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -buoyantSimpleRadiationFoam.C - -EXE = $(FOAM_APPBIN)/buoyantSimpleRadiationFoam diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/options deleted file mode 100644 index f26046adb2..0000000000 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/Make/options +++ /dev/null @@ -1,18 +0,0 @@ -EXE_INC = \ - -I.. \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ - -I$(LIB_SRC)/turbulenceModels \ - -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/RAS \ - -I$(LIB_SRC)/finiteVolume/cfdTools \ - -I$(LIB_SRC)/finiteVolume/lnInclude - -EXE_LIBS = \ - -lfluidThermophysicalModels \ - -lspecie \ - -lradiationModels \ - -lcompressibleTurbulenceModel \ - -lcompressibleRASModels \ - -lfiniteVolume \ - -lmeshTools diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C deleted file mode 100644 index 38f3a7c647..0000000000 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 - buoyantSimpleRadiationFoam - -Description - Steady-state solver for buoyant, turbulent flow of compressible fluids, - including radiation, for ventilation and heat-transfer. - -\*---------------------------------------------------------------------------*/ - -#include "fvCFD.H" -#include "psiThermo.H" -#include "RASModel.H" -#include "fixedGradientFvPatchFields.H" -#include "radiationModel.H" -#include "simpleControl.H" -#include "IOMRFZoneList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "readGravitationalAcceleration.H" - #include "createFields.H" - #include "createZones.H" - #include "createRadiationModel.H" - #include "initContinuityErrs.H" - - simpleControl simple(mesh); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< "\nStarting time loop\n" << endl; - - while (simple.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Pressure-velocity SIMPLE corrector - { - #include "UEqn.H" - #include "EEqn.H" - #include "pEqn.H" - } - - turbulence->correct(); - - runTime.write(); - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // From d023108fa74ced5601e8e41adee35b2fe6703abc Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 13:09:24 +0000 Subject: [PATCH 15/23] ENH: Updated buoyantSimpleRadiationFoam tutorials - now reside in buoyanSimpleFoam cases --- .../hotRadiationRoom/0/G | 0 .../hotRadiationRoom/0/T | 0 .../hotRadiationRoom/0/U | 0 .../hotRadiationRoom/0/alphat | 0 .../hotRadiationRoom/0/epsilon | 0 .../hotRadiationRoom/0/k | 0 .../hotRadiationRoom/0/mut | 0 .../hotRadiationRoom/0/p | 0 .../hotRadiationRoom/0/p_rgh | 0 .../hotRadiationRoom/Allclean | 0 .../hotRadiationRoom/Allrun | 0 .../hotRadiationRoom/constant/RASProperties | 0 .../hotRadiationRoom/constant/g | 0 .../hotRadiationRoom/constant/polyMesh/blockMeshDict | 0 .../hotRadiationRoom/constant/polyMesh/boundary | 0 .../hotRadiationRoom/constant/radiationProperties | 0 .../hotRadiationRoom/constant/thermophysicalProperties | 0 .../hotRadiationRoom/system/controlDict | 2 +- .../hotRadiationRoom/system/fvSchemes | 0 .../hotRadiationRoom/system/fvSolution | 0 .../hotRadiationRoomFvDOM/0/G | 0 .../hotRadiationRoomFvDOM/0/IDefault | 0 .../hotRadiationRoomFvDOM/0/T | 0 .../hotRadiationRoomFvDOM/0/U | 0 .../hotRadiationRoomFvDOM/0/alphat | 0 .../hotRadiationRoomFvDOM/0/epsilon | 0 .../hotRadiationRoomFvDOM/0/k | 0 .../hotRadiationRoomFvDOM/0/mut | 0 .../hotRadiationRoomFvDOM/0/p | 0 .../hotRadiationRoomFvDOM/0/p_rgh | 0 .../hotRadiationRoomFvDOM/Allclean | 0 .../hotRadiationRoomFvDOM/Allrun | 0 .../hotRadiationRoomFvDOM/constant/RASProperties | 0 .../hotRadiationRoomFvDOM/constant/g | 0 .../hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict | 0 .../hotRadiationRoomFvDOM/constant/polyMesh/boundary | 0 .../hotRadiationRoomFvDOM/constant/radiationProperties | 0 .../hotRadiationRoomFvDOM/constant/thermophysicalProperties | 0 .../hotRadiationRoomFvDOM/system/controlDict | 2 +- .../hotRadiationRoomFvDOM/system/fvSchemes | 0 .../hotRadiationRoomFvDOM/system/fvSolution | 0 41 files changed, 2 insertions(+), 2 deletions(-) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/G (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/T (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/U (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/alphat (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/epsilon (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/k (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/mut (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/p (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/0/p_rgh (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/Allclean (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/Allrun (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/constant/RASProperties (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/constant/g (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/constant/polyMesh/blockMeshDict (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/constant/polyMesh/boundary (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/constant/radiationProperties (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/constant/thermophysicalProperties (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/system/controlDict (96%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/system/fvSchemes (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoom/system/fvSolution (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/G (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/IDefault (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/T (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/U (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/alphat (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/epsilon (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/k (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/mut (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/p (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/0/p_rgh (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/Allclean (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/Allrun (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/constant/RASProperties (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/constant/g (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/constant/polyMesh/boundary (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/constant/radiationProperties (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/constant/thermophysicalProperties (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/system/controlDict (96%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/system/fvSchemes (100%) rename tutorials/heatTransfer/{buoyantSimpleRadiationFoam => buoyantSimpleFoam}/hotRadiationRoomFvDOM/system/fvSolution (100%) diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/G similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/G diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/T b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/T similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/T rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/T diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/U b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/U similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/U rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/U diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/alphat b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/alphat similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/alphat rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/alphat diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/epsilon similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/epsilon diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/k similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/k diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/mut b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/mut similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/mut rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/mut diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/p similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/p diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p_rgh b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/p_rgh similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p_rgh rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/0/p_rgh diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allclean similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/Allclean rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allclean diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allrun similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/Allrun rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/Allrun diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/RASProperties similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/RASProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/RASProperties diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/g b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/g similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/g rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/g diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/polyMesh/blockMeshDict rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/polyMesh/blockMeshDict diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/polyMesh/boundary similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/polyMesh/boundary rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/polyMesh/boundary diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/radiationProperties similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/radiationProperties diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/constant/thermophysicalProperties diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/controlDict similarity index 96% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/controlDict index 3a0f2f992f..9e12984010 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application buoyantSimpleRadiationFoam; +application buoyantSimpleFoam; startFrom latestTime; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/fvSchemes similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/fvSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/fvSolution similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/fvSolution diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/G similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/G diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/IDefault similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/IDefault diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/T similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/T diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/U similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/U diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/alphat similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/alphat diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/epsilon similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/epsilon diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/k similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/k diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/mut similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/mut diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/p similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/p diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p_rgh b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/p_rgh similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p_rgh rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/0/p_rgh diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/Allclean b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allclean similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/Allclean rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allclean diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allrun similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/Allrun rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/Allrun diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/RASProperties similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/RASProperties diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/g b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/g similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/g rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/g diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/radiationProperties similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/radiationProperties diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/controlDict similarity index 96% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/controlDict index 95fff8df10..76e8fe4bef 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict +++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/controlDict @@ -15,7 +15,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application buoyantSimpleRadiationFoam; +application buoyantSimpleFoam; startFrom latestTime; diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/fvSchemes similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/fvSchemes diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/fvSolution similarity index 100% rename from tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution rename to tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/fvSolution From 577ef5742d57752c73defdc3949c4eae4024d4d7 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 13:30:04 +0000 Subject: [PATCH 16/23] ENH: buoyantPimpleFoam - updated equation sources --- applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H | 5 ++++- .../heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C | 1 - applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H | 4 +++- .../solvers/heatTransfer/buoyantSimpleFoam/createZones.H | 3 --- 4 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleFoam/createZones.H diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H index d8f3bb56ce..e12724ed69 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/UEqn.H @@ -5,10 +5,14 @@ fvm::ddt(rho, U) + fvm::div(phi, U) + turbulence->divDevRhoReff(U) + == + sources(rho, U) ); UEqn.relax(); + sources.constrain(UEqn); + if (pimple.momentumPredictor()) { solve @@ -22,7 +26,6 @@ - fvc::snGrad(p_rgh) )*mesh.magSf() ) - + sources(rho, U) ); K = 0.5*magSqr(U); } diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index 79d3fb7f2f..c78c453058 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -36,7 +36,6 @@ Description #include "fvCFD.H" #include "rhoThermo.H" #include "turbulenceModel.H" -#include "fixedGradientFvPatchFields.H" #include "IObasicSourceList.H" #include "pimpleControl.H" diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index 86c314c9c4..e82c1fa97c 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -9,7 +9,7 @@ surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU)); volVectorField HbyA("HbyA", U); - HbyA = rAU*(UEqn == sources(rho, U))().H(); + HbyA = rAU*UEqn.H(); surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf()); @@ -24,6 +24,8 @@ + phig ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + fvScalarMatrix p_rghDDtEqn ( fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createZones.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createZones.H deleted file mode 100644 index 08480c68d2..0000000000 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createZones.H +++ /dev/null @@ -1,3 +0,0 @@ - IOMRFZoneList mrfZones(mesh); - mrfZones.correctBoundaryVelocity(U); - From 8f76549b1d630ef509c8807a485956b6dca9751a Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 13:30:14 +0000 Subject: [PATCH 17/23] ENH: buoyantSimpleFoam - updated equation sources --- .../solvers/heatTransfer/buoyantSimpleFoam/EEqn.H | 4 ++++ .../heatTransfer/buoyantSimpleFoam/Make/options | 12 ++++++++---- .../solvers/heatTransfer/buoyantSimpleFoam/UEqn.H | 4 +++- .../buoyantSimpleFoam/buoyantSimpleFoam.C | 3 +-- .../heatTransfer/buoyantSimpleFoam/createFields.H | 2 ++ .../solvers/heatTransfer/buoyantSimpleFoam/pEqn.H | 3 ++- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H index 0d1f41d0c3..094b50cb3e 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H @@ -12,9 +12,13 @@ - fvm::laplacian(turbulence->alphaEff(), he) == radiation->Sh(thermo) + + sources(rho, he) ); EEqn.relax(); + + sources.constrain(EEqn); + EEqn.solve(); thermo.correct(); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options index f26046adb2..5103b2dd72 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options @@ -1,18 +1,22 @@ EXE_INC = \ - -I.. \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/RAS \ - -I$(LIB_SRC)/finiteVolume/cfdTools \ - -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ + -lfiniteVolume \ + -lfieldSources \ + -lsampling \ + -lmeshTools \ -lfluidThermophysicalModels \ -lspecie \ -lradiationModels \ -lcompressibleTurbulenceModel \ -lcompressibleRASModels \ - -lfiniteVolume \ -lmeshTools diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H index e1593c3691..860cef4547 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/UEqn.H @@ -4,11 +4,13 @@ ( fvm::div(phi, U) + turbulence->divDevRhoReff(U) + == + sources(rho, U) ); UEqn().relax(); - mrfZones.addCoriolis(rho, UEqn()); + sources.constrain(UEqn()); if (simple.momentumPredictor()) { diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 38f3a7c647..16c8e368a2 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -36,7 +36,7 @@ Description #include "fixedGradientFvPatchFields.H" #include "radiationModel.H" #include "simpleControl.H" -#include "IOMRFZoneList.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,7 +47,6 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "readGravitationalAcceleration.H" #include "createFields.H" - #include "createZones.H" #include "createRadiationModel.H" #include "initContinuityErrs.H" diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H index bb7a65cb1d..704bf32d50 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/createFields.H @@ -87,3 +87,5 @@ dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar totalVolume = sum(mesh.V()); + + IObasicSourceList sources(mesh); diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 66ae75b650..2e6cbf3d47 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -17,7 +17,7 @@ fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) ); - mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); bool closedVolume = adjustPhi(phiHbyA, U, p_rgh); @@ -45,6 +45,7 @@ // calculated from the relaxed pressure U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf); U.correctBoundaryConditions(); + sources.correct(U); } } From 9226110172a50b80ad3e3942080b38976e8a428d Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 13:30:29 +0000 Subject: [PATCH 18/23] ENH: CHT solvers - updated equation sources --- .../chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C | 1 - .../chtMultiRegionSimpleFoam/fluid/EEqn.H | 3 +++ .../chtMultiRegionSimpleFoam/fluid/UEqn.H | 6 +++--- .../chtMultiRegionSimpleFoam/fluid/createFluidFields.H | 8 -------- .../chtMultiRegionSimpleFoam/fluid/pEqn.H | 3 +++ .../chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H | 2 -- .../solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H | 3 +++ .../heatTransfer/chtMultiRegionFoam/solid/solveSolid.H | 7 ++++++- 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C index 4586122006..149a81a3a4 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C @@ -36,7 +36,6 @@ Description #include "regionProperties.H" #include "solidThermo.H" #include "radiationModel.H" -#include "IOporosityModelList.H" #include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H index be84cfce0e..3e3157de72 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/EEqn.H @@ -16,6 +16,9 @@ ); EEqn.relax(); + + sources.constrain(EEqn); + EEqn.solve(); thermo.correct(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H index 8bbc8be581..8df8cd4784 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H @@ -3,13 +3,13 @@ ( fvm::div(phi, U) + turb.divDevRhoReff(U) - + sources(rho, U) + == + sources(rho, U) ); UEqn().relax(); - // Add porous resistance - pZones.addResistance(UEqn()); + sources.constrain(UEqn()); solve ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H index 3d66fa798b..d30848804e 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H @@ -18,7 +18,6 @@ PtrList rhoMin(fluidRegions.size()); PtrList heatSources(fluidRegions.size()); - PtrList porousZonesFluid(fluidRegions.size()); // Populate fluid field pointer lists forAll(fluidRegions, i) @@ -200,13 +199,6 @@ i, new IObasicSourceList(fluidRegions[i]) ); - - Info<< " Adding porous zones\n" << endl; - porousZonesFluid.set - ( - i, - new IOporosityModelList(fluidRegions[i]) - ); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H index d2ea510ced..fca0848912 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H @@ -23,6 +23,8 @@ phiHbyA += phig; + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + dimensionedScalar compressibility = fvc::domainIntegrate(psi); bool compressible = (compressibility.value() > SMALL); @@ -54,6 +56,7 @@ // calculated from the relaxed pressure U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux())/rhorAUf); U.correctBoundaryConditions(); + sources.correct(U); } } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H index 4f15d8c619..ee005e0d22 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H @@ -14,8 +14,6 @@ IObasicSourceList& sources = heatSources[i]; - const IOporosityModelList& pZones = porousZonesFluid[i]; - const dimensionedScalar initialMass ( "initialMass", diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H index 753c3257de..2944c6aef0 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -24,6 +24,8 @@ + phig ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + { fvScalarMatrix p_rghDDtEqn ( @@ -64,6 +66,7 @@ U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); U.correctBoundaryConditions(); + sources.correct(U); K = 0.5*magSqr(U); } } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H index a04750cf17..c281ccc197 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H @@ -10,9 +10,14 @@ if (finalIter) ( fvm::ddt(betav*rho, h) - fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)") - + sources(rho, h) + == + sources(rho, h) ); + hEqn().relax(); + + sources.constrain(hEqn()); + hEqn().solve(mesh.solver(h.select(finalIter))); } } From 46c5a2b7dd4897e06fd1529eb55314e1e0555d5f Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 14:21:58 +0000 Subject: [PATCH 19/23] ENH: Added radiation capability to buoyantPimpleFoam --- .../heatTransfer/buoyantPimpleFoam/EEqn.H | 28 +++++++++++++++++++ .../buoyantPimpleFoam/Make/options | 20 ++++++------- .../buoyantPimpleFoam/buoyantPimpleFoam.C | 2 ++ .../buoyantPimpleFoam/createFields.H | 5 +--- 4 files changed, 41 insertions(+), 14 deletions(-) create mode 100644 applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H new file mode 100644 index 0000000000..1cc6ed584c --- /dev/null +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H @@ -0,0 +1,28 @@ +{ + volScalarField& he = thermo.he(); + + fvScalarMatrix EEqn + ( + fvm::ddt(rho, he) + fvm::div(phi, he) + + fvc::ddt(rho, K) + fvc::div(phi, K) + + ( + he.name() == "e" + ? fvc::div + ( + fvc::absolute(phi/fvc::interpolate(rho), U), + p, + "div(phiv,p)" + ) + : -dpdt + ) + - fvm::laplacian(turbulence->alphaEff(), he) + == + sources(rho, he) + ); + + EEqn.relax(); + sources.constrain(EEqn); + EEqn.solve(); + + thermo.correct(); +} diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options index 5d86b094de..6962643dcd 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options @@ -1,21 +1,21 @@ EXE_INC = \ - -I../../compressible/rhoPimpleFoam \ - -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/sampling/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/fieldSources/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel EXE_LIBS = \ - -lmeshTools \ - -lfluidThermophysicalModels \ - -lspecie \ - -lcompressibleTurbulenceModel \ - -lcompressibleRASModels \ - -lcompressibleLESModels \ -lfiniteVolume \ -lsampling \ -lmeshTools \ - -lfieldSources + -lfieldSources \ + -lfluidThermophysicalModels \ + -lradiationModels \ + -lspecie \ + -lcompressibleTurbulenceModel \ + -lcompressibleRASModels \ + -lcompressibleLESModels diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C index c78c453058..62fcf33c04 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/buoyantPimpleFoam.C @@ -36,6 +36,7 @@ Description #include "fvCFD.H" #include "rhoThermo.H" #include "turbulenceModel.H" +#include "radiationModel.H" #include "IObasicSourceList.H" #include "pimpleControl.H" @@ -48,6 +49,7 @@ int main(int argc, char *argv[]) #include "createMesh.H" #include "readGravitationalAcceleration.H" #include "createFields.H" + #include "createRadiationModel.H" #include "initContinuityErrs.H" #include "readTimeControls.H" #include "compressibleCourantNo.H" diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H index 9838978028..b606339627 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/createFields.H @@ -1,9 +1,6 @@ Info<< "Reading thermophysical properties\n" << endl; - autoPtr pThermo - ( - rhoThermo::New(mesh) - ); + autoPtr pThermo(rhoThermo::New(mesh)); rhoThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); From cf6956f119a640f830cdbfe4061f7c713f99a618 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 14:22:23 +0000 Subject: [PATCH 20/23] ENH: Removed unused #include header --- .../solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C | 1 - 1 file changed, 1 deletion(-) diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C index 16c8e368a2..bbd6f77773 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/buoyantSimpleFoam.C @@ -33,7 +33,6 @@ Description #include "fvCFD.H" #include "psiThermo.H" #include "RASModel.H" -#include "fixedGradientFvPatchFields.H" #include "radiationModel.H" #include "simpleControl.H" #include "IObasicSourceList.H" From b5d1ab435d5b2f3d2599506defc3bf6eeab22448 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 15:08:52 +0000 Subject: [PATCH 21/23] ENH: Updated solver run-time selectable sources --- applications/solvers/combustion/XiFoam/pEqn.H | 4 ++-- .../solvers/combustion/engineFoam/pEqn.H | 4 ++-- .../solvers/combustion/fireFoam/pEqn.H | 2 +- .../solvers/combustion/reactingFoam/pEqn.H | 4 ++-- .../solvers/combustion/rhoReactingFoam/pEqn.H | 4 ++-- .../solvers/compressible/rhoPimpleFoam/pEqn.H | 4 ++-- .../rhoPimpleFoam/rhoPimplecFoam/pEqn.H | 4 ++-- .../solvers/compressible/rhoSimpleFoam/pEqn.H | 4 ++-- .../rhoSimpleFoam/rhoSimplecFoam/pEqn.H | 4 ++-- .../heatTransfer/buoyantPimpleFoam/pEqn.H | 2 +- .../lagrangian/coalChemistryFoam/UEqn.H | 3 ++- .../lagrangian/coalChemistryFoam/pEqn.H | 10 ++++++--- .../lagrangian/reactingParcelFilmFoam/EEqn.H | 2 ++ .../reactingParcelFilmFoam/Make/options | 4 ++++ .../lagrangian/reactingParcelFilmFoam/UEqn.H | 3 +++ .../lagrangian/reactingParcelFilmFoam/YEqn.H | 12 +++++++--- .../reactingParcelFilmFoam/createFields.H | 2 ++ .../lagrangian/reactingParcelFilmFoam/pEqn.H | 5 +++++ .../reactingParcelFilmFoam.C | 1 + .../reactingParcelFilmFoam/rhoEqn.H | 3 ++- .../lagrangian/reactingParcelFoam/UEqn.H | 3 ++- .../lagrangian/reactingParcelFoam/pEqn.H | 22 ++++++++++--------- .../solvers/lagrangian/sprayFoam/UEqn.H | 3 ++- .../solvers/lagrangian/sprayFoam/pEqn.H | 10 ++++++++- .../sprayFoam/sprayEngineFoam/pEqn.H | 10 ++++++++- 25 files changed, 89 insertions(+), 40 deletions(-) diff --git a/applications/solvers/combustion/XiFoam/pEqn.H b/applications/solvers/combustion/XiFoam/pEqn.H index 99d445e6e9..b5a6d173fb 100644 --- a/applications/solvers/combustion/XiFoam/pEqn.H +++ b/applications/solvers/combustion/XiFoam/pEqn.H @@ -29,7 +29,7 @@ if (pimple.transonic()) sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -64,7 +64,7 @@ else sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/combustion/engineFoam/pEqn.H b/applications/solvers/combustion/engineFoam/pEqn.H index 2a45a1d7e0..b38d6dbf4b 100644 --- a/applications/solvers/combustion/engineFoam/pEqn.H +++ b/applications/solvers/combustion/engineFoam/pEqn.H @@ -26,7 +26,7 @@ if (pimple.transonic()) sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -58,7 +58,7 @@ else sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/combustion/fireFoam/pEqn.H b/applications/solvers/combustion/fireFoam/pEqn.H index 4a0145a693..6101c9dd5d 100644 --- a/applications/solvers/combustion/fireFoam/pEqn.H +++ b/applications/solvers/combustion/fireFoam/pEqn.H @@ -37,7 +37,7 @@ while (pimple.correctNonOrthogonal()) + sources(psi, p_rgh, rho.name()) ); - sources.constrain(p_rghEqn, rho.name()); + sources.constrain(p_rghEqn); p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/combustion/reactingFoam/pEqn.H b/applications/solvers/combustion/reactingFoam/pEqn.H index 34c8bde310..2ed1bc1ca5 100644 --- a/applications/solvers/combustion/reactingFoam/pEqn.H +++ b/applications/solvers/combustion/reactingFoam/pEqn.H @@ -29,7 +29,7 @@ if (pimple.transonic()) sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -64,7 +64,7 @@ else sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/combustion/rhoReactingFoam/pEqn.H b/applications/solvers/combustion/rhoReactingFoam/pEqn.H index 55880747b2..cb25d83662 100644 --- a/applications/solvers/combustion/rhoReactingFoam/pEqn.H +++ b/applications/solvers/combustion/rhoReactingFoam/pEqn.H @@ -40,7 +40,7 @@ sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -80,7 +80,7 @@ - fvm::laplacian(rho*rAU, p) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 0d1f3e25d4..a656d77248 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -39,7 +39,7 @@ if (pimple.transonic()) sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -77,7 +77,7 @@ else sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H index 628eb71f29..aa3e615af6 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimplecFoam/pEqn.H @@ -51,7 +51,7 @@ if (pimple.transonic()) // Relax the pressure equation to maintain diagonal dominance pEqn.relax(); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(); @@ -89,7 +89,7 @@ else sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(); diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 4f1ad08b28..2782d20652 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -35,7 +35,7 @@ // Relax the pressure equation to ensure diagonal-dominance pEqn.relax(); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.setReference(pRefCell, pRefValue); @@ -71,7 +71,7 @@ pEqn.setReference(pRefCell, pRefValue); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H index 1ffacc1afa..02300d8a9e 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoSimplecFoam/pEqn.H @@ -45,7 +45,7 @@ if (simple.transonic()) // Relax the pressure equation to maintain diagonal dominance pEqn.relax(); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.setReference(pRefCell, pRefValue); @@ -82,7 +82,7 @@ else sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.setReference(pRefCell, pRefValue); diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H index e82c1fa97c..99bef3a118 100644 --- a/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/pEqn.H @@ -42,7 +42,7 @@ - fvm::laplacian(rhorAUf, p_rgh) ); - sources.constrain(p_rghEqn, rho.name()); + sources.constrain(p_rghEqn); p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H index 24f56e83d2..fe7b047d9a 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H @@ -7,6 +7,7 @@ rho.dimensionedInternalField()*g + coalParcels.SU(U) + limestoneParcels.SU(U) + + sources(rho, U) ); UEqn.relax(); @@ -15,6 +16,6 @@ if (pimple.momentumPredictor()) { - solve(UEqn == -fvc::grad(p) + sources(rho, U)); + solve(UEqn == -fvc::grad(p)); K = 0.5*magSqr(U); } diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 22d927ca6b..0baee1ad30 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -2,7 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA("HbyA", U); -HbyA = rAU*(UEqn == sources(rho, U))().H(); +HbyA = rAU*UEqn.H(); if (pimple.transonic()) { @@ -16,6 +16,8 @@ if (pimple.transonic()) ) ); + sources.relativeFlux(fvc::interpolate(psi), phid); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -28,7 +30,7 @@ if (pimple.transonic()) + sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); @@ -50,6 +52,8 @@ else ) ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -62,7 +66,7 @@ else + sources(psi, p, rho.name()) ); - sources.constrain(pEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H index f5a909a9dd..2c327a1099 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/EEqn.H @@ -21,9 +21,11 @@ + surfaceFilm.Sh() + radiation->Sh(thermo) + combustion->Sh() + + sources(rho, he) ); EEqn.relax(); + sources.constrain(EEqn); EEqn.solve(); thermo.correct(); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options index a477abff47..a2d24b6d11 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options @@ -1,5 +1,7 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/fieldSources/lnInclude \ + -I${LIB_SRC}/sampling/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ @@ -25,6 +27,8 @@ EXE_INC = \ EXE_LIBS = \ -lfiniteVolume \ + -lfieldSources \ + -lsampling \ -lmeshTools \ -lcompressibleRASModels \ -lcompressibleLESModels \ diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H index 81c587e243..5884abe0c1 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/UEqn.H @@ -5,10 +5,13 @@ + turbulence->divDevRhoReff(U) == parcels.SU(U) + + sources(rho, U) ); UEqn.relax(); + sources.constrain(UEqn); + if (pimple.momentumPredictor()) { solve diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H index b14b7d6dae..e05dcdef6a 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H @@ -22,18 +22,24 @@ tmp > mvConvection { volScalarField& Yi = Y[i]; - solve + fvScalarMatrix YEqn ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) - fvm::laplacian(turbulence->alphaEff(), Yi) == parcels.SYi(i, Yi) + + sources(rho, Yi) + + combustion->R(Yi) + surfaceFilm.Srho(i) - + combustion->R(Yi), - mesh.solver("Yi") ); + YEqn.relax(); + + sources.constrain(YEqn); + + YEqn.solve(mesh.solver("Yi")); + Yi.max(0.0); Yt += Yi; } diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 057978c8f8..1a15b1b2ab 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -139,3 +139,5 @@ mesh, dimensionedScalar("dQ", dimEnergy/dimTime, 0.0) ); + + IObasicSourceList sources(mesh); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H index 6a09845b6b..bcdd3beca4 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/pEqn.H @@ -18,6 +18,7 @@ surfaceScalarField phiHbyA + phig ); +sources.relativeFlux(fvc::interpolate(rho), phiHbyA); while (pimple.correctNonOrthogonal()) { @@ -30,8 +31,11 @@ while (pimple.correctNonOrthogonal()) == parcels.Srho() + surfaceFilm.Srho() + + sources(psi, p_rgh, rho.name()) ); + sources.constrain(p_rghEqn); + p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -39,6 +43,7 @@ while (pimple.correctNonOrthogonal()) phi = phiHbyA + p_rghEqn.flux(); U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf); U.correctBoundaryConditions(); + sources.correct(U); } } diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C index 06df5b1748..203ee0ecd8 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C @@ -37,6 +37,7 @@ Description #include "psiCombustionModel.H" #include "radiationModel.H" #include "SLGThermo.H" +#include "IObasicSourceList.H" #include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H index f939060181..282acfe91e 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/rhoEqn.H @@ -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 @@ -37,6 +37,7 @@ Description == parcels.Srho(rho) + surfaceFilm.Srho() + + sources(rho) ); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H index 090922e572..612e582c54 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/UEqn.H @@ -7,6 +7,7 @@ == rho.dimensionedInternalField()*g + parcels.SU(U) + + sources(rho, U) ); UEqn.relax(); @@ -17,6 +18,6 @@ if (pimple.momentumPredictor()) { - solve(UEqn == -fvc::grad(p) + sources(rho, U)); + solve(UEqn == -fvc::grad(p)); K = 0.5*magSqr(U); } diff --git a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H index 1bcdf7c92f..569beae058 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/pEqn.H @@ -7,17 +7,19 @@ volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA("HbyA", U); - HbyA = rAU*(UEqn == sources(rho, U))().H(); + HbyA = rAU*UEqn.H(); - surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf()); - if (!pZones.active()) - { - // ddtPhiCorr only used without porosity - phiHbyA += fvc::ddtPhiCorr(rAU, rho, U, phi); - } - - phiHbyA *= fvc::interpolate(rho); + surfaceScalarField phiHbyA + ( + "phiHbyA", + fvc::interpolate(rho) + *( + (fvc::interpolate(HbyA) & mesh.Sf()) + + fvc::ddtPhiCorr(rAU, rho, U, phi) + ) + ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); fvScalarMatrix pDDtEqn ( @@ -36,7 +38,7 @@ - fvm::laplacian(rho*rAU, p) ); - sources.constrain(pDDtEqn, rho.name()); + sources.constrain(pEqn); pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); diff --git a/applications/solvers/lagrangian/sprayFoam/UEqn.H b/applications/solvers/lagrangian/sprayFoam/UEqn.H index 2ddaa2c301..3723f7f79d 100644 --- a/applications/solvers/lagrangian/sprayFoam/UEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/UEqn.H @@ -6,6 +6,7 @@ == rho.dimensionedInternalField()*g + parcels.SU(U) + + sources(rho, U) ); UEqn.relax(); @@ -14,6 +15,6 @@ if (pimple.momentumPredictor()) { - solve(UEqn == -fvc::grad(p) + sources(rho, U)); + solve(UEqn == -fvc::grad(p)); K = 0.5*magSqr(U); } diff --git a/applications/solvers/lagrangian/sprayFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/pEqn.H index d476a6bda8..9d95ee6dec 100644 --- a/applications/solvers/lagrangian/sprayFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/pEqn.H @@ -2,7 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA("HbyA", U); -HbyA = rAU*(UEqn == sources(rho, U))().H(); +HbyA = rAU*UEqn.H(); if (pimple.transonic()) { @@ -16,6 +16,8 @@ if (pimple.transonic()) ) ); + sources.relativeFlux(fvc::interpolate(psi), phid); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -28,6 +30,8 @@ if (pimple.transonic()) + sources(psi, p, rho.name()) ); + sources.constrain(pEqn); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -48,6 +52,8 @@ else ) ); + sources.relativeFlux(fvc::interpolate(psi), phiHbyA); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -60,6 +66,8 @@ else + sources(psi, p, rho.name()) ); + sources.constrain(pEqn); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) diff --git a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H index 0301fba2ea..d3435a8163 100644 --- a/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H +++ b/applications/solvers/lagrangian/sprayFoam/sprayEngineFoam/pEqn.H @@ -2,7 +2,7 @@ rho = thermo.rho(); volScalarField rAU(1.0/UEqn.A()); volVectorField HbyA("HbyA", U); -HbyA = rAU*(UEqn == sources(rho, U))().H(); +HbyA = rAU*UEqn.H(); if (pimple.transonic()) { @@ -16,6 +16,8 @@ if (pimple.transonic()) ) ); + sources.relativeFlux(fvc::interpolate(psi), phid); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -28,6 +30,8 @@ if (pimple.transonic()) + sources(psi, p, rho.name()) ); + sources.constrain(pEqn); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -48,6 +52,8 @@ else ) ); + sources.relativeFlux(fvc::interpolate(rho), phiHbyA); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn @@ -60,6 +66,8 @@ else + sources(psi, p, rho.name()) ); + sources.constrain(pEqn); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) From 74e2acbc2253a17dae8e2ff7720fa6ec5abe6718 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 15:48:25 +0000 Subject: [PATCH 22/23] ENH: Tutorial updates --- tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0.org/T | 2 +- tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/T | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0.org/T b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0.org/T index 85431492b2..3ddfa33af1 100644 --- a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0.org/T +++ b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0.org/T @@ -39,7 +39,7 @@ boundaryField U U; phi phi; rho none; - psi psi; + psi thermo:psi; gamma 1.4; } diff --git a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/T b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/T index 5361f751ed..4fee89f86e 100644 --- a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/T +++ b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/0/T @@ -1243,7 +1243,7 @@ boundaryField type totalTemperature; U U; phi phi; - psi psi; + psi thermo:psi; gamma 1.4; T0 uniform 297; value nonuniform List From 2bb551bc85b51db216aca110e5478faede918e13 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 6 Dec 2012 15:56:16 +0000 Subject: [PATCH 23/23] ENH: Updated smoluchowskiJump BC --- .../T/smoluchowskiJumpTFvPatchScalarField.C | 26 ++++++++++++++++--- .../T/smoluchowskiJumpTFvPatchScalarField.H | 18 ++++++++++--- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C index 8f1ebe37c8..2b04637b04 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C @@ -38,6 +38,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), + UName_("U"), + rhoName_("rho"), + psiName_("thermo:psi"), + muName_("thermo:mu"), accommodationCoeff_(1.0), Twall_(p.size(), 0.0), gamma_(1.4) @@ -57,6 +61,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField ) : mixedFvPatchScalarField(ptf, p, iF, mapper), + UName_(ptf.UName_), + rhoName_(ptf.rhoName_), + psiName_(ptf.psiName_), + muName_(ptf.muName_), accommodationCoeff_(ptf.accommodationCoeff_), Twall_(ptf.Twall_), gamma_(ptf.gamma_) @@ -71,6 +79,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField ) : mixedFvPatchScalarField(p, iF), + UName_(dict.lookupOrDefault("U", "U")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + psiName_(dict.lookupOrDefault("psi", "thermo:psi")), + muName_(dict.lookupOrDefault("mu", "thermo:mu")), accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))), Twall_("Twall", dict, p.size()), gamma_(dict.lookupOrDefault("gamma", 1.4)) @@ -159,13 +171,13 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs() } const fvPatchScalarField& pmu = - patch().lookupPatchField("mu"); + patch().lookupPatchField(muName_); const fvPatchScalarField& prho = - patch().lookupPatchField("rho"); + patch().lookupPatchField(rhoName_); const fvPatchField& ppsi = - patch().lookupPatchField("psi"); + patch().lookupPatchField(psiName_); const fvPatchVectorField& pU = - patch().lookupPatchField("U"); + patch().lookupPatchField(UName_); // Prandtl number reading consistent with rhoCentralFoam const dictionary& thermophysicalProperties = @@ -204,6 +216,12 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs() void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const { fvPatchScalarField::write(os); + + writeEntryIfDifferent(os, "U", "U", UName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "psi", "thermo:psi", psiName_); + writeEntryIfDifferent(os, "mu", "thermo:mu", muName_); + os.writeKeyword("accommodationCoeff") << accommodationCoeff_ << token::END_STATEMENT << nl; Twall_.writeEntry("Twall", os); diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H index 8f84cfb6e6..845aa9f424 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.H @@ -53,13 +53,25 @@ class smoluchowskiJumpTFvPatchScalarField // Private data - // Accommodation coefficient + //- Velocity field name, default = "U" + word UName_; + + //- Density field name, default = "rho" + word rhoName_; + + //- Compressibility field name, default = "thermo:psi" + word psiName_; + + //- Dynamic viscosity field name, default = "thermo:mu" + word muName_; + + //- Accommodation coefficient scalar accommodationCoeff_; - // Wall surface temperature + //- Wall surface temperature scalarField Twall_; - // Heat capacity ratio (default 1.4) + //- Heat capacity ratio (default 1.4) scalar gamma_; public: