• OpenFOAM案例编写为HDF5存档的库，而不是默认的每个进程每个时间每个变量一个文件的方法。 这样可以节省大量文件，使结果的管理，复制和后处理变得更加容易。 XDMF文件用于描述HDF5文件的内容，可以在ParaView，...
• 【OpenFOAM案例】02 自己动手

千次阅读 2019-09-23 14:37:29
前言：很多人说OpenFOAM很难，要啃上很多的理论书籍，什么流体力学、计算流体力学、矩阵理论、线性代数、数值计算、C++程序设计神马的，看看光这一堆书就能吓倒绝大多数的人。其实我们并不一定要从这些基础的东西...


前言：很多人说OpenFOAM很难，要啃上很多的理论书籍，什么流体力学、计算流体力学、矩阵理论、线性代数、数值计算、C++程序设计神马的，看看光这一堆书就能吓倒绝大多数的人。其实我们并不一定要从这些基础的东西入手，我觉得要学习使用一个工具，首先使它运转起来才是最靠谱的。通过大量实例练习，做多了自然就能有所感悟。

前面讲到了利用icoFoam求解器计算弯曲管道中流体混合问题。现在来自己动手做一个简单的案例，还是利用icoFoam求解器。icoFoam求解器计算的是瞬态不可压层流流动问题，是OpenFOAM中最简单的求解器之一。
关于此求解器内部实现原理，我们以后再慢慢剖析，一开始就讲一大堆的公式推导会吓坏小朋友的。闲话少说，我们来开始我们的案例。
案例描述
一个非常简单的管道流动问题。我们不强调问题多复杂，只关注OpenFOAM解决问题的思路。
流体流经一个直径0.01m，长度0.5m的管道，计算其内部流场。流体介质为水，密度1000kg/m3，动力粘度0.001 pa.s，入口流速0.1 m。
雷诺数：$Re= \frac{\rho u D}{\mu} = \frac{1000 \times 0.1 \times 0.01}{0.001} =1000$ 几何及网格如图所示。在ICEM CFD中创建几何并划分网格，各边界命名如图所示。生成并输出网格pipe.msh。

