|
[Sponsors] |
February 15, 2021, 07:41 |
what does constrainHbyA.C do?
|
#1 |
New Member
Mahdi
Join Date: May 2020
Posts: 10
Rep Power: 5 |
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 } |
|
Tags |
constrainhbya.c |
|
|