The unreliable extrapolateProfile option has been replaced by the more flexible
and reliable profile option which allows the velocity profile to be specified as
a Function1 of the normalised distance to the wall. To simplify the
specification of the most common velocity profiles the new laminarBL (quadratic
profile) and turbulentBL (1/7th power law) Function1s are provided.
In addition to the new profile option the flow rate can now be specified as a
meanVelocity, volumetricFlowRate or massFlowRate, all of which are Function1s of
time.
The following tutorials have been updated to use the laminarBL profile:
multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis
multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface
The following tutorials have been updated to use the turbulentBL profile:
combustion/reactingFoam/Lagrangian/verticalChannel
combustion/reactingFoam/Lagrangian/verticalChannelLTS
combustion/reactingFoam/Lagrangian/verticalChannelSteady
compressible/rhoPimpleFoam/RAS/angledDuct
compressible/rhoPimpleFoam/RAS/angledDuctLTS
compressible/rhoPimpleFoam/RAS/squareBendLiq
compressible/rhoPorousSimpleFoam/angledDuctImplicit
compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff
compressible/rhoSimpleFoam/squareBend
compressible/rhoSimpleFoam/squareBendLiq
heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger
heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger
incompressible/porousSimpleFoam/angledDuctImplicit
incompressible/porousSimpleFoam/straightDuctImplicit
multiphase/interFoam/RAS/angledDuct
Class
Foam::flowRateInletVelocityFvPatchVectorField
Description
Velocity inlet boundary condition creating a velocity field with
optionally specified profile normal to the patch adjusted to match the
specified mass flow rate, volumetric flow rate or mean velocity.
For a mass-based flux:
- the flow rate should be provided in kg/s
- if \c rho is "none" the flow rate is in m3/s
- otherwise \c rho should correspond to the name of the density field
- if the density field cannot be found in the database, the user must
specify the inlet density using the \c rhoInlet entry
For a volumetric-based flux:
- the flow rate is in m3/s
Usage
\table
Property | Description | Required | Default value
massFlowRate | Mass flow rate [kg/s] | no |
volumetricFlowRate | Volumetric flow rate [m^3/s]| no |
meanVelocity | Mean velocity [m/s]| no |
profile | Velocity profile | no |
rho | Density field name | no | rho
rhoInlet | Inlet density | no |
alpha | Volume fraction field name | no |
\endtable
Example of the boundary condition specification for a volumetric flow rate:
\verbatim
<patchName>
{
type flowRateInletVelocity;
volumetricFlowRate 0.2;
profile laminarBL;
}
\endverbatim
Example of the boundary condition specification for a mass flow rate:
\verbatim
<patchName>
{
type flowRateInletVelocity;
massFlowRate 0.2;
profile turbulentBL;
rho rho;
rhoInlet 1.0;
}
\endverbatim
Example of the boundary condition specification for a volumetric flow rate:
\verbatim
<patchName>
{
type flowRateInletVelocity;
meanVelocity 5;
profile turbulentBL;
}
\endverbatim
The \c volumetricFlowRate, \c massFlowRate or \c meanVelocity entries are
\c Function1 of time, see Foam::Function1s.
The \c profile entry is a \c Function1 of the normalised distance to the
wall. Any suitable Foam::Function1s can be used including
Foam::Function1s::codedFunction1 but Foam::Function1s::laminarBL and
Foam::Function1s::turbulentBL have been created specifically for this
purpose and are likely to be appropriate for most cases.
Note
- \c rhoInlet is required for the case of a mass flow rate, where the
density field is not available at start-up
- The value is positive into the domain (as an inlet)
- May not work correctly for transonic inlets
- Strange behaviour with potentialFoam since the U equation is not solved
See also
Foam::fixedValueFvPatchField
Foam::Function1s::laminarBL
Foam::Function1s::turbulentBL
Foam::Function1s
Foam::flowRateOutletVelocityFvPatchVectorField
126 lines
2.8 KiB
C++
126 lines
2.8 KiB
C++
/*--------------------------------*- C++ -*----------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration | Website: https://openfoam.org
|
|
\\ / A nd | Version: dev
|
|
\\/ M anipulation |
|
|
\*---------------------------------------------------------------------------*/
|
|
FoamFile
|
|
{
|
|
format ascii;
|
|
class dictionary;
|
|
object blockMeshDict;
|
|
}
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
// Block definition for a porosity with an angled inlet/outlet
|
|
// the porosity is not aligned with the main axes
|
|
|
|
convertToMeters 0.001;
|
|
|
|
angle 45;
|
|
|
|
width 50;
|
|
lenInlet 150;
|
|
lenPoro 100;
|
|
lenOutlet 100;
|
|
|
|
yzCells 20;
|
|
nInletCells 15;
|
|
nPoroCells 20;
|
|
nOutletCells 20;
|
|
|
|
vertices #codeStream
|
|
{
|
|
codeInclude
|
|
#{
|
|
#include "pointField.H"
|
|
#include "transformField.H"
|
|
#};
|
|
|
|
code
|
|
#{
|
|
const scalar halfWidth = ($width)/2.0;
|
|
|
|
// Length between the bend and outlet
|
|
const scalar distOutlet = $lenPoro + $lenOutlet;
|
|
|
|
pointField points
|
|
({
|
|
point(0, 0, -halfWidth), // pt 0
|
|
point($lenPoro, 0, -halfWidth), // pt 1
|
|
point(distOutlet, 0, -halfWidth), // pt 2
|
|
point(0, $width, -halfWidth), // pt 3
|
|
point($lenPoro, $width, -halfWidth), // pt 4
|
|
point(distOutlet, $width, -halfWidth) // pt 5
|
|
});
|
|
|
|
// Rotate points around z-axis
|
|
points = transform(Rz(degToRad($angle)), points);
|
|
|
|
// Append points 6 and 7
|
|
points.append(point(-$lenInlet, points[0].y(), points[0].z())); // pt 6
|
|
points.append(point(-$lenInlet, points[3].y(), points[3].z())); // pt 7
|
|
|
|
// Duplicate z points
|
|
points.append(cmptMultiply(points, vector(1, 1, -1)));
|
|
|
|
os << points;
|
|
#};
|
|
};
|
|
|
|
blocks
|
|
(
|
|
// Inlet block
|
|
hex (6 0 3 7 14 8 11 15)
|
|
inlet ($nInletCells $yzCells $yzCells) simpleGrading (1 1 1)
|
|
|
|
// Porosity block
|
|
hex (0 1 4 3 8 9 12 11)
|
|
porosity ($nPoroCells $yzCells $yzCells) simpleGrading (1 1 1)
|
|
|
|
// Outlet block
|
|
hex (1 2 5 4 9 10 13 12)
|
|
outlet ($nOutletCells $yzCells $yzCells) simpleGrading (1 1 1)
|
|
);
|
|
|
|
defaultPatch
|
|
{
|
|
name walls;
|
|
type wall;
|
|
}
|
|
|
|
boundary
|
|
(
|
|
porosityWall
|
|
{
|
|
type wall;
|
|
faces
|
|
(
|
|
(8 9 12 11)
|
|
(0 3 4 1)
|
|
(0 1 9 8)
|
|
(3 11 12 4)
|
|
);
|
|
}
|
|
|
|
inlet
|
|
{
|
|
type patch;
|
|
faces
|
|
(
|
|
(14 15 7 6)
|
|
);
|
|
}
|
|
|
|
outlet
|
|
{
|
|
type patch;
|
|
faces
|
|
(
|
|
(2 5 13 10)
|
|
);
|
|
}
|
|
);
|
|
|
|
// ************************************************************************* //
|