46 FatalErrorIn(
" ") <<
"wallDistanceMethod: "
48 <<
" Options are: default and daCustom."
56 label patchI =
mesh_.boundaryMesh().findPatchID(patchName);
74 const_cast<volScalarField&
>(
mesh_.thisDb().lookupObject<volScalarField>(
"T"));
82 label patchI =
mesh_.boundaryMesh().findPatchID(patchName);
84 mixedFvPatchField<scalar>& mixedPatch =
85 refCast<mixedFvPatchField<scalar>>(
T.boundaryFieldRef()[patchI]);
87 forAll(mixedPatch.refValue(), faceI)
89 mixedPatch.refValue()[faceI] = input[counterI];
90 mixedPatch.refGrad()[faceI] = 0;
97 scalar deltaCoeffs = 0;
106 if (turbModelType ==
"incompressible")
110 IOdictionary transportProperties(
112 "transportProperties",
113 mesh_.time().constant(),
118 scalar Cp = readScalar(transportProperties.lookup(
"Cp"));
124 label patchI =
mesh_.boundaryMesh().findPatchID(patchName);
126 mixedFvPatchField<scalar>& mixedPatch =
127 refCast<mixedFvPatchField<scalar>>(
T.boundaryFieldRef()[patchI]);
134 deltaCoeffs =
T.boundaryField()[patchI].patch().deltaCoeffs()[faceI];
138 label nearWallCellIndex =
mesh_.boundaryMesh()[patchI].faceCells()[faceI];
139 vector c1 =
mesh_.Cf().boundaryField()[patchI][faceI];
140 vector c2 =
mesh_.C()[nearWallCellIndex];
141 scalar d = mag(c1 - c2);
144 scalar alphaEffBf =
alphaEff.boundaryField()[patchI][faceI];
145 scalar myKDeltaCoeffs = Cp * alphaEffBf * deltaCoeffs;
147 scalar neighKDeltaCoeffs = input[counterI];
148 mixedPatch.valueFraction()[faceI] = neighKDeltaCoeffs / (myKDeltaCoeffs + neighKDeltaCoeffs);
154 if (turbModelType ==
"compressible")
160 const fluidThermo&
thermo =
mesh_.thisDb().lookupObject<fluidThermo>(
"thermophysicalProperties");
161 const volScalarField&
he =
thermo.he();
163 const IOdictionary& thermoDict =
mesh_.thisDb().lookupObject<IOdictionary>(
"thermophysicalProperties");
164 dictionary mixSubDict = thermoDict.subDict(
"mixture");
165 dictionary specieSubDict = mixSubDict.subDict(
"specie");
166 scalar molWeight = specieSubDict.getScalar(
"molWeight");
167 dictionary thermodynamicsSubDict = mixSubDict.subDict(
"thermodynamics");
168 scalar Cp = thermodynamicsSubDict.getScalar(
"Cp");
172 scalar RR = Foam::constant::thermodynamic::RR;
176 scalar R = RR / molWeight;
180 if (
he.name() ==
"e")
194 label patchI =
mesh_.boundaryMesh().findPatchID(patchName);
196 mixedFvPatchField<scalar>& mixedPatch =
197 refCast<mixedFvPatchField<scalar>>(
T.boundaryFieldRef()[patchI]);
204 deltaCoeffs =
T.boundaryField()[patchI].patch().deltaCoeffs()[faceI];
208 label nearWallCellIndex =
mesh_.boundaryMesh()[patchI].faceCells()[faceI];
209 vector c1 =
mesh_.Cf().boundaryField()[patchI][faceI];
210 vector c2 =
mesh_.C()[nearWallCellIndex];
211 scalar d = mag(c1 - c2);
214 scalar alphaEffBf =
alphaEff.boundaryField()[patchI][faceI];
215 scalar myKDeltaCoeffs = tmpVal * alphaEffBf * deltaCoeffs;
217 scalar neighKDeltaCoeffs = input[counterI];
218 mixedPatch.valueFraction()[faceI] = neighKDeltaCoeffs / (myKDeltaCoeffs + neighKDeltaCoeffs);
227 IOdictionary solidProperties(
230 mesh_.time().constant(),
235 scalar
k = readScalar(solidProperties.lookup(
"k"));
241 label patchI =
mesh_.boundaryMesh().findPatchID(patchName);
248 deltaCoeffs =
T.boundaryField()[patchI].patch().deltaCoeffs()[faceI];
252 label nearWallCellIndex =
mesh_.boundaryMesh()[patchI].faceCells()[faceI];
253 vector c1 =
mesh_.Cf().boundaryField()[patchI][faceI];
254 vector c2 =
mesh_.C()[nearWallCellIndex];
255 scalar d = mag(c1 - c2);
258 mixedFvPatchField<scalar>& mixedPatch = refCast<mixedFvPatchField<scalar>>(
T.boundaryFieldRef()[patchI]);
259 scalar myKDeltaCoeffs =
k * deltaCoeffs;
261 scalar neighKDeltaCoeffs = input[counterI];
262 mixedPatch.valueFraction()[faceI] = neighKDeltaCoeffs / (myKDeltaCoeffs + neighKDeltaCoeffs);
269 FatalErrorIn(
"DAInputThermalCoupling::run") <<
" discipline not valid! "
270 << abort(FatalError);
273 T.correctBoundaryConditions();