Added missing overlap ggi enthalpy jump condition

This commit is contained in:
Hrvoje Jasak 2017-05-30 14:33:58 +01:00
parent 2ffeda244c
commit 7c1ca1b9ea
5 changed files with 599 additions and 0 deletions

View file

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Author
Ilaria De Dominicis, General Electric Power, (March 2016)
Contributor
Hrvoje Jasak, Wikki Ltd.
Gregor Cvijetic, FMENA Zagreb.
GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
\*---------------------------------------------------------------------------*/
#include "overlapGgiEnthalpyJumpFvPatchField.H"
#include "IOmanip.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
overlapGgiEnthalpyJumpFvPatchField<Type>::overlapGgiEnthalpyJumpFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
jumpOverlapGgiFvPatchField<Type>(p, iF),
rotating_(false),
jump_(this->size(), pTraits<Type>::zero)
{
}
template<class Type>
overlapGgiEnthalpyJumpFvPatchField<Type>::overlapGgiEnthalpyJumpFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
jumpOverlapGgiFvPatchField<Type>(p, iF),
rotating_(dict.lookup("rotating")),
jump_(this->size(), pTraits<Type>::zero)
{
if (dict.found("value"))
{
fvPatchField<Type>::operator=
(
Field<Type>("value", dict, p.size())
);
}
else
{
this->evaluate(Pstream::blocking);
}
}
template<class Type>
overlapGgiEnthalpyJumpFvPatchField<Type>::overlapGgiEnthalpyJumpFvPatchField
(
const overlapGgiEnthalpyJumpFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
jumpOverlapGgiFvPatchField<Type>(ptf, p, iF, mapper),
rotating_(ptf.rotating_),
jump_(ptf.jump_, mapper)
{
}
template<class Type>
overlapGgiEnthalpyJumpFvPatchField<Type>::overlapGgiEnthalpyJumpFvPatchField
(
const overlapGgiEnthalpyJumpFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
jumpOverlapGgiFvPatchField<Type>(ptf, iF),
rotating_(ptf.rotating_),
jump_(ptf.jump_)
{
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void overlapGgiEnthalpyJumpFvPatchField<Type>::autoMap
(
const fvPatchFieldMapper& m
)
{
jumpOverlapGgiFvPatchField<Type>::autoMap(m);
jump_.autoMap(m);
}
template<class Type>
void overlapGgiEnthalpyJumpFvPatchField<Type>::rmap
(
const fvPatchField<Type>& ptf,
const labelList& addr
)
{
jumpOverlapGgiFvPatchField<Type>::rmap(ptf, addr);
// rmap jump
const overlapGgiEnthalpyJumpFvPatchField<Type>& ejPtf =
refCast<const overlapGgiEnthalpyJumpFvPatchField<Type> >(ptf);
jump_.rmap(ejPtf.jump_, addr);
}
template<class Type>
void overlapGgiEnthalpyJumpFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("patchType")
<< overlapGgiFvPatch::typeName << token::END_STATEMENT << nl;
os.writeKeyword("rotating")
<< rotating_ << token::END_STATEMENT << nl;
IOstream::streamFormat fmt0 = os.format(IOstream::ASCII);
os.format(fmt0);
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -0,0 +1,196 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::overlapGgiEnthalpyJumpFvPatchField
Description
Foam::overlapGgiEnthalpyJumpFvPatchField
Author
Ilaria De Dominicis, General Electric Power, (March 2016)
Contributor
Hrvoje Jasak, Wikki Ltd.
Gregor Cvijetic, FMENA Zagreb.
GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
SourceFiles
overlapGgiEnthalpyJumpFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef overlapGgiEnthalpyJumpFvPatchField_H
#define overlapGgiEnthalpyJumpFvPatchField_H
#include "jumpOverlapGgiFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class overlapGgiEnthalpyJumpFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class overlapGgiEnthalpyJumpFvPatchField
:
public jumpOverlapGgiFvPatchField<Type>
{
// Private data
//- Is the patch on the rotating side?
Switch rotating_;
//- "jump" field
Field<Type> jump_;
public:
//- Runtime type information
TypeName("overlapGgiEnthalpyJump");
// Constructors
//- Construct from patch and internal field
overlapGgiEnthalpyJumpFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
overlapGgiEnthalpyJumpFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given overlapGgiEnthalpyJumpFvPatchField
// onto a new patch
overlapGgiEnthalpyJumpFvPatchField
(
const overlapGgiEnthalpyJumpFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy setting internal field reference
overlapGgiEnthalpyJumpFvPatchField
(
const overlapGgiEnthalpyJumpFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new overlapGgiEnthalpyJumpFvPatchField<Type>(*this)
);
}
//- 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 overlapGgiEnthalpyJumpFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Is the patch rotating
bool rotating() const
{
return rotating_;
}
//- Return the "jump" across the patch as a "half" field
virtual tmp<Field<Type> > jump() const
{
return jump_;
}
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchField<Type>&,
const labelList&
);
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
//- Specialisation of the jump-condition for the enthalpy
template<>
void overlapGgiEnthalpyJumpFvPatchField<scalar>::updateCoeffs();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "overlapGgiEnthalpyJumpFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Author
Ilaria De Dominicis, General Electric Power, (March 2016)
Contributor
Hrvoje Jasak, Wikki Ltd.
Gregor Cvijetic, FMENA Zagreb.
GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
\*---------------------------------------------------------------------------*/
#include "overlapGgiEnthalpyJumpFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
makeTemplatePatchTypeField
(
fvPatchScalarField,
overlapGgiEnthalpyJumpFvPatchScalarField
);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<>
void Foam::overlapGgiEnthalpyJumpFvPatchField<Foam::scalar>::updateCoeffs()
{
if (updated())
{
return;
}
// Get access to relative and rotational velocity
const word URotName("URot");
const word UThetaName("UTheta");
jump_ = 0;
if
(
!this->db().objectRegistry::found(URotName)
|| !this->db().objectRegistry::found(UThetaName)
)
{
// Velocities not available, do not update
InfoIn
(
"void gradientEnthalpyFvPatchScalarField::"
"updateCoeffs(const vectorField& Up)"
) << "Velocity fields " << URotName << " or "
<< UThetaName << " not found. "
<< "Performing enthalpy value update" << endl;
jump_ = 0;
}
else
{
const fvPatchVectorField& URotp =
lookupPatchField<volVectorField, vector>(URotName);
const fvPatchScalarField& UThetap =
lookupPatchField<volScalarField, scalar>(UThetaName);
if (rotating_)
{
// We can either make jump_ on neighbour field and interpolate (in
// jumpOverlapGgi) or interpolate first, then add jump_ for
// internalField
const scalarField UThetaIn = UThetap.patchInternalField();
jump_ = - (
mag(UThetaIn)
*mag(URotp.patchInternalField())
);
}
else
{
const scalarField UThetaIn = UThetap.patchNeighbourField();
jump_ = (
mag(UThetaIn)
*mag(URotp.patchNeighbourField())
);
}
}
jumpOverlapGgiFvPatchField<scalar>::updateCoeffs();
}
// ************************************************************************* //

View file

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Author
Ilaria De Dominicis, General Electric Power, (March 2016)
Contributor
Hrvoje Jasak, Wikki Ltd.
Gregor Cvijetic, FMENA Zagreb.
GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
\*---------------------------------------------------------------------------*/
#ifndef overlapGgiEnthalpyJumpFvPatchFields_H
#define overlapGgiEnthalpyJumpFvPatchFields_H
#include "overlapGgiEnthalpyJumpFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(overlapGgiEnthalpyJump)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View file

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 4.0
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Author
Ilaria De Dominicis, General Electric Power, (March 2016)
Contributor
Hrvoje Jasak, Wikki Ltd.
Gregor Cvijetic, FMENA Zagreb.
GE CONFIDENTIAL INFORMATION 2016 General Electric Company. All Rights Reserved
\*---------------------------------------------------------------------------*/
#ifndef overlapGgiEnthalpyJumpFvPatchFieldsFwd_H
#define overlapGgiEnthalpyJumpFvPatchFieldsFwd_H
#include "fvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class overlapGgiEnthalpyJumpFvPatchField;
makePatchTypeFieldTypedefs(overlapGgiEnthalpyJump)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //