CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

what does constrainHbyA.C do?

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By mAlletto
  • 1 Post By mAlletto

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 15, 2021, 07:51
Default what does constrainHbyA.C do?
  #1
New Member
 
Mahdi
Join Date: May 2020
Posts: 10
Rep Power: 6
M.Davoodi is on a distinguished road
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;
}


// **************************************************
M.Davoodi is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


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