如何计算阻力系数与升力系数【翻译】

翻译自:http://cfdcomputing.com/drag_openfoam.htm

为了输出面片或者边界上的升力和阻力系数,我们需要使用函数对象并将他们包含到system/controlDict文件中。

第一个改变发生在system/controlDict文件中:

Functions {

    #include "dragAndLiftForces"

    }

这一操作将在OpenFOAM每一次迭代都执行的"dragAndLiftForces"包含进来。下一步我们将在sysyem目录下创建包含如下内容的"dragAndLiftForces"文件

forces

{

type forceCoeffs; // Report coefficient of forces

functionObjectLibs ( "libforces.so" );

outputControl timeStep;

outputInterval 1;     // iteration at which output will be reported

patches

(

"boundary.*" ); // All patches to compute forces on

);

 

pName p;

UName U;

log true;

rhoInf 1; // is the free stream density.

CofR ( 0 0 0 ); // center of rotation

liftDir ( 0. 0 1 ); // lift direction

dragDir ( 1 0. 0 ); // drag direction

pitchAxis ( 0 0 1 ); // pitch axis

magUInf 20.0; // inflow velocity

lRef 1; // Length

Aref 1; // Frontal Area

}

OpenFOAM在算例中记录下升力系数,阻力系数和力矩系数并且输出到forces目录下,文件的输出格式如下:

# Time Cd      Cl      Cm

1 1.1      0.2      0.477

首行的头信息和续行是每次迭代的CdClCm的值。OpenFOAM会报告流量系数直到迭代结束。

可以用其他程序来读取forces.dat输出文件,画出历史残差和流量系数曲线。

posted @ 2016-07-12 11:23  硫酸亚铜  阅读(2105)  评论(0编辑  收藏  举报