CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How does fixedFluxBuoyantPressure work (https://www.cfd-online.com/Forums/openfoam-solving/58539-how-does-fixedfluxbuoyantpressure-work.html)

vitke September 19, 2008 09:40

Hi all I am trying to figur
 
Hi all

I am trying to figure out how does the fixedFluxBuoyantPressure bc work, because I want to modify it to set the outer normal derivative of the potential h (which is my primary variable) to -(rho-rho0)/rho0 (n*vector(0,0,1)), where n is the outer normal, rho is a scalar field, and rho0 is a constant.

I found somewhere that "fixedFluxBuoyantPressure is used to setup full pressure field on boundaries (p+r*g*h)". Here is the updateCoefs() code of this bc:

void fixedFluxBuoyantPressureFvPatchScalarField::update Coeffs()
{
if (updated())
{
return;
}

const dictionary& environmentalProperties
= db().lookupObject<iodictionary>("environmentalProp erties");

dimensionedVector g(environmentalProperties.lookup("g"));

const fvPatchField<scalar>& rho =
patch().lookupPatchField<volscalarfield,>("rho");

gradient() = -rho.snGrad()*(g.value() & patch().Cf());

fixedGradientFvPatchScalarField::updateCoeffs();
}

Here go my questions:

1) Why does this method set the gradient? In my understanding, it should set the value to -rho*(g.value() & patch().Cf()) plus the value specified as the bc. Why does it set the gradient to the normal derivative of this thing? Is the value set somewhere else?

2) Why does it call fixedGradientFvPatchScalarField::updateCoeffs() and what does this do? Sets the value? Or just sets the "updated" indicator to true?

3) Why was this class derived from fixedGradientFvPatchScalarField if it is supposed to set the pressure and not it's gradient?

4) Finally, how can I set the normal derivative of my potential? This is supposed to set my flux to zero. I tried to play with that gradient() = ... line, but it does not work, which is not strange since I don't understand how this should work.


All times are GMT -4. The time now is 04:41.