OpenFOAM准备
本案例采用icoFoam求解器进行求解。因此先从tutorials文件夹中拷贝一个icoFoam模板，我们这里还是使用前面的elbow文件夹。
在此之前，先创建一个工作文件夹。我用命令在run路径下创建文件夹pipe。
mkdir $FOAM_RUN/pipe 之后利用命令copy一个elbow文件夹到pipe下面。 cp -r$FOAM_TUTORIALS/incompressible/icoFoam/elbow/ $FOAM_RUN/pipe 这样的话，pipe文件夹下就有了elbow文件夹。如果有洁癖的话，可以把elbow文件夹命名为pipe，或者把elbow文件夹下的文件copy到pipe文件夹下，然后删除掉elbow。这里懒得折腾，直接进入到elbow路径下，并把前面生成的pipe.msh文件拷贝到elbow文件夹下。 网格转换 进入到elbow目录下，利用命令： fluentMeshToFoam pipe.msh 此命令将网格pipe.msh转化为OpenFOAM能够识别的网格文件。 elbow目录如下所示： ├── 0 │ ├── p │ └── U ├── Allclean ├── Allrun ├── constant │ ├── polyMesh │ │ ├── boundary │ │ ├── cellZones │ │ ├── faces │ │ ├── faceZones │ │ ├── neighbour │ │ ├── owner │ │ ├── points │ │ └── pointZones │ └── transportProperties ├── elbow.msh ├── pipe.msh └── system ├── controlDict ├── foamDataToFluentDict ├── fvSchemes └── fvSolution 4 directories, 19 files 此时可以查看polyMesh文件夹下的boundary文件。文件内容为： FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * // 3 ( INLET { type patch; nFaces 288; startFace 210864; } OUTLET { type patch; nFaces 288; startFace 211152; } WALL { type wall; inGroups 1(wall); nFaces 7968; startFace 211440; } ) 检查文件边界名称分别为：INLET、OUTLET以及WALL。这些是我们在ICEM CFD中定义的Part名称。此文件不需要修改。 设置p文件与U文件 0文件夹中包含有p文件和U文件。 先利用命令打开p文件，删除一些没用的边界，修改其内容为： FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type zeroGradient; } OUTLET { type fixedValue; value uniform 0; } WALL { type zeroGradient; } } 再打开U文件，修改其内容为： FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { INLET { type fixedValue; value uniform (0.1 0 0); } OUTLET { type zeroGradient; } WALL { type noSlip; } } 这里修改INLET边界的速度为x方向0.1 m/s。 修改transportProperties文件 此文件中设置一些常数项，本案例只需要设置运动粘度即可。 FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object transportProperties; } // * * * * * * * * * * * * * * * * * * * * * * * // nu [0 2 -1 0 0 0 0] 1e-6; 注意这里设置的是运动粘度，其量纲单位是m2/s。 设置controlDict文件 打开controlDict文件 FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * // application icoFoam; startFrom latestTime; startTime 0; stopAt endTime; endTime 20; deltaT 0.05; writeControl timeStep; writeInterval 20; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { #includeFunc residuals }  计算 回到elbow目录下，运行命令： icoFoam  也可以用并行计算： mpiexec -n 6 icoFoam 利用6个cpu进行计算。 此时可以利用命令监测残差： foamMonitor -l postProcessing/residuals/0/residuals.dat 注意：此方法是建立在已安装gnuplot的基础之上，否则是看不到残差的。我的机器上blueCFD使用此命令出错，但是在虚拟机中用OpenFOAM没有任何问题，我不清楚是gnuplot没安装好还是其他什么原因。看不到残差曲线的，将就着看输出的数据好了。 后处理 输入命令： paraFoam 软件自动启动ParaView，可观察剖面上速度分布云图，如图所示。 更多关于CFD内容，可微信扫描下方二维码关注微信公众号。 转载于:https://www.cnblogs.com/LSCAX/p/7074325.html 展开全文 • 案例演示利用OpenFOAM的icoFoam求解器计算弯曲管道中的混合流动问题。 1 拷贝tutorials文件 启动终端，且拷贝tutorials文件夹中的文件。利用命令: cp -r$FOAM_TUTORIALS/incompressible/icoFoam/elbow/ $FOAM_RUN...  本案例演示利用OpenFOAM的icoFoam求解器计算弯曲管道中的混合流动问题。 1 拷贝tutorials文件 启动终端，且拷贝tutorials文件夹中的文件。利用命令: cp -r$FOAM_TUTORIALS/incompressible/icoFoam/elbow/ $FOAM_RUN 将案例文件拷贝到了$FOAM_RUN路径中。
此时可以利用命令查看目录结构:
tree $FOAM_RUN/elbow 查询结果如下图所示。 $ tree $FOAM_RUN/elbow /home/ofuser/blueCFD/ofuser-of4/run/elbow ├── 0 │ ├── p │ └── U ├── Allclean ├── Allrun ├── constant │ └── transportProperties ├── elbow.msh └── system ├── controlDict ├── foamDataToFluentDict ├── fvSchemes └── fvSolution 3 directories, 10 files 包含三个文件夹：0、constant以及system。 2 转换网格 案例中的网格使用的是msh文件，这里要通过命令将其转化为openfoam网格。 采用命令： cd$FOAM_RUN/elbow
fluentMeshToFoam elbow.msh
如下图所示。

注：Fluent提供了众多的工具用于将外部网格文件转换为OpenFOAM网格
3 case结构
OpenFOAM的case组织结构如如所示。

包含三个基本文件夹：
0：存储物理量的初始值constant：存储网格参数、边界条件以及物理属性（如材料参数、湍流参数等）system：存储一些求解控制参数
4 设置0文件夹
本案例中0文件夹中包含两个文件：p文件与U文件，分别设置初始时刻的压力与速度。
4.1 修改p文件
利用文本编辑器打开p文件。在blueCFD中可以使用命令(先进入0目录，然后用nano打开p文件)：
cd 0
nano p
注意：在不同的linux系统中可以使用不同的文本编辑器，如在ubuntu系统中，可以使用gedit、nano或vi
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
version     2.0;
format      ascii;
class       volScalarField;
object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];
internalField   uniform 0;
boundaryField
{
wall-4
{
}

velocity-inlet-5
{
}

velocity-inlet-6
{
}

pressure-outlet-7
{
type            fixedValue;
value           uniform 0;
}

wall-8
{
}

frontAndBackPlanes
{
type            empty;
}
}

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

文件内容：
关于OpenFOAM中的边界类型：
4.2 U文件
U文件中指定边界速度值。利用文本编辑器打开U文件。
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
version     2.0;
format      ascii;
class       volVectorField;
object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField   uniform (0 0 0);

