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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2021, 07:41
Default what does constrainHbyA.C do?
  #1
New Member
 
Mahdi
Join Date: May 2020
Posts: 10
Rep Power: 5
M.Davoodi is on a distinguished road
Hi Guys,
I was looking at the constrainHbyA.C file and there are two parts that seems to me really odd, I was wondering if someone with more experience can give me some feedback? What happens on the red part? It calls for pressure at the boundary and then it does nothing? No variable has been changed or modified here....
What about the blue part, it says HbyA at boundary is equal to velocity value at the boundary?! That is odd, really doesn't make much sense to me...

,


\*---------------------------------------------------------------------------*/
27
28 #include "constrainHbyA.H"
29 #include "volFields.H"
30 #include "fixedFluxExtrapolatedPressureFvPatchScalarField.H "
31
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34 Foam::tmp<Foam::volVectorField> Foam::constrainHbyA
35 (
36 const tmp<volVectorField>& tHbyA,
37 const volVectorField& U,
38 const volScalarField& p
39 )
40 {
41 tmp<volVectorField> tHbyANew;
42
43 if (tHbyA.isTmp())
44 {
45 tHbyANew = tHbyA;
46 tHbyANew.ref().rename("HbyA");
47 }
48 else
49 {
50 tHbyANew = new volVectorField("HbyA", tHbyA);
51 }
52
53 volVectorField& HbyA = tHbyANew.ref();
54 volVectorField::Boundary& HbyAbf = HbyA.boundaryFieldRef();
55
56 forAll(U.boundaryField(), patchi)
57 {
58 if
59 (
60 !U.boundaryField()[patchi].assignable()
61 && !isA<fixedFluxExtrapolatedPressureFvPatchScalarFie ld>
62 (
63 p.boundaryField()[patchi]
64 )
65 )
66 {
67 HbyAbf[patchi] = U.boundaryField()[patchi];
68 }
69 }
70
71 return tHbyANew;
72 }
M.Davoodi is offline   Reply With Quote

Reply

Tags
constrainhbya.c


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



All times are GMT -4. The time now is 16:38.