OpenFoam singleGraph功能示例

本文介绍如何使用OpenFOAM工具箱中的singleGraph工具进行指定场沿特定线段的数据采样。通过定义不同起点和终点的线段,并指定需要采样的场变量T,可以获取沿该线段分布的数据并输出为图表形式。文中提供了具体的配置示例及采样脚本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

singleGraph/3.2.2/

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Writes graph data for specified fields along a line, specified by start
    and end points.
    Contour Profiles 2.2.1

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

/*
// Line: y = 0.25
start   (0 0.25 0);
end     (1 0.25 0);
fields  (T);
*/

/*
// Line: y = 0.75
start   (0 0.75 0);
end     (1 0.75 0);
fields  (T);
*/

/*
// Line: x = 0.25
start   (0.25 0 0);
end     (0.25 1 0);
fields  (T);
*/


// Line: x = -0.5
start   (-0.5 -1 0);
end     (-0.5 1 0);
fields  (T);


// Sampling and I/O settings
#includeEtc "caseDicts/postProcessing/graphs/sampleDict.cfg"

// Override settings here, e.g.


setConfig
{
    type lineCell;
    axis y;        // y, z, xyz
}


/*
setConfig
{
    type lineCell;
    axis x;        // y, z, xyz
}
*/

// Must be last entry
#includeEtc "caseDicts/postProcessing/graphs/graph.cfg"

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

脚本

cd /home/dyfluid/myFile/trainingExamples/foamRun/3.2.2/40tr/
foamGet singleGraph
## 重复运行/3.2.2/40tr/
gedit /home/dyfluid/myFile/trainingExamples/foamRun/3.2.2/40tr/system/singleGraph # 2
# 编辑singleGraph
postProcess -func singleGraph # 1
# gedit /home/dyfluid/myFile/trainingExamples/foamRun/3.2.2/40tr/postProcessing/singleGraph/0/line_T.xy
# # 复制进主机ex
gedit /home/dyfluid/myFile/trainingExamples/foamRun/3.2.2/40tr/postProcessing/singleGraph/6.2832/line_T.xy
# 复制进主机

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

jmsyh

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值