boundaryField
{
wall-4
{
type            noSlip;
}

velocity-inlet-5
{
type            fixedValue;
value           uniform (1 0 0);
}

velocity-inlet-6
{
type            fixedValue;
value           uniform (0 3 0);
}

pressure-outlet-7
{
}

wall-8
{
type            noSlip;
}

frontAndBackPlanes
{
type            empty;
}
}

// ************************************************************************* //
文件中指定边界velocity-inlet-5的速度为x方向1m/s，velocity-inlet-6边界速度为y方向3m/s。
本案例中U文件不需要修改。
5 constant目录
constant目录下保存了网格数据与物性参数等。
├── polyMesh
│   ├── boundary
│   ├── cellZones
│   ├── faces
│   ├── faceZones
│   ├── neighbour
│   ├── owner
│   ├── points
│   └── pointZones
└── transportProperties

1 directory, 9 files
本案例中的网格来自于外部转化，因此不需要修改polyMesh文件夹中的内容。
transportProperties文件中存储了传输属性参数，用文本文件打开来看。
nano transportProperties
此文件的内容：
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
version     2.0;
format      ascii;
class       dictionary;
location    "constant";
object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

nu              [0 2 -1 0 0 0 0] 0.01;

// ************************************************************************* //
此文件中只是定义了粘度为0.01 m2/s。在不可压缩流动中，只需要定义此参数。
6 system目录
system目录下包含四个文件。
.
├── controlDict
├── foamDataToFluentDict
├── fvSchemes
└── fvSolution

0 directories, 4 files

fvShceme：该文件中定义了求解过程中所采用的各种离散格式。fvSolution：该文件包含压力速度耦合方法、用于求解差分量的数值方法，以及收敛残差等。controlDict：此文件中定义了各种求解控制参数，如时间步长、文件保存间隔等。foamDataToFluentDict：此文件只有当使用了fluentMeshToFoam命令才会出现，一般情况下不用修改。
本案例需要关注的是文件controlDict。用文本文件打开此文件，修改endTime为75。其他参数保持默认。
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
version     2.0;
format      ascii;
class       dictionary;
location    "system";
object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application     icoFoam;

startFrom       latestTime;

startTime       0;

stopAt          endTime;

endTime         75;

deltaT          0.05;

writeControl    timeStep;

writeInterval   20;

purgeWrite      0;

writeFormat     ascii;

writePrecision  6;

writeCompression off;

timeFormat      general;

timePrecision   6;

runTimeModifiable true;

// ************************************************************************* //
7 求解计算
在case路径下输入命令：
icoFoam
计算自动进行，直至求解完成。
8 计算后处理
输入命令：
paraFoam
系统启动paraView进行后处理。
速度分布如图所示。

压力分布如图所示。

转载于:https://www.cnblogs.com/LSCAX/p/7074314.html
展开全文
• OpenFOAM-3.0.1自带案例讲解

千次阅读 2020-07-16 12:23:54
gas bubbles in a liquid Example Problem: bubbleColumnclassic bubble column problem with an inlet and outlet for the foam and bubbles and two walls. buoyantFoam Transient Solver for buoyant, turbulent...


转载自：http://www.cnblogs.com/fortran/articles/1996927.html
boundaryFoam
Steady-state solver for 1D turbulent flow,typically to generate boundary layer conditions at an inlet, for use in a simulation

Example Problems:

boundaryLaunderSharma model which has the ability to in model cases and predict by-pass transition, using the Launder equations.
boundaryWallFunctions solves a 1D turbulent model with two walls and one cyclic boundaries.

bubbleFoam
Solver for a system of two incompressible fluid phases with one phase dispersed, e.g. gas bubbles in a liquid

Example Problem:

bubbleColumnclassic bubble column problem with an inlet and outlet for the foam and bubbles and two walls.

buoyantFoam
Transient Solver for buoyant, turbulent flow of compressible fluids for ventilation and heat-transfer

Example Problem:

hotRoom 3D environment with one inlet, the "floor", which the user can make any temperature and watch the thermal effects. i.e., thermal plume emanating from a 600 degree source on the floor

buoyantSimpleFoam
Steady-state solver for buoyant, turbulent flow of compressible fluids for ventilation and heat-transfer

Example Problem:

hotRoom same as the first hot room, however this solver is steady state, showing a longer process, rather than transient.

Steady-state solver for buoyant, turbulent flow of compressible fluids with radiation, for ventilation and heat-transfer

Example Problem:

hotRadiationRoom a much finer mesh room than the previous two hotRoom cases, along with an elevated heating source, radiation

