void Foam::fv::fixedTemperatureConstraint::constrain ( fvMatrix<scalar>& eqn, const label ) { const basicThermo& thermo = mesh_.lookupObject<basicThermo>(basicThermo::dictName); switch (mode_) { case tmUniform: { const scalar t = mesh_.time().value(); scalarField Tuni(cells_.size(), Tuniform_->value(t)); eqn.setValues(cells_, thermo.he(thermo.p(), Tuni, cells_)); break; } case tmLookup: { const volScalarField& T = mesh().lookupObject<volScalarField>(TName_); scalarField Tlkp(T, cells_); eqn.setValues(cells_, thermo.he(thermo.p(), Tlkp, cells_)); break; } default: { // error handling done by NamedEnum } } }
void Foam::fixedInternalValueFvPatchField<Type>::manipulateMatrix ( fvMatrix<Type>& matrix ) { // Apply the refValue as a constraint in the matrix matrix.setValues(this->patch().faceCells(), refValue_); }
void forceEquation<T>::operator()(fvMatrix<T> &eq) { typedef GeometricField<T,fvPatchField,volMesh> resultField; clearVariables(); DynamicList<label> cellIDs; if(!getMask(cellIDs,eq.psi().name())) { return; } Field<T> values(cellIDs.size()); parse(valueExpression_); const resultField &calculated=getResult<resultField>(); forAll(cellIDs,i) { values[i]=calculated[cellIDs[i]]; } eq.setValues(cellIDs,values); }