Commit 00015a74 authored by andy's avatar andy
Browse files

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
parent 99fa564b
/* 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
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "directMappedFixedInternalValueFvPatchField.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
directMappedFixedValueFvPatchField<Type>(p, iF)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
directMappedFixedValueFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
directMappedFixedValueFvPatchField<Type>(p, iF, dict)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>& ptf
)
:
directMappedFixedValueFvPatchField<Type>(ptf)
{}
template<class Type>
directMappedFixedInternalValueFvPatchField<Type>::
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
directMappedFixedValueFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void directMappedFixedInternalValueFvPatchField<Type>::updateCoeffs()
{
typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
if (this->updated())
{
return;
}
// Retrieve the neighbour values and assign to this patch boundary field
directMappedFixedValueFvPatchField<Type>::updateCoeffs();
// Get the coupling information from the directMappedPatchBase
const directMappedPatchBase& mpp =
refCast<const directMappedPatchBase>(this->patch().patch());
const polyMesh& nbrMesh = mpp.sampleMesh();
const fvPatch& nbrPatch =
refCast<const fvMesh>
(
nbrMesh
).boundary()[mpp.samplePolyPatch().index()];
// Force recalculation of mapping and schedule
const mapDistribute& distMap = mpp.map();
// Retrieve the neighbour field
const fvPatchField<Type>& nbrField =
nbrPatch.lookupPatchField<FieldType, Type>
(
this->dimensionedInternalField().name()
);
// Retrieve the neighbour patch internal field
Field<Type> 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<Type>& intFld = const_cast<Field<Type>&>(this->internalField());
UIndirectList<Type>(intFld, this->patch().faceCells()) = nbrIntFld;
}
template<class Type>
void directMappedFixedInternalValueFvPatchField<Type>::write(Ostream& os) const
{
directMappedFixedValueFvPatchField<Type>::write(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
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 Type>
class directMappedFixedInternalValueFvPatchField
:
public directMappedFixedValueFvPatchField<Type>
{
public:
//- Runtime type information
TypeName("directMappedFixedInternalValue");
// Constructors
//- Construct from patch and internal field
directMappedFixedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
directMappedFixedInternalValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// directMappedFixedInternalValueFvPatchField onto a new patch
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new directMappedFixedInternalValueFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
directMappedFixedInternalValueFvPatchField
(
const directMappedFixedInternalValueFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new directMappedFixedInternalValueFvPatchField<Type>(*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
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "directMappedFixedInternalValueFvPatchFields.H"
#include "volMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(directMappedFixedInternalValue);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedInternalValueFvPatchFields_H
#define directMappedFixedInternalValueFvPatchFields_H
#include "directMappedFixedInternalValueFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef directMappedFixedInternalValueFvPatchFieldsFwd_H
#define directMappedFixedInternalValueFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class directMappedFixedInternalValueFvPatchField;
makePatchTypeFieldTypedefs(directMappedFixedInternalValue)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "directMappedFixedPushedInternalValueFvPatchField.H"
#include "UIndirectList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
directMappedFixedValueFvPatchField<Type>(p, iF)
{}
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const directMappedFixedPushedInternalValueFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
directMappedFixedValueFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
directMappedFixedPushedInternalValueFvPatchField<Type>::
directMappedFixedPushedInternalValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
directMappedFixedValueFvPatchField<Type>(p, iF, dict)
{}