channelOodles
Incompressible LES solver for flow in a channel

Example Problem:

channel395 solves for channel flow, with several cyclic patches and only two top and bottom walls. Able to keep the mass flow rate in the channel constant, by calculating the velocity at each step, takes a long time to run.

chtMultiRegionFoam
Solver that couples conjugate heat transfer in a solid to a buoyancy-driven flow simulation

Example Problem:

multiRegionHeater same as the hotRoom example problems, however this has multiple sources for heat, not just one

compressibleLesInterFoam
Solver for 2 compressible, isothermal immiscible fluids using a volume of fluid (VOF) phase-fraction based interface capturing approach, with LES

Example Problems:

depthCharge2D modeled on a scale, a charge is blown in the mixture and the turbulence is modeled in a 2D environment based off the run time and a single momentum equation

depthCharge3D same thing as the first, but in a 3D environment.

coodles
Coodles is a generic single-phase compressible LES solver

Example Problem:

pitzDaily a simple 2D compression, inlet turbulence case with propane for the fluid, with an applicable mesh

dieselFoam
Diesel spray and combustion code

Example Problem:

aachenBomb block filled with air, a diesel injector is placed on the top center of the block and n-Heptane is injected, evaporates and combusts

dnsFoam
Direct numerical simulation solver for boxes of isotropic turbulence

Example Problem:

boxTurb16 a box made up of six cyclic patches to model isotropic turbulence

electrostaticFoam
Solver for electrostatics

Example Problem:

chargedWire an electrostatic solver with user input values for the electric field strength

engineFoam
Solver for internal combustion engines

Example Problem:

kivaTest a very complex mesh of a combustion engine of a cylinder four pistons

financialFoam
Solves the Black-Scholes equation to price commodities

Example Problem:

europeanCall gives the price C of the trading cost S, the mesh is 1D

gnemdFoam
General purpose molecular dynamics solver to simulate atoms in arbitrary shaped domains and average atomic/molecular quantities to the mesh to create field data

Example Problems:

constrictedChannel demonstrates multiple species, tethered molecules, field plots and the flexibility offered by molConfig

nanoNozzle a channel with a complex shape of solid walls, where a section of neon is driven along with mixes of argon, used to demonstrate molecule demonstration

icoDyMFoam
Transient solver for incompressible, laminar flow of Newtonian fluids with dynamic mesh

Example Problem:

movingCone a dynamic moving mesh that the user can manipulate to produce desired outcome, simplest moving mesh

icoFoam
Transient solver for incompressible, laminar flow of Newtonian fluids

Example Problems:

cavity enclosed square flow field with one moving boundary

cavityClipped the same cavity, but a square of length of 0.04 m is removed from the bottom right of the cavity

cavityGrade same as the cavity mesh, however there are now four individual blocks in the cavity

elbow models the same simulation as the cavity cases, however it is not the traditional block mesh, but bent into an elbow

interDyMFoam
Solver for 2 incompressible fluids, which captures the interface using a VOF method with optional mesh motion

Example Problems:

damBreakWithObstacle a wall of water falls, and crashes into an obstacle inside a 3D environment

sloshingTank2D a 2D environment that creates sloshing water to simulate crashing and oscillating waves

sloshingTank2D3DoF Couldn't find anything

sloshingTank3D a 3D environment that created sloshing water to simulate crashing and oscillating waves
sloshingTank3D3DoF Couldn't find anything

sloshingTank3D6DoF Couldn't find anything

interFoam
Solver for 2 incompressible fluids, which captures the interface using a VOF method

Example Promblem:

damBreak simulation of a breaking wall, the water runs into an object and is projected around the 2D environment, modeled from user defined time steps

laplacianFoam
Solves a simple Laplace equation, e.g. for thermal diffusion in a solid

Example Problem:

flange a complex mesh of a flange, shows thermal diffusion through the solid

lesCavitatingFoam
Transient cavitation code with LES turbulence

Example Problems:

throttle a 2D mesh consisting of two main chambers and a small connecting tube, from the tube there is a thrusting source

throttle3D same case as seen in 3D

lesInterFoam
Solver for 2 incompressible fluids capturing the interface. Turbulence is modeled using a runtime selectable incompressible LES model

Example Problem:

nozzleFlow2D a nozzle is inserted into the bottom left of a wedge container, pouring in a liquid, very applicable but runs slower than rasInterFoam

mdEquilibrationFoam
Solver that equilibrates and/or preconditions molecular dynamics systems

Example Problem:

