|
[Sponsors] |
February 15, 2021, 07:51 |
what does constrainHbyA.C do?
|
#1 |
New Member
Mahdi
Join Date: May 2020
Posts: 10
Rep Power: 6 |
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; } // ************************************************** |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
what does constrainHbyA.C do? | M.Davoodi | OpenFOAM Programming & Development | 0 | February 15, 2021 07:41 |