CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   pressureInletUniformVelocity vs pressureInletVelocity (https://www.cfd-online.com/Forums/openfoam/228488-pressureinletuniformvelocity-vs-pressureinletvelocity.html)

arashgmn July 3, 2020 05:08

pressureInletUniformVelocity vs pressureInletVelocity
 
What is the difference between pressureInletUniformVelocity and pressureInletVelocity?

Based on the source code for the first one we have:

Code:

operator==(patch().nf()*gSum(patch().Sf() & *this)/gSum(patch().magSf()));
and for the second one

Code:

operator==(n*phip/magS);
in which n and magS are defined as before:

Code:

tmp<vectorField> n = patch().nf();
const Field<scalar>& magS = patch().magSf();

Can someone explain how does gSum work and what difference does it make?

jherb July 10, 2020 19:22

The first one applys the area averaged value of the velocities of the faces of the patch (so one value) to all faces of the patch. For each face of the patch the velocity vector is in the direction of the face normal vectors.


The second one sets different velocity values (again in the direction of the face normals) based on the calculated flux values.

arashgmn July 11, 2020 03:57

Quote:

Originally Posted by jherb (Post 777463)
The first one applys the area averaged value of the velocities of the faces of the patch (so one value) to all faces of the patch. For each face of the patch the velocity vector is in the direction of the face normal vectors.


The second one sets different velocity values (again in the direction of the face normals) based on the calculated flux values.

Thanks Joachim. It resolved my confusion.


All times are GMT -4. The time now is 17:01.