periodicCube a cubic domain with a periodic boundary in each direction, there is a lattice of molecules, each in a block, heated to a target temperature

mhdFoam
Solver for magnetohydrodynamics (MHD): incompressible, laminar flow of a conducting fluid under the influence of a magnetic field

Example Problem:

hartmann this solves the coupled Maxwell-Navier-Stokes equations for an incompressible fluid, with a presumed constant electrical conductivity

MRFSimpleFoam
Steady state solver for incompressible turbulent flow with Multiple Reference Frames regions

Example Problem:

mixerVessel2D a 2D rotator or impellor working in a constant flow, can work at any RPM

multiphaseInterFoam
Solver for an arbitrary number of incompressible immiscible fluids, capturing the multiple interfaces using a VOF method

Example Problem:

damBreak4phase same as the damBreak case, however this case contains different fluids at different levels in the mesh

damBreak4phaseFine same, just with a finer mesh for greater resolution

nonNewtonianIcoFoam
Transient solver for incompressible, laminar flow of non-Newtonian fluids

Example Problem:

offsetCylinder same as the icoFoam tutorial, however in the mesh there is a cylinder, and it is made to investigate laminar flow around the cylinder

oodles
Incompressible LES solver

Example Problems:

pitzDaily same as the coodles case with a very fine mesh, 244k cells. So it runs very slowly

pitzDailyDirectMapped the same as the pitzDaily case with a longer inlet, the mesh is still composed of mainly walls

potentialFoam
Simple potential flow solver which can be used to generate starting fields for full Navier-Stokes codes

Example Problems:

cylinder non-orthogonal mesh, investigate potential flow around a cylinder

pitzDaily same as the other pitzDaily examples however, this case considers the Navier-Stokes equations and can be any fluid

rasCavitatingFoam
Transient cavitation code with RAS turbulence

Example Problem:

throttle same thruster problem just as in lesCavitatingFoam, however, it doesn't use LES turbulence for the thrust

rasInterFoam
Solver for 2 incompressible fluids capturing the interface. Turbulence is modeled using a runtime selectable incompressible RAS model

Example Problem:

damBreak same as the other damBreak cases, however this has a RAS liquid, therefore the turbulence isn't as great from the other cases

rhoCentralFoam
Density-based compressible flow solver based on central-upwind schemes

Example Problems:

biconic25-55Run35 a rather simple mesh made for thermodynamics, with an and a field stream, this case contains a "perfect gas"

forwardStep a flow of Mach 3 at an inlet to a rectangular geometry with a step near the inlet region that generates shock waves, can generate a supersonic flow

obliqueShock 2D aerodynamic test problem, there is a supersonic inlet into the simple rectangular mesh, made to represent the reflection of an oblique shock, such as a plane going mach

shockTube traditional shock tube problem, a 2D environment in which a shock wave is produced and the high-pressure and temperature gasses are shown

wedge15Ma5 very similar to the oblique shock case, however the meshes bottom right side has been cut out, the supersonic inlet has now been moved to the vertex of the cut

rhoPimpleFoam
Transient solver for turbulent flow of compressible fluids for ventilation and heat-transfer

Example Problem:

angledDuct a simple mesh of a duct that is bent at an angle, gas is thrust through the inlet and makes its way to the outlet while heating the mesh as well

rhoPorousSimpleFoam
Steady-state solver for turbulent flow of compressible fluids with implicit or explicit porosity treatment

Example Problems:

angledDuctExplicit duct with a rectangular cross section with a sharp 45_ bend at the center. The porous media is added where the duct is bending and it goes halfway up the angled duct

angledDuctImplicit same as the other solver, the difference is the porosity of examples, this example has a finer mesh, and therefore is far more robust

rhopSonicFoam
Pressure-density-based compressible flow solver

Example Problems:

shockTube a one dimensional unsteady case where a discontinuity, normally in pressure, is introduced in the middle of the domain

wedge15Ma5 same as the first wedge case, without the upward scheme, as the solver is also pressure based

rhoSonicFoam
Density-based compressible flow solver

Example Problems:

forwardStep same as the first forward step without the applied upward scheme

shockTube same tube and solver again, however this one is neither pressure or central-upwind scheme based

rhoTurbFoam
Transient solver for compressible, turbulent flow

Example Problem:

cavity the same as the icoFoam case however this isn't a laminar flow, as well the lid is no longer the transient side but the back wall

rhoTurbTwinParcelFoam
Transient solver for compressible, turbulent flow with two thermo-clouds

Example Problem:

