ubCoupledTemperatureFvPatchScalarField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2025-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 #include "XiFluid.H"
29 
30 // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * //
31 
33 (
35  tmp<scalarField>& sumKappaTByDelta,
36  tmp<scalarField>& sumKappaByDelta,
37  scalarField& sumq,
38  tmp<scalarField>& qByKappa
39 ) const
40 {
41  const solvers::XiFluid& XiFluid
42  (
43  patch().mesh()
44  .lookupObject<solvers::XiFluid>(solver::typeName)
45  );
46 
47  const ubRhoThermo& thermo = XiFluid.thermo;
48 
49  const uRhoMulticomponentThermo& uThermo = thermo.uThermo();
50  const bRhoMulticomponentThermo& bThermo = thermo.bThermo();
51 
52  const scalarField& alphau =
53  thermo.alphau().boundaryField()[patch().index()];
54  const scalarField& alphab =
55  thermo.alphab().boundaryField()[patch().index()];
56 
57  const fvPatchScalarField& Twu(uThermo.T().boundaryField()[patch().index()]);
58  const fvPatchScalarField& Twb(bThermo.T().boundaryField()[patch().index()]);
59 
60  // Simple model pending generalised thermophysicalTransportModel interface
61  tmp<scalarField> kappaEffu
62  (
63  XiFluid.uThermophysicalTransport.kappaEff(patch().index())
64  );
65  tmp<scalarField> kappaEffb
66  (
67  XiFluid.bThermophysicalTransport.kappaEff(patch().index())
68  );
69 
70  tmp<scalarField> alphaKappaEffu(alphau*kappaEffu());
71  tmp<scalarField> alphaKappaEffb(alphab*kappaEffb());
72 
73  scalarField sumKappa(size(), scalar(0));
74  scalarField sumKappaT(size(), scalar(0));
75 
76  if (&Twu == this)
77  {
78  kappa = alphaKappaEffu;
79  qByKappa = sumq/kappaEffu;
80  sumq -= alphau*sumq;
81  }
82  else
83  {
84  const scalarField Tu
85  (
86  uThermo.T().boundaryField()[patch().index()]
87  .patchInternalField()
88  );
89 
90  sumKappa += alphaKappaEffu();
91  sumKappaT += alphaKappaEffu*Tu;
92  }
93 
94  if (&Twb == this)
95  {
96  kappa = alphaKappaEffb;
97  qByKappa = sumq/kappaEffb;
98  sumq -= alphab*sumq;
99  }
100  else
101  {
102  const scalarField Tb
103  (
104  bThermo.T().boundaryField()[patch().index()]
105  .patchInternalField()
106  );
107 
108  sumKappa += alphaKappaEffb();
109  sumKappaT += alphaKappaEffb*Tb;
110  }
111 
112  sumKappaByDelta = sumKappa*patch().deltaCoeffs();
113  sumKappaTByDelta = sumKappaT*patch().deltaCoeffs();
114 }
115 
116 
118 (
119  tmp<scalarField>& sumKappaTByDeltaNbr,
120  tmp<scalarField>& sumKappaByDeltaNbr,
121  tmp<scalarField>& qNbr
122 ) const
123 {
124  const solvers::XiFluid& XiFluid
125  (
126  patch().mesh()
127  .lookupObject<solvers::XiFluid>(solver::typeName)
128  );
129 
130  const ubRhoThermo& thermo = XiFluid.thermo;
131 
132  const uRhoMulticomponentThermo& uThermo = thermo.uThermo();
133  const bRhoMulticomponentThermo& bThermo = thermo.bThermo();
134 
135  const scalarField& alphau =
136  thermo.alphau().boundaryField()[patch().index()];
137  const scalarField& alphab =
138  thermo.alphab().boundaryField()[patch().index()];
139 
140  const scalarField Tu
141  (
142  uThermo.T().boundaryField()[patch().index()].patchInternalField()
143  );
144  const scalarField Tb
145  (
146  bThermo.T().boundaryField()[patch().index()].patchInternalField()
147  );
148 
149  // Simple model pending generalised thermophysicalTransportModel interface
150  tmp<scalarField> kappaEffu
151  (
152  XiFluid.uThermophysicalTransport.kappaEff(patch().index())
153  );
154  tmp<scalarField> kappaEffb
155  (
156  XiFluid.bThermophysicalTransport.kappaEff(patch().index())
157  );
158 
159  const scalarField alphaKappaEffu(alphau*kappaEffu);
160  const scalarField alphaKappaEffb(alphab*kappaEffb);
161 
162  sumKappaByDeltaNbr =
163  (alphaKappaEffu + alphaKappaEffb)*patch().deltaCoeffs();
164  sumKappaTByDeltaNbr =
165  (alphaKappaEffu*Tu + alphaKappaEffb*Tb)*patch().deltaCoeffs();
166 }
167 
168 
169 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
170 
173 (
174  const fvPatch& p,
176  const dictionary& dict
177 )
178 :
180 {}
181 
182 
185 (
187  const fvPatch& p,
189  const fieldMapper& mapper
190 )
191 :
192  coupledTemperatureFvPatchScalarField(psf, p, iF, mapper)
193 {}
194 
195 
198 (
201 )
202 :
204 {}
205 
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 namespace Foam
210 {
212  (
215  );
216 }
217 
218 
219 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Base-class for combustion fluid thermodynamic properties based on compressibility.
virtual const volScalarField & T() const =0
Temperature [K].
Mixed boundary condition for temperature, to be used for heat-transfer with another region in a CHT c...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:58
Solver module for compressible premixed/partially-premixed combustion with turbulence modelling.
Definition: XiFluid.H:144
const ubRhoThermo & thermo
Reference to the fluid thermophysical properties.
Definition: XiFluid.H:287
const thermophysicalTransportModel & uThermophysicalTransport
Definition: XiFluid.H:291
const thermophysicalTransportModel & bThermophysicalTransport
Definition: XiFluid.H:292
virtual tmp< volScalarField > kappaEff() const =0
Effective thermal turbulent conductivity.
A class for managing temporary objects.
Definition: tmp.H:55
Base-class for combustion fluid thermodynamic properties based on compressibility.
Mixed boundary condition for the phase temperature of a phase in an Euler-Euler multiphase simulation...
virtual void getNbr(tmp< scalarField > &sumKappaTByDeltaNbr, tmp< scalarField > &sumKappaByDeltaNbr, tmp< scalarField > &qNbr) const
Get the neighbour patch sum kappa*Tc/delta and kappa/delta.
ubCoupledTemperatureFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, fvMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
virtual void getThis(tmp< scalarField > &kappa, tmp< scalarField > &sumKappaTByDelta, tmp< scalarField > &sumKappaByDelta, scalarField &sumq, tmp< scalarField > &qByKappa) const
Get the patch kappa, sum kappa*Tc/delta and kappa/delta for all.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
const dimensionedScalar kappa
Coulomb constant: default SI units: [N.m2/C2].
Namespace for OpenFOAM.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
makePatchTypeField(fvPatchScalarField, atmosphericBoundaryLayerTurbulentEpsilonFvPatchScalarField)
dictionary dict
volScalarField & p
fluidMulticomponentThermo & thermo
Definition: createFields.H:15