Commit 975a84c6 authored by sergio's avatar sergio

ENH Adding new coupled BC for solid-twoPhase system and tutorial

New tutorial for chtMultiRegionTwoPhaseEulerFoam for quenching
parent 20b6ef17
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2018 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::compressible::
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
Description
Mixed boundary condition for temperature and radiation heat transfer
to be used for in multiregion cases with two phase Euler system
Usage
\table
Property | Description | Required | Default value
Tnbr | name of the field | no | T
qrNbr | name of the radiative flux in the nbr region | no | none
qr | name of the radiative flux in this region | no | none
region | region to which this BC belongs | yes
otherPhase | name of the vapour phase in the fluid region | yes
kappaMethod | inherited from temperatureCoupledBase | inherited |
kappa | inherited from temperatureCoupledBase | inherited |
\endtable
Example of the boundary condition specification on the fluid region:
\verbatim
<patchName>
{
type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
Tnbr T;
qrNbr none;
qr none;
kappaMethod phaseSystem;
region fluid;
otherPhase gas;
value uniform 300;
}
\endverbatim
Example of the boundary condition specification on the solid region:
\verbatim
<patchName>
{
type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
Tnbr T.liquid;
qrNbr none;
qr none;
kappaMethod solidThermo;
region solid;
otherPhase gas;
value uniform 300;
}
\endverbatim
Needs to be on underlying mapped(Wall)FvPatch.
See also
Foam::temperatureCoupledBase
SourceFiles
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField_H
#define turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField_H
#include "mixedFvPatchFields.H"
#include "temperatureCoupledBase.H"
#include "scalarList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
:
public mixedFvPatchScalarField,
public temperatureCoupledBase
{
// Data types
//- Enumeration listing the region
enum regionType
{
solid,
fluid
};
// Private data
//- Heat source type names
static const Enum<regionType> regionTypeNames_;
//- Heat source type
regionType regionType_;
//- name of the other phase (vapor/liquid phase)
word otherPhaseName_;
//- Name of field on the neighbour region
const word TnbrName_;
//- Name of the radiative heat flux in the neighbour region
const word qrNbrName_;
//- Name of the radiative heat flux in local region
const word qrName_;
public:
//- Runtime type information
TypeName("compressible::turbulentTemperatureTwoPhaseRadCoupledMixed");
// Constructors
//- Construct from patch and internal field
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// turbulentTemperatureCoupledBaffleMixedFvPatchScalarField onto a
// new patch
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
*this
)
);
}
//- Construct as copy setting internal field reference
turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
const turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new turbulentTemperatureTwoPhaseRadCoupledMixedFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/solid";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 1123;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
innerWall
{
type zeroGradient;
}
solid_to_water
{
type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
value uniform 1123;
Tnbr T.liquid;
kappaMethod solidThermo;
region solid;
otherPhase gas;
qrNbr none;
qr none;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/solid";
object cellToRegion;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
symmetry
{
type symmetry;
}
empty
{
type empty;
}
solid_to_water
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/heater";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 100000;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
".*"
{
type calculated;
value uniform 0;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/water";
object T.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 333;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
top
{
type inletOutlet;
value uniform 333;
inletValue uniform 333;
}
bottom
{
type fixedValue;
value uniform 333;
}
externalWall
{
type fixedValue;
value uniform 333;
}
innerWall
{
type zeroGradient;
}
water_to_solid
{
type copiedFixedValue;
sourceFieldName T.liquid;
value uniform 1123;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/water";
object T.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 0 0 1 0 0 0 ];
internalField uniform 333;
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
top
{
type inletOutlet;
value uniform 333;
inletValue uniform 333;
}
bottom
{
type fixedValue;
value uniform 333;
}
externalWall
{
type fixedValue;
value uniform 333;
}
innerWall
{
type zeroGradient;
}
water_to_solid
{
type compressible::turbulentTemperatureTwoPhaseRadCoupledMixed;
value uniform 1123;
Tnbr T;
kappaMethod phaseSystem;
region fluid;
otherPhase gas;
qrNbr none;
qr none;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0/water";
object U.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 1 -1 0 0 0 0 ];
internalField uniform ( 0 0 0 );
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
top
{
type pressureInletOutletVelocity;
phi phi.gas;
value uniform ( 0 0 0 );
inletValue uniform ( 0 0 0 );
}
".*"
{
type fixedValue;
value uniform ( 0 0 0 );
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0/water";
object U.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 1 -1 0 0 0 0 ];
internalField uniform ( 0 0 0 );
boundaryField
{
#includeEtc "caseDicts/setConstraintTypes"
top
{
type pressureInletOutletVelocity;
phi phi.liquid;
value uniform ( 0 0 0 );
inletValue uniform ( 0 0 0 );
}
".*"
{
type fixedValue;
value uniform ( 0 0 0 );
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/water";
object alpha.gas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
sides
{
type symmetry;
}
innerWall
{
type zeroGradient;
}
externalWall
{
type zeroGradient;
}
top
{
type inletOutlet;
phi phi.gas;
inletValue uniform 1;
value uniform 1;
}
bottom
{
type zeroGradient;
}
water_to_solid
{
type zeroGradient;
}
}
// ************************************************************************* //
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: plus.feature-EulerEulerSolvers |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0/water";
object alpha.liquid;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
sides