what does constrainHbyA.C do?
Hi Guys,
Does anyone know what happens on the parts of the constrainHbyA.C code (the part shown by the red and blue fonts?): It seems that in the red part it is trying to find the value of pressure at the boundaries and then it does NOTHING? No variable is changed or modified here, it just finds the value of pressure and literally does nothing! A bit strange? Also what about the blue part? It says HbyA value at the boundaries are equal to the value of velocity????! Where does that come from? \*---------------------------------------------------------------------------*/ #include "constrainHbyA.H" #include "volFields.H" #include "fixedFluxExtrapolatedPressureFvPatchScalarField.H " // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Foam::tmp<Foam::volVectorField> Foam::constrainHbyA ( const tmp<volVectorField>& tHbyA, const volVectorField& U, const volScalarField& p ) { tmp<volVectorField> tHbyANew; if (tHbyA.isTmp()) { tHbyANew = tHbyA; tHbyANew.ref().rename("HbyA"); } else { tHbyANew = new volVectorField("HbyA", tHbyA); } volVectorField& HbyA = tHbyANew.ref(); volVectorField::Boundary& HbyAbf = HbyA.boundaryFieldRef(); forAll(U.boundaryField(), patchi) { if ( !U.boundaryField()[patchi].assignable() && !isA<fixedFluxExtrapolatedPressureFvPatchScalarFie ld> ( p.boundaryField()[patchi] ) ) { HbyAbf[patchi] = U.boundaryField()[patchi]; } } return tHbyANew; } // ************************************************** |
There is a small description of the function here:
https://openfoamwiki.net/index.php/SimpleFoam is this of help? |
Quote:
Also a quick question about the red part. Do u have any idea what is that part doing? It says if “!U.boundaryField()[patchi].assignable() && !isA<fixedFluxExtrapolatedPressureFvPatchScalarFie ld>” Then do: “ p.boundaryField()[patchi] ” ? |
The red text is the argument to the function which checks if it is a fixedfluxpressure boundary condition
|
Quote:
|
All times are GMT -4. The time now is 22:44. |