22 DAFvSource::DAFvSource(
31 mesh.time().timeName(),
37 modelType_(modelType),
56 if (daOption.
getAllOptions().lookupOrDefault<label>(
"debug", 0))
58 Info <<
"Selecting " << modelType <<
" for DAFvSource" << endl;
61 dictionaryConstructorTable::iterator cstrIter =
62 dictionaryConstructorTablePtr_->find(modelType);
65 if (cstrIter == dictionaryConstructorTablePtr_->end())
76 <<
"Unknown DAFvSource type "
77 << modelType << nl << nl
78 <<
"Valid DAFvSource types:" << endl
79 << dictionaryConstructorTablePtr_->sortedToc()
84 return autoPtr<DAFvSource>(
85 cstrIter()(modelType,
mesh, daOption, daModel, daIndex));
98 FatalErrorIn(
"") <<
"calcFvSource not implemented " << endl
100 << abort(FatalError);
111 FatalErrorIn(
"") <<
"calcFvSource not implemented " << endl
113 << abort(FatalError);
135 FatalErrorIn(
"") <<
"initFvSourcePars not implemented " << endl
137 << abort(FatalError);
141 label snappedCenterCellI,
144 scalar centerX = 0.0;
145 scalar centerY = 0.0;
146 scalar centerZ = 0.0;
148 if (snappedCenterCellI >= 0)
150 centerX =
mesh_.C()[snappedCenterCellI][0];
151 centerY =
mesh_.C()[snappedCenterCellI][1];
152 centerZ =
mesh_.C()[snappedCenterCellI][2];
154 reduce(centerX, sumOp<scalar>());
155 reduce(centerY, sumOp<scalar>());
156 reduce(centerZ, sumOp<scalar>());
166 if (
mesh_.thisDb().foundObject<volVectorField>(
"fvSource"))
168 volVectorField&
fvSource =
const_cast<volVectorField&
>(
169 mesh_.thisDb().lookupObject<volVectorField>(
"fvSource"));
173 else if (
mesh_.thisDb().foundObject<volScalarField>(
"fvSource"))
175 volScalarField&
fvSource =
const_cast<volScalarField&
>(
176 mesh_.thisDb().lookupObject<volScalarField>(
"fvSource"));
182 FatalErrorIn(
"") <<
"fvSource not found! "
183 << abort(FatalError);