CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to define proper BC? (https://www.cfd-online.com/Forums/openfoam-solving/239997-how-define-proper-bc.html)

Ryuzaki December 6, 2021 13:39

How to define proper BC?
 
2 Attachment(s)
Hi,

I read an article and I want to do the work here myself, but many initial conditions are given. For example, we can find the free flow velocity based on the Mach number at the given temperature. However, Pressure inlet boundary condition is used. Mass flow rate value is also given. I'm so confused.

thx in advance..

sqek December 6, 2021 15:34

It looks like they're giving all the information they measured, not just what they set, for convenience

The second image looks like they were setting the pressure for the inlet and outlet, and letting the solver find the velocity (so in openfoam, you'd use pressureInletOutletVelocity or similar for the velocity) - which can be tricky to find the right numerical schemes, as it doesn't tend to converge very well
(the stagnation pressure difference between inlet and outlet can only come from losses within the flow, so it needs to get turbulent and shock losses right, and the feedback loop from pressure-velocity-losses-pressure is quite slow so it takes ages to converge)

So the free-stream conditions that they give in the first one are measured from their results most likely, and they're only setting inlet/outlet pressures and temperatures

Ryuzaki December 9, 2021 05:02

dear sqek,
Firstly I wish to express my gratitude for your detailed expression.
I was thinking of using boundary conditions "pressureInletVelocity" for "u" and "totalPressure" for "p". If I use them, do I have to enter 0 for "pressureInletVelocity" and wait for the software to calculate the speed?

The U value for Mach 1.71 at 300K is approximately 594m/s. What if I enter "freestreamVelocity=594" for the inlet without going into the situations I mentioned above? Similarly, I'm thinking of entering the "p" value as 500000 for the inlet and 101325 for the outlet.

What do you think? thx in advance..
Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [1 -1 -2 0 0 0 0];

internalField uniform 500000;

boundaryField
{
fab
{
type symmetry;
}

wall
{
type zeroGradient;
}
inlet
{
type totalPressure;
gamma 1.4;
p0 $internalField;
}

outlet
{
type waveTransmissive;
field p;
psi thermo:psi;
gamma 1.4;
fieldInf 101325;
lInf 100;
value 101325;
}
top
{
type zeroGradient;
}
}

// ************************************************** *********************** //
Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];
internalField uniform (593.751 0 0);

boundaryField
{
farfield
{
type freestreamVelocity;
freestreamValue $internalField;
}

bottom
{
type noSlip;
}

top
{
type slip;
}

fab
{
type symmetry;
}
}

// ************************************************** *********************** //
Quote:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //



dimensions [0 0 0 1 0 0 0];

internalField uniform 300;

boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}

outlet
{
type inletOutlet;
value $internalField;
}

wall
{
type zeroGradient;
}

kayma
{
type zeroGradient;
}

front
{
type zeroGradient;
}

top
{
type zeroGradient;
}

back
{
type symmetry;
}
}

// ************************************************** *********************** //
Quote:

Originally Posted by sqek (Post 818011)
It looks like they're giving all the information they measured, not just what they set, for convenience

The second image looks like they were setting the pressure for the inlet and outlet, and letting the solver find the velocity (so in openfoam, you'd use pressureInletOutletVelocity or similar for the velocity) - which can be tricky to find the right numerical schemes, as it doesn't tend to converge very well
(the stagnation pressure difference between inlet and outlet can only come from losses within the flow, so it needs to get turbulent and shock losses right, and the feedback loop from pressure-velocity-losses-pressure is quite slow so it takes ages to converge)

So the free-stream conditions that they give in the first one are measured from their results most likely, and they're only setting inlet/outlet pressures and temperatures



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