OpenFoam-6导入并编译一个新湍流模型

更新时间:2023-07-24 10:55:40 阅读: 评论:0

OpenFoam-6导⼊并编译⼀个新湍流模型OpenFoam-6 导⼊并编译⼀个新湍流模型
⼀准备原始模型
⾸先,在终端在定位到你的⼯作⽬录,然后执⾏以下操作(如果你不熟悉命令⾏操作,也可以按注释进⾏图形界⾯的操作)
#从$FOAM_SRC/TurbulenceModels/turbulenceModels/RAS/ 中复制kOmegaSST⽂件夹并改名为newkOmegaSST
cp  -r $FOAM_SRC/TurbulenceModels/turbulenceModels/RAS/kOmegaSST $FOAM_RUN/newkOmegaSST
# 进⼊你新建的⽂件夹
cd newkOmegaSST
# 将⽂件夹中的kOmegaSST.H命名为newkOmegaSST.H
mv kOmegaSST.H newkOmegaSST.H
# 将⽂件夹中的kOmegaSST.C命名为newkOmegaSST.C
学围棋的好处
mv kOmegaSST.C newkOmegaSST.C
# 复制 $FOAM_SRC/TurbulenceModels/incompressible中的Make⽂件夹到你的⼯作⽬录
cp -r $FOAM_SRC/TurbulenceModels/incompressible/Make/ .
cp -r $FOAM_SRC/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C maketurbulentTransportModels.C ⼆修改编译配置
在前述操作中,你从OpenFOAM的源⽂件中复制了⼀个名为turbulentTransportModels.C的⽂件,并将其命名为maketurbulentTransportModels.C
现在打开该⽂件,仅保留第⼀个#include声明及第⼀个宏命令,其余内容全部删除,并添加下述内容:
#include "newkOmegaSST.H"
makeRASModel(newkOmegaSST);
修改完成后的⽂件如下所⽰
接着你应当修改Make⽂件夹下的files⽂件
⾸先打开这个⽂件,并清空⾥⾯的内容,并加⼊如下代码,最后保存退出
这段代码表⽰了.so⽂件的⽣成路径,也可以⽣成在当前⽬录下,需要调⽤的时候指定.so⽂件所在⽬录就⾏
maketurbulentTransportModels.C
LIB = $(FOAM_USER_LIBBIN)/libmyincompressibleTurbulenceModels
如下图所⽰
对Make⽂件夹下的options作如下操作
清空该⽂件原始内容,并添加如下代码,保存退出.
EXE_INC = \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
LIB_LIBS = \
产品广告设计-lincompressibleTransportModels \
-lturbulenceModels \
-lfiniteVolume \
-lmeshTools
如下图所⽰
三修改.H 和.C ⽂件
采⽤gedit命令分别打开newkOmegaSST.H和newkOmegaSST.C⽂件,将原有出现kOmegaSST的地⽅使⽤newkOmegaSST进⾏替换,但使⽤d命令进⾏替换时需要注意不要将基类替换,这⾥需要替换的地⽅较少我采⽤⼿动替换,以便清楚展⽰。newkOmegaSST.H
/*---------------------------------------------------------------------------*\
=========                |
\\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
\\    /  O peration    | Website:  openfoam银耳怎么煮才会粘稠
\\  /    A nd          | Copyright (C) 2016-2018 OpenFOAM Foundation
\\/    M anipulation  |整数除以小数
-------------------------------------------------------------------------------
Licen
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public Licen as published by
the Free Software Foundation, either version 3 of the Licen, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be uful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public Licen
for more details.
You should have received a copy of the GNU General Public Licen
along with OpenFOAM.  If not, e &u/licens/>.
\*---------------------------------------------------------------------------*/
微信头像图片动漫#include "newkOmegaSST.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
{
namespace RASModels
{
// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
template<class BasicTurbulenceModel>
newkOmegaSST<BasicTurbulenceModel>::newkOmegaSST
(
const alphaField& alpha,
属牛的名人
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName,
const word& type
)
:
Foam::kOmegaSST
<
eddyViscosity<RASModel<BasicTurbulenceModel>>,
BasicTurbulenceModel
>
(
type,
alpha,
rho,
U,
alphaRhoPhi,
phi,
transport,
propertiesName
)
{
if (type == typeName)
{
this->printCoeffs(type);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace RASModels
} // End namespace Foam
// ************************************************************************* // newkOmegaSST.H
/*---------------------------------------------------------------------------*\
=========                |
\\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
\\    /  O peration    | Website:  openfoam
\\  /    A nd          | Copyright (C) 2016-2018 OpenFOAM Foundation      \\/    M anipulation  |
-------------------------------------------------------------------------------Licen
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it    under the terms of the GNU General Public Licen as published by    the Free Software Foundation, either version 3 of the Licen, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be uful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public Licen    for more details.
You should have received a copy of the GNU General Public Licen
along with OpenFOAM.  If not, e &u/licens/>.
Class
Foam::RASModels::kOmegaSST
Description
Specialisation for RAS of the generic kOmegaSSTBa ba class.
For more information, e Description of kOmegaSSTBa.H
See also
Foam::kOmegaSST
SourceFiles
kOmegaSST.C
\*---------------------------------------------------------------------------*/
#ifndef newkOmegaSST_H
#define newkOmegaSST_H
#include "kOmegaSSTBa.H"
什么是性格#include "RASModel.H"
#include "eddyViscosity.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace RASModels
{
/*---------------------------------------------------------------------------*\
急性毒性试验Class kOmegaSST Declaration
\*---------------------------------------------------------------------------*/
template<class BasicTurbulenceModel>
class newkOmegaSST
:
public Foam::kOmegaSST
<
eddyViscosity<RASModel<BasicTurbulenceModel>>,
BasicTurbulenceModel
>
{
public:
typedef typename BasicTurbulenceModel::alphaField alphaField;
typedef typename BasicTurbulenceModel::rhoField rhoField;
typedef typename BasicTurbulenceModel::transportModel transportModel;
//- Runtime type information
TypeName("newkOmegaSST");
// Constructors
//- Construct from components

本文发布于:2023-07-24 10:55:40,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/82/1114456.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:件夹   修改   替换   内容   添加   需要   命令   编译
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图