simplifiedSiwek multiregion lagrangian clouds, in a squar 2D mesh with a long inlet in the top left corner, shows turbulent flow into compression of the gas

scalarTransportFoam
Solves a transport equation for a passive scalar

Example Problem:

pitzDaily scalar transport, swirl test: non-uniform initial field, using field algebra

settlingFoam
Solver for 2 incompressible fluids for simulating the settling of the dispersed phase

Example Problems:

dahl a very fine 2D mesh in which two 2 fluids are released, one one from the top and the other from the bottom, they then settle together

tank3D Couldn't find anything

simpleFoam
Steady-state solver for incompressible, turbulent flow of non-Newtonian fluids

Example Problems:

airFoil2D a 2D airfoil in a large square mesh, that is put into the flow of turbulent non-Newtonian fluids

pitzDaily same as all the others, however this version has a turbulent flow

pitzDailyExptInlet same thing with a different inlet

simpleSRFFoam

Example Problem:

mixer a large 3D rotor, can be applied in many different ways

snappyHexMesh
Automatic meshing tool

Example Problems:

iglooWithFridges exactly as advertised, an igloo with 2 fridges in it, simply used to show how the tool works

motorBike once again, simply here to show how the tool works

solidDisplacementFoam
Transient segregated finite-volume solver of linear-elastic, small-strain deformation of a solid body, with optional thermal diffusion and thermal stresses

Example Problem:

plateHole a square mesh with a quarter circle cut out of the bottom left corner, pressure is applied to the plate for stress analysis

solidEquilibriumDisplacementFoam
Steady-state segregated finite-volume solver of linear-elastic, small-strain deformation of a solid body

Example Problem:

beamEndLoad a rectangular beam is strained, testing the elastic properties of the material, as well stress is shown in the beam

sonicFoam
Transient solver for trans-sonic/supersonic, laminar flow of a compressible gas.

Example Problems:

forwardStep same as the other forwardStep problems, however this contains a laminar flow rather than turbo

shockTube another version of a shock tube problem with a laminar flow and compressible gas

sonicLiquidFoam
Transient solver for trans-sonic/supersonic, laminar flow of a compressible liquid

Example Problem:

decompressionTank a simple tank under high pressure becomes decompressed by a nozzle inserted in the side of the tank

sonicTurbFoam
Transient solver for trans-sonic/supersonic, turbulent flow of a compressible gas

Example Problems:

nacaAirfoil a supersonic flow around a 2D NACA airfoil

prism a supersonic flow blown around a 2D prism

turbFoam
Transient solver for incompressible, turbulent flow

Example Problem:

cavity same as the last cavity case, however it contains incompressible gas

twoPhaseEulerFoam
Solver for a system of 2 incompressible fluid phases with one phase dispersed, e.g. gas bubbles in a liquid

Example Problems:

bed couldn't find anything

bed2 couldn't find anything

bubbleColumn couldn't find anything

XiFoam
Compressible premixed/partially-premixed combustion solver with turbulence modeling

Example Problem:

moriyoshiHomogeneous couldn't find anything

Xoodles
Compressible premixed/partially-premixed combustion solver with large-eddy simulation (LES) turbulence modeling

Example Problems:

pitzDaily couldn't find anything

pitzDaily3D couldn't find anything

转载于:https://www.cnblogs.com/liusuanyatong/p/11259761.html


展开全文
• 结合使用PFC3D和OpenFOAM进行流体-颗粒相互作用建模。 参见： : 该存储库包含有关通过将基于OpenFOAM的CFD求解器与PFC3D耦合来解决流体-粒子相互作用问题的信息。 OpenFOAM是一个用于连续力学问题数值分析的开源C...
• 请注意，这不是PyFOAM，它是用于运行OpenFOAM案例的自动化工具。 您在该存储库中看到的是OpenFOAM ，它调用Python函数和类进行原位数据分析。 出于各种原因，您可能会将计算任务的一部分转移到Python（主要是使用...
• 近期不少留言说OpenFOAM不容易安装，今天来谈谈如何在Linux下利用Docker安装OpenFOAM。 Linux发行版众多，估计有几百种，比较流行的是三个派系： RHEL系。比较出名的发行版像Red Hat Enterprise、CentOS、Fedora等 ...

