OpenFoam 计算过程中数据监测设置

使用OpenFoam计算时,过程中的残差,自定义点位置变量值的监测,需要进行的设置。

一,在system下创建文件

system/residuals

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Web:      www.OpenFOAM.org
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    For specified fields, writes out the initial residuals for the first
    solution of each time step; for non-scalar fields (e.g. vectors), writes
    the largest of the residuals for each component (e.g. x, y, z).

\*---------------------------------------------------------------------------*/

#includeEtc "caseDicts/postProcessing/numerical/residuals.cfg"

fields (p U k epsilon);

// ************************************************************************* //

system/probes

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Web:      www.OpenFOAM.org
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Writes out values of fields from cells nearest to specified locations.

\*---------------------------------------------------------------------------*/

#includeEtc "caseDicts/postProcessing/probes/probes.cfg"

fields (p U);
probeLocations
(
    (3 6.15 0.15)    //0
    (3 6.15 1)
    (3 6.15 2)
    (3 6.15 3)
    (3 6.15 4)
    (3 6.15 5)
    (3 6.15 6.15)   //6
    (3 5 6.15)
    (3 4 6.15)
    (3 3 6.15)
    (3 2 6.15)
    (3 1 6.15)
    (3 -0.15 6.15)  //12
    (3 -0.15 5)
    (3 -0.15 4)
    (3 -0.15 3)
    (3 -0.15 2)
    (3 -0.15 1)
    (3 -0.15 0.15)  //18
);

// ************************************************************************* //

二,在system/controlDict 中添加功能项,链接 residuals 和 probes

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1706+                                |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
/* Butterfly 0.0.4                https://github.com/ladybug-tools/butterfly *\
\*---------------------------------------------------------------------------*/
FoamFile
{
	version		4.0;
	format		ascii;
	class		dictionary;
	location	"system";
	object		controlDict;
}

//#include		"probes";

application		simpleFoam;

startFrom		latestTime;

startTime		0;

stopAt		endTime;

endTime		3000;

deltaT		1;

writeControl		timeStep;

writeInterval		200;

purgeWrite		0;

writeFormat		ascii;

writePrecision		8;

writeCompression		off;

timeFormat		general;

timePrecision		6;

runTimeModifiable		true;

functions{

 #includeFunc  probes
 #includeFunc  probes_lines_0.1m
 #includeFunc  probes_lines_0.01m
 #includeFunc  probes_lines_0m
 #includeFunc  residuals

}

三,计算开始后,postProcessing 文件夹 出现 residuals 和 probes 文件夹记录监测数据。使用gnu plot 或者 python 处理数据,进行可视化。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值