CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Question about define the BC class (http://www.cfd-online.com/Forums/openfoam/106431-question-about-define-bc-class.html)

mathslw August 28, 2012 20:51

Question about define the BC class
 
Hi,

I want to define my own BC class after each iteration. Actually, I want to update my inlet velocity after each iteration. As far as I know, I can use the following format:

void Foam::updateInletVelocityFvPatchVectorField::updat eCoeffs()
{
if (updated())
{
return;
}

const fvPatchField<vector>& Uf =
patch().lookupPatchField<volVectorField, vector>("U");

How can I obtain the velocity "Ufc" of the patch cell ?
How can I obtain the gradient "gradUc" of the velocity of the patch cell?

vectorField::operator= (gradUc & Ufc);
updateInletVelocityFvPatchVectorField::updateCoeff s();
}

Can I use the set gradUc = Uf.gradientInternalCoeffs() and Ucf = Uf.patchInternalField()?

Thanks in advance!

Wei


All times are GMT -4. The time now is 05:24.