“工欲善其事必先利其器”，软件装不上，讲再多的使用技巧也是白搭。近期不少留言说OpenFOAM不容易安装，今天来谈谈如何在Linux下利用Docker安装OpenFOAM。
Linux发行版众多，估计有几百种，比较流行的是三个派系：
RHEL系。比较出名的发行版像Red Hat Enterprise、CentOS、Fedora等SuSE系。像OpenSUSE等Debian系。流行的如Ubuntu、Linux Mint等
OpenFOAM对于Ubuntu专门提供了安装方式，利用apt-get方法快速的安装。不过对于其他的linux发行版，则没那么方便了，下面的方法主要针对ubuntu以外的linux系统，不过也同样适用于ubuntu。
本文采用的是Docker方式安装OpenFOAM，其实也可以利用源代码编译的方式安装，不过编译过程耗时较长。
以下内容以CentOS为基础进行解说，其他发行版并未经过测试。
1 安装前的准备工作
确保自己使用的Linux内核足够新。在终端中输入命令查看操作系统内核版本号：
uname -r
至少保证内核版本高于3.10。如下图所示，此操作系统内核版本为3.10，满足安装要求。
注意：确保网络畅通。

2 安装Docker
Docker是一个开源的应用容器引擎，让开发者可以打包他们的应用以及依赖包到一个可移植的容器中，然后发布到任何流行的 Linux 机器上，也可以实现虚拟化。容器是完全使用沙箱机制，相互之间不会有任何接口。关于Docker，可以自己上网搜索。
2.1 RHEL、CentOS及Fedora
输入命令更新源：
sudo yum -y update（在RHEL及CentOS上）
sudo dnf -y update（在Fedora上）
输入一下命令安装Docker：
curl -fsSL https://get.docker.com/ | sh
sudo systemctl enable docker.service
sudo systemctl start docker
第一条命令安装过程会持续很久，视网速而定，需要耐心等待。
2.2 SLES以及openSuSE
在SLES发行版上，要先输入：
sudo SUSEConnect -p sle-module-containers/12/x86_64 -r ''
之后输入（SLES及openSuSE上）：
sudo zypper -n in docker
sudo systemctl start docker
sudo systemctl enable docker
2.3 Debian
输入命令：
sudo apt-get -y update
curl -fsSL https://get.docker.com/ | sh
3 配置Docker
输入命令将用户添加到Docker中。
sudo usermod -aG docker $(whoami) 4 安装openfoam4-linux 输入命令： sudo sh -c "wget http://dl.openfoam.org/docker/openfoam4-linux -O /usr/bin/openfoam4-linux" sudo chmod 755 /usr/bin/openfoam4-linux 5 运行openfoam4-linux 输入命令： mkdir -p$HOME/OpenFOAM/${USER}-4.1 cd$HOME/OpenFOAM/${USER}-4.1 openfoam4-linux 最后一个命令因为要连接docker，如果网速非常慢可能会出错，多试几次。连接成功后会下载文件，好几百兆的文件，可能会持续很久。 出现如下图所示情况后，耐心等待吧，几百兆的文件估计要下载很久很久（建议爬墙，否则会很慢）。 6 测试OpenFOAM 当所有的文件都下载完毕后，终端会自动进行解压。 解压完毕后会自动启动Docker，此时可以在里面运行OpenFOAM。 依次输入以下命令： cd$FOAM_RUN
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily . cd pitzDaily blockMesh simpleFoam paraFoam 如下图所示。 计算结果如图所示。 若要关闭docker，则可以使用命令： exit 关闭后若要再次启动Docker，可使用命令： service docker start cd$HOME/OpenFOAM/${USER}-4.1 openfoam4-linux 启动Docker后就可以使用OpenFOAM的各种功能了。 更多关于CFD内容，可微信扫描下方二维码关注微信公众号。 转载于:https://www.cnblogs.com/LSCAX/p/7074326.html 展开全文 • 请注意，这不是PyFOAM，它是用于运行OpenFOAM案例的自动化工具。 PythonFOAM：使用OpenFOAM和Python进行现场数据分析使用Python模块通过OpenFOAM 8进行现场数据分析。请注意，这不是PyFOAM，它是用于运行OpenFOAM... • 运用于经典而强大OPENFOAM平台的流固耦合流代码。推荐给所有涉及冲刷，越岸侵蚀模拟等的问题学习者使用。 • 不止一次听到有人抱怨OpenFOAM的学习极为陡峭(网络上、公众号后台中经常碰到)。有人说冲着OpenFOAM的免费Download而来，结果想要用上它却花费了巨量的时间成本，在使用过程中遇到了新的问题依然是一筹莫展。今天就站... • 粒子演示 有限尺寸的颗粒 碰撞 取决于位置的阻力或用户特定的力 ...案例 一维案例 只是一个区间和仅在 x 方向上具有速度的粒子。 公元前 区间的末端以墙为界 周期BC 模拟是周期性的 3D盒子 墙壁有界框 期刊盒 • OpenFOAM-4.x-version-4.0.tar.gz(OpenFOAM的源代码)ThirdParty-4.x-version-4.0.tar.gz(一些第三方软件的源代码)解压后分别重命名为OpenFOAM-4.0和ThirdParty-4.0，放在家目录下的OpenFOAM目录下。在.bashrc文件中... • 要求：具有C++11支持和OpenFOAM v6的g++ 。 其他编译器未经测试，但可以正常工作。 第1步，按照官方安装OpenFOAM v6。 之后进行测试以确保安装正常（例如，通过运行一些串行和并行教程案例）。 第2步，无论是在... • 案例中实现对管道入口的速度进行扰动，观察管道内的压力分布、速度分布等，主要考察动态链接库的使用以及自我定义边界条件的写法 • 修改了 OpenFOAM 的 kEpsilon 湍流模型，它使用 fvOptions 添加源项。 安装 克隆并移动到此存储库，然后运行wmake libso ： cd$WM_PROJECT_USER_DIR git clone ...
• 官方网站上的openfoam的圆柱绕流算例
• 同时，此存储库仍以从FreeCAD几何体为高级用户准备实际案例文件为目标，这也意味着用户需要在生产环境中调整OpenFOAM案例文件。 即使同意，CSIR fork的功能也没有从CfdOF仓库中获取。 CfdOF具有不同的GPL许可证。 ...
• OpenFOAM：求解器和案例 使用 OpenFOAM 工具箱制作的求解器和案例（一些用于我的硕士论文） 使用 GitHub 进行版本控制使我能够跟踪使用 OpenFOAM 开发求解器的进度。 目标是在考虑温度相关粘度的情况下模拟 PCM。 第...
• 它是与OpenFOAM一起分发的compressibleInterFoam求解器的修改。 当前，模拟对于典型的工业用途来说是非常不便的，但是由于可以定制，因此对研究很有帮助。 入门： 需要才能运行代码。 在solver目录中运行./...
• OpenFOAM-AhmedBody 视频： : 这个例子展示了如何 在 SALOME 中创建边界 在 SALOME 中创建网格 从 SALOME 导出网格并导入到 OpenFOAMOpenFOAM 中运行案例
• openFoam是一款开源CFD平台，本资源适合初学OF的CFD研究人员
• 通过更多解决方案策略在OpenFOAM中扩展GAMG求解器的功能 根据添加F和V周期 如何使用： 进入根目录并使用以下命令：wmake libso（需要OpenFOAM v8环境） 在所需案例的ControlDict中添加库“ libGAMGnew.so”，如下...
• OpenFOAM照比商业软件如Fluent Star-CCM...而我不具备这种能力，只能通过一个一个的案例来学习，也希望对其他OpenFOAM新手提供一些帮助。 在OpenFOAM 的用户手册中，第一个案例就是Cavity，翻译过来就是腔。 ...
• OpenFOAM的圆柱绕流算例记录

