40 FatalErrorIn(
"DAInputPatchVar::size") <<
"varType not valid" << exit(FatalError);
53 patchVSubDict.readEntry<wordList>(
"patches", patchNames);
56 Info <<
"DAInputPatchVar. " << endl;
57 Info <<
"Setting " <<
varName_ <<
" = " << input <<
" at " << patchNames << endl;
63 volScalarField& var =
const_cast<volScalarField&
>(
mesh_.thisDb().lookupObject<volScalarField>(
varName_));
68 word patchName = patchNames[idxI];
69 label patchI =
mesh_.boundaryMesh().findPatchID(patchName);
70 if (
mesh_.boundaryMesh()[patchI].size() > 0)
72 if (var.boundaryField()[patchI].type() ==
"fixedValue")
74 forAll(var.boundaryField()[patchI], faceI)
76 var.boundaryFieldRef()[patchI][faceI] = input[0];
79 else if (var.boundaryField()[patchI].type() ==
"inletOutlet")
81 mixedFvPatchField<scalar>& inletOutletPatch =
82 refCast<mixedFvPatchField<scalar>>(var.boundaryFieldRef()[patchI]);
84 forAll(var.boundaryField()[patchI], faceI)
86 inletOutletPatch.refValue()[faceI] = input[0];
91 FatalErrorIn(
"DAInputPatchVelocity::run")
92 <<
"patch type not valid! only support fixedValue or inletOutlet"
97 var.correctBoundaryConditions();
102 volVectorField& var =
const_cast<volVectorField&
>(
mesh_.thisDb().lookupObject<volVectorField>(
varName_));
107 word patchName = patchNames[idxI];
108 label patchI =
mesh_.boundaryMesh().findPatchID(patchName);
109 if (
mesh_.boundaryMesh()[patchI].size() > 0)
111 if (var.boundaryField()[patchI].type() ==
"fixedValue")
113 forAll(var.boundaryField()[patchI], faceI)
115 for (label i = 0; i < 3; i++)
117 var.boundaryFieldRef()[patchI][faceI][i] = input[i];
121 else if (var.boundaryField()[patchI].type() ==
"inletOutlet")
123 mixedFvPatchField<vector>& inletOutletPatch =
124 refCast<mixedFvPatchField<vector>>(var.boundaryFieldRef()[patchI]);
126 forAll(var.boundaryField()[patchI], faceI)
128 for (label i = 0; i < 3; i++)
130 inletOutletPatch.refValue()[faceI][i] = input[i];
136 FatalErrorIn(
"DAInputPatchVelocity::run")
137 <<
"patch type not valid! only support fixedValue or inletOutlet"
142 var.correctBoundaryConditions();