From 00015a749ced3d5303801c288c436ed81bfdbada Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 8 Apr 2010 16:36:28 +0100 Subject: [PATCH 1/7] ENH: Initial commit of surface film modelling functionality - film approximated as single layer mesh, generated using extrudeToRegionMesh utility - library implemented in a hierarchy similar to lagrangian/intermediate: - currently includes kinematic and thermodynamic variants - sub-models include: - film detachment/dripping - phase change (place holder only) - works in parallel - currently in beta status --- src/surfaceFilmModels/Make/files | 26 + src/surfaceFilmModels/Make/options | 7 + ...rectMappedFixedInternalValueFvPatchField.C | 162 +++ ...rectMappedFixedInternalValueFvPatchField.H | 150 +++ ...ectMappedFixedInternalValueFvPatchFields.C | 43 + ...ectMappedFixedInternalValueFvPatchFields.H | 49 + ...MappedFixedInternalValueFvPatchFieldsFwd.H | 50 + ...ppedFixedPushedInternalValueFvPatchField.C | 133 +++ ...ppedFixedPushedInternalValueFvPatchField.H | 157 +++ ...pedFixedPushedInternalValueFvPatchFields.C | 43 + ...pedFixedPushedInternalValueFvPatchFields.H | 49 + ...FixedPushedInternalValueFvPatchFieldsFwd.H | 50 + ...ilmHeightInletVelocityFvPatchVectorField.C | 167 +++ ...ilmHeightInletVelocityFvPatchVectorField.H | 198 +++ .../injectionModel/injectionModel.C | 71 ++ .../injectionModel/injectionModel.H | 160 +++ .../injectionModel/injectionModelI.H | 44 + .../injectionModel/newInjectionModel.C | 59 + .../injectionModel/noInjection/noInjection.C | 72 ++ .../injectionModel/noInjection/noInjection.H | 104 ++ .../removeInjection/removeInjection.C | 71 ++ .../removeInjection/removeInjection.H | 104 ++ .../noPhaseChange/noPhaseChange.C | 67 ++ .../noPhaseChange/noPhaseChange.H | 100 ++ .../phaseChangeModel/newPhaseChangeModel.C | 59 + .../phaseChangeModel/phaseChangeModel.C | 81 ++ .../phaseChangeModel/phaseChangeModel.H | 155 +++ .../phaseChangeModel/phaseChangeModelI.H | 44 + .../kinematicSingleLayer.C | 1062 +++++++++++++++++ .../kinematicSingleLayer.H | 482 ++++++++ .../kinematicSingleLayerI.H | 221 ++++ .../kinematicSingleLayerTemplates.C | 62 + .../surfaceFilmModel/noFilm/noFilm.C | 209 ++++ .../surfaceFilmModel/noFilm/noFilm.H | 173 +++ .../surfaceFilmModel/newSurfaceFilmModel.C | 78 ++ .../surfaceFilmModel/surfaceFilmModel.C | 166 +++ .../surfaceFilmModel/surfaceFilmModel.H | 250 ++++ .../surfaceFilmModel/surfaceFilmModelI.H | 44 + .../thermoSingleLayer/thermoSingleLayer.C | 394 ++++++ .../thermoSingleLayer/thermoSingleLayer.H | 280 +++++ .../thermoSingleLayer/thermoSingleLayerI.H | 113 ++ 41 files changed, 6009 insertions(+) create mode 100644 src/surfaceFilmModels/Make/files create mode 100644 src/surfaceFilmModels/Make/options create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelI.H create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/newInjectionModel.C create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.H create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/newPhaseChangeModel.C create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelI.H create mode 100644 src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C create mode 100644 src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.H create mode 100644 src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerI.H create mode 100644 src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayerTemplates.C create mode 100644 src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C create mode 100644 src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H create mode 100644 src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/newSurfaceFilmModel.C create mode 100644 src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C create mode 100644 src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H create mode 100644 src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModelI.H create mode 100644 src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C create mode 100644 src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.H create mode 100644 src/surfaceFilmModels/surfaceFilmModel/thermoSingleLayer/thermoSingleLayerI.H diff --git a/src/surfaceFilmModels/Make/files b/src/surfaceFilmModels/Make/files new file mode 100644 index 0000000000..aecce33191 --- /dev/null +++ b/src/surfaceFilmModels/Make/files @@ -0,0 +1,26 @@ +/* Surface film models */ +surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.C +surfaceFilmModel/surfaceFilmModel/newSurfaceFilmModel.C +surfaceFilmModel/noFilm/noFilm.C +surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C +surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C + + +/* Sub-models */ +submodels/kinematic/injectionModel/injectionModel/injectionModel.C +submodels/kinematic/injectionModel/injectionModel/newInjectionModel.C +submodels/kinematic/injectionModel/noInjection/noInjection.C +submodels/kinematic/injectionModel/removeInjection/removeInjection.C + +submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C +submodels/thermo/phaseChangeModel/phaseChangeModel/newPhaseChangeModel.C +submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C + + +/* Boundary conditions */ +derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C +derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C +derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C + + +LIB = $(FOAM_LIBBIN)/libsurfaceFilmModels diff --git a/src/surfaceFilmModels/Make/options b/src/surfaceFilmModels/Make/options new file mode 100644 index 0000000000..d27c95d033 --- /dev/null +++ b/src/surfaceFilmModels/Make/options @@ -0,0 +1,7 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lmeshTools diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C new file mode 100644 index 0000000000..9c84101d85 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C @@ -0,0 +1,162 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "directMappedFixedInternalValueFvPatchField.H" +#include "UIndirectList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +directMappedFixedInternalValueFvPatchField:: +directMappedFixedInternalValueFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + directMappedFixedValueFvPatchField(p, iF) +{} + + +template +directMappedFixedInternalValueFvPatchField:: +directMappedFixedInternalValueFvPatchField +( + const directMappedFixedInternalValueFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + directMappedFixedValueFvPatchField(ptf, p, iF, mapper) +{} + + +template +directMappedFixedInternalValueFvPatchField:: +directMappedFixedInternalValueFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + directMappedFixedValueFvPatchField(p, iF, dict) +{} + + +template +directMappedFixedInternalValueFvPatchField:: +directMappedFixedInternalValueFvPatchField +( + const directMappedFixedInternalValueFvPatchField& ptf +) +: + directMappedFixedValueFvPatchField(ptf) +{} + + +template +directMappedFixedInternalValueFvPatchField:: +directMappedFixedInternalValueFvPatchField +( + const directMappedFixedInternalValueFvPatchField& ptf, + const DimensionedField& iF +) +: + directMappedFixedValueFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void directMappedFixedInternalValueFvPatchField::updateCoeffs() +{ + typedef GeometricField FieldType; + + if (this->updated()) + { + return; + } + + // Retrieve the neighbour values and assign to this patch boundary field + directMappedFixedValueFvPatchField::updateCoeffs(); + + // Get the coupling information from the directMappedPatchBase + const directMappedPatchBase& mpp = + refCast(this->patch().patch()); + const polyMesh& nbrMesh = mpp.sampleMesh(); + const fvPatch& nbrPatch = + refCast + ( + nbrMesh + ).boundary()[mpp.samplePolyPatch().index()]; + + // Force recalculation of mapping and schedule + const mapDistribute& distMap = mpp.map(); + + // Retrieve the neighbour field + const fvPatchField& nbrField = + nbrPatch.lookupPatchField + ( + this->dimensionedInternalField().name() + ); + + // Retrieve the neighbour patch internal field + Field nbrIntFld = nbrField.patchInternalField(); + mapDistribute::distribute + ( + Pstream::defaultCommsType, + distMap.schedule(), + distMap.constructSize(), + distMap.subMap(), // what to send + distMap.constructMap(), // what to receive + nbrIntFld + ); + + // Assign (this) patch internal field to its neighbour values + Field& intFld = const_cast&>(this->internalField()); + UIndirectList(intFld, this->patch().faceCells()) = nbrIntFld; +} + + +template +void directMappedFixedInternalValueFvPatchField::write(Ostream& os) const +{ + directMappedFixedValueFvPatchField::write(os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H new file mode 100644 index 0000000000..4aef5ebd2c --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.H @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::directMappedFixedInternalValueFvPatchField + +Description + Recycles the boundary and internal values of a neighbour patch field to + the boundary and internal values of *this. + +SourceFiles + directMappedFixedInternalValueFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedFixedInternalValueFvPatchField_H +#define directMappedFixedInternalValueFvPatchField_H + +#include "directMappedFixedValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class directMappedFixedInternalValueFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class directMappedFixedInternalValueFvPatchField +: + public directMappedFixedValueFvPatchField +{ + +public: + + //- Runtime type information + TypeName("directMappedFixedInternalValue"); + + + // Constructors + + //- Construct from patch and internal field + directMappedFixedInternalValueFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + directMappedFixedInternalValueFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // directMappedFixedInternalValueFvPatchField onto a new patch + directMappedFixedInternalValueFvPatchField + ( + const directMappedFixedInternalValueFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + directMappedFixedInternalValueFvPatchField + ( + const directMappedFixedInternalValueFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new directMappedFixedInternalValueFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + directMappedFixedInternalValueFvPatchField + ( + const directMappedFixedInternalValueFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new directMappedFixedInternalValueFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "directMappedFixedInternalValueFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C new file mode 100644 index 0000000000..11a290c3c1 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "directMappedFixedInternalValueFvPatchFields.H" +#include "volMesh.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(directMappedFixedInternalValue); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H new file mode 100644 index 0000000000..29301f9f0d --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedFixedInternalValueFvPatchFields_H +#define directMappedFixedInternalValueFvPatchFields_H + +#include "directMappedFixedInternalValueFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(directMappedFixedInternalValue) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H new file mode 100644 index 0000000000..55ee7d1ab6 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedFixedInternalValueFvPatchFieldsFwd_H +#define directMappedFixedInternalValueFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class directMappedFixedInternalValueFvPatchField; + +makePatchTypeFieldTypedefs(directMappedFixedInternalValue) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C new file mode 100644 index 0000000000..c9230d8adf --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.C @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "directMappedFixedPushedInternalValueFvPatchField.H" +#include "UIndirectList.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +directMappedFixedPushedInternalValueFvPatchField:: +directMappedFixedPushedInternalValueFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + directMappedFixedValueFvPatchField(p, iF) +{} + + +template +directMappedFixedPushedInternalValueFvPatchField:: +directMappedFixedPushedInternalValueFvPatchField +( + const directMappedFixedPushedInternalValueFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + directMappedFixedValueFvPatchField(ptf, p, iF, mapper) +{} + + +template +directMappedFixedPushedInternalValueFvPatchField:: +directMappedFixedPushedInternalValueFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + directMappedFixedValueFvPatchField(p, iF, dict) +{} + + +template +directMappedFixedPushedInternalValueFvPatchField:: +directMappedFixedPushedInternalValueFvPatchField +( + const directMappedFixedPushedInternalValueFvPatchField& ptf +) +: + directMappedFixedValueFvPatchField(ptf) +{} + + +template +directMappedFixedPushedInternalValueFvPatchField:: +directMappedFixedPushedInternalValueFvPatchField +( + const directMappedFixedPushedInternalValueFvPatchField& ptf, + const DimensionedField& iF +) +: + directMappedFixedValueFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void directMappedFixedPushedInternalValueFvPatchField::updateCoeffs() +{ + typedef GeometricField FieldType; + + if (this->updated()) + { + return; + } + + // Retrieve the neighbour values and assign to this patch boundary field + directMappedFixedValueFvPatchField::updateCoeffs(); + + // Assign the patch internal field to its boundary value + Field& intFld = const_cast&>(this->internalField()); + UIndirectList(intFld, this->patch().faceCells()) = *this; +} + + +template +void directMappedFixedPushedInternalValueFvPatchField::write +( + Ostream& os +) const +{ + directMappedFixedValueFvPatchField::write(os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H new file mode 100644 index 0000000000..3074b80896 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchField.H @@ -0,0 +1,157 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::directMappedFixedPushedInternalValueFvPatchField + +Description + Recycles the boundary values of a neighbour patch field to the boundary + and internal values of *this. + +SourceFiles + directMappedFixedPushedInternalValueFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedFixedPushedInternalValueFvPatchField_H +#define directMappedFixedPushedInternalValueFvPatchField_H + +#include "directMappedFixedValueFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class directMappedFixedPushedInternalValueFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class directMappedFixedPushedInternalValueFvPatchField +: + public directMappedFixedValueFvPatchField +{ + +public: + + //- Runtime type information + TypeName("directMappedFixedPushedInternalValue"); + + + // Constructors + + //- Construct from patch and internal field + directMappedFixedPushedInternalValueFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + directMappedFixedPushedInternalValueFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given a + // directMappedFixedPushedInternalValueFvPatchField onto a new patch + directMappedFixedPushedInternalValueFvPatchField + ( + const directMappedFixedPushedInternalValueFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + directMappedFixedPushedInternalValueFvPatchField + ( + const directMappedFixedPushedInternalValueFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new directMappedFixedPushedInternalValueFvPatchField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + directMappedFixedPushedInternalValueFvPatchField + ( + const directMappedFixedPushedInternalValueFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new directMappedFixedPushedInternalValueFvPatchField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "directMappedFixedPushedInternalValueFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C new file mode 100644 index 0000000000..b7ab210106 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "directMappedFixedPushedInternalValueFvPatchFields.H" +#include "volMesh.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(directMappedFixedPushedInternalValue); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H new file mode 100644 index 0000000000..9d5a800af5 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedFixedPushedInternalValueFvPatchFields_H +#define directMappedFixedPushedInternalValueFvPatchFields_H + +#include "directMappedFixedPushedInternalValueFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(directMappedFixedPushedInternalValue) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H new file mode 100644 index 0000000000..5ef59b5645 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedFixedPushedInternalValueFvPatchFieldsFwd_H +#define directMappedFixedPushedInternalValueFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class directMappedFixedPushedInternalValueFvPatchField; + +makePatchTypeFieldTypedefs(directMappedFixedInternalValue) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C new file mode 100644 index 0000000000..576d48d663 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C @@ -0,0 +1,167 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "filmHeightInletVelocityFvPatchVectorField.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::filmHeightInletVelocityFvPatchVectorField:: +filmHeightInletVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedValueFvPatchVectorField(p, iF), + phiName_("phi"), + rhoName_("rho"), + deltafName_("deltaf") +{} + + +Foam::filmHeightInletVelocityFvPatchVectorField:: +filmHeightInletVelocityFvPatchVectorField +( + const filmHeightInletVelocityFvPatchVectorField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchVectorField(ptf, p, iF, mapper), + phiName_(ptf.phiName_), + rhoName_(ptf.rhoName_), + deltafName_(ptf.deltafName_) +{} + + +Foam::filmHeightInletVelocityFvPatchVectorField:: +filmHeightInletVelocityFvPatchVectorField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValueFvPatchVectorField(p, iF), + phiName_(dict.lookupOrDefault("phi", "phi")), + rhoName_(dict.lookupOrDefault("rho", "rho")), + deltafName_(dict.lookupOrDefault("deltaf", "deltaf")) +{ + fvPatchVectorField::operator=(vectorField("value", dict, p.size())); +} + + +Foam::filmHeightInletVelocityFvPatchVectorField:: +filmHeightInletVelocityFvPatchVectorField +( + const filmHeightInletVelocityFvPatchVectorField& fhivpvf +) +: + fixedValueFvPatchVectorField(fhivpvf), + phiName_(fhivpvf.phiName_), + rhoName_(fhivpvf.rhoName_), + deltafName_(fhivpvf.deltafName_) +{} + + +Foam::filmHeightInletVelocityFvPatchVectorField:: +filmHeightInletVelocityFvPatchVectorField +( + const filmHeightInletVelocityFvPatchVectorField& fhivpvf, + const DimensionedField& iF +) +: + fixedValueFvPatchVectorField(fhivpvf, iF), + phiName_(fhivpvf.phiName_), + rhoName_(fhivpvf.rhoName_), + deltafName_(fhivpvf.deltafName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::filmHeightInletVelocityFvPatchVectorField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const fvsPatchField& phip = + patch().lookupPatchField(phiName_); + + const fvPatchField& rhop = + patch().lookupPatchField(rhoName_); + + const fvPatchField& deltafp = + patch().lookupPatchField(deltafName_); + + vectorField n = patch().nf(); + const scalarField& magSf = patch().magSf(); + + operator==(deltafp*n*phip/(rhop*magSf*sqr(deltafp) + ROOTVSMALL)); + + fixedValueFvPatchVectorField::updateCoeffs(); +} + + +void Foam::filmHeightInletVelocityFvPatchVectorField::write(Ostream& os) const +{ + fvPatchVectorField::write(os); + writeEntryIfDifferent(os, "phi", "phi", phiName_); + writeEntryIfDifferent(os, "rho", "rho", rhoName_); + writeEntryIfDifferent(os, "deltaf", "deltaf", deltafName_); + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + +void Foam::filmHeightInletVelocityFvPatchVectorField::operator= +( + const fvPatchField& pvf +) +{ + fvPatchField::operator=(patch().nf()*(patch().nf() & pvf)); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchVectorField, + filmHeightInletVelocityFvPatchVectorField + ); +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H new file mode 100644 index 0000000000..3c6132cd6c --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.H @@ -0,0 +1,198 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::filmHeightInletVelocityFvPatchVectorField + +Description + Velocity inlet boundary condition for patches where the film height is + specified. The inflow velocity is obtained from the flux with a direction + normal to the patch faces. + +SourceFiles + filmHeightInletVelocityFvPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef filmHeightInletVelocityFvPatchVectorField_H +#define filmHeightInletVelocityFvPatchVectorField_H + +#include "fvPatchFields.H" +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class filmHeightInletVelocityFvPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class filmHeightInletVelocityFvPatchVectorField +: + public fixedValueFvPatchVectorField +{ + // Private data + + //- Name of flux field + word phiName_; + + //- Name of density field + word rhoName_; + + //- Name of film height field + word deltafName_; + + +public: + + //- Runtime type information + TypeName("filmHeightInletVelocity"); + + + // Constructors + + //- Construct from patch and internal field + filmHeightInletVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + filmHeightInletVelocityFvPatchVectorField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given filmHeightInletVelocityFvPatchVectorField + // onto a new patch + filmHeightInletVelocityFvPatchVectorField + ( + const filmHeightInletVelocityFvPatchVectorField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + filmHeightInletVelocityFvPatchVectorField + ( + const filmHeightInletVelocityFvPatchVectorField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new filmHeightInletVelocityFvPatchVectorField(*this) + ); + } + + //- Construct as copy setting internal field reference + filmHeightInletVelocityFvPatchVectorField + ( + const filmHeightInletVelocityFvPatchVectorField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new filmHeightInletVelocityFvPatchVectorField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the name of phi + const word& phiName() const + { + return phiName_; + } + + //- Return reference to the name of phi to allow adjustment + word& phiName() + { + return phiName_; + } + + //- Return the name of rho + const word& rhoName() const + { + return rhoName_; + } + + //- Return reference to the name of rho to allow adjustment + word& rhoName() + { + return rhoName_; + } + + //- Return the name of deltaf + const word& deltafName() const + { + return deltafName_; + } + + //- Return reference to the name of df to allow adjustment + word& deltafName() + { + return deltafName_; + } + + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; + + + // Member operators + + virtual void operator=(const fvPatchField& pvf); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C new file mode 100644 index 0000000000..96d59420ca --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "injectionModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(injectionModel, 0); + defineRunTimeSelectionTable(injectionModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::injectionModel::injectionModel +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + owner_(owner), + coeffs_(dictionary::null) +{} + + +Foam::surfaceFilmModels::injectionModel::injectionModel +( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict +) +: + owner_(owner), + coeffs_(dict.subDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::injectionModel::~injectionModel() +{} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H new file mode 100644 index 0000000000..bc140539bf --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::injectionModel + +Description + +SourceFiles + injectionModelI.H + injectionModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef injectionModel_H +#define injectionModel_H + +#include "surfaceFilmModel.H" +#include "runTimeSelectionTables.H" +#include "scalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class injectionModel Declaration +\*---------------------------------------------------------------------------*/ + +class injectionModel +{ +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + injectionModel(const injectionModel&); + + //- Disallow default bitwise assignment + void operator=(const injectionModel&); + + +protected: + + // Protected data + + //- Reference to the owner surface film model + const surfaceFilmModel& owner_; + + //- Model coefficients dictionary + dictionary coeffs_; + + +public: + + //- Runtime type information + TypeName("injectionModel"); + + + // Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + injectionModel, + dictionary, + ( + const surfaceFilmModel& owner, + const dictionary& dict + ), + (owner, dict) + ); + + // Constructors + + //- Construct null + injectionModel(const surfaceFilmModel& owner, const dictionary& dict); + + //- Construct from type name, dictionary and surface film model + injectionModel + ( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + // Selectors + + //- Return a reference to the selected phase change model + static autoPtr New + ( + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~injectionModel(); + + + // Member Functions + + // Access + + //- Return the reference to the owner surface film model + inline const surfaceFilmModel& owner() const; + + //- Return the model coefficients dictionary + inline const dictionary& coeffs() const; + + + // Evolution + + //- Correct + virtual void correct + ( + scalarField& massToInject, + scalarField& diameterToInject + ) = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "injectionModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelI.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelI.H new file mode 100644 index 0000000000..2f3bf02ef1 --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelI.H @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "injectionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +inline const Foam::surfaceFilmModels::surfaceFilmModel& +Foam::surfaceFilmModels::injectionModel::owner() const +{ + return owner_; +} + + +inline const Foam::dictionary& +Foam::surfaceFilmModels::injectionModel::coeffs() const +{ + return coeffs_; +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/newInjectionModel.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/newInjectionModel.C new file mode 100644 index 0000000000..7bddebcc8e --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/newInjectionModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "injectionModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::surfaceFilmModels::injectionModel::New +( + const surfaceFilmModel& model, + const dictionary& dict +) +{ + word modelType(dict.lookup("injectionModel")); + + Info<< " Selecting injectionModel " << modelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "injectionModel::New(const surfaceFilmModel&, const dictionary&)" + ) << "Unknown injectionModel type " << modelType + << nl << nl << "Valid injectionModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr(cstrIter()(model, dict)); +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C new file mode 100644 index 0000000000..39d2c34706 --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C @@ -0,0 +1,72 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "noInjection.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(noInjection, 0); + addToRunTimeSelectionTable(injectionModel, noInjection, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::noInjection::noInjection +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + injectionModel(owner, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::noInjection::~noInjection() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::surfaceFilmModels::noInjection::correct +( + scalarField& massToInject, + scalarField& diameterToInject +) +{ + // no mass injected + massToInject = 0.0; +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.H new file mode 100644 index 0000000000..7b1446ebab --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::noInjection + +Description + Dummy injection model for 'none' + +SourceFiles + noInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noInjection_H +#define noInjection_H + +#include "injectionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class noInjection Declaration +\*---------------------------------------------------------------------------*/ + +class noInjection +: + public injectionModel +{ +private: + + // Private member functions + + //- Disallow default bitwise copy construct + noInjection(const noInjection&); + + //- Disallow default bitwise assignment + void operator=(const noInjection&); + + +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from surface film model + noInjection(const surfaceFilmModel& owner, const dictionary& dict); + + + //- Destructor + virtual ~noInjection(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct + ( + scalarField& massToInject, + scalarField& diameterToInject + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C new file mode 100644 index 0000000000..58fbd9fe5a --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "removeInjection.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(removeInjection, 0); + addToRunTimeSelectionTable(injectionModel, removeInjection, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::removeInjection::removeInjection +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + injectionModel(owner, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::removeInjection::~removeInjection() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::surfaceFilmModels::removeInjection::correct +( + scalarField&, + scalarField& +) +{ + // do nothing - all mass available to be removed +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H new file mode 100644 index 0000000000..4fc4a63fc4 --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H @@ -0,0 +1,104 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::removeInjection + +Description + All mass available to be removed from the system is removed. + +SourceFiles + removeInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef removeInjection_H +#define removeInjection_H + +#include "injectionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class removeInjection Declaration +\*---------------------------------------------------------------------------*/ + +class removeInjection +: + public injectionModel +{ +private: + + // Private member functions + + //- Disallow default bitwise copy construct + removeInjection(const removeInjection&); + + //- Disallow default bitwise assignment + void operator=(const removeInjection&); + + +public: + + //- Runtime type information + TypeName("remove"); + + + // Constructors + + //- Construct from surface film model + removeInjection(const surfaceFilmModel& owner, const dictionary& dict); + + + //- Destructor + virtual ~removeInjection(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct + ( + scalarField& massToInject, + scalarField& diameterToInject + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C new file mode 100644 index 0000000000..551bfb2a44 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C @@ -0,0 +1,67 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "noPhaseChange.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(noPhaseChange, 0); + addToRunTimeSelectionTable(phaseChangeModel, noPhaseChange, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::noPhaseChange::noPhaseChange +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + phaseChangeModel(owner, dict) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::noPhaseChange::~noPhaseChange() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::surfaceFilmModels::noPhaseChange::correct() +{ + // do nothing +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H new file mode 100644 index 0000000000..487e3c2b3c --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::noPhaseChange + +Description + Dummy phase change model for 'none' + +SourceFiles + noPhaseChange.C + +\*---------------------------------------------------------------------------*/ + +#ifndef noPhaseChange_H +#define noPhaseChange_H + +#include "phaseChangeModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class noPhaseChange Declaration +\*---------------------------------------------------------------------------*/ + +class noPhaseChange +: + public phaseChangeModel +{ +private: + + // Private member functions + + //- Disallow default bitwise copy construct + noPhaseChange(const noPhaseChange&); + + //- Disallow default bitwise assignment + void operator=(const noPhaseChange&); + + +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from surface film model + noPhaseChange(const surfaceFilmModel& owner, const dictionary& dict); + + + //- Destructor + virtual ~noPhaseChange(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct(); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/newPhaseChangeModel.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/newPhaseChangeModel.C new file mode 100644 index 0000000000..7cc04c0027 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/newPhaseChangeModel.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "phaseChangeModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::surfaceFilmModels::phaseChangeModel::New +( + const surfaceFilmModel& model, + const dictionary& dict +) +{ + word modelType(dict.lookup("phaseChangeModel")); + + Info<< " Selecting phaseChangeModel " << modelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "phaseChangeModel::New(const surfaceFilmModel&, const dictionary&)" + ) << "Unknown phaseChangeModel type " << modelType + << nl << nl << "Valid phaseChangeModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr(cstrIter()(model, dict)); +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C new file mode 100644 index 0000000000..e2a0b93a75 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "phaseChangeModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(phaseChangeModel, 0); + defineRunTimeSelectionTable(phaseChangeModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + owner_(owner), + coeffs_(dictionary::null) +{} + + +Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel +( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict +) +: + owner_(owner), + coeffs_(dict.subDict(type + "Coeffs")) +{ + WarningIn + ( + "phaseChangeModel::phaseChangeModel" + "(" + "const word&, " + "const surfaceFilmModel&, " + "const dictionary&" + ")" + ) << "Phase change models not implemented!" << endl; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::phaseChangeModel::~phaseChangeModel() +{} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H new file mode 100644 index 0000000000..87a08b1016 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H @@ -0,0 +1,155 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::phaseChangeModel + +Description + +SourceFiles + phaseChangeModelI.H + phaseChangeModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef phaseChangeModel_H +#define phaseChangeModel_H + +#include "surfaceFilmModel.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class phaseChangeModel Declaration +\*---------------------------------------------------------------------------*/ + +class phaseChangeModel +{ +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + phaseChangeModel(const phaseChangeModel&); + + //- Disallow default bitwise assignment + void operator=(const phaseChangeModel&); + + +protected: + + // Protected data + + //- Reference to the owner surface film model + const surfaceFilmModel& owner_; + + //- Model coefficients dictionary + dictionary coeffs_; + + +public: + + //- Runtime type information + TypeName("phaseChangeModel"); + + + // Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + phaseChangeModel, + dictionary, + ( + const surfaceFilmModel& owner, + const dictionary& dict + ), + (owner, dict) + ); + + // Constructors + + //- Construct null + phaseChangeModel(const surfaceFilmModel& owner, const dictionary& dict); + + //- Construct from type name, dictionary and surface film model + phaseChangeModel + ( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + // Selectors + + //- Return a reference to the selected phase change model + static autoPtr New + ( + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~phaseChangeModel(); + + + // Member Functions + + // Access + + //- Return the reference to the owner surface film model + inline const surfaceFilmModel& owner() const; + + //- Return the model coefficients dictionary + inline const dictionary& coeffs() const; + + + // Evolution + + //- Correct // TODO + virtual void correct() = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "phaseChangeModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelI.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelI.H new file mode 100644 index 0000000000..f893bbbfa7 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelI.H @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "phaseChangeModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +inline const Foam::surfaceFilmModels::surfaceFilmModel& +Foam::surfaceFilmModels::phaseChangeModel::owner() const +{ + return owner_; +} + + +inline const Foam::dictionary& +Foam::surfaceFilmModels::phaseChangeModel::coeffs() const +{ + return coeffs_; +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C new file mode 100644 index 0000000000..376d2cd199 --- /dev/null +++ b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C @@ -0,0 +1,1062 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 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 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "kinematicSingleLayer.H" +#include "fvm.H" +#include "fvcDiv.H" +#include "fvcLaplacian.H" +#include "fvcSnGrad.H" +#include "fvcReconstruct.H" +#include "fvcVolumeIntegrate.H" +#include "addToRunTimeSelectionTable.H" +#include "directMappedWallPolyPatch.H" + +// Sub-models +#include "injectionModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(kinematicSingleLayer, 0); + addToRunTimeSelectionTable + ( + surfaceFilmModel, + kinematicSingleLayer, + mesh + ); + } +} + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +bool Foam::surfaceFilmModels::kinematicSingleLayer::read() +{ + if (surfaceFilmModel::read()) + { + const dictionary& solution = filmRegion_.solutionDict().subDict("PISO"); + solution.lookup("momentumPredictor") >> momentumPredictor_; + solution.lookup("nOuterCorr") >> nOuterCorr_; + solution.lookup("nCorr") >> nCorr_; + solution.lookup("nNonOrthCorr") >> nNonOrthCorr_; + + coeffs_.lookup("Cf") >> Cf_; + coeffs_.lookup("deltaStable") >> deltaStable_; + + return true; + } + else + { + return false; + } +} + + +void Foam::surfaceFilmModels::kinematicSingleLayer::initialise() +{ + if (debug) + { + Pout<< "kinematicSingleLayer::initialise()" << endl; + } + + label nBoundaryFaces = 0; + DynamicList