25 const word objFuncName,
26 const word objFuncPart,
27 const dictionary& objFuncDict)
53 const labelList& objFuncFaceSources,
54 const labelList& objFuncCellSources,
55 scalarList& objFuncFaceValues,
56 scalarList& objFuncCellValues,
81 forAll(objFuncCellValues, idxI)
83 objFuncCellValues[idxI] = 0.0;
88 const objectRegistry& db =
mesh_.thisDb();
90 const volScalarField&
lambda = db.lookupObject<volScalarField>(
"solid:lambda");
91 const volScalarField&
mu = db.lookupObject<volScalarField>(
"solid:mu");
92 const volScalarField&
rho = db.lookupObject<volScalarField>(
"solid:rho");
93 const volTensorField&
gradD = db.lookupObject<volTensorField>(
"gradD");
98 volScalarField vonMises =
scale_* sqrt((3.0 / 2.0) * magSqr(dev(
sigma)));
100 scalar objValTmp = 0.0;
101 forAll(objFuncCellSources, idxI)
103 const label& cellI = objFuncCellSources[idxI];
105 objFuncCellValues[idxI] = exp(
coeffKS_ * vonMises[cellI]);
107 objValTmp += objFuncCellValues[idxI];
109 if (objValTmp > 1e200)
111 FatalErrorIn(
" ") <<
"KS function summation term too large! "
112 <<
"Reduce coeffKS! " << abort(FatalError);
117 reduce(objValTmp, sumOp<scalar>());
122 objFuncValue = log(objValTmp) /
coeffKS_;