CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Questions about modifications of mixed boundary conditions (http://www.cfd-online.com/Forums/openfoam/106911-questions-about-modifications-mixed-boundary-conditions.html)

fumiya September 12, 2012 05:29

Questions about modifications of mixed boundary conditions
 
Hi,

I want to modify the mixed boundary condition in OpenFOAM so that
I can set the refValue up as the boundary value of another field U.

I think I have to make modifications something like the followings to the
original code(src/finiteVolume/fields/fvPatchFields/basic/mixed/
mixedFvPatchField.C).

In the evaluate function,

template<class Type>
void mixedFvPatchField<Type>::evaluate(const Pstream::commsTypes)
{
if (!this->updated())
{
this->updateCoeffs();
}

************my modifications***********************************
const fvPatchField<Type>& Up =
this->patch().template lookupPatchField<volField<Type>, Type>("U");

refValue_ = boundary value of Up;
************************************************** *********

Field<Type>:operator=
(
valueFraction_*refValue_
+
(1.0 - valueFraction_)*
(
this->patchInternalField()
+ refGrad_/this->patch().deltaCoeffs()
)
);

fvPatchField<Type>::evaluate();
}

What exact modifications should I do?

Regards,
Fumiya

fumiya September 14, 2012 12:50

To be more specific, could you tell me how to use the lookupPatchField
for any kind of Field (scalar, vector, tensor), like

const fvPatchField<Type>& Up =
this->patch().template lookupPatchField<volField<Type>, Type>("U");

When I use the above command, there is an error that volField was not
declared in this scope.

Fumiya


All times are GMT -4. The time now is 07:18.