CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   calculated type of primitive boundary field (

suniljain February 19, 2010 01:35

calculated type of primitive boundary field
hi .
what is the syntax of calculated type of primitive boundary case has three coupled equation with 3 variables. i have a relation between two variables (fields) at a particular patch , say x=constant *y. so how to give boundary condition for x and y at that patch. please help me.

benk February 19, 2010 17:19

If I understand your question, you have 2 equations coupled via a fixedValue boundary condition. Something like this should work for your boundary condition (although I'd be interested to know if there's a better way):


label wall2 = mesh.boundaryMesh().findPatchID("boundaryWall2");
fixedValueFvPatchScalarField& bufferT = refCast<fixedValueFvPatchScalarField>(T.boundaryField()[wall2]);

scalarField& valT  = bufferT;

forAll (valT, faceI)
  valT[faceI] =  c.boundaryField()[wall2][faceI];

This code will set the boundary condition for T equal to c at the boundary labeled "boundaryWall2".

For a gradient boundary condition, it's similar (described here:

All times are GMT -4. The time now is 06:27.