|
[Sponsors] |
February 15, 2021, 08: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; } // ************************************************** |
|
February 15, 2021, 09:25 |
|
#2 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
There is a small description of the function here:
https://openfoamwiki.net/index.php/SimpleFoam is this of help? |
|
February 15, 2021, 09:47 |
|
#3 | |
New Member
Mahdi
Join Date: May 2020
Posts: 10
Rep Power: 6 |
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] ” ? |
||
February 15, 2021, 13:06 |
|
#4 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
The red text is the argument to the function which checks if it is a fixedfluxpressure boundary condition
|
|
February 15, 2021, 13:10 |
|
#5 |
New Member
Mahdi
Join Date: May 2020
Posts: 10
Rep Power: 6 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
what does constrainHbyA.C do? | M.Davoodi | OpenFOAM Programming & Development | 0 | February 15, 2021 08:41 |