千次阅读 2021-09-08 20:13:33
圆柱绕流是流体力学里最经典的算例之一，受到众多学者的“喜爱...这次做Re=200时的圆柱绕流算例，画网格用ICEM，CFD软件用开源软件OpenFOAM，后处理用tecplot。 1. 前处理：画网格 用ICEM画网格。圆柱直径D=1m，计算
• openfoam中处理旋转体的方法主要包括两种方法：滑移网格法和多重参考系方法，在滑移网格方法中主要采用的为任意网格界面法（AMI），多重参考系方法则是通过设定多重参考系区域，该区域包括将旋转体包括在内部，集体...
• 1 明确目标——为啥费老大劲儿学习OpenFOAM 学习OpenFOAM主要出于课题需要，希望实现以下几个目标： l 【 】学会用SnappyHexMesh生成高质量网格； l 【 】学习使用OpenFOAM自带的 Immersed Boundary Method （IBM...
• OpenFoam导入gmesh二维网格

千次阅读 2019-01-16 10:44:58
以下所有翻译自上链接，...OpenFoam版本2.3.0 gmesh版本4.1.0 （OpenFoam师兄祖传代码比较老，没空升级，先试着再说。） 创建本教程是为了说明如何使用GMSH开源网格生成器为OpenFOAM生成2D网格。 默认情况下，...

...