OpenFOAM在运行过程中使用forcesIncompressibe计算力
在路径/opt/openfoam6/etc/caseDicts/postProcessing/forces下复制文件forcesIncompressible到CASE/system。
在controlDict字典中添加
functions
{
#includeFunc forcesIncompressible;
}
System/forcesIncompressible内容如下:
#includeEtc "caseDicts/postProcessing/forces/forcesIncompressible.cfg"
rhoInf 1000; // 不可压缩流体的恒定密度值
patches (caisson); // 指定受力patch
CofR (0 0 0); // 指定力矩计算的旋转中心
pitchAxis (0 0 1); // 纵摇轴(即力矩方向)
详细说明可在 /opt/openfoam6/src/functionObjects/forces/forces/forces.H 和
/opt/openfoam6/src/functionObjects/forces/forceCeoffs/forceCoeffs.H 中查看,如下:
/*------------------------------------------------------------------------*\
Class
Foam::functionObjects::forces
Description
Calculates the forces and moments by integrating the pressure and
skin-friction forces over a given list of patches.
Member function forces::write() calculates the forces/moments and
writes the forces/moments into the file \<timeDir\>/forces.dat and bin
data (if selected) to the file \<timeDir\>/forces_bin.dat
Example of function object specification:
\verbatim
forces1
{
type forces;
libs ("libforces.so");
...
log yes;
patches (walls);
binData
{
nBin 20;
direction (1 0 0);
cumulative yes;
}
}
\endverbatim
Usage
\table
Property | Description | Required | Default value
type | Type name: forces | yes |
log | Write force data to standard output | no | no
patches | Patches included in the forces calculation | yes |
p | Pressure field name | no | p
U | Velocity field name | no | U
rho | Density field name (see below) | no | rho
CofR | Centre of rotation (see below) | no |
directForceDensity | Force density supplied directly (see below)|no|no
fD | Name of force density field (see below) | no | fD
\endtable
Bin data is optional, but if the dictionary is present, the entries must
be defined according o
\table
nBin | number of data bins | yes |
direction | direction along which bins are defined | yes |
cumulative | bin data accumulated with incresing distance | yes |
\endtable
Note
- For incompressible cases, set \c rho to \c rhoInf. You will then be
required to provide a \c rhoInf value corresponding to the free-stream
constant density.
- If the force density is supplied directly, set the \c directForceDensity
flag to 'yes', and supply the force density field using the \c
fDName entry
- The centre of rotation (CofR) for moment calculations can either be
specified by an \c CofR entry, or be taken from origin of the local
coordinate system. For example,
\verbatim
CofR (0 0 0);
\endverbatim
or
\verbatim
coordinateSystem
{
origin (0 0 0);
e3 (0 0 1);
e1 (1 0 0);
}
\endverbatim
See also
Foam::functionObject
Foam::functionObjects::fvMeshFunctionObject
Foam::functionObjects::logFiles
Foam::functionObjects::timeControl
Foam::forceCoeffs
SourceFiles
forces.C
\*-------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*\
Class
Foam::functionObjects::forceCoeffs
Description
Extends the forces functionObject by providing lift, drag and moment
coefficients. The data can optionally be output into bins, defined in a
given direction.
Example of function object specification:
\verbatim
forceCoeffs1
{
type forceCoeffs;
libs ("libforces.so");
...
log yes;
patches (walls);
liftDir (0 1 0);
dragDir (-1 0 0);
pitchAxis (0 0 1);
magUInf 100;
lRef 3.5;
Aref 2.2;
binData
{
nBin 20;
direction (1 0 0);
cumulative yes;
}
}
\endverbatim
Usage
\table
Property | Description | Required | Default value
type | type name: forceCoeffs | yes |
log | write force data to standard output | no | no
patches | patches included in the forces calculation | yes |
liftDir | lift direction | yes |
dragDir | drag direction | yes |
pitchAxis | picth axis | yes |
magUInf | free stream velocity magnitude | yes |
lRef | reference length scale for moment calculations | yes |
Aref | reference area | yes |
\endtable
Bin data is optional, but if the dictionary is present, the entries must
be defined according o
\table
nBin | number of data bins | yes |
direction | direction along which bins are defined | yes |
cumulative | bin data accumulated with incresing distance | yes |
\endtable
See also
Foam::functionObject
Foam::functionObjects::timeControl
Foam::functionObjects::forces
SourceFiles
forceCoeffs.C
\*-------------------------------------------------------------------------*/
Property | Description | Required | Default value |
---|---|---|---|
type | type name: forceCoeffs | yes | |
log | write force data to standard output | no | no |
patches | patches included in the forces calculation | yes | |
liftDir | lift direction | yes | |
dragDir | drag direction | yes | |
pitchAxis | picth axis | yes | |
magUInf | free stream velocity magnitude | yes | |
lRef | reference length scale for moment calculations | yes | |
Aref | reference area | yes |