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/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/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); +} + + +// ************************************************************************* //