diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..e924e9de680bcbe388c230a109aa2d01c14b9adf --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/files @@ -0,0 +1,13 @@ +regionProperties/regionProperties.C + +coupleManager/coupleManager.C + +derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C +derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C + + +chtMultiRegionFoam.C + +EXE = $(FOAM_APPBIN)/chtMultiRegionFoam + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..6bf54dad003cf91b4c5e8668cc5494f803a01d10 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options @@ -0,0 +1,16 @@ +EXE_INC = \ + -Ifluid \ + -Isolid \ + -IregionProperties \ + -IcoupleManager \ + -IderivedFvPatchFields/solidWallTemperatureCoupled \ + -IderivedFvPatchFields/solidWallHeatFluxTemperatureCoupled \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/turbulenceModels + +EXE_LIBS = \ + -lfiniteVolume \ + -lbasicThermophysicalModels \ + -lspecie \ + -lcompressibleTurbulenceModels diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..b8151196305023ca58530101a7ca4dd4c0469fd4 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionFoam.C @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + chtMultiRegionFoam + +Description + Combination of heatConductionFoam and buoyantFoam for conjugate heat + transfer between a solid region and fluid region + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicThermo.H" +#include "compressible/turbulenceModel/turbulenceModel.H" +#include "fixedGradientFvPatchFields.H" +#include "regionProperties.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "solveContinuityEquation.C" +#include "solveMomentumEquation.C" +#include "compressibleContinuityErrors.C" +#include "solvePressureDifferenceEquation.C" +#include "solveEnthalpyEquation.C" +#include "compressibleCourantNo.C" + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" +# include "createTime.H" + + regionProperties rp(runTime); + +# include "createFluidMeshes.H" +# include "createSolidMeshes.H" + +# include "createFluidFields.H" + +# include "createSolidFields.H" + +# include "initContinuityErrs.H" + +# include "readTimeControls.H" + + if (fluidRegions.size()) + { +# include "compressibleMultiRegionCourantNo.H" +# include "setInitialDeltaT.H" + } + + while(runTime.run()) + { +# include "readTimeControls.H" + + if (fluidRegions.size()) + { +# include "compressibleMultiRegionCourantNo.H" +# include "setDeltaT.H" + } + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + forAll(fluidRegions, i) + { + Info<< "\nSolving for fluid region " + << fluidRegions[i].name() << endl; +# include "readFluidMultiRegionPISOControls.H" +# include "solveFluid.H" + } + + forAll(solidRegions, i) + { + Info<< "\nSolving for solid region " + << solidRegions[i].name() << endl; +# include "readSolidMultiRegionPISOControls.H" +# include "solveSolid.H" + } + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info << "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.C new file mode 100644 index 0000000000000000000000000000000000000000..0fbe3ea29fdda768310dad8dcf784f07c0504f2f --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.C @@ -0,0 +1,140 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "coupleManager.H" +#include "OFstream.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::coupleManager::coupleManager(const fvPatch& patch) +: + patch_(patch), + neighbourRegionName_("undefined-neighbourRegionName"), + neighbourPatchName_("undefined-neighbourPatchName"), + neighbourFieldName_("undefined-neighbourFieldName"), + localRegion_(patch_.boundaryMesh().mesh()) +{} + + +Foam::coupleManager::coupleManager +( + const fvPatch& patch, + const dictionary& dict +) +: + patch_(patch), + neighbourRegionName_(dict.lookup("neighbourRegionName")), + neighbourPatchName_(dict.lookup("neighbourPatchName")), + neighbourFieldName_(dict.lookup("neighbourFieldName")), + localRegion_(patch_.boundaryMesh().mesh()) +{} + + +Foam::coupleManager::coupleManager +( + const coupleManager& cm +) +: + patch_(cm.patch()), + neighbourRegionName_(cm.neighbourRegionName()), + neighbourPatchName_(cm.neighbourPatchName()), + neighbourFieldName_(cm.neighbourFieldName()), + localRegion_(patch_.boundaryMesh().mesh()) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::coupleManager::~coupleManager() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::coupleManager::checkCouple() const +{ + Info<< "neighbourRegionName_ = " << neighbourRegionName_ << endl; + Info<< "neighbourPatchName_ = " << neighbourPatchName_ << endl; + Info<< "neighbourFieldName_ = " << neighbourFieldName_ << endl; + + const fvPatch& nPatch = neighbourPatch(); + + if (patch_.size() != nPatch.size()) + { + FatalErrorIn("Foam::coupleManager::checkCouple()") + << "Unequal patch sizes:" << nl + << " patch name (size) = " << patch_.name() + << "(" << patch_.size() << ")" << nl + << " neighbour patch name (size) = " + << nPatch.name() << "(" << patch_.size() << ")" << nl + << abort(FatalError); + } +} + + +void Foam::coupleManager::coupleToObj() const +{ + const fvPatch& nPatch = neighbourPatch(); + + OFstream obj + ( + patch_.name() + "_to_" + nPatch.name() + "_couple.obj" + ); + const vectorField& c1 = patch_.Cf(); + const vectorField& c2 = neighbourPatch().Cf(); + + if (c1.size() != c2.size()) + { + FatalErrorIn("coupleManager::coupleToObj() const") + << "Coupled patches are of unequal size:" << nl + << " patch0 = " << patch_.name() + << "(" << patch_.size() << ")" << nl + << " patch1 = " << nPatch.name() + << "(" << nPatch.size() << ")" << nl + << abort(FatalError); + } + + forAll(c1, i) + { + obj << "v " << c1[i].x() << " " << c1[i].y() << " " << c1[i].z() << nl + << "v " << c2[i].x() << " " << c2[i].y() << " " << c2[i].z() << nl + << "l " << (2*i + 1) << " " << (2*i + 2) << endl; + } +} + + +void Foam::coupleManager::writeEntries(Ostream& os) const +{ + os.writeKeyword("neighbourRegionName"); + os << neighbourRegionName_ << token::END_STATEMENT << nl; + os.writeKeyword("neighbourPatchName"); + os << neighbourPatchName_ << token::END_STATEMENT << nl; + os.writeKeyword("neighbourFieldName"); + os << neighbourFieldName_ << token::END_STATEMENT << nl; +} + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.H new file mode 100644 index 0000000000000000000000000000000000000000..a6f265faae1558f724dcb3d8a9100ca75bea30d7 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManager.H @@ -0,0 +1,170 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + coupleManager + +Description + Object to handle the coupling of region patches. It can be queried to + return the neighbour information. + +SourceFiles + coupleManager.C + +\*---------------------------------------------------------------------------*/ + +#ifndef coupleManager_H +#define coupleManager_H + +#include "Ostream.H" +#include "dictionary.H" +#include "fvPatch.H" +#include "fvMesh.H" +#include "Time.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class coupleManager Declaration +\*---------------------------------------------------------------------------*/ + +class coupleManager +{ + // Private data + + //- Reference to the local fvPatch + const fvPatch& patch_; + + //- Name of neighbour region + word neighbourRegionName_; + + //- Name of patch on the neighbour region + word neighbourPatchName_; + + //- Name of field on the neighbour region + word neighbourFieldName_; + + //- Reference to the local region + const fvMesh& localRegion_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct +// coupleManager(const coupleManager&); + + //- Disallow default bitwise assignment + void operator=(const coupleManager&); + + +public: + + // Constructors + + //- Construct from fvPatch + coupleManager(const fvPatch& patch); + + //- Construct from fvPatch and dictionary + coupleManager(const fvPatch& patch, const dictionary& dict); + + //- Copy constructor + coupleManager(const coupleManager& cm); + + + // Destructor + + ~coupleManager(); + + + // Member Functions + + // Access + + //- Return a reference to the local patch + inline const fvPatch& patch() const; + + //- Return the name of the neighbour region + inline const word& neighbourRegionName() const; + + //- Return the name of the patch on the neighbour region + inline const word& neighbourPatchName() const; + + //- Return the name of the field on the neighbour region + inline const word& neighbourFieldName() const; + + //- Return a reference to the neighbour mesh + inline const fvMesh& neighbourRegion() const; + + //- Return the neighbour patch ID + inline const label neighbourPatchID() const; + + //- Return a reference to the neighbour patch + inline const fvPatch& neighbourPatch() const; + + //- Return a reference to the neighbour patch field + template<class Type> + inline const fvPatchField<Type>& neighbourPatchField() const; + + //- Check that the couple is valid + void checkCouple() const; + + + // Edit + + //- Return the name of the neighbour region + word& neighbourRegionName(); + + //- Return the name of the patch on the neighbour region + word& neighbourPatchName(); + + //- Return the name of the field on the neighbour region + word& neighbourFieldName(); + + + // Write + + //- Write couple to obj file + void coupleToObj() const; + + //- Write entries for patches + void writeEntries(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "coupleManagerI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManagerI.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManagerI.H new file mode 100644 index 0000000000000000000000000000000000000000..5a252d870422421bab3c95e06e79762c0aa6a24c --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupleManager/coupleManagerI.H @@ -0,0 +1,98 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +inline const Foam::fvPatch& Foam::coupleManager::patch() const +{ + return patch_; +}; + + +inline const Foam::word& Foam::coupleManager::neighbourRegionName() const +{ + return neighbourRegionName_; +}; + + +inline const Foam::word& Foam::coupleManager::neighbourPatchName() const +{ + return neighbourPatchName_; +}; + + +inline const Foam::word& Foam::coupleManager::neighbourFieldName() const +{ + return neighbourFieldName_; +}; + + +inline const Foam::fvMesh& Foam::coupleManager::neighbourRegion() const +{ + return localRegion_.objectRegistry::parent() + .lookupObject<fvMesh>(neighbourRegionName_); +} + + +inline const Foam::label Foam::coupleManager::neighbourPatchID() const +{ + return neighbourRegion().boundaryMesh().findPatchID(neighbourPatchName_); +} + + +inline const Foam::fvPatch& Foam::coupleManager::neighbourPatch() const +{ + return neighbourRegion().boundary()[neighbourPatchID()]; +} + + +template<class Type> +inline const Foam::fvPatchField<Type>& +Foam::coupleManager::neighbourPatchField() const +{ + return neighbourPatch().lookupPatchField + <GeometricField<Type, fvPatchField, volMesh>, Type> + (neighbourFieldName_); +} + + +inline Foam::word& Foam::coupleManager::neighbourRegionName() +{ + return neighbourRegionName_; +}; + + +inline Foam::word& Foam::coupleManager::neighbourPatchName() +{ + return neighbourPatchName_; +}; + + +inline Foam::word& Foam::coupleManager::neighbourFieldName() +{ + return neighbourFieldName_; +}; + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..c1fdf3f5380db24906d8845a6070754e4d1eef94 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C @@ -0,0 +1,168 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "solidWallHeatFluxTemperatureFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: +solidWallHeatFluxTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + q_(p.size(), 0.0), + KName_("undefined-K") +{} + + +Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: +solidWallHeatFluxTemperatureFvPatchScalarField +( + const solidWallHeatFluxTemperatureFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + q_(ptf.q_, mapper), + KName_(ptf.KName_) +{} + + +Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: +solidWallHeatFluxTemperatureFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + q_("q", dict, p.size()), + KName_(dict.lookup("K")) +{} + + +Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: +solidWallHeatFluxTemperatureFvPatchScalarField +( + const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf +) +: + fixedValueFvPatchScalarField(tppsf), + q_(tppsf.q_), + KName_(tppsf.KName_) +{} + + +Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: +solidWallHeatFluxTemperatureFvPatchScalarField +( + const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(tppsf, iF), + q_(tppsf.q_), + KName_(tppsf.KName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap +( + const fvPatchFieldMapper& m +) +{ + fixedValueFvPatchScalarField::autoMap(m); + q_.autoMap(m); +} + + +void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap +( + const fvPatchScalarField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchScalarField::rmap(ptf, addr); + + const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf = + refCast<const solidWallHeatFluxTemperatureFvPatchScalarField>(ptf); + + q_.rmap(hfptf.q_, addr); +} + + +void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const scalarField& Kw = + patch().lookupPatchField<volScalarField, scalar>(KName_); + + const fvPatchScalarField& Tw = *this; + + operator==(q_/(patch().deltaCoeffs()*Kw) + Tw.patchInternalField()); + + fixedValueFvPatchScalarField::updateCoeffs(); +} + + +void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write +( + Ostream& os +) const +{ + fixedValueFvPatchScalarField::write(os); + q_.writeEntry("q", os); + os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + solidWallHeatFluxTemperatureFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..a03fe7bf39c40a1f78c8821d4a3efa9254e70956 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H @@ -0,0 +1,181 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + solidWallHeatFluxTemperatureFvPatchScalarField + +Description + Heat flux boundary condition for temperature on solid region + + Example usage: + myWallPatch + { + type solidWallHeatFluxTemperature; + K K; // Name of K field + q uniform 1000; // Heat flux / [W/m2] + value 300.0; // Initial temperature / [K] + } + + +SourceFiles + solidWallHeatFluxTemperatureFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H +#define solidWallHeatFluxTemperatureFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class solidWallHeatFluxTemperatureFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Heat flux / [W/m2] + scalarField q_; + + //- Name of thermal conductivity field + word KName_; + + +public: + + //- Runtime type information + TypeName("solidWallHeatFluxTemperature"); + + + // Constructors + + //- Construct from patch and internal field + solidWallHeatFluxTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + solidWallHeatFluxTemperatureFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // solidWallHeatFluxTemperatureFvPatchScalarField + // onto a new patch + solidWallHeatFluxTemperatureFvPatchScalarField + ( + const solidWallHeatFluxTemperatureFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + solidWallHeatFluxTemperatureFvPatchScalarField + ( + const solidWallHeatFluxTemperatureFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new solidWallHeatFluxTemperatureFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + solidWallHeatFluxTemperatureFvPatchScalarField + ( + const solidWallHeatFluxTemperatureFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchScalarField&, + const labelList& + ); + + + // I-O + + //- Write + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..43a859a408c446cc164d187a7cce6bee1f0e46ad --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" + +#include "solidWallTemperatureCoupledFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: +solidWallHeatFluxTemperatureCoupledFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedGradientFvPatchScalarField(p, iF), + coupleManager_(p), + KName_("undefined-K") +{} + + +Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: +solidWallHeatFluxTemperatureCoupledFvPatchScalarField +( + const solidWallHeatFluxTemperatureCoupledFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedGradientFvPatchScalarField(ptf, p, iF, mapper), + coupleManager_(ptf.coupleManager_), + KName_(ptf.KName_) +{} + + +Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: +solidWallHeatFluxTemperatureCoupledFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedGradientFvPatchScalarField(p, iF), + coupleManager_(p, dict), + KName_(dict.lookup("K")) +{ + if (dict.found("value")) + { + fvPatchField<scalar>::operator= + ( + scalarField("value", dict, p.size()) + ); + } + else + { + evaluate(); + } +} + + +Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField:: +solidWallHeatFluxTemperatureCoupledFvPatchScalarField +( + const solidWallHeatFluxTemperatureCoupledFvPatchScalarField& whftcsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedGradientFvPatchScalarField(whftcsf, iF), + coupleManager_(whftcsf.coupleManager_), + KName_(whftcsf.KName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const fvPatchField<scalar>& neighbourField = + coupleManager_.neighbourPatchField<scalar>(); + + const fvPatchField<scalar>& K = + patch().lookupPatchField<volScalarField, scalar>(KName_); + + gradient() = refCast<const solidWallTemperatureCoupledFvPatchScalarField> + (neighbourField).flux()/K; + + fixedGradientFvPatchScalarField::updateCoeffs(); +} + + +void Foam::solidWallHeatFluxTemperatureCoupledFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + coupleManager_.writeEntries(os); + os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makePatchTypeField +( + fvPatchScalarField, + solidWallHeatFluxTemperatureCoupledFvPatchScalarField +); + +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..12b75c180020351050e80010b283146769b524d9 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperatureCoupled/solidWallHeatFluxTemperatureCoupledFvPatchScalarField.H @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + solidWallHeatFluxTemperatureCoupledFvPatchScalarField + +Description + Fixed heat-flux boundary condition for temperature, to be used by the + conjugate heat transfer solver. + + Example usage: + myInterfacePatchName + { + type solidWallHeatFluxTemperatureCoupled; + neighbourRegionName fluid; + neighbourPatchName fluidSolidInterface; + neighbourFieldName T; + K K; + value uniform 300; + } + +SourceFiles + solidWallHeatFluxTemperatureCoupledFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solidWallHeatFluxTemperatureCoupledFvPatchScalarField_H +#define solidWallHeatFluxTemperatureCoupledFvPatchScalarField_H + +#include "fvPatchFields.H" +#include "fixedGradientFvPatchFields.H" +#include "coupleManager.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class solidWallHeatFluxTemperatureCoupledFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class solidWallHeatFluxTemperatureCoupledFvPatchScalarField +: + public fixedGradientFvPatchScalarField +{ + // Private data + + //- Couple manager object + coupleManager coupleManager_; + + //- Name of thermal conductivity field + word KName_; + + +public: + + //- Runtime type information + TypeName("solidWallHeatFluxTemperatureCoupled"); + + + // Constructors + + //- Construct from patch and internal field + solidWallHeatFluxTemperatureCoupledFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + solidWallHeatFluxTemperatureCoupledFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // solidWallHeatFluxTemperatureCoupledFvPatchScalarField + // onto a new patch + solidWallHeatFluxTemperatureCoupledFvPatchScalarField + ( + const solidWallHeatFluxTemperatureCoupledFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new solidWallHeatFluxTemperatureCoupledFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + solidWallHeatFluxTemperatureCoupledFvPatchScalarField + ( + const solidWallHeatFluxTemperatureCoupledFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new solidWallHeatFluxTemperatureCoupledFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..b1480446bd3d7b6c42689adc7dc7bb4d801475a0 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.C @@ -0,0 +1,156 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "solidWallTemperatureCoupledFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solidWallTemperatureCoupledFvPatchScalarField:: +solidWallTemperatureCoupledFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(p, iF), + coupleManager_(p), + KName_("undefined-K") +{} + + +Foam::solidWallTemperatureCoupledFvPatchScalarField:: +solidWallTemperatureCoupledFvPatchScalarField +( + const solidWallTemperatureCoupledFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + coupleManager_(ptf.coupleManager_), + KName_(ptf.KName_) +{} + + +Foam::solidWallTemperatureCoupledFvPatchScalarField:: +solidWallTemperatureCoupledFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF), + coupleManager_(p, dict), + KName_(dict.lookup("K")) +{ + if (dict.found("value")) + { + fvPatchField<scalar>::operator= + ( + scalarField("value", dict, p.size()) + ); + } + else + { + evaluate(); + } +} + + +Foam::solidWallTemperatureCoupledFvPatchScalarField:: +solidWallTemperatureCoupledFvPatchScalarField +( + const solidWallTemperatureCoupledFvPatchScalarField& wtcsf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedValueFvPatchScalarField(wtcsf, iF), + coupleManager_(wtcsf.coupleManager_), + KName_(wtcsf.KName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::solidWallTemperatureCoupledFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const fvPatchField<scalar>& neighbourField = + coupleManager_.neighbourPatchField<scalar>(); + + operator==(neighbourField); + + fixedValueFvPatchScalarField::updateCoeffs(); +} + + +void Foam::solidWallTemperatureCoupledFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchScalarField::write(os); + coupleManager_.writeEntries(os); + os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +Foam::tmp<Foam::scalarField> +Foam::solidWallTemperatureCoupledFvPatchScalarField::flux() const +{ + const fvPatchScalarField& Kw = + patch().lookupPatchField<volScalarField, scalar>(KName_); + + const fvPatchScalarField& Tw = *this; + + return Tw.snGrad()*patch().magSf()*Kw; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +makePatchTypeField +( + fvPatchScalarField, + solidWallTemperatureCoupledFvPatchScalarField +); + +} // End namespace Foam + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..abf33a7b433a9b99346f3d78e4b35226a1923120 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallTemperatureCoupled/solidWallTemperatureCoupledFvPatchScalarField.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + solidWallHeatFluxCoupledFvPatchScalarField + +Description + Fixed value boundary condition for temperature, to be used by the + conjugate heat transfer solver. + + Example usage: + myInterfacePatchName + { + type solidWallTemperatureCoupled; + neighbourRegionName fluid; + neighbourPatchName fluidSolidInterface; + neighbourFieldName T; + K K; + value uniform 300; + } + +SourceFiles + solidWallTemperatureCoupledFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solidWallTemperatureCoupledFvPatchScalarField_H +#define solidWallTemperatureCoupledFvPatchScalarField_H + +#include "fvPatchFields.H" +#include "fixedValueFvPatchFields.H" +#include "coupleManager.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class solidWallTemperatureCoupledFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class solidWallTemperatureCoupledFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Couple manager object + coupleManager coupleManager_; + + //- Name of thermal conductivity field + word KName_; + + +public: + + //- Runtime type information + TypeName("solidWallTemperatureCoupled"); + + + // Constructors + + //- Construct from patch and internal field + solidWallTemperatureCoupledFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + solidWallTemperatureCoupledFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given solidWallTemperatureCoupledFvPatchScalarField + // onto a new patch + solidWallTemperatureCoupledFvPatchScalarField + ( + const solidWallTemperatureCoupledFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct and return a clone + virtual tmp<fvPatchScalarField> clone() const + { + return tmp<fvPatchScalarField> + ( + new solidWallTemperatureCoupledFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + solidWallTemperatureCoupledFvPatchScalarField + ( + const solidWallTemperatureCoupledFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchScalarField> clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchScalarField> + ( + new solidWallTemperatureCoupledFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + //- Flux + tmp<scalarField> flux() const; + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..ba3d099a9f72730909512c6017df90d51d8818d5 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/UEqn.H @@ -0,0 +1,10 @@ + tmp<fvVectorMatrix> UEqn = solveMomentumEquation + ( + momentumPredictor, + Uf[i], + rhof[i], + phif[i], + pdf[i], + ghf[i], + turb[i] + ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleContinuityErrors.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleContinuityErrors.C new file mode 100644 index 0000000000000000000000000000000000000000..8101c81e9358e1d6a35e596eede27af3920f5b4d --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleContinuityErrors.C @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Continuity errors for fluid meshes + +\*---------------------------------------------------------------------------*/ + +void compressibleContinuityErrors +( + scalar& cumulativeContErr, + const volScalarField& rho, + const basicThermo& thermo +) +{ + dimensionedScalar totalMass = fvc::domainIntegrate(rho); + + scalar sumLocalContErr = + ( + fvc::domainIntegrate(mag(rho - thermo.rho()))/totalMass + ).value(); + + scalar globalContErr = + ( + fvc::domainIntegrate(rho - thermo.rho())/totalMass + ).value(); + + cumulativeContErr += globalContErr; + + const word& regionName = rho.mesh().name(); + + Info<< "time step continuity errors (" << regionName << ")" + << ": sum local = " << sumLocalContErr + << ", global = " << globalContErr + << ", cumulative = " << cumulativeContErr + << endl; +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C new file mode 100644 index 0000000000000000000000000000000000000000..ce1f54aca16ec8e0493a94882f83e9d4dc474d83 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleCourantNo.C @@ -0,0 +1,63 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Calculates and outputs the mean and maximum Courant Numbers for the fluid + regions + +\*---------------------------------------------------------------------------*/ + +scalar compressibleCourantNo +( + const fvMesh& mesh, + const Time& runTime, + const volScalarField& rho, + const surfaceScalarField& phi +) +{ + scalar CoNum = 0.0; + scalar meanCoNum = 0.0; + + if (mesh.nInternalFaces()) + { + surfaceScalarField SfUfbyDelta = + mesh.surfaceInterpolation::deltaCoeffs() + * mag(phi) + / fvc::interpolate(rho); + + CoNum = max(SfUfbyDelta/mesh.magSf()) + .value()*runTime.deltaT().value(); + + meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())) + .value()*runTime.deltaT().value(); + } + + Info<< "Region: " << mesh.name() << " Courant Number mean: " << meanCoNum + << " max: " << CoNum << endl; + + return CoNum; +} + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H new file mode 100644 index 0000000000000000000000000000000000000000..68c3621ec1fdb4fa4b0c2d9a805f7d3afd086767 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/compressibleMultiRegionCourantNo.H @@ -0,0 +1,15 @@ + scalar CoNum = -GREAT; + forAll(fluidRegions, regionI) + { + CoNum = max + ( + compressibleCourantNo + ( + fluidRegions[regionI], + runTime, + rhof[regionI], + phif[regionI] + ), + CoNum + ); + } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H new file mode 100644 index 0000000000000000000000000000000000000000..73c51deeecef39b0731350481be819a85218d013 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidFields.H @@ -0,0 +1,181 @@ + // Initialise fluid field pointer lists + PtrList<basicThermo> thermof(fluidRegions.size()); + PtrList<volScalarField> rhof(fluidRegions.size()); + PtrList<volScalarField> Kf(fluidRegions.size()); + PtrList<volVectorField> Uf(fluidRegions.size()); + PtrList<surfaceScalarField> phif(fluidRegions.size()); + PtrList<compressible::turbulenceModel> turb(fluidRegions.size()); + PtrList<volScalarField> DpDtf(fluidRegions.size()); + PtrList<volScalarField> ghf(fluidRegions.size()); + PtrList<volScalarField> pdf(fluidRegions.size()); + + List<scalar> initialMassf(fluidRegions.size()); + + dimensionedScalar pRef("pRef", dimensionSet(1, -1, -2, 0, 0), 1.0E5); + + // Populate fluid field pointer lists + forAll(fluidRegions, i) + { + Info<< "*** Reading fluid mesh thermophysical properties for region " + << fluidRegions[i].name() << nl << endl; + + Info<< " Adding to pdf\n" << endl; + pdf.set + ( + i, + new volScalarField + ( + IOobject + ( + "pd", + runTime.timeName(), + fluidRegions[i], + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + fluidRegions[i] + ) + ); + + Info<< " Adding to thermof\n" << endl; + + thermof.set + ( + i, + autoPtr<basicThermo> + ( + basicThermo::New(fluidRegions[i]) + ).ptr() + ); + + Info<< " Adding to rhof\n" << endl; + rhof.set + ( + i, + new volScalarField + ( + IOobject + ( + "rho", + runTime.timeName(), + fluidRegions[i], + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + thermof[i].rho() + ) + ); + + Info<< " Adding to Kf\n" << endl; + Kf.set + ( + i, + new volScalarField + ( + IOobject + ( + "K", + runTime.timeName(), + fluidRegions[i], + IOobject::NO_READ, + IOobject::NO_WRITE + ), + thermof[i].rho()*thermof[i].Cp()*thermof[i].alpha() + ) + ); + + Info<< " Adding to Uf\n" << endl; + Uf.set + ( + i, + new volVectorField + ( + IOobject + ( + "U", + runTime.timeName(), + fluidRegions[i], + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + fluidRegions[i] + ) + ); + + Info<< " Adding to phif\n" << endl; + phif.set + ( + i, + new surfaceScalarField + ( + IOobject + ( + "phi", + runTime.timeName(), + fluidRegions[i], + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(rhof[i]*Uf[i]) + & fluidRegions[i].Sf() + ) + ); + + Info<< " Adding to turb\n" << endl; + turb.set + ( + i, + autoPtr<compressible::turbulenceModel> + ( + compressible::turbulenceModel::New + ( + rhof[i], + Uf[i], + phif[i], + thermof[i] + ) + ).ptr() + ); + + Info<< " Adding to DpDtf\n" << endl; + DpDtf.set + ( + i, + new volScalarField + ( + fvc::DDt + ( + surfaceScalarField + ( + "phiU", + phif[i]/fvc::interpolate(rhof[i]) + ), + thermof[i].p() + ) + ) + ); + + const dictionary& environmentalProperties = + fluidRegions[i].lookupObject<IOdictionary> + ("environmentalProperties"); + dimensionedVector g(environmentalProperties.lookup("g")); + + Info<< " Adding to ghf\n" << endl; + ghf.set + ( + i, + new volScalarField + ( + "gh", + g & fluidRegions[i].C() + ) + ); + + Info<< " Updating p from pd\n" << endl; + thermof[i].p() == pdf[i] + rhof[i]*ghf[i] + pRef; + + + initialMassf[i] = fvc::domainIntegrate(rhof[i]).value(); + } + + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidMeshes.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidMeshes.H new file mode 100644 index 0000000000000000000000000000000000000000..aec08349eca1f3d06d53f0f22b36d9ab19e2f3a7 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/createFluidMeshes.H @@ -0,0 +1,45 @@ + PtrList<fvMesh> fluidRegions(rp.fluidRegionNames().size()); + + forAll(rp.fluidRegionNames(), i) + { + Info<< "Create fluid mesh for region " << rp.fluidRegionNames()[i] + << " for time = " << runTime.timeName() << nl << endl; + + fluidRegions.set + ( + i, + new fvMesh + ( + IOobject + ( + rp.fluidRegionNames()[i], + runTime.timeName(), + runTime, + IOobject::MUST_READ + ) + ) + ); + + // Force calculation of geometric properties to prevent it being done + // later in e.g. some boundary evaluation + //(void)fluidRegions[i].weights(); + //(void)fluidRegions[i].deltaCoeffs(); + + // Attach environmental properties to each region + autoPtr<IOdictionary> environmentalProperties + ( + new IOdictionary + ( + IOobject + ( + "environmentalProperties", + runTime.constant(), + fluidRegions[i], + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ); + + environmentalProperties.ptr()->store(); + } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..301ceddfdb432b980642c092d15257e87f51e71e --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/hEqn.H @@ -0,0 +1,9 @@ + solveEnthalpyEquation + ( + rhof[i], + DpDtf[i], + phif[i], + turb[i], + thermof[i] + ); + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..9e07ab170ca34dcea523343a2fdd380976d1af35 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pEqn.H @@ -0,0 +1,66 @@ +{ + bool closedVolume = false; + + //pdf[i].boundaryField() == + // thermof[i].p().boundaryField() + // - rhof[i].boundaryField()*ghf[i].boundaryField() + // - pRef.value(); + + rhof[i] = thermof[i].rho(); + + volScalarField rUA = 1.0/UEqn().A(); + Uf[i] = rUA*UEqn().H(); + + phif[i] = + fvc::interpolate(rhof[i]) + *( + (fvc::interpolate(Uf[i]) & fluidRegions[i].Sf()) +// + fvc::ddtPhiCorr(rUA, rhof[i], Uf[i], phif[i]) + ) + - fvc::interpolate(rhof[i]*rUA*ghf[i]) + *fvc::snGrad(rhof[i]) + *fluidRegions[i].magSf(); + + // Solve pressure difference +# include "pdEqn.H" + + // Solve continuity +# include "rhoEqn.H" + + // Update pressure field (including bc) + thermof[i].p() == pdf[i] + rhof[i]*ghf[i] + pRef; + DpDtf[i] = fvc::DDt + ( + surfaceScalarField("phiU", phif[i]/fvc::interpolate(rhof[i])), + thermof[i].p() + ); + + // Update continuity errors + compressibleContinuityErrors(cumulativeContErr, rhof[i], thermof[i]); + + // Correct velocity field + Uf[i] -= rUA*(fvc::grad(pdf[i]) + fvc::grad(rhof[i])*ghf[i]); + Uf[i].correctBoundaryConditions(); + + // For closed-volume cases adjust the pressure and density levels + // to obey overall mass continuity + if (closedVolume) + { + thermof[i].p() += + ( + dimensionedScalar + ( + "massIni", + dimMass, + initialMassf[i] + ) + - fvc::domainIntegrate(thermof[i].psi()*thermof[i].p()) + ) + /fvc::domainIntegrate(thermof[i].psi()); + + rhof[i] = thermof[i].rho(); + } + + // Update thermal conductivity + Kf[i] = rhof[i]*thermof[i].Cp()*turb[i].alphaEff(); +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pdEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pdEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..a3938432565cf675aa3dee0caee3a19eaafbdb14 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/pdEqn.H @@ -0,0 +1,14 @@ + solvePressureDifferenceEquation + ( + corr, + nCorr, + nNonOrthCorr, + closedVolume, + pdf[i], + pRef, + rhof[i], + thermof[i].psi(), + rUA, + ghf[i], + phif[i] + ); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H new file mode 100644 index 0000000000000000000000000000000000000000..75d6d96d1119f2630f6973a626959c54b7928407 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/readFluidMultiRegionPISOControls.H @@ -0,0 +1,27 @@ + dictionary piso = fluidRegions[i].solutionDict().subDict("PISO"); + + int nCorr(readInt(piso.lookup("nCorrectors"))); + + int nNonOrthCorr = 0; + if (piso.found("nNonOrthogonalCorrectors")) + { + nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors")); + } + + bool momentumPredictor = true; + if (piso.found("momentumPredictor")) + { + momentumPredictor = Switch(piso.lookup("momentumPredictor")); + } + + bool transonic = false; + if (piso.found("transonic")) + { + transonic = Switch(piso.lookup("transonic")); + } + + int nOuterCorr = 1; + if (piso.found("nOuterCorrectors")) + { + nOuterCorr = readInt(piso.lookup("nOuterCorrectors")); + } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/rhoEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/rhoEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..a7e2a98c4aa5251ea9048f47d156dbbe4f628f3e --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/rhoEqn.H @@ -0,0 +1 @@ + solveContinuityEquation(rhof[i], phif[i]); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setInitialDeltaT.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setInitialDeltaT.H new file mode 100644 index 0000000000000000000000000000000000000000..161eb742e76f2e7f798ae59cbaf6c50aff0b68da --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/setInitialDeltaT.H @@ -0,0 +1,15 @@ + if (adjustTimeStep) + { + if (CoNum > SMALL) + { + runTime.setDeltaT + ( + min + ( + maxCo*runTime.deltaT().value()/CoNum, + maxDeltaT + ) + ); + } + } + diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveContinuityEquation.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveContinuityEquation.C new file mode 100644 index 0000000000000000000000000000000000000000..3d834a32aeda2c5f435b43c864517a30f7194fa7 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveContinuityEquation.C @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Solve continuity equation + +\*---------------------------------------------------------------------------*/ + +void solveContinuityEquation +( + volScalarField& rho, + const surfaceScalarField& phi +) +{ + solve(fvm::ddt(rho) + fvc::div(phi)); +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveEnthalpyEquation.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveEnthalpyEquation.C new file mode 100644 index 0000000000000000000000000000000000000000..9c9ba030c324abe46f988055018cb87f5c7553b0 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveEnthalpyEquation.C @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Solve enthalpy equation + +\*---------------------------------------------------------------------------*/ + +void solveEnthalpyEquation +( + const volScalarField& rho, + const volScalarField& DpDt, + const surfaceScalarField& phi, + const compressible::turbulenceModel& turb, + basicThermo& thermo +) +{ + volScalarField& h = thermo.h(); + + tmp<fvScalarMatrix> hEqn + ( + fvm::ddt(rho, h) + + fvm::div(phi, h) + - fvm::laplacian(turb.alphaEff(), h) + == + DpDt + ); + hEqn().relax(); + hEqn().solve(); + + thermo.correct(); + + Info<< "Min/max T:" << min(thermo.T()) << ' ' << max(thermo.T()) + << endl; +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H new file mode 100644 index 0000000000000000000000000000000000000000..e24771256f48c6232a12e05d30438e3a42f3c3e0 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveFluid.H @@ -0,0 +1,15 @@ +# include "rhoEqn.H" + for (int ocorr=0; ocorr<nOuterCorr; ocorr++) + { + # include "UEqn.H" + + # include "hEqn.H" + + // --- PISO loop + + for (int corr=0; corr<nCorr; corr++) + { + # include "pEqn.H" + } + } + turb[i].correct(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveMomentumEquation.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveMomentumEquation.C new file mode 100644 index 0000000000000000000000000000000000000000..22a8b2e65ebd81578dd5631cff178dd0743107f9 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solveMomentumEquation.C @@ -0,0 +1,57 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Solve momentum equation and return matrix for use in pressure equation + +\*---------------------------------------------------------------------------*/ + +tmp<fvVectorMatrix> solveMomentumEquation +( + const bool momentumPredictor, + volVectorField& U, + const volScalarField& rho, + const surfaceScalarField& phi, + const volScalarField& pd, + const volScalarField& gh, + const compressible::turbulenceModel& turb +) +{ + // Solve the Momentum equation + tmp<fvVectorMatrix> UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turb.divDevRhoReff(U) + ); + + UEqn().relax(); + + if (momentumPredictor) + { + solve(UEqn() == -fvc::grad(pd) - fvc::grad(rho)*gh); + } + + return UEqn; +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solvePressureDifferenceEquation.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solvePressureDifferenceEquation.C new file mode 100644 index 0000000000000000000000000000000000000000..3dbd6c82646f444800cf728f0e3ca2d65af57450 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/fluid/solvePressureDifferenceEquation.C @@ -0,0 +1,73 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + Solve pressure difference equation + +\*---------------------------------------------------------------------------*/ + +void solvePressureDifferenceEquation +( + const label corr, + const label nCorr, + const label nNonOrthCorr, + bool& closedVolume, + volScalarField& pd, + const dimensionedScalar& pRef, + const volScalarField& rho, + const volScalarField& psi, + const volScalarField& rUA, + const volScalarField& gh, + surfaceScalarField& phi +) +{ + closedVolume = pd.needReference(); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pdEqn + ( + fvm::ddt(psi, pd) + + fvc::ddt(psi)*pRef + + fvc::ddt(psi, rho)*gh + + fvc::div(phi) + - fvm::laplacian(rho*rUA, pd) + ); + + //pdEqn.solve(); + if (corr == nCorr-1 && nonOrth == nNonOrthCorr) + { + pdEqn.solve(pd.mesh().solver(pd.name() + "Final")); + } + else + { + pdEqn.solve(pd.mesh().solver(pd.name())); + } + + if (nonOrth == nNonOrthCorr) + { + phi += pdEqn.flux(); + } + } +} diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C new file mode 100644 index 0000000000000000000000000000000000000000..8e70c6f07ed5af2248cb1cc0144d208dd492608b --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.C @@ -0,0 +1,69 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "regionProperties.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::regionProperties::regionProperties(const Time& runTime) +: + IOdictionary + ( + IOobject + ( + "regionProperties", + runTime.time().constant(), + runTime.db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + fluidRegionNames_(lookup("fluidRegionNames")), + solidRegionNames_(lookup("solidRegionNames")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::regionProperties::~regionProperties() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::List<Foam::word>& Foam::regionProperties::fluidRegionNames() const +{ + return fluidRegionNames_; +} + + +const Foam::List<Foam::word>& Foam::regionProperties::solidRegionNames() const +{ + return solidRegionNames_; +} + + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.H new file mode 100644 index 0000000000000000000000000000000000000000..86e00a5476627ae17340668167f43c633293f0e8 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/regionProperties/regionProperties.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + regionProperties + +Description + Simple class to hold region information for coupled region simulations + +SourceFiles + regionProperties.C + +\*---------------------------------------------------------------------------*/ + +#ifndef regionProperties_H +#define regionProperties_H + +#include "IOdictionary.H" +#include "Time.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class regionProperties Declaration +\*---------------------------------------------------------------------------*/ + +class regionProperties +: + public IOdictionary +{ + // Private data + + //- List of the fluid region names + List<word> fluidRegionNames_; + + //- List of the solid region names + List<word> solidRegionNames_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + regionProperties(const regionProperties&); + + //- Disallow default bitwise assignment + void operator=(const regionProperties&); + + +public: + + // Constructors + + //- Construct from components + regionProperties(const Time& runTime); + + + // Destructor + + ~regionProperties(); + + + // Member Functions + + // Access + + //- Return const reference to the list of fluid region names + const List<word>& fluidRegionNames() const; + + //- Return const reference to the list of solid region names + const List<word>& solidRegionNames() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H new file mode 100644 index 0000000000000000000000000000000000000000..3361a89add381ed2f43d39b602b2b945040453cf --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -0,0 +1,91 @@ + // Initialise solid field pointer lists + PtrList<volScalarField> rhos(solidRegions.size()); + PtrList<volScalarField> cps(solidRegions.size()); + PtrList<volScalarField> rhosCps(solidRegions.size()); + PtrList<volScalarField> Ks(solidRegions.size()); + PtrList<volScalarField> Ts(solidRegions.size()); + + // Populate solid field pointer lists + forAll(solidRegions, i) + { + Info<< "*** Reading solid mesh thermophysical properties for region " + << solidRegions[i].name() << nl << endl; + + Info<< " Adding to rhos\n" << endl; + rhos.set + ( + i, + new volScalarField + ( + IOobject + ( + "rho", + runTime.timeName(), + solidRegions[i], + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + solidRegions[i] + ) + ); + + Info<< " Adding to cps\n" << endl; + cps.set + ( + i, + new volScalarField + ( + IOobject + ( + "cp", + runTime.timeName(), + solidRegions[i], + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + solidRegions[i] + ) + ); + + rhosCps.set + ( + i, + new volScalarField("rhosCps", rhos[i]*cps[i]) + ); + + Info<< " Adding to Ks\n" << endl; + Ks.set + ( + i, + new volScalarField + ( + IOobject + ( + "K", + runTime.timeName(), + solidRegions[i], + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + solidRegions[i] + ) + ); + + Info<< " Adding to Ts\n" << endl; + Ts.set + ( + i, + new volScalarField + ( + IOobject + ( + "T", + runTime.timeName(), + solidRegions[i], + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + solidRegions[i] + ) + ); + } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidMeshes.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidMeshes.H new file mode 100644 index 0000000000000000000000000000000000000000..eb50be23808e6ffdf31c17fca398bb5366f24c7e --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidMeshes.H @@ -0,0 +1,27 @@ + PtrList<fvMesh> solidRegions(rp.solidRegionNames().size()); + + forAll(rp.solidRegionNames(), i) + { + Info<< "Create solid mesh for region " << rp.solidRegionNames()[i] + << " for time = " << runTime.timeName() << nl << endl; + + solidRegions.set + ( + i, + new fvMesh + ( + IOobject + ( + rp.solidRegionNames()[i], + runTime.timeName(), + runTime, + IOobject::MUST_READ + ) + ) + ); + + // Force calculation of geometric properties to prevent it being done + // later in e.g. some boundary evaluation + //(void)solidRegions[i].weights(); + //(void)solidRegions[i].deltaCoeffs(); + } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H new file mode 100644 index 0000000000000000000000000000000000000000..6373e79d49c0869238a30a138aef81a7af905d05 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/readSolidMultiRegionPISOControls.H @@ -0,0 +1,7 @@ + dictionary piso = solidRegions[i].solutionDict().subDict("PISO"); + + int nNonOrthCorr = 0; + if (piso.found("nNonOrthogonalCorrectors")) + { + nNonOrthCorr = readInt(piso.lookup("nNonOrthogonalCorrectors")); + } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H new file mode 100644 index 0000000000000000000000000000000000000000..40299e7b575315ebf474e119eefff142aec054a0 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solveSolid.H @@ -0,0 +1,9 @@ +{ + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + solve + ( + fvm::ddt(rhosCps[i], Ts[i]) - fvm::laplacian(Ks[i], Ts[i]) + ); + } +} diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 22047adeda3feb448245eda16ebcd843c4e96823..80a93f4ce113e7dc892e27747d636e6355469d83 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -259,6 +259,10 @@ cfdTools/general/porousMedia/porousZones.C cfdTools/general/MRF/MRFZone.C cfdTools/general/MRF/MRFZones.C cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C +cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C +cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C +cfdTools/general/SRF/SRFModel/rpm/rpm.C +cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C fvMeshCutSurface = fvMesh/fvMeshCutSurface diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C new file mode 100644 index 0000000000000000000000000000000000000000..77255818e3b9d1876f5eba58d8f5be3ee74ac083 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.C @@ -0,0 +1,193 @@ +/*---------------------------------------------------------------------------* \ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + + Formulation based on relative velocities + +\*---------------------------------------------------------------------------*/ + +#include "SRFModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace SRF + { + defineTypeNameAndDebug(SRFModel, 0); + defineRunTimeSelectionTable(SRFModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::SRF::SRFModel::SRFModel +( + const word& type, + const volVectorField& Urel +) +: + IOdictionary + ( + IOobject + ( + "SRFProperties", + Urel.mesh().time().constant(), + Urel.mesh().db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ), + Urel_(Urel), + mesh_(Urel_.mesh()), + axis_(lookup("axis")), + SRFModelCoeffs_(subDict(type + "Coeffs")), + omega_(dimensionedVector("omega", dimless/dimTime, vector::zero)) +{ + // Normalise the axis + axis_ /= mag(axis_); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::SRF::SRFModel::~SRFModel() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::SRF::SRFModel::read() +{ + if (regIOobject::read()) + { + // Re-read axis + SRFModelCoeffs_.lookup("axis") >> axis_; + axis_ /= mag(axis_); + + // Re-read sub-model coeffs + SRFModelCoeffs_ = subDict(type() + "Coeffs"); + + return true; + } + else + { + return false; + } +} + + +const Foam::vector& Foam::SRF::SRFModel::axis() const +{ + return axis_; +} + + +const Foam::dimensionedVector& Foam::SRF::SRFModel::omega() const +{ + return omega_; +} + + +Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh> > +Foam::SRF::SRFModel::Fcoriolis() const +{ + return tmp<DimensionedField<vector, volMesh> > + ( + new DimensionedField<vector, volMesh> + ( + IOobject + ( + "Fcoriolis", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + 2.0*omega_ ^ Urel_ + ) + ); +} + + +Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh> > +Foam::SRF::SRFModel::Fcentrifugal() const +{ + return tmp<DimensionedField<vector, volMesh> > + ( + new DimensionedField<vector, volMesh> + ( + IOobject + ( + "Fcentrifugal", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + omega_ ^ (omega_ ^ mesh_.C()) + ) + ); +} + + +Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh> > +Foam::SRF::SRFModel::Su() const +{ + return Fcoriolis() + Fcentrifugal(); +} + + +Foam::vectorField Foam::SRF::SRFModel::velocity +( + const vectorField& positions +) const +{ + return -omega_.value() ^ (positions - axis_*(axis_ & positions)); +} + + +Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::U() const +{ + return tmp<volVectorField> + ( + new volVectorField + ( + IOobject + ( + "Usrf", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + -omega_ ^ (mesh_.C() - axis_*(axis_ & mesh_.C())) + ) + ); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.H b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.H new file mode 100644 index 0000000000000000000000000000000000000000..4a680efa5db827302a691c8774acfa2ae84db49b --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/SRFModel.H @@ -0,0 +1,187 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Namespace + Foam::SRF + +Description + Namespace for single rotating frame (SRF) models + +Class + Foam::SRF::SRFModel + +Description + Top level model for single rotating frame + - Steady state only - no time derivatives included + +SourceFiles + SRFModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SRFModel_H +#define SRFModel_H + +#include "IOdictionary.H" +#include "autoPtr.H" +#include "runTimeSelectionTables.H" +#include "fvMesh.H" +#include "volFields.H" +#include "vectorField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace SRF +{ + +/*---------------------------------------------------------------------------*\ + Class SRFModel Declaration +\*---------------------------------------------------------------------------*/ + +class SRFModel +: + public IOdictionary +{ + +protected: + + // Protected data + + //- Reference to the relative velocity field + const volVectorField& Urel_; + + //- Reference to the mesh + const fvMesh& mesh_; + + //- Axis of rotation + vector axis_; + + //- SRF model coeficients dictionary + dictionary SRFModelCoeffs_; + + //- Angular velocity of the frame (rad/s) + dimensionedVector omega_; + + +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + SRFModel(const SRFModel&); + + //- Disallow default bitwise assignment + void operator=(const SRFModel&); + + +public: + + //- Runtime type information + TypeName("SRFModel"); + + + // Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + SRFModel, + dictionary, + ( + const volVectorField& Urel + ), + (Urel) + ); + + + // Constructors + + //- Construct from components + SRFModel + ( + const word& type, + const volVectorField& Urel + ); + + + // Selectors + + //- Return a reference to the selected SRF model + static autoPtr<SRFModel> New + ( + const volVectorField& Urel + ); + + + // Destructor + + virtual ~SRFModel(); + + + // Member Functions + + // Edit + + //- Read radiationProperties dictionary + virtual bool read(); + + + // Access + + //- Return the axis of rotation + const vector& axis() const; + + //- Return the angular velocity field [rad/s] + const dimensionedVector& omega() const; + + //- Return the coriolis force + tmp<DimensionedField<vector, volMesh> > Fcoriolis() const; + + //- Return the centrifugal force + tmp<DimensionedField<vector, volMesh> > Fcentrifugal() const; + + //- Source term component for momentum equation + tmp<DimensionedField<vector, volMesh> > Su() const; + + //- Return velocity vector from positions + vectorField velocity(const vectorField& positions) const; + + //- Return velocity of SRF for complete mesh + tmp<volVectorField> U() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace SRF +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C new file mode 100644 index 0000000000000000000000000000000000000000..c359e6d16226cd90d6031273caf4925deb2eb91b --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/SRFModel/newSRFModel.C @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + +\*---------------------------------------------------------------------------*/ + +#include "SRFModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace SRF +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +autoPtr<SRFModel> SRFModel::New +( + const volVectorField& Urel +) +{ + word SRFModelTypeName; + + // Enclose the creation of the SRFPropertiesDict to ensure it is + // deleted before the SRFModel is created - otherwise the dictionary + // is entered in the database twice + { + IOdictionary SRFPropertiesDict + ( + IOobject + ( + "SRFProperties", + Urel.mesh().time().constant(), + Urel.mesh().db(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + SRFPropertiesDict.lookup("SRFModel") >> SRFModelTypeName; + } + + Info<< "Selecting SRFModel " << SRFModelTypeName << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(SRFModelTypeName); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "SRFModel::New(const fvMesh&)" + ) << "Unknown SRFModel type " << SRFModelTypeName + << nl << nl + << "Valid SRFModel types are :" << nl + << dictionaryConstructorTablePtr_->toc() + << exit(FatalError); + } + + return autoPtr<SRFModel>(cstrIter()(Urel)); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace SRF +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.C b/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.C new file mode 100644 index 0000000000000000000000000000000000000000..13c023cf279f2683c47a6489012c1b7d8f2cfbad --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.C @@ -0,0 +1,92 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Description + +\*---------------------------------------------------------------------------*/ + +#include "rpm.H" +#include "addToRunTimeSelectionTable.H" +#include "mathematicalConstants.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace SRF + { + defineTypeNameAndDebug(rpm, 0); + + addToRunTimeSelectionTable + ( + SRFModel, + rpm, + dictionary + ); + } +} + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::SRF::rpm::rpm +( + const volVectorField& U +) +: + SRFModel(typeName, U), + rpm_(readScalar(SRFModelCoeffs_.lookup("rpm"))) +{ + // Initialise the angular velocity + omega_.value() = axis_*rpm_*2.0*mathematicalConstant::pi/60.0; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::SRF::rpm::~rpm() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::SRF::rpm::read() +{ + if (SRFModel::read()) + { + // Re-read rpm + SRFModelCoeffs_.lookup("rpm") >> rpm_; + + // Update angular velocity + omega_.value() = axis_*rpm_*(2.0*mathematicalConstant::pi/60.0); + + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.H b/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.H new file mode 100644 index 0000000000000000000000000000000000000000..c341ac3e8b273d6257db91c2521dc334ddb4cce2 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm/rpm.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::SRF::rpm + +Description + Basic SRF model whereby angular velocity is specified in terms of + a (global) axis and revolutions-per-minute [rpm] + +SourceFiles + rpm.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SRFModelRpm_H +#define SRFModelRpm_H + +#include "SRFModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace SRF +{ + +/*---------------------------------------------------------------------------*\ + Class rpm Declaration +\*---------------------------------------------------------------------------*/ + +class rpm +: + public SRFModel +{ + + // Private data + + //- Revolutions per minute + scalar rpm_; + + + // Private member functions + + //- Disallow default bitwise copy construct + rpm(const rpm&); + + //- Disallow default bitwise assignment + void operator=(const rpm&); + + +public: + + //- Runtime type information + TypeName("rpm"); + + + // Constructors + + //- Construct from components + rpm(const volVectorField& U); + + + // Destructor + + ~rpm(); + + // Member functions + + // I-O + + //- Read + bool read(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace SRF +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C new file mode 100644 index 0000000000000000000000000000000000000000..20562d44250f7165d81f0b6a17f365b20c1afaae --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C @@ -0,0 +1,181 @@ +/*---------------------------------------------------------------------------* \ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SRFVelocityFvPatchVectorField.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +#include "SRFModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchVectorField(p, iF), + relative_(0), + inletValue_(p.size(), vector::zero) +{} + + +SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +( + const SRFVelocityFvPatchVectorField& ptf, + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchVectorField(ptf, p, iF, mapper), + relative_(ptf.relative_), + inletValue_(ptf.inletValue_, mapper) +{} + + +SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField<vector, volMesh>& iF, + const dictionary& dict +) +: + fixedValueFvPatchVectorField(p, iF), + relative_(dict.lookup("relative")), + inletValue_("inletValue", dict, p.size()) +{ + fvPatchVectorField::operator=(vectorField("value", dict, p.size())); +} + + +SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +( + const SRFVelocityFvPatchVectorField& srfvpvf +) +: + fixedValueFvPatchVectorField(srfvpvf), + relative_(srfvpvf.relative_), + inletValue_(srfvpvf.inletValue_) +{} + + +SRFVelocityFvPatchVectorField::SRFVelocityFvPatchVectorField +( + const SRFVelocityFvPatchVectorField& srfvpvf, + const DimensionedField<vector, volMesh>& iF +) +: + fixedValueFvPatchVectorField(srfvpvf, iF), + relative_(srfvpvf.relative_), + inletValue_(srfvpvf.inletValue_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void SRFVelocityFvPatchVectorField::autoMap +( + const fvPatchFieldMapper& m +) +{ + vectorField::autoMap(m); + inletValue_.autoMap(m); +} + + +void SRFVelocityFvPatchVectorField::rmap +( + const fvPatchVectorField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchVectorField::rmap(ptf, addr); + + const SRFVelocityFvPatchVectorField& tiptf = + refCast<const SRFVelocityFvPatchVectorField>(ptf); + + inletValue_.rmap(tiptf.inletValue_, addr); +} + + +void SRFVelocityFvPatchVectorField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // If relative, include the effect of the SRF + if (relative_) + { + // Get reference to the SRF model + const SRF::SRFModel& srf = + db().lookupObject<SRF::SRFModel>("SRFProperties"); + + // Determine patch velocity due to SRF + const vectorField SRFVelocity = srf.velocity(patch().Cf()); + + operator==(SRFVelocity + inletValue_); + } + // If absolute, simply supply the inlet value as a fixed value + else + { + operator==(inletValue_); + } + + fixedValueFvPatchVectorField::updateCoeffs(); +} + + +void SRFVelocityFvPatchVectorField::write(Ostream& os) const +{ + fvPatchVectorField::write(os); + os.writeKeyword("relative") << relative_ << token::END_STATEMENT << nl; + inletValue_.writeEntry("inletValue", os); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchVectorField, + SRFVelocityFvPatchVectorField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H new file mode 100644 index 0000000000000000000000000000000000000000..9383887bcd8467be06458edb670e70af7b14bfbf --- /dev/null +++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.H @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::SRFVelocityFvPatchVectorField + +Description + Velocity patch to be used with SRF model + +SourceFiles + SRFVelocityFvPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SRFVelocityFvPatchVectorField_H +#define SRFVelocityFvPatchVectorField_H + +#include "fvPatchFields.H" +#include "fixedValueFvPatchFields.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class SRFVelocityFvPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class SRFVelocityFvPatchVectorField +: + public fixedValueFvPatchVectorField +{ + // Private data + + //- Is the supplied inlet value relative to the SRF + Switch relative_; + + //- Inlet value + vectorField inletValue_; + + +public: + + //- Runtime type information + TypeName("SRFVelocity"); + + + // Constructors + + //- Construct from patch and internal field + SRFVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + SRFVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given SRFVelocityFvPatchVectorField + // onto a new patch + SRFVelocityFvPatchVectorField + ( + const SRFVelocityFvPatchVectorField&, + const fvPatch&, + const DimensionedField<vector, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + SRFVelocityFvPatchVectorField + ( + const SRFVelocityFvPatchVectorField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchVectorField> clone() const + { + return tmp<fvPatchVectorField> + ( + new SRFVelocityFvPatchVectorField(*this) + ); + } + + //- Construct as copy setting internal field reference + SRFVelocityFvPatchVectorField + ( + const SRFVelocityFvPatchVectorField&, + const DimensionedField<vector, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchVectorField> clone + ( + const DimensionedField<vector, volMesh>& iF + ) const + { + return tmp<fvPatchVectorField> + ( + new SRFVelocityFvPatchVectorField(*this, iF) + ); + } + + + // Member functions + + // Mapping functions + + //- Map (and resize as needed) from self given a mapping object + virtual void autoMap + ( + const fvPatchFieldMapper& + ); + + //- Reverse map the given fvPatchField onto this fvPatchField + virtual void rmap + ( + const fvPatchVectorField&, + const labelList& + ); + + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C index 63a5f08f916a6749c0a83ebace48cc2aa775795e..0b3efba158ceb8c69558e7649546db2e7910881d 100644 --- a/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C +++ b/src/finiteVolume/interpolation/interpolation/interpolationCellPoint/cellPointWeight/cellPointWeight.C @@ -49,7 +49,7 @@ void Foam::cellPointWeight::findTetrahedron } // Initialise closest triangle variables - scalar minUVWClose = GREAT; + scalar minUVWClose = VGREAT; label pointIClose = 0; label faceClose = 0; @@ -198,7 +198,7 @@ void Foam::cellPointWeight::findTriangle } // Initialise closest triangle variables - scalar minUVClose = GREAT; + scalar minUVClose = VGREAT; label pointIClose = 0; // Decompose each face into triangles, making a tet when diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C index 8dc0dc5db056b548826fa664211bb9beccfa1e46..8a487e60487faedc33383dd2b8d831d42f1f5291 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/interpolation/displacementInterpolationFvMotionSolver.C @@ -168,10 +168,28 @@ displacementInterpolationFvMotionSolver label zoneI = fZones.findZoneID(zoneName); const faceZone& fz = fZones[zoneI]; - scalarField fzCoords = fz().localPoints().component(dir); + scalar minCoord = VGREAT; + scalar maxCoord = -VGREAT; - zoneCoordinates[2*i] = gMin(fzCoords); - zoneCoordinates[2*i+1] = gMax(fzCoords); + forAll(fz().meshPoints(), localI) + { + label pointI = fz().meshPoints()[localI]; + const scalar coord = points0_[pointI][dir]; + minCoord = min(minCoord, coord); + maxCoord = max(maxCoord, coord); + } + + zoneCoordinates[2*i] = returnReduce(minCoord, minOp<scalar>()); + zoneCoordinates[2*i+1] = returnReduce(maxCoord, maxOp<scalar>()); + + if (debug) + { + Pout<< "direction " << dir << " : " + << "zone " << zoneName + << " ranges from coordinate " << zoneCoordinates[2*i] + << " to " << zoneCoordinates[2*i+1] + << endl; + } } zoneCoordinates.sort(); diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C index 00f3fa9362a5592d6926aecfd9390f28f5a56837..876b13338341c6d07b1ae16eec590c646dbd74cf 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C @@ -36,34 +36,20 @@ License namespace Foam { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -//Foam::vector -// Foam::surfaceSlipDisplacementPointPatchVectorField::projectNormal -//( -// const label pointI, -// const point& pt -//) -//{ -// vector projectNormal -// -// if (wedge) -// { -// // For wedge: assume axis runs from (0 0 0) in direction axisNormal_ -// //vector projectNormal(pt-axisPt); -// //projectNormal -= (axisNormal&projectNormal)*projectNormal; -// -// projectNormal = pt - (axisNormal_&pt)*axisNormal_; -// projectNormal /= mag(projectNormal) + VSMALL; -// } -// else -// { -// projectNormal = this->patch().pointNormals()[pointI]; -// } -// -// return projectNormal; -//} +template<> +const char* +NamedEnum<surfaceSlipDisplacementPointPatchVectorField::followMode, 3>:: +names[] = +{ + "nearest", + "pointNormal", + "fixedNormal" +}; + +const NamedEnum<surfaceSlipDisplacementPointPatchVectorField::followMode, 3> + surfaceSlipDisplacementPointPatchVectorField::followModeNames_; // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -77,6 +63,7 @@ surfaceSlipDisplacementPointPatchVectorField : pointPatchVectorField(p, iF), surfaceNames_(), + projectMode_(NEAREST), projectDir_(vector::zero), wedgePlane_(-1) {} @@ -92,6 +79,7 @@ surfaceSlipDisplacementPointPatchVectorField : pointPatchVectorField(p, iF), surfaceNames_(dict.lookup("projectSurfaces")), + projectMode_(followModeNames_.read(dict.lookup("followMode"))), projectDir_(dict.lookup("projectDirection")), wedgePlane_(readLabel(dict.lookup("wedgePlane"))), frozenPointsZone_(dict.lookup("frozenPointsZone")) @@ -109,6 +97,7 @@ surfaceSlipDisplacementPointPatchVectorField : pointPatchVectorField(p, iF), surfaceNames_(ppf.surfaceNames()), + projectMode_(ppf.projectMode()), projectDir_(ppf.projectDir()), wedgePlane_(ppf.wedgePlane()), frozenPointsZone_(ppf.frozenPointsZone()) @@ -123,6 +112,7 @@ surfaceSlipDisplacementPointPatchVectorField : pointPatchVectorField(ppf), surfaceNames_(ppf.surfaceNames()), + projectMode_(ppf.projectMode()), projectDir_(ppf.projectDir()), wedgePlane_(ppf.wedgePlane()), frozenPointsZone_(ppf.frozenPointsZone()) @@ -138,6 +128,7 @@ surfaceSlipDisplacementPointPatchVectorField : pointPatchVectorField(ppf, iF), surfaceNames_(ppf.surfaceNames()), + projectMode_(ppf.projectMode()), projectDir_(ppf.projectDir()), wedgePlane_(ppf.wedgePlane()), frozenPointsZone_(ppf.frozenPointsZone()) @@ -184,17 +175,21 @@ void surfaceSlipDisplacementPointPatchVectorField::evaluate // Construct large enough vector in direction of projectDir so // we're guaranteed to hit something. - //- Fixed projection vector: - //vector n = projectDir_/mag(projectDir_); - //vector projectVec = n*(n&(mesh.bounds().max()-mesh.bounds().min())); + const scalar projectLen = mag(mesh.bounds().max()-mesh.bounds().min()); + + // For case of fixed projection vector: + vector projectVec; + if (projectMode_ == FIXEDNORMAL) + { + vector n = projectDir_/mag(projectDir_); + projectVec = projectLen*n; + } //- Per point projection vector: - const scalar projectLen = mag(mesh.bounds().max()-mesh.bounds().min()); const pointField& localPoints = patch().localPoints(); const labelList& meshPoints = patch().meshPoints(); - //vectorField motionU(this->patchInternalField()); vectorField displacement(this->patchInternalField()); @@ -234,85 +229,90 @@ void surfaceSlipDisplacementPointPatchVectorField::evaluate } else { - //point start(localPoints[i] + deltaT*motionU[i]); point start(points0[meshPoints[i]] + displacement[i]); - vector projectVec(projectLen*patch().pointNormals()[i]); - scalar offset = 0; - if (wedgePlane_ >= 0 && wedgePlane_ <= vector::nComponents) - { - offset = start[wedgePlane_]; - start[wedgePlane_] = 0; - projectVec[wedgePlane_] = 0; - } - pointIndexHit intersection; - // Check if already on surface - surfaces().findNearest(start, sqr(SMALL), intersection); - - if (intersection.hit()) + if (projectMode_ == NEAREST) { - //Pout<< " point:" << start << " near:" << intersection.hit() - // << endl; + surfaces().findNearest(start, sqr(projectLen), intersection); } else { - // No nearest found. Do intersection + // Check if already on surface + surfaces().findNearest(start, sqr(SMALL), intersection); - label rightSurf0, rightSurf1; - pointIndexHit rightHit0, rightHit1; - surfaces().findNearestIntersection - ( - start, - start+projectVec, - rightSurf0, - rightHit0, - rightSurf1, - rightHit1 - ); - - // Do intersection - label leftSurf0, leftSurf1; - pointIndexHit leftHit0, leftHit1; - surfaces().findNearestIntersection - ( - start, - start-projectVec, - leftSurf0, - leftHit0, - leftSurf1, - leftHit1 - ); - - if (rightHit0.hit()) + if (!intersection.hit()) { - if (leftHit0.hit()) + // No nearest found. Do intersection + + if (projectMode_ == POINTNORMAL) { - if - ( - magSqr(rightHit0.hitPoint()-start) - < magSqr(leftHit0.hitPoint()-start) - ) + projectVec = projectLen*patch().pointNormals()[i]; + } + + // Knock out any wedge component + if (wedgePlane_ >= 0 && wedgePlane_ <= vector::nComponents) + { + offset = start[wedgePlane_]; + start[wedgePlane_] = 0; + projectVec[wedgePlane_] = 0; + } + + label rightSurf0, rightSurf1; + pointIndexHit rightHit0, rightHit1; + surfaces().findNearestIntersection + ( + start, + start+projectVec, + rightSurf0, + rightHit0, + rightSurf1, + rightHit1 + ); + + // Do intersection + label leftSurf0, leftSurf1; + pointIndexHit leftHit0, leftHit1; + surfaces().findNearestIntersection + ( + start, + start-projectVec, + leftSurf0, + leftHit0, + leftSurf1, + leftHit1 + ); + + if (rightHit0.hit()) + { + if (leftHit0.hit()) { - intersection = rightHit0; + if + ( + magSqr(rightHit0.hitPoint()-start) + < magSqr(leftHit0.hitPoint()-start) + ) + { + intersection = rightHit0; + } + else + { + intersection = leftHit0; + } } else { - intersection = leftHit0; + intersection = rightHit0; } } else { - intersection = rightHit0; - } - } - else - { - if (leftHit0.hit()) - { - intersection = leftHit0; + if (leftHit0.hit()) + { + intersection = leftHit0; + } } } } @@ -327,7 +327,6 @@ void surfaceSlipDisplacementPointPatchVectorField::evaluate { interPt[wedgePlane_] += offset; } - //motionU[i] = (interPt-localPoints[i])/deltaT; displacement[i] = interPt-points0[meshPoints[i]]; } else @@ -337,7 +336,7 @@ void surfaceSlipDisplacementPointPatchVectorField::evaluate << " did not find any intersection between ray from " << start-projectVec << " to " << start+projectVec << endl; - } + } } } @@ -356,6 +355,8 @@ void surfaceSlipDisplacementPointPatchVectorField::write(Ostream& os) const pointPatchVectorField::write(os); os.writeKeyword("projectSurfaces") << surfaceNames_ << token::END_STATEMENT << nl; + os.writeKeyword("followMode") << followModeNames_[projectMode_] + << token::END_STATEMENT << nl; os.writeKeyword("projectDirection") << projectDir_ << token::END_STATEMENT << nl; os.writeKeyword("wedgePlane") << wedgePlane_ diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H index 7db1e8ef68d44ed1d37fa7f3f1dc2fe7e8bab5fa..169a7dfb08565e5095be2254087a6e8505bbedb6 100644 --- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H +++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.H @@ -27,6 +27,21 @@ Class Description Displacement follows a triSurface. Use in a displacement fvMotionSolver. + Following is either + - NEAREST : nearest + - POINTNORMAL : intersection with point normal + - FIXEDNORMAL : intersection with fixed vector + + Optionally (intersection only) removes a component ("wedgePlane") to + stay in 2D. + + Needs: + - projectSurfaces : names of triSurfaceMeshes (in constant/triSurface) + - followMode : see above + - projectDirection : if followMode = fixedNormal + - wedgePlane : -1 or component to knock out of intersection normal + - frozenPointsZone : empty or name of pointZone containing points + that do not move SourceFiles surfaceSlipDisplacementPointPatchVectorField.C @@ -52,11 +67,31 @@ class surfaceSlipDisplacementPointPatchVectorField : public pointPatchVectorField { + +public: + + // Public data types + + enum followMode + { + NEAREST, + POINTNORMAL, + FIXEDNORMAL + }; + +private: + // Private data + //- follow mode names + static const NamedEnum<followMode, 3> followModeNames_; + //- names of surfaces const fileNameList surfaceNames_; + //- How to follow/project onto surface + const followMode projectMode_; + //- direction to project const vector projectDir_; @@ -72,9 +107,6 @@ class surfaceSlipDisplacementPointPatchVectorField // Private Member Functions - ////- Calculate projection direction (normalised) at pointI. - //vector projectNormal(const label pointI, const point& pt) const; - //- Disallow default bitwise assignment void operator=(const surfaceSlipDisplacementPointPatchVectorField&); @@ -163,6 +195,12 @@ public: //- Surface to follow. Demand loads surfaceNames. const triSurfaceMeshes& surfaces() const; + //- Mode of projection/following + const followMode projectMode() const + { + return projectMode_; + } + //- Direction to project back onto surface const vector& projectDir() const { diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C index b9da7468d6814ac377bca118b33bcee8e961d559..e476bc8348bdd477c0a5b548b0db0d85d97436fc 100644 --- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C @@ -142,7 +142,7 @@ bool Foam::surfaceToCell::differingPointNormals pointToNearest ); - if (pointTriI != cellTriI) + if (pointTriI != -1 && pointTriI != cellTriI) { scalar cosAngle = normals[pointTriI] & normals[cellTriI]; diff --git a/tutorials/buoyantSimpleRadiationFoam/Allclean b/tutorials/buoyantSimpleRadiationFoam/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..fa072cf0d64fe0670e5f4f1de38f50e09ec3341d --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/Allclean @@ -0,0 +1,16 @@ +#!/bin/sh + +currDir=`pwd` +application=`basename $currDir` +cases="hotRadiationRoom" + +tutorialPath=`dirname $0`/.. +. $tutorialPath/CleanFunctions + +wclean $application + +for case in $cases +do + cleanCase $case +done + diff --git a/tutorials/buoyantSimpleRadiationFoam/Allrun b/tutorials/buoyantSimpleRadiationFoam/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..201e1d3fce39c1e6c486e33b8a9ce0aa0ad2e284 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/Allrun @@ -0,0 +1,16 @@ +#!/bin/sh + +currDir=`pwd` +application=`basename $currDir` +cases="hotRadiationRoom" + +tutorialPath=`dirname $0`/.. +. $tutorialPath/RunFunctions + +compileApplication $currDir $application + +for case in $cases +do + runApplication blockMesh $case + runApplication $application $case +done diff --git a/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/Make/files b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..5dccac44bcf6587b7384de56eeefb5755b3f96b9 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/Make/files @@ -0,0 +1,4 @@ +buoyantSimpleRadiationFoam.C + +EXE = $(FOAM_USER_APPBIN)/buoyantSimpleRadiationFoam + diff --git a/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/Make/options b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..12943280aada9d1c5db3178dd4475c8b43265014 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/Make/options @@ -0,0 +1,14 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/cfdTools \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/turbulenceModels + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools \ + -lbasicThermophysicalModels \ + -lspecie \ + -lradiation \ + -lcompressibleTurbulenceModels diff --git a/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/UEqn.H b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..d58a70a54e4f3a533ee3f149a757ed68c0438f14 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/UEqn.H @@ -0,0 +1,12 @@ + // Solve the Momentum equation + + tmp<fvVectorMatrix> UEqn + ( + fvm::div(phi, U) + - fvm::Sp(fvc::div(phi), U) + + turbulence->divDevRhoReff(U) + ); + + UEqn().relax(); + + solve(UEqn() == -fvc::grad(pd) - fvc::grad(rho)*gh); diff --git a/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..649a7d97b0d7d45e34f0273bd5eadb150f55d30b --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C @@ -0,0 +1,89 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + buoyantSimpleRadiationFoam + +Description + Steady-state solver for buoyant, turbulent flow of compressible fluids, + including radiation, for ventilation and heat-transfer. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicThermo.H" +#include "compressible/turbulenceModel/turbulenceModel.H" +#include "fixedGradientFvPatchFields.H" +#include "radiationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" +# include "createTime.H" +# include "createMesh.H" +# include "readEnvironmentalProperties.H" +# include "createFields.H" +# include "initContinuityErrs.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + for (runTime++; !runTime.end(); runTime++) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + +# include "readSIMPLEControls.H" + + pd.storePrevIter(); + rho.storePrevIter(); + + // Pressure-velocity SIMPLE corrector + { +# include "UEqn.H" + +# include "hEqn.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; +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/createFields.H b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..707ef2fff88f99d71e627e5dd55402d83382a6bf --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/createFields.H @@ -0,0 +1,93 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr<basicThermo> thermo + ( + basicThermo::New(mesh) + ); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + thermo->rho() + ); + + volScalarField& p = thermo->p(); + volScalarField& h = thermo->h(); + const volScalarField& T = thermo->T(); + + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + +# include "compressibleCreatePhi.H" + + + Info<< "Creating turbulence model\n" << endl; + autoPtr<compressible::turbulenceModel> turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo() + ) + ); + + Info<< "Calculating field g.h\n" << endl; + volScalarField gh("gh", g & mesh.C()); + + + dimensionedScalar pRef("pRef", p.dimensions(), 1.0e5); + + Info<< "Creating field pd\n" << endl; + volScalarField pd + ( + IOobject + ( + "pd", + runTime.timeName(), + mesh + ), + p - rho*gh - pRef, + p.boundaryField().types() + ); + + + label pdRefCell = 0; + scalar pdRefValue = 0.0; + setRefCell + ( + pd, + mesh.solutionDict().subDict("SIMPLE"), + pdRefCell, + pdRefValue + ); + + + Info<< "Creating radiation model\n" << endl; + autoPtr<radiation::radiationModel> radiation + ( + radiation::radiationModel::New(T) + ); + + + dimensionedScalar initialMass = fvc::domainIntegrate(rho); diff --git a/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/hEqn.H b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/hEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..88094369d4107068cf0fc9eeb788322a7f0158da --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/hEqn.H @@ -0,0 +1,20 @@ +{ + fvScalarMatrix hEqn + ( + fvm::div(phi, h) + - fvm::Sp(fvc::div(phi), h) + - fvm::laplacian(turbulence->alphaEff(), h) + == + fvc::div(phi/fvc::interpolate(rho)*fvc::interpolate(p)) + - p*fvc::div(phi/fvc::interpolate(rho)) + + radiation->Sh(thermo()) + ); + + hEqn.relax(); + + hEqn.solve(); + + thermo->correct(); + + radiation->correct(); +} diff --git a/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/pEqn.H b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..8accc61b7f0e13f653a8c9d0705ad62daf5d63e1 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam/pEqn.H @@ -0,0 +1,47 @@ +pd.boundaryField() == + p.boundaryField() - rho.boundaryField()*gh.boundaryField() - pRef.value(); + +volScalarField rUA = 1.0/UEqn().A(); +U = rUA*UEqn().H(); +UEqn.clear(); +phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf()); +bool closedVolume = adjustPhi(phi, U, p); +phi -= fvc::interpolate(rho*gh*rUA)*fvc::snGrad(rho)*mesh.magSf(); + +for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +{ + fvScalarMatrix pdEqn + ( + fvm::laplacian(rho*rUA, pd) == fvc::div(phi) + ); + + pdEqn.setReference(pdRefCell, pdRefValue); + pdEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi -= pdEqn.flux(); + } +} + +#include "continuityErrs.H" + +// Explicitly relax pressure for momentum corrector +pd.relax(); + +p = pd + rho*gh + pRef; + +U -= rUA*(fvc::grad(pd) + fvc::grad(rho)*gh); +U.correctBoundaryConditions(); + +// For closed-volume cases adjust the pressure and density levels +// to obey overall mass continuity +if (closedVolume) +{ + p += (initialMass - fvc::domainIntegrate(thermo->psi()*p)) + /fvc::domainIntegrate(thermo->psi()); +} + +rho = thermo->rho(); +rho.relax(); +Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G new file mode 100644 index 0000000000000000000000000000000000000000..dfd805fa71fb87d8c1c55582181f0f0b7c7d94f3 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/G @@ -0,0 +1,65 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object G; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + + fixedWalls + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + + ceiling + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + + box + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/T b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/T new file mode 100644 index 0000000000000000000000000000000000000000..0ecdeff71343a0853559122adcbefce4191fe65e --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/T @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object T; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + floor + { + type fixedValue; + value uniform 300.0; + } + + ceiling + { + type fixedValue; + value uniform 300.0; + } + + fixedWalls + { + type zeroGradient; + } + + box + { + type fixedValue; + value uniform 500.0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/U b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/U new file mode 100644 index 0000000000000000000000000000000000000000..16f8002e98dc4aa45826a8f471077539171a2f9b --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/U @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volVectorField; + object U; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + floor + { + type fixedValue; + value uniform (0 0 0); + } + + ceiling + { + type fixedValue; + value uniform (0 0 0); + } + + fixedWalls + { + type fixedValue; + value uniform (0 0 0); + } + + box + { + type fixedValue; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..81909ac75d69c483a74e7e8566ee3be11d149377 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/epsilon @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object epsilon; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + floor + { + type zeroGradient; + } + + ceiling + { + type zeroGradient; + } + + fixedWalls + { + type zeroGradient; + } + + box + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k new file mode 100644 index 0000000000000000000000000000000000000000..1b9213c0b9bc5feb576c9e36c48d0eb2dfd9c965 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/k @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object k; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + floor + { + type zeroGradient; + } + + ceiling + { + type zeroGradient; + } + + fixedWalls + { + type zeroGradient; + } + + box + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p new file mode 100644 index 0000000000000000000000000000000000000000..5d480870b214b8b691f317640c3d031e52f3357b --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/0/p @@ -0,0 +1,58 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object p; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + floor + { + type fixedFluxBuoyantPressure; + value uniform 100000; + } + + ceiling + { + type fixedFluxBuoyantPressure; + value uniform 100000; + } + + fixedWalls + { + type fixedFluxBuoyantPressure; + value uniform 100000; + } + + box + { + type fixedFluxBuoyantPressure; + value uniform 100000; + } +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/environmentalProperties b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/environmentalProperties new file mode 100644 index 0000000000000000000000000000000000000000..7b2cfed6faba45db705361179ae8d52323e920ca --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/environmentalProperties @@ -0,0 +1,28 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object environmentalProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [0 1 -2 0 0 0 0] (0 0 -9.81); + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/polyMesh/blockMeshDict b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..616eed6b757fa652d9b60bbb8804b86c21751783 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/polyMesh/blockMeshDict @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0.0 0.0 0.0) + ( 0.5 0.0 0.0) + ( 1.5 0.0 0.0) + (10.0 0.0 0.0) + ( 0.0 0.5 0.0) + ( 0.5 0.5 0.0) + ( 1.5 0.5 0.0) + (10.0 0.5 0.0) + ( 0.0 1.5 0.0) + ( 0.5 1.5 0.0) + ( 1.5 1.5 0.0) + (10.0 1.5 0.0) + ( 0.0 6.0 0.0) + ( 0.5 6.0 0.0) + ( 1.5 6.0 0.0) + (10.0 6.0 0.0) + + ( 0.0 0.0 0.5) + ( 0.5 0.0 0.5) + ( 1.5 0.0 0.5) + (10.0 0.0 0.5) + ( 0.0 0.5 0.5) + ( 0.5 0.5 0.5) + ( 1.5 0.5 0.5) + (10.0 0.5 0.5) + ( 0.0 1.5 0.5) + ( 0.5 1.5 0.5) + ( 1.5 1.5 0.5) + (10.0 1.5 0.5) + ( 0.0 6.0 0.5) + ( 0.5 6.0 0.5) + ( 1.5 6.0 0.5) + (10.0 6.0 0.5) + + ( 0.0 0.0 2.0) + ( 0.5 0.0 2.0) + ( 1.5 0.0 2.0) + (10.0 0.0 2.0) + ( 0.0 0.5 2.0) + ( 0.5 0.5 2.0) + ( 1.5 0.5 2.0) + (10.0 0.5 2.0) + ( 0.0 1.5 2.0) + ( 0.5 1.5 2.0) + ( 1.5 1.5 2.0) + (10.0 1.5 2.0) + ( 0.0 6.0 2.0) + ( 0.5 6.0 2.0) + ( 1.5 6.0 2.0) + (10.0 6.0 2.0) +); + +blocks +( + hex ( 0 1 5 4 16 17 21 20) ( 5 5 5) simpleGrading (1 1 1) + hex ( 1 2 6 5 17 18 22 21) (10 5 5) simpleGrading (1 1 1) + hex ( 2 3 7 6 18 19 23 22) (80 5 5) simpleGrading (1 1 1) + hex ( 4 5 9 8 20 21 25 24) ( 5 10 5) simpleGrading (1 1 1) + hex ( 6 7 11 10 22 23 27 26) (80 10 5) simpleGrading (1 1 1) + hex ( 8 9 13 12 24 25 29 28) ( 5 40 5) simpleGrading (1 1 1) + hex ( 9 10 14 13 25 26 30 29) (10 40 5) simpleGrading (1 1 1) + hex (10 11 15 14 26 27 31 30) (80 40 5) simpleGrading (1 1 1) + + hex (16 17 21 20 32 33 37 36) ( 5 5 15) simpleGrading (1 1 1) + hex (17 18 22 21 33 34 38 37) (10 5 15) simpleGrading (1 1 1) + hex (18 19 23 22 34 35 39 38) (80 5 15) simpleGrading (1 1 1) + hex (20 21 25 24 36 37 41 40) ( 5 10 15) simpleGrading (1 1 1) + + hex (21 22 26 25 37 38 42 41) (10 10 15) simpleGrading (1 1 1) + + hex (22 23 27 26 38 39 43 42) (80 10 15) simpleGrading (1 1 1) + hex (24 25 29 28 40 41 45 44) ( 5 40 15) simpleGrading (1 1 1) + hex (25 26 30 29 41 42 46 45) (10 40 15) simpleGrading (1 1 1) + hex (26 27 31 30 42 43 47 46) (80 40 15) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall box + ( + ( 6 22 21 5) + (10 26 22 6) + ( 9 25 26 10) + ( 5 21 25 9) + (22 26 25 21) + ) + wall floor + ( + ( 1 5 4 0) + ( 2 6 5 1) + ( 3 7 6 2) + ( 5 9 8 4) + ( 7 11 10 6) + ( 9 13 12 8) + (10 14 13 9) + (11 15 14 10) + ) + wall ceiling + ( + (33 37 36 32) + (34 38 37 33) + (35 39 38 34) + (37 41 40 36) + (38 42 41 37) + (39 43 42 38) + (41 45 44 40) + (42 46 45 41) + (43 47 46 42) + ) + wall fixedWalls + ( + ( 1 17 16 0) + ( 2 18 17 1) + ( 3 19 18 2) + (17 33 32 16) + (18 34 33 17) + (19 35 34 18) + + ( 7 23 19 3) + (11 27 23 7) + (15 31 27 11) + (23 39 35 19) + (27 43 39 23) + (31 47 43 27) + + (14 30 31 15) + (13 29 30 14) + (12 28 29 13) + (30 46 47 31) + (29 45 46 30) + (28 44 45 29) + + ( 8 24 28 12) + ( 4 20 24 8) + ( 0 16 20 4) + (24 40 44 28) + (20 36 40 24) + (16 32 36 20) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..51ad413058820b8008fc7e36afef54022a1191e0 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object environmentalProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +radiation on; + +radiationModel P1; + +noRadiation +{ +} + +P1Coeffs +{ +} + +absorptionEmissionModel constantAbsorptionEmission; + +constantAbsorptionEmissionCoeffs +{ + a a [ 0 -1 0 0 0 0 0] 0.5; + e e [ 0 -1 0 0 0 0 0] 0.5; + E E [ 1 -1 -3 0 0 0 0] 0.0; +} + +scatterModel constantScatter; + +constantScatterCoeffs +{ + sigma sigma [ 0 -1 0 0 0 0 0] 0.0; + C C [ 0 0 0 0 0 0 0] 0.0; +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..ca90242d7d51bdd737438508ea0ae9d7cd54159f --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/thermophysicalProperties @@ -0,0 +1,30 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object thermophysicalProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; + +mixture air 1 28.9 1000 0 1.8e-05 0.7; + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/turbulenceProperties b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..48be4c90346552bcbb706994d5dc3245d42d1742 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/turbulenceProperties @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object turbulenceProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +turbulenceModel kEpsilon; + +turbulence on; + +laminarCoeffs +{ +} + +kEpsilonCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + C3 C3 [0 0 0 0 0 0 0] 0.85; + alphah alphah [0 0 0 0 0 0 0] 1; + alphak alphak [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +RNGkEpsilonCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.0845; + C1 C1 [0 0 0 0 0 0 0] 1.42; + C2 C2 [0 0 0 0 0 0 0] 1.68; + C3 C3 [0 0 0 0 0 0 0] -0.33; + alphah alphah [0 0 0 0 0 0 0] 1; + alphak alphaK [0 0 0 0 0 0 0] 1.39; + alphaEps alphaEps [0 0 0 0 0 0 0] 1.39; + eta0 eta0 [0 0 0 0 0 0 0] 4.38; + beta beta [0 0 0 0 0 0 0] 0.012; +} + +LaunderSharmaKECoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + C3 C3 [0 0 0 0 0 0 0] -0.33; + alphah alphah [0 0 0 0 0 0 0] 1; + alphak alphak [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +LRRCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + Clrr1 Clrr1 [0 0 0 0 0 0 0] 1.8; + Clrr2 Clrr2 [0 0 0 0 0 0 0] 0.6; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphah alphah [0 0 0 0 0 0 0] 1; + Cs Cs [0 0 0 0 0 0 0] 0.25; + Ceps Ceps [0 0 0 0 0 0 0] 0.15; + alphaR alphaR [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +LaunderGibsonRSTMCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + Clg1 Clg1 [0 0 0 0 0 0 0] 1.8; + Clg2 Clg2 [0 0 0 0 0 0 0] 0.6; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphah alphah [0 0 0 0 0 0 0] 1; + C1Ref C1Ref [0 0 0 0 0 0 0] 0.5; + C2Ref C2Ref [0 0 0 0 0 0 0] 0.3; + Cs Cs [0 0 0 0 0 0 0] 0.25; + Ceps Ceps [0 0 0 0 0 0 0] 0.15; + alphaR alphaR [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +wallFunctionCoeffs +{ + kappa kappa [0 0 0 0 0 0 0] 0.4187; + E E [0 0 0 0 0 0 0] 9; +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..788d322513d60a9351555b95319bac3959196c8e --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/controlDict @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object controlDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application buoyantSimpleRadiationFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..31389fc51f754d0da3084d04eaa828284e33d719 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSchemes @@ -0,0 +1,76 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object fvSchemes; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div((muEff*dev2(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear corrected; + laplacian((rho*(1|A(U))),pd) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(gammaRad,G) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + pd; +} + + +// ************************************************************************* // diff --git a/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..f7feeaa6efa82fe9adaa1a5b3a5ae9c5dfcfbc02 --- /dev/null +++ b/tutorials/buoyantSimpleRadiationFoam/hotRadiationRoom/system/fvSolution @@ -0,0 +1,84 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object fvSolution; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pd PCG + { + preconditioner DIC; + tolerance 1e-06; + relTol 0.01; + }; + U PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + h PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + k PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + epsilon PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + G PCG + { + preconditioner DIC; + tolerance 1e-05; + relTol 0.1; + }; +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + pdRefCell 0; + pdRefValue 0; +} + +relaxationFactors +{ + rho 1.0; + pd 0.3; + U 0.7; + h 0.7; + k 0.7; + epsilon 0.7; + G 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/Allclean b/tutorials/rhoTurbTwinParcelFoam/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..ad62b421fbaa6db3ae7f2e82a016facdb4fe5cfe --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/Allclean @@ -0,0 +1,16 @@ +#!/bin/sh + +currDir=`pwd` +application=`basename $currDir` +cases="simplifiedSiwek" + +tutorialPath=`dirname $0`/.. +. $tutorialPath/CleanFunctions + +wclean $application + +for case in $cases +do + cleanCase $case +done + diff --git a/tutorials/rhoTurbTwinParcelFoam/Allrun b/tutorials/rhoTurbTwinParcelFoam/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..f3255d83ad851436e796d7931c0158297c69b5c9 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/Allrun @@ -0,0 +1,16 @@ +#!/bin/sh + +currDir=`pwd` +application=`basename $currDir` +cases="simplifiedSiwek" + +tutorialPath=`dirname $0`/.. +. $tutorialPath/RunFunctions + +compileApplication $currDir $application + +for case in $cases +do + runApplication blockMesh $case + runApplication $application $case +done diff --git a/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/Make/files b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..b11cae03a931a88a5d305111b38cce5ce25e7bed --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/Make/files @@ -0,0 +1,3 @@ +rhoTurbTwinParcelFoam.C + +EXE = $(FOAM_USER_APPBIN)/rhoTurbTwinParcelFoam diff --git a/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/Make/options b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..4af7133ad332cad337a01c0dad6f21880272033d --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/Make/options @@ -0,0 +1,21 @@ +EXE_INC = \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/turbulenceModels + +EXE_LIBS = \ + -llagrangian \ + -llagrangianIntermediate \ + -lfiniteVolume \ + -lmeshTools \ + -lthermophysicalFunctions \ + -lbasicThermophysicalModels \ + -lcombustionThermophysicalModels \ + -lspecie \ + -lradiation \ + -lcompressibleTurbulenceModels diff --git a/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/UEqn.H b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/UEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..4d58a14da89574c12d4162e343f98eba5cf7085f --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/UEqn.H @@ -0,0 +1,17 @@ + fvVectorMatrix UEqn + ( + fvm::ddt(rho, U) + + fvm::div(phi, U) + + turbulence->divDevRhoReff(U) + == + thermoCloud1.SU1() + + kinematicCloud1.SU1() + + rho.dimensionedInternalField()*g + ); + + UEqn.relax(); + + if (momentumPredictor) + { + solve(UEqn == -fvc::grad(p)); + } diff --git a/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/createFields.H b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..1191d94b024057dcefd0930ebf96451bf470140c --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/createFields.H @@ -0,0 +1,84 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr<basicThermo> thermo + ( + basicThermo::New(mesh) + ); + + volScalarField& p = thermo->p(); + volScalarField& h = thermo->h(); + const volScalarField& psi = thermo->psi(); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + thermo->rho() + ); + + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + +# include "compressibleCreatePhi.H" + + + Info<< "Creating turbulence model\n" << endl; + autoPtr<compressible::turbulenceModel> turbulence + ( + compressible::turbulenceModel::New + ( + rho, + U, + phi, + thermo() + ) + ); + + + Info<< "Creating field DpDt\n" << endl; + volScalarField DpDt = + fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); + + pointMesh pMesh(mesh); + volPointInterpolation vpi(mesh, pMesh); + + Info<< "Constructing thermoCloud1" << endl; + basicThermoCloud thermoCloud1 + ( + "thermoCloud1", + vpi, + rho, + U, + g, + thermo() + ); + + Info<< "Constructing kinematicCloud1" << endl; + basicKinematicCloud kinematicCloud1 + ( + "kinematicCloud1", + vpi, + rho, + U, + thermo().mu(), + g + ); + diff --git a/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/hEqn.H b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/hEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..5359c9c2cecae01b52923ff14943cc4a1373d598 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/hEqn.H @@ -0,0 +1,17 @@ +{ + fvScalarMatrix hEqn + ( + fvm::ddt(rho, h) + + fvm::div(phi, h) + - fvm::laplacian(turbulence->alphaEff(), h) + == + DpDt + + thermoCloud1.Sh1() + ); + + hEqn.relax(); + + hEqn.solve(); + + thermo->correct(); +} diff --git a/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/pEqn.H b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/pEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..b506245034010d76f0ad0fb87dd22c8b559f5597 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/pEqn.H @@ -0,0 +1,68 @@ +rho = thermo->rho(); + +volScalarField rUA = 1.0/UEqn.A(); +U = rUA*UEqn.H(); + +if (transonic) +{ + surfaceScalarField phid + ( + "phid", + fvc::interpolate(thermo->psi()) + *( + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phi) + ) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvm::div(phid, p) + - fvm::laplacian(rho*rUA, p) + ); + + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi == pEqn.flux(); + } + } +} +else +{ + phi = + fvc::interpolate(rho)* + ( + (fvc::interpolate(U) & mesh.Sf()) + + fvc::ddtPhiCorr(rUA, rho, U, phi) + ); + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::ddt(psi, p) + + fvc::div(phi) + - fvm::laplacian(rho*rUA, p) + ); + + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi += pEqn.flux(); + } + } +} + +#include "rhoEqn.H" +#include "compressibleContinuityErrs.H" + +U -= rUA*fvc::grad(p); +U.correctBoundaryConditions(); + +DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p); diff --git a/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam.C b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..0b9edd0b3c8c0349856373914c4d1dc3b7fff851 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam/rhoTurbTwinParcelFoam.C @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + rhoTurbFoam + +Description + Transient solver for compressible, turbulent flow with two thermo-clouds. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicThermo.H" +#include "compressible/turbulenceModel/turbulenceModel.H" + +#include "basicThermoCloud.H" +#include "basicKinematicCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" + +# include "createTime.H" +# include "createMesh.H" +# include "readEnvironmentalProperties.H" +# include "createFields.H" +# include "readPISOControls.H" +# include "initContinuityErrs.H" +# include "readTimeControls.H" +# include "compressibleCourantNo.H" +# include "setInitialDeltaT.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.run()) + { +# include "readTimeControls.H" +# include "readPISOControls.H" +# include "compressibleCourantNo.H" +# include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + Info<< "Evolving thermoCloud1" << endl; + thermoCloud1.evolve(); + thermoCloud1.info(); + + Info<< "Evolving kinematicCloud1" << endl; + kinematicCloud1.evolve(); + kinematicCloud1.info(); + + +# include "rhoEqn.H" + + // --- PIMPLE loop + for (int ocorr=1; ocorr<=nOuterCorr; ocorr++) + { +# include "UEqn.H" + + // --- PISO loop + for (int corr=1; corr<=nCorr; corr++) + { +# include "hEqn.H" +# include "pEqn.H" + } + } + + turbulence->correct(); + + rho = thermo->rho(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/G b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/G new file mode 100644 index 0000000000000000000000000000000000000000..473b2202225297ae58694e6f19ceced3bdbd8800 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/G @@ -0,0 +1,64 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object G; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + top + { + type MarshakRadiation; + T T; + emissivity 1.0; + value uniform 0; + } + bottom + { + type MarshakRadiation; + T T; + emissivity 1.0; + value uniform 0; + } + walls + { + type MarshakRadiation; + T T; + emissivity 1.0; + value uniform 0; + } + symmetry + { + type symmetryPlane; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/T b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/T new file mode 100644 index 0000000000000000000000000000000000000000..48baa8f7f74f2fc15c44e02ec39a9d49ec075cd7 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/T @@ -0,0 +1,61 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object T; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 400; + +boundaryField +{ + top + { + type fixedValue; + value uniform 400; + } + + bottom + { + type zeroGradient; + } + + walls + { + type zeroGradient; + } + + symmetry + { + type symmetryPlane; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/U b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/U new file mode 100644 index 0000000000000000000000000000000000000000..7d433912331103f9cd7544667b4392e5361d9058 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/U @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4.1 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volVectorField; + object U; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + top + { + type fixedValue; + value uniform (0 0 0); + } + bottom + { + type fixedValue; + value uniform (0 0 0); + } + walls + { + type fixedValue; + value uniform (0 0 0); + } + symmetry + { + type symmetryPlane; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/epsilon b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..8de558dbd3a81171122c5b74b51a6efaf0604abd --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/epsilon @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object epsilon; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 5390.5; + +boundaryField +{ + top + { + type zeroGradient; + } + + bottom + { + type zeroGradient; + } + + walls + { + type zeroGradient; + } + + symmetry + { + type symmetryPlane; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/k b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/k new file mode 100644 index 0000000000000000000000000000000000000000..f5f4cb92dd5a03af12d8f68cfe07762ff3b7e90e --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/k @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object k; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 37.5; + +boundaryField +{ + top + { + type zeroGradient; + } + + bottom + { + type zeroGradient; + } + + walls + { + type zeroGradient; + } + + symmetry + { + type symmetryPlane; + } + + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/p b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/p new file mode 100644 index 0000000000000000000000000000000000000000..e2f41ffd04e6bc2aa692c3e4e6b0acd304dc9739 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/0/p @@ -0,0 +1,2558 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4.1 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root "/home/andy/OpenFOAM/andy-1.4.1/development/spray/rhoTurbThermoParcelExplicitSourceFoam"; + case "testCase"; + instance "0"; + local ""; + + class volScalarField; + object p; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField nonuniform List<scalar> +2500 +( +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +100000 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +5e+05 +) +; + +boundaryField +{ + top + { + type zeroGradient; + } + bottom + { + type zeroGradient; + } + walls + { + type zeroGradient; + } + symmetry + { + type symmetryPlane; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/environmentalProperties b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/environmentalProperties new file mode 100644 index 0000000000000000000000000000000000000000..e9aee6c9b50caa4fae9f0025596b7894773d2cbb --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/environmentalProperties @@ -0,0 +1,28 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object environmentalProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [0 1 -2 0 0 0 0] (0 -9.81 0); + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Positions b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Positions new file mode 100644 index 0000000000000000000000000000000000000000..f01a5a8ad8f65ff5c64b2247c279212bf9f9ca2b --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Positions @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class vectorField; + object kinematicCloud1Positions; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +( +(0.0075 0.5 0.05) +(0.0125 0.5 0.05) +(0.0175 0.5 0.05) +(0.0225 0.5 0.05) +(0.0275 0.5 0.05) +(0.0325 0.5 0.05) +(0.0375 0.5 0.05) +(0.0425 0.5 0.05) +(0.0475 0.5 0.05) +(0.0075 0.4 0.05) +(0.0125 0.4 0.05) +(0.0175 0.4 0.05) +(0.0225 0.4 0.05) +(0.0275 0.4 0.05) +(0.0325 0.4 0.05) +(0.0375 0.4 0.05) +(0.0425 0.4 0.05) +(0.0475 0.4 0.05) +) +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties new file mode 100644 index 0000000000000000000000000000000000000000..3d652853607546d2299e6b1cfbd0eedbb8094897 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/kinematicCloud1Properties @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4.1 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object kinematicCloud1Properties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Particle sub-models +InjectionModel ManualInjection; +DragModel SphereDrag; +DispersionModel StochasticDispersionRAS; +WallInteractionModel StandardWallInteraction; + +// Parcel basis type +parcelBasisType mass; + +// Total mass to inject +massTotal massTotal [ 1 0 0 0 0] 2.0e-4; + +// Minimum particle mass +minParticleMass minParticleMass [ 1 0 0 0 0] 1.0e-15; + +// Parcel thermo properties +rho0 rho0 [ 1 -3 0 0 0] 5000; + +// Coupling between particles and carrier phase via source terms +coupled true; + +// Integer used to identify different parcel types +parcelTypeId 2; + +interpolationSchemes +{ + rho cell; + U cellPointFace; + mu cell; +} + +integrationSchemes +{ + U Euler; +} + +ManualInjectionCoeffs +{ + injectionTime 0; + positionsFile kinematicCloud1Positions; + U0 (0 0 0); + parcelPDF + { + pdfType RosinRammler; + RosinRammlerPDF + { + minValue 50.0e-06; + maxValue 100.0e-06; + d (75.0e-06); + n (0.5); + } + } +} + +StandardWallInteractionCoeffs +{ + e e [ 0 0 0 0 0] 1; + mu mu [ 0 0 0 0 0] 0; +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..26ea6f0982bf65f1dd8c723e8dfaa507bff37fdf --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/polyMesh/blockMeshDict @@ -0,0 +1,95 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1.0; + +vertices +( + (0 0 0) + (0.05 0 0) + (0.05 0.5 0) + (0 0.5 0) + (0 0 0.1) + (0.05 0 0.1) + (0.05 0.5 0.1) + (0 0.5 0.1) + (0.5 0 0) + (0.5 0.5 0) + (0.5 0 0.1) + (0.5 0.5 0.1) + (0.05 1 0) + (0 1 0) + (0.05 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (5 50 1) simpleGrading (1 1 1) + hex (1 8 9 2 5 10 11 6) (40 50 1) simpleGrading (1 1 1) + hex (3 2 12 13 7 6 14 15) (5 50 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch top + ( + (13 15 14 12) + ) + patch bottom + ( + (0 1 5 4) + (1 8 10 5) + ) + wall walls + ( + (8 9 11 10) + (9 2 6 11) + (2 12 14 6) + ) + symmetryPlane symmetry + ( + (4 7 3 0) + (7 15 13 3) + ) + empty frontAndBack + ( + (0 3 2 1) + (3 13 12 2) + (1 2 9 8) + (5 6 7 4) + (6 14 15 7) + (10 11 6 5) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Positions b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Positions new file mode 100644 index 0000000000000000000000000000000000000000..ced7be69f3489984f0ce419225dc61a4bd55c5f1 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Positions @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class vectorField; + object limestonePositions; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +( +(0.0075 0.55 0.05) +(0.0125 0.55 0.05) +(0.0175 0.55 0.05) +(0.0225 0.55 0.05) +(0.0275 0.55 0.05) +(0.0325 0.55 0.05) +(0.0375 0.55 0.05) +(0.0425 0.55 0.05) +(0.0475 0.55 0.05) +(0.0075 0.45 0.05) +(0.0125 0.45 0.05) +(0.0175 0.45 0.05) +(0.0225 0.45 0.05) +(0.0275 0.45 0.05) +(0.0325 0.45 0.05) +(0.0375 0.45 0.05) +(0.0425 0.45 0.05) +(0.0475 0.45 0.05) +) +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties new file mode 100644 index 0000000000000000000000000000000000000000..af6f908566aeb3e8bc53d98e05f646c9dc5e1896 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4.1 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object thermoCloud1Properties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Particle sub-models +InjectionModel ManualInjection; +DragModel SphereDrag; +DispersionModel StochasticDispersionRAS; +WallInteractionModel StandardWallInteraction; +HeatTransferModel RanzMarshall; + +radiation off; + +// Parcel basis type +parcelBasisType mass; + +// Total mass to inject +massTotal massTotal [ 1 0 0 0 0] 1e-4; + +// Minimum particle mass +minParticleMass minParticleMass [ 1 0 0 0 0] 1.0e-15; + +// Parcel thermo properties +rho0 rho0 [ 1 -3 0 0 0] 2500; +T0 T0 [ 0 0 0 1 0] 300; +cp0 cp0 [ 0 2 -2 -1 0] 900; +epsilon0 epsilon0 [ 0 0 0 0 0] 1; +f0 f0 [ 0 0 0 0 0] 0.5; + +// Coupling between particles and carrier phase via source terms +coupled true; + +// Integer used to identify different parcel types +parcelTypeId 1; + +interpolationSchemes +{ + rho cell; + U cellPointFace; + mu cell; + T cell; + Cp cell; +} + +integrationSchemes +{ + U Euler; + T Analytical; +} + +ManualInjectionCoeffs +{ + injectionTime 0; + positionsFile thermoCloud1Positions; + U0 (0 0 0); + parcelPDF + { + pdfType RosinRammler; + RosinRammlerPDF + { + minValue 5.0e-06; + maxValue 500.0e-06; + d (50.0e-06); + n (0.5); + } + } +} + +StandardWallInteractionCoeffs +{ + e e [ 0 0 0 0 0] 1; + mu mu [ 0 0 0 0 0] 0; +} + +RanzMarshallCoeffs +{ + Pr Pr [ 0 0 0 0 0] 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..de5bb8e48e5192cafcbc12ff31c5be7686645f48 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/thermophysicalProperties @@ -0,0 +1,32 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object thermophysicalProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Thermophysical model +thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; + +mixture air 1 28.9 1007 0 1.84e-05 0.7; + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/turbulenceProperties b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..eb33720fe872b2016d815aea5fd8fd6634f22155 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/constant/turbulenceProperties @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object turbulenceProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Turbulence model selection +turbulenceModel kEpsilon; + +// Do you wish to calculate turbulence? +turbulence on; + +// Laminar model coefficients +laminarCoeffs +{ +} + +// Standard k-epsilon model coefficients +kEpsilonCoeffs +{ + // Cmu + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + // C1 + C1 C1 [0 0 0 0 0 0 0] 1.44; + // C2 + C2 C2 [0 0 0 0 0 0 0] 1.92; + // C3 + C3 C3 [0 0 0 0 0 0 0] -0.33; + // alphah + alphah alphah [0 0 0 0 0 0 0] 1; + // alphak + alphak alphak [0 0 0 0 0 0 0] 1; + // alphaEps + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +// RNG k-epsilon model coefficients +RNGkEpsilonCoeffs +{ + // Cmu + Cmu Cmu [0 0 0 0 0 0 0] 0.0845; + // C1 + C1 C1 [0 0 0 0 0 0 0] 1.42; + // C2 + C2 C2 [0 0 0 0 0 0 0] 1.68; + // C3 + C3 C3 [0 0 0 0 0 0 0] -0.33; + // alphah + alphah alphah [0 0 0 0 0 0 0] 1; + // alphak + alphak alphaK [0 0 0 0 0 0 0] 1.39; + // alphaEps + alphaEps alphaEps [0 0 0 0 0 0 0] 1.39; + // eta0 + eta0 eta0 [0 0 0 0 0 0 0] 4.38; + // beta + beta beta [0 0 0 0 0 0 0] 0.012; +} + +// Launder-Sharma low Reynolds number k-epsilon model coefficients +LaunderSharmaKECoeffs +{ + // Cmu + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + // C1 + C1 C1 [0 0 0 0 0 0 0] 1.44; + // C2 + C2 C2 [0 0 0 0 0 0 0] 1.92; + // C3 + C3 C3 [0 0 0 0 0 0 0] -0.33; + // alphah + alphah alphah [0 0 0 0 0 0 0] 1; + // alphak + alphak alphak [0 0 0 0 0 0 0] 1; + // alphaEps + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +// Launder-Reece-Rodi RSTM with wall functions model coefficients +LRRCoeffs +{ + // Cmu + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + // Clrr1 + Clrr1 Clrr1 [0 0 0 0 0 0 0] 1.8; + // Clrr2 + Clrr2 Clrr2 [0 0 0 0 0 0 0] 0.6; + // C1 + C1 C1 [0 0 0 0 0 0 0] 1.44; + // C2 + C2 C2 [0 0 0 0 0 0 0] 1.92; + // Cs + Cs Cs [0 0 0 0 0 0 0] 0.25; + // Ceps + Ceps Ceps [0 0 0 0 0 0 0] 0.15; + // alphah + alphah alphah [0 0 0 0 0 0 0] 1; + // alphaEps + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; + // alphaR + alphaR alphaR [0 0 0 0 0 0 0] 1.22; +} + +// Launder-Gibson RSTM with wall reflection and wall functions model coefficients +LaunderGibsonRSTMCoeffs +{ + // Cmu + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + // Clg1 + Clg1 Clg1 [0 0 0 0 0 0 0] 1.8; + // Clg2 + Clg2 Clg2 [0 0 0 0 0 0 0] 0.6; + // C1 + C1 C1 [0 0 0 0 0 0 0] 1.44; + // C2 + C2 C2 [0 0 0 0 0 0 0] 1.92; + // C1Ref + C1Ref C1Ref [0 0 0 0 0 0 0] 0.5; + // C2Ref + C2Ref C2Ref [0 0 0 0 0 0 0] 0.3; + // Cs + Cs Cs [0 0 0 0 0 0 0] 0.25; + // Ceps + Ceps Ceps [0 0 0 0 0 0 0] 0.15; + // alphah + alphah alphah [0 0 0 0 0 0 0] 1; + // alphaEps + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; + // alphaR + alphaR alphaR [0 0 0 0 0 0 0] 1.22; +} + +// Wall function coefficients +wallFunctionCoeffs +{ + // kappa + kappa kappa [0 0 0 0 0 0 0] 0.4187; + // E + E E [0 0 0 0 0 0 0] 9; +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/controlDict b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..05d2cad84f04614e8e64bafe2305d7230ed42f7f --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/controlDict @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object controlDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Foam Application Class +application rhoTurbThermoParcelFoam; + +// Start point of run +startFrom latestTime; + +// Calculation start time +startTime 0; + +// End point of run +stopAt endTime; + +// Calculation end time +endTime 0.5; + +// Calculation time step +deltaT 1.0e-4; + +// Type of write output control +writeControl adjustableRunTime; + +// Interval with which the results are output +writeInterval 0.01; + +// Limits number of time directories before overwriting +purgeWrite 0; + +// Write Format +writeFormat ascii; + +// Significant figures of written ASCII data +writePrecision 10; + +// Write Compression +writeCompression uncompressed; + +// Time directories name format +timeFormat general; + +// Decimal precision of time directory names +timePrecision 6; + +// Can parameters be modified during run time? +runTimeModifiable yes; + +// Automatic adjustment of time step? +adjustTimeStep yes; + +// maxCo +maxCo 0.2; + +// maxDeltaT +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/decomposeParDict b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..dea9c89534ea9f14d56b019197dcd1188a669726 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/decomposeParDict @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +numberOfSubdomains 4; + +method metis; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (1 1 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights + ( + 1 + 1 + 1 + 1 + ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots +( +); + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/fvSchemes b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/fvSchemes new file mode 100755 index 0000000000000000000000000000000000000000..029fee22959778296efa7bc9f2d3261b653198d1 --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/fvSchemes @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object fvSchemes; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// Time derivative discretisation schemes +ddtSchemes +{ + // Default scheme + default Euler; +} + +// Gradient discretisation schemes +gradSchemes +{ + // Default gradient scheme + default Gauss linear; + grad(p) Gauss linear; +} + +// Convection discretisation schemes +divSchemes +{ + // Default scheme + default none; + div(phi,U) Gauss upwind; + div(phid,p) Gauss upwind; + div(phiU,p) Gauss linear; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(U) Gauss linear; + div((muEff*dev2(grad(U).T()))) Gauss linear; + div(phi,Yi_h) Gauss upwind; +} + +// Laplacian discretisation schemes +laplacianSchemes +{ + // Default scheme + default Gauss linear corrected; + laplacian(muEff,U) Gauss linear corrected; + laplacian(mut,U) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian((rho*(1|A(U))),p) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; +} + +// Interpolation schemes +interpolationSchemes +{ + // Default scheme + default linear; +} + +// Surface normal gradient schemes +snGradSchemes +{ + // Default scheme + default corrected; +} + +// Calculation of flux +fluxRequired +{ + // Create storage for flux for all solved variables? + default no; + p; +} + + +// ************************************************************************* // diff --git a/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/fvSolution b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/fvSolution new file mode 100755 index 0000000000000000000000000000000000000000..1fc5059b5c248063f54af762a7e9aeff133cc21d --- /dev/null +++ b/tutorials/rhoTurbTwinParcelFoam/simplifiedSiwek/system/fvSolution @@ -0,0 +1,146 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object fvSolution; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + // Solver for the rho equation + rho PCG + { + preconditioner DIC; + tolerance 1e-05; + relTol 0; + }; + // Solver for the U equation + U PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0; + }; + // Solver for the p equation + p PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + G PCG + { + preconditioner DIC; + tolerance 1e-05; + relTol 0; + }; + Yi PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + CO2 PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + O2 PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + N2 PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + CH4 PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + H2 PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + H2O PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + CO PBiCG + { + preconditioner DILU; + tolerance 1e-06; + relTol 0; + }; + + // Solver for the h equation + h PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0; + }; + // Solver for the R equation + R PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0; + }; + // Solver for the k equation + k PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0; + }; + // Solver for the epsilon equation + epsilon PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0; + }; +} + +PISO +{ + // Transonic? + transonic yes; + // Number of PISO correctors + nCorrectors 2; + // Number of non-orthogonal correctors + nNonOrthogonalCorrectors 0; + // momentumPredictor? + momentumPredictor yes; +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/Allclean b/tutorials/simpleSRFFoam/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..84e497ae85e5aaa9dfa4427ebc47960aee36b370 --- /dev/null +++ b/tutorials/simpleSRFFoam/Allclean @@ -0,0 +1,16 @@ +#!/bin/sh + +currDir=`pwd` +application=`basename $currDir` +cases="mixer" + +tutorialPath=`dirname $0`/.. +. $tutorialPath/CleanFunctions + +wclean $application + +for case in $cases +do + cleanCase $case +done + diff --git a/tutorials/simpleSRFFoam/Allrun b/tutorials/simpleSRFFoam/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..d235878a47b90eb047272edf5bccd82ffcf20cc4 --- /dev/null +++ b/tutorials/simpleSRFFoam/Allrun @@ -0,0 +1,16 @@ +#!/bin/sh + +currDir=`pwd` +application=`basename $currDir` +cases="mixer" + +tutorialPath=`dirname $0`/.. +. $tutorialPath/RunFunctions + +compileApplication $currDir $application + +for case in $cases +do + runApplication blockMesh $case + runApplication $application $case +done diff --git a/tutorials/simpleSRFFoam/mixer/0/Urel b/tutorials/simpleSRFFoam/mixer/0/Urel new file mode 100644 index 0000000000000000000000000000000000000000..b843c7858b586c1817a1a092758cd941a8f3644a --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/0/Urel @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volVectorField; + object Urel; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type SRFVelocity; + inletValue uniform (0 0 -10); + relative yes; + value uniform (0 0 0); + } + + outlet + { + type zeroGradient; + } + + innerWall + { + type fixedValue; + value uniform (0 0 0); + } + + outerWall + { + type SRFVelocity; + inletValue uniform (0 0 0); + relative yes; + value uniform (0 0 0); + } + + cyclic + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/0/epsilon b/tutorials/simpleSRFFoam/mixer/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..6bc667ad42f7825eee8f2a96e0aa9604633d1352 --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/0/epsilon @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object epsilon; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 14.855; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 14.855; + } + + outlet + { + type zeroGradient; + } + + innerWall + { + type zeroGradient; + } + + outerWall + { + type zeroGradient; + } + + cyclic + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/0/k b/tutorials/simpleSRFFoam/mixer/0/k new file mode 100644 index 0000000000000000000000000000000000000000..3c971a95cbdb444ad0e61c46f3870ce2fe9c74a3 --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/0/k @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object k; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.375; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.375; + } + + outlet + { + type zeroGradient; + } + + innerWall + { + type zeroGradient; + } + + outerWall + { + type zeroGradient; + } + + cyclic + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/0/omega b/tutorials/simpleSRFFoam/mixer/0/omega new file mode 100644 index 0000000000000000000000000000000000000000..b86edc641218ae61cf01ffda6941aa6b3dbd5832 --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/0/omega @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object omega; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 3.5; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 3.5; + } + + outlet + { + type zeroGradient; + } + + innerWall + { + type zeroGradient; + } + + outerWall + { + type zeroGradient; + } + + cyclic + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/0/p b/tutorials/simpleSRFFoam/mixer/0/p new file mode 100644 index 0000000000000000000000000000000000000000..75fe0835e102d7affa9f5f4b800b679264c14c3e --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/0/p @@ -0,0 +1,60 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class volScalarField; + object p; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet + { + type fixedValue; + value uniform 0; + } + + innerWall + { + type zeroGradient; + } + + outerWall + { + type zeroGradient; + } + + cyclic + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/constant/SRFProperties b/tutorials/simpleSRFFoam/mixer/constant/SRFProperties new file mode 100644 index 0000000000000000000000000000000000000000..c7ba552f0f3977bb9df2747176d10524427292a5 --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/constant/SRFProperties @@ -0,0 +1,35 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object SRFProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +SRFModel rpm; + +axis (0 0 1); + +rpmCoeffs +{ + rpm 5000.0; +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/constant/polyMesh/blockMeshDict b/tutorials/simpleSRFFoam/mixer/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..7ee95068a18d55af2bcab6654d19eb6a625e8815 --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/constant/polyMesh/blockMeshDict @@ -0,0 +1,123 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +vertices +( + ( 0.500 0.000 0.000) + ( 0.369 0.338 0.000) + ( 0.338 0.369 0.000) + ( 0.000 0.500 0.000) + ( 0.737 0.676 0.000) + ( 0.074 0.068 0.000) + ( 0.676 0.737 0.000) + ( 0.068 0.074 0.000) + ( 0.000 1.000 0.000) + ( 1.000 0.000 0.000) + ( 0.100 0.000 0.000) + ( 0.000 0.100 0.000) + ( 0.500 0.000 2.000) + ( 0.369 0.338 2.000) + ( 0.338 0.369 2.000) + ( 0.000 0.500 2.000) + ( 0.737 0.676 2.000) + ( 0.074 0.068 2.000) + ( 0.676 0.737 2.000) + ( 0.068 0.074 2.000) + ( 0.000 1.000 2.000) + ( 1.000 0.000 2.000) + ( 0.100 0.000 2.000) + ( 0.000 0.100 2.000) +); + +blocks +( + hex (1 0 9 4 13 12 21 16) (10 20 40) simpleGrading (1 1 1) + hex (2 1 4 6 14 13 16 18) (2 20 40) simpleGrading (1 1 1) + hex (3 2 6 8 15 14 18 20) (10 20 40) simpleGrading (1 1 1) + hex (5 10 0 1 17 22 12 13) (10 20 40) simpleGrading (1 1 1) + hex (11 7 2 3 23 19 14 15) (10 20 40) simpleGrading (1 1 1) +); + +edges +( + arc 0 1 ( 0.470 0.171 0.000 ) + arc 12 13 ( 0.470 0.171 2.000 ) + arc 2 3 ( 0.171 0.470 0.000 ) + arc 14 15 ( 0.171 0.470 2.000 ) + arc 9 4 ( 0.940 0.342 0.000 ) + arc 21 16 ( 0.940 0.342 2.000 ) + arc 5 10 ( 0.094 0.034 0.000 ) + arc 17 22 ( 0.094 0.034 2.000 ) + arc 6 8 ( 0.342 0.940 0.000 ) + arc 18 20 ( 0.342 0.940 2.000 ) + arc 11 7 ( 0.034 0.094 0.000 ) + arc 23 19 ( 0.034 0.094 2.000 ) +); + +patches +( + patch inlet + ( + (13 12 21 16) + (14 13 16 18) + (15 14 18 20) + (17 22 12 13) + (23 19 14 15) + ) + patch outlet + ( + (1 4 9 0) + (2 6 4 1) + (3 8 6 2) + (5 1 0 10) + (11 3 2 7) + ) + wall innerWall + ( + (2 1 13 14) + (5 10 22 17) + (5 17 13 1) + (11 7 19 23) + (7 2 14 19) + ) + wall outerWall + ( + (4 16 21 9) + (6 18 16 4) + (8 20 18 6) + ) + cyclic cyclic + ( + (0 9 21 12) + (10 0 12 22) + (3 15 20 8) + (11 23 15 3) + ) +); + +mergeMatchPairs +( +); diff --git a/tutorials/simpleSRFFoam/mixer/constant/transportProperties b/tutorials/simpleSRFFoam/mixer/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..ab0e454728e11e70c5d779f39b1095a1731d6e2f --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/constant/transportProperties @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object transportProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [0 2 -1 0 0 0 0] 1.5e-05; + +CrossPowerLawCoeffs +{ + nu0 nu0 [0 2 -1 0 0 0 0] 1e-06; + nuInf nuInf [0 2 -1 0 0 0 0] 1e-06; + m m [0 0 1 0 0 0 0] 1; + n n [0 0 0 0 0 0 0] 1; +} + +BirdCarreauCoeffs +{ + nu0 nu0 [0 2 -1 0 0 0 0] 1e-06; + nuInf nuInf [0 2 -1 0 0 0 0] 1e-06; + k k [0 0 1 0 0 0 0] 0; + n n [0 0 0 0 0 0 0] 1; +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/constant/turbulenceProperties b/tutorials/simpleSRFFoam/mixer/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..65b42f00637b42d054fd8d51ba51b09f28c1aff8 --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/constant/turbulenceProperties @@ -0,0 +1,198 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object turbulenceProperties; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +turbulenceModel kOmegaSST; + +turbulence on; + +laminarCoeffs +{ +} + +kEpsilonCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +RNGkEpsilonCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.0845; + C1 C1 [0 0 0 0 0 0 0] 1.42; + C2 C2 [0 0 0 0 0 0 0] 1.68; + alphak alphaK [0 0 0 0 0 0 0] 1.39; + alphaEps alphaEps [0 0 0 0 0 0 0] 1.39; + eta0 eta0 [0 0 0 0 0 0 0] 4.38; + beta beta [0 0 0 0 0 0 0] 0.012; +} + +kOmegaSSTCoeffs +{ + alphaK1 alphaK1 [0 0 0 0 0 0 0] 0.85034; + alphaK2 alphaK1 [0 0 0 0 0 0 0] 1.0; + alphaOmega1 alphaOmega1 [0 0 0 0 0 0 0] 0.5; + alphaOmega2 alphaOmega2 [0 0 0 0 0 0 0] 0.85616; + gamma1 gamma1 [0 0 0 0 0 0 0] 0.5532; + gamma2 gamma2 [0 0 0 0 0 0 0] 0.4403; + beta1 beta1 [0 0 0 0 0 0 0] 0.0750; + beta2 beta2 [0 0 0 0 0 0 0] 0.0828; + betaStar betaStar [0 0 0 0 0 0 0] 0.09; + a1 a1 [0 0 0 0 0 0 0] 0.31; + c1 c1 [0 0 0 0 0 0 0] 10; + + Cmu Cmu [0 0 0 0 0 0 0] 0.09; +} + +NonlinearKEShihCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphak alphak [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76932; + A1 A1 [0 0 0 0 0 0 0] 1.25; + A2 A2 [0 0 0 0 0 0 0] 1000; + Ctau1 Ctau1 [0 0 0 0 0 0 0] -4; + Ctau2 Ctau2 [0 0 0 0 0 0 0] 13; + Ctau3 Ctau3 [0 0 0 0 0 0 0] -2; + alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9; +} + +LienCubicKECoeffs +{ + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphak alphak [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; + A1 A1 [0 0 0 0 0 0 0] 1.25; + A2 A2 [0 0 0 0 0 0 0] 1000; + Ctau1 Ctau1 [0 0 0 0 0 0 0] -4; + Ctau2 Ctau2 [0 0 0 0 0 0 0] 13; + Ctau3 Ctau3 [0 0 0 0 0 0 0] -2; + alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9; +} + +QZetaCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphaZeta alphaZeta [0 0 0 0 0 0 0] 0.76923; + anisotropic no; +} + +LaunderSharmaKECoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +LamBremhorstKECoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +LienCubicKELowReCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphak alphak [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; + A1 A1 [0 0 0 0 0 0 0] 1.25; + A2 A2 [0 0 0 0 0 0 0] 1000; + Ctau1 Ctau1 [0 0 0 0 0 0 0] -4; + Ctau2 Ctau2 [0 0 0 0 0 0 0] 13; + Ctau3 Ctau3 [0 0 0 0 0 0 0] -2; + alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9; + Am Am [0 0 0 0 0 0 0] 0.016; + Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263; + Amu Amu [0 0 0 0 0 0 0] 0.00222; +} + +LienLeschzinerLowReCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + alphak alphak [0 0 0 0 0 0 0] 1; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; + Am Am [0 0 0 0 0 0 0] 0.016; + Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263; + Amu Amu [0 0 0 0 0 0 0] 0.00222; +} + +LRRCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + Clrr1 Clrr1 [0 0 0 0 0 0 0] 1.8; + Clrr2 Clrr2 [0 0 0 0 0 0 0] 0.6; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + Cs Cs [0 0 0 0 0 0 0] 0.25; + Ceps Ceps [0 0 0 0 0 0 0] 0.15; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; +} + +LaunderGibsonRSTMCoeffs +{ + Cmu Cmu [0 0 0 0 0 0 0] 0.09; + Clg1 Clg1 [0 0 0 0 0 0 0] 1.8; + Clg2 Clg2 [0 0 0 0 0 0 0] 0.6; + C1 C1 [0 0 0 0 0 0 0] 1.44; + C2 C2 [0 0 0 0 0 0 0] 1.92; + C1Ref C1Ref [0 0 0 0 0 0 0] 0.5; + C2Ref C2Ref [0 0 0 0 0 0 0] 0.3; + Cs Cs [0 0 0 0 0 0 0] 0.25; + Ceps Ceps [0 0 0 0 0 0 0] 0.15; + alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923; + alphaR alphaR [0 0 0 0 0 0 0] 1.22; +} + +SpalartAllmarasCoeffs +{ + alphaNut alphaNut [0 0 0 0 0 0 0] 1.5; + Cb1 Cb1 [0 0 0 0 0 0 0] 0.1355; + Cb2 Cb2 [0 0 0 0 0 0 0] 0.622; + Cw2 Cw2 [0 0 0 0 0 0 0] 0.3; + Cw3 Cw3 [0 0 0 0 0 0 0] 2; + Cv1 Cv1 [0 0 0 0 0 0 0] 7.1; + Cv2 Cv2 [0 0 0 0 0 0 0] 5.0; +} + +wallFunctionCoeffs +{ + kappa kappa [0 0 0 0 0 0 0] 0.4187; + E E [0 0 0 0 0 0 0] 9; +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/system/controlDict b/tutorials/simpleSRFFoam/mixer/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..a69778d53df9810ab36e2d8f999cd4cf1bba0798 --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/system/controlDict @@ -0,0 +1,56 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object controlDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application simpleSRFFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/system/fvSchemes b/tutorials/simpleSRFFoam/mixer/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..c372f564adf85bc5b062712d17374c3b66ae198d --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/system/fvSchemes @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object fvSchemes; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; + grad(Urel) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,Urel) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,omega) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(phi,nuTilda) Gauss upwind; + div((nuEff*dev(grad(Urel).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,Urel) Gauss linear corrected; + laplacian((1|A(Urel)),p) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DomegaEff,omega) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(Urel) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p; +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/mixer/system/fvSolution b/tutorials/simpleSRFFoam/mixer/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..c8b1fd40a4e728cd4b623dfbb51657174be1e2cd --- /dev/null +++ b/tutorials/simpleSRFFoam/mixer/system/fvSolution @@ -0,0 +1,88 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + + root ""; + case ""; + instance ""; + local ""; + + class dictionary; + object fvSolution; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p PCG + { + preconditioner DIC; + tolerance 1e-06; + relTol 0.01; + }; + Urel PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + k PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + epsilon PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + omega PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + R PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; + nuTilda PBiCG + { + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + }; +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; +} + +relaxationFactors +{ + p 0.3; + Urel 0.7; + k 0.7; + epsilon 0.7; + omega 0.7; + R 0.7; + nuTilda 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/simpleSRFFoam/simpleSRFFoam/Make/files b/tutorials/simpleSRFFoam/simpleSRFFoam/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..cd5e01f8b47d908fd495dbddf22813ec52481d40 --- /dev/null +++ b/tutorials/simpleSRFFoam/simpleSRFFoam/Make/files @@ -0,0 +1,3 @@ +simpleSRFFoam.C + +EXE = $(FOAM_USER_APPBIN)/simpleSRFFoam diff --git a/tutorials/simpleSRFFoam/simpleSRFFoam/Make/options b/tutorials/simpleSRFFoam/simpleSRFFoam/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..35a2464b977bddf8edd5b0b55933a9d7e9a7f9fd --- /dev/null +++ b/tutorials/simpleSRFFoam/simpleSRFFoam/Make/options @@ -0,0 +1,10 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/transportModels + +EXE_LIBS = \ + -lincompressibleTurbulenceModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools diff --git a/tutorials/simpleSRFFoam/simpleSRFFoam/createFields.H b/tutorials/simpleSRFFoam/simpleSRFFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..2ef0fc8b67eaf0da9d40e93c33677679149caa5a --- /dev/null +++ b/tutorials/simpleSRFFoam/simpleSRFFoam/createFields.H @@ -0,0 +1,74 @@ + Info << "Reading field p\n" << endl; + volScalarField p + ( + IOobject + ( + "p", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading field Urel\n" << endl; + volVectorField Urel + ( + IOobject + ( + "Urel", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + // Create absolute velocity field (post-processing only) + // Will be updated before first use, so can be initialised by Urel + Info<< "Creating field Uabs\n" << endl; + volVectorField Uabs + ( + IOobject + ( + "Uabs", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + Urel + ); + + Info<< "Reading/calculating face flux field phi\n" << endl; + surfaceScalarField phi + ( + IOobject + ( + "phi", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + linearInterpolate(Urel) & mesh.Sf() + ); + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); + + singlePhaseTransportModel laminarTransport(Urel, phi); + + autoPtr<turbulenceModel> turbulence + ( + turbulenceModel::New(Urel, phi, laminarTransport) + ); + + Info<< "Creating SRF model\n" << endl; + autoPtr<SRF::SRFModel> SRF + ( + SRF::SRFModel::New(Urel) + ); diff --git a/tutorials/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C b/tutorials/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C new file mode 100644 index 0000000000000000000000000000000000000000..4ae921d4875dd5bde044f61e1b953ba9c92ce90c --- /dev/null +++ b/tutorials/simpleSRFFoam/simpleSRFFoam/simpleSRFFoam.C @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + simpleSRFFoam + +Description + Steady-state solver for incompressible, turbulent flow of non-Newtonian + fluids with single rotating frame. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" +#include "incompressible/turbulenceModel/turbulenceModel.H" +#include "SRFModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + +# include "setRootCase.H" + +# include "createTime.H" +# include "createMesh.H" +# include "createFields.H" +# include "initContinuityErrs.H" + + //mesh.clearPrimitives(); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + for (runTime++; !runTime.end(); runTime++) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + +# include "readSIMPLEControls.H" + + p.storePrevIter(); + + // Pressure-velocity SIMPLE corrector + { + // Momentum predictor + tmp<fvVectorMatrix> UrelEqn + ( + fvm::div(phi, Urel) + + turbulence->divDevReff(Urel) + + SRF->Su() + ); + + UrelEqn().relax(); + + solve(UrelEqn() == -fvc::grad(p)); + + p.boundaryField().updateCoeffs(); + volScalarField AUrel = UrelEqn().A(); + Urel = UrelEqn().H()/AUrel; + UrelEqn.clear(); + phi = fvc::interpolate(Urel) & mesh.Sf(); + adjustPhi(phi, Urel, p); + + // Non-orthogonal pressure corrector loop + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + fvScalarMatrix pEqn + ( + fvm::laplacian(1.0/AUrel, p) == fvc::div(phi) + ); + + pEqn.setReference(pRefCell, pRefValue); + pEqn.solve(); + + if (nonOrth == nNonOrthCorr) + { + phi -= pEqn.flux(); + } + } + +# include "continuityErrs.H" + + // Explicitly relax pressure for momentum corrector + p.relax(); + + // Momentum corrector + Urel -= fvc::grad(p)/AUrel; + Urel.correctBoundaryConditions(); + } + + turbulence->correct(); + + Uabs = Urel + SRF->U(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return(0); +} + + +// ************************************************************************* //