From 116309c27870e10412a9367a61dcadcd6c72e4d9 Mon Sep 17 00:00:00 2001 From: EleHa Date: Sun, 4 Apr 2021 14:01:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=A4=E9=A2=8665=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\257\221\347\253\240\350\212\202\350\256\244\351\242\206.md" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\347\277\273\350\257\221\347\253\240\350\212\202\350\256\244\351\242\206.md" "b/\347\277\273\350\257\221\347\253\240\350\212\202\350\256\244\351\242\206.md" index 3511f86..c975ea2 100644 --- "a/\347\277\273\350\257\221\347\253\240\350\212\202\350\256\244\351\242\206.md" +++ "b/\347\277\273\350\257\221\347\253\240\350\212\202\350\256\244\351\242\206.md" @@ -77,7 +77,7 @@ ### 62 **Some theory behind the scenes of LES 357** wangyang ### 63 **The use of phi 362** wangyang ### 64 **Derivation of the IATE diameter model 365** -### 65 **Derivation of the MRF approach 376** +### 65 Derivation of the MRF approach 376. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . EleHa ## X Appendix 381 ### 66 **Useful Linux commands 381 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xfygogo ### 67 **Archive data 386 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xfygogo -- Gitee From 99bd15c8e69283870982d3e1e96ba9b9cd1679d2 Mon Sep 17 00:00:00 2001 From: EleHa Date: Sun, 4 Apr 2021 14:01:58 +0800 Subject: [PATCH 2/2] Complete Section 35 --- 35.Eulerian_multiphase_modelling.md | 520 ++++++++++------------------ 1 file changed, 185 insertions(+), 335 deletions(-) diff --git a/35.Eulerian_multiphase_modelling.md b/35.Eulerian_multiphase_modelling.md index fecc652..9e53f39 100644 --- a/35.Eulerian_multiphase_modelling.md +++ b/35.Eulerian_multiphase_modelling.md @@ -1,79 +1,48 @@ -### 35 Eulerian multiphase modelling +### 35 欧拉多相流模型 -In Eulerian two-phase modelling both phases are considered continua even though one phase might consist of -dispersed phase elements (DPEs) such as bubbles, drops or particles. In these simulations the two phases can -be distinguished into a continuous phase and a dispersed phase. This naming scheme refers to the physical -situation. Within the (Eulerian) mathematical description, however, both phases are continua. +在欧拉二相流模型中,尽管其中一相可能由分散相元素(如气泡、液滴或颗粒等)组成,这两相仍均被看成是连续的。在该类模拟中,这两相可被区分为连续相和分散相。这些名称表示其物理状态。然而,在(欧拉)数学描述中,两相皆是连续的。 -As two momentum equations are solved (one per phase), each phase has its own velocity field. However, -there is only one pressure field. Thus, the pressure is the same for both phases; this also applies to the VOF -method. Due to the fact that two continuity[^99] and two momentum equations are solved, this approach is often -referred to as two fluid model. +求解两个动量方程时(每相一个方程),每个相都有自己的速度场。但是,仅存在一个压力场,因此两相压力相同;该规则同样适用于VOF方法。由于须求解两个连续性方程[^99]和两个动量方程,该方法通常被称为*双流体模型*。 -The Eulerian description of multi-phase flow is not limited to two phases, however, for reasons of simplicity, -we limit ourselves to the case of two phases. +多相流的欧拉描述并不局限于两相流,但是,为简单起见,仅对两相流的情况进行讨论。 ![图像89a](images/fig89a.png)\ -(a) Discrete bubbles in a continuous liquid. +(a) 连续液体中的分散气泡。 ![图像89b](images/fig89b.png)\ -(b) Continuum approach. +(b) 连续介质法。 -Figure 89: Modelling approach on the example of a gas-liquid two-phase system. +图像89:建模方法,以气液两相系统为例。 -As the DPEs are considered to be a continuous phase, their properties are averaged over each cell of the -computational domain. Thus, the properties of the dispersed phase are the mean properties of the dispersed -matter. If all DPEs have equal properties (e.g. diameter, density, etc.), then the dispersed phase is referred to as -being mono-disperse. Only in the case of mono-dispersity, the averaging over the cells introduces no additional -errors. If the DPEs have variable properties (e.g. a diameter range), then the dispersed phase is referred to as -being poly-disperse. The correct handling of poly-dispersity requires additional considerations on the models. +由于分散相元素被看作连续相,其性质取计算域内每个单元的平均值。因此,分散相的性质是分散物质的平均性质。如果所有分散相元素均具有相同的性质(如直径、密度等),则该分散相称为*单分散相*。仅在单分散性的情况下,对单元取平均不会引入额外误差。如果分散相元素性质是变化的(如存在一个直径范围),则该分散相称为*多分散相*。为正确处理多分散性,须对模型进行额外的考虑。 -#### 35.1 Phase model class +#### 35.1 相模型类 -One of the strenghts of object oriented programming is that the class structure in the source code can reflect -the properties and relations of real-world things. +面向对象程序设计的其中一个优势是,源代码中的类结构能反映现实世界事物的性质和关系。 -The phase model class in the various two- and multi-phase solvers of OpenFOAM is one example of how -techniques of object oriented programming can be applied. In terms of a multi-phase problem in fluid dynamics -we distinguish different phases. +OpenFOAM中各种二相流求解器和多相流求解器的相模型类,即是面向对象程序设计技术的一个应用实例。对于流体力学中的多相问题,我们区分了不同的相。 -We now violate the unwritten law of to not cite *Wikipedia*[Citation needed]. +此处违反了不引用*Wikipedia*的不成文规则。 ->Phase (matter), a physically distinctive form of a substance, such as the solid, liquid, and gaseous states of ordinary matter—also referred to as a "macroscopic state" - +>*相(物质)是一种物理上独特的物质形态,例如普通物质的固态、液态和气态,也被称为“宏观状态”。* -In fluid dynamics phase is a commonly used term. When we intend our code to represent the reality we want -to describe as closely as possible we need to introduce the concept of the phase into our source code. From a -programming point of view properties of a phase – such as viscosity, velocity, etc. – are easy to implement. The -viscosity of a phase is simply a field of values, velocity is another field of values. +在流体力学中,相是一个常用术语。当我们希望代码能够尽可能相近地描述现实时,须将相的概念引入到源代码中。从程序设计的角度来看,相的性质(如粘度、速度等)是很容易实现的。相的粘度无非是一个场量,速度则是另一个场量。 -Object orientation allows us to translate the idea of the phase into programming language. The basic idea -is that a phase has a viscosity, it also has a velocity. We now create a class named phaseModel and this class -needs to have a viscosity, a velocity and everthing else a phase needs to fit our needs. +面向对象的方法允许将相的概念转化为编程语言。其基本思路是,相具有粘度,也具有速度。我们现在创建一个名为`phaseModel`的类,为符合需要,该类须具有粘度、速度以及相所需的其他一切。 -The phase model classes follow the code of best practice in object oriented programming to hide internal -data from the outer world and to provide access via the classes methods (data encapsulation, see ). +相模型类遵循面向对象程序设计的最佳实践准则:隐藏内部数据,并通过类方法提供访问途径(数据封装,见)。 -**No phases, please** +**不使用相** -In the single-phase solvers of OpenFOAM – such as *simpleFoam* – the concept of a phase is not used. As there -is only one temperature and velocity to deal with, the concept of phases is not needed. In the single-phase -solvers the phase-properties (viscosity, velocity, density, etc.) are linked according to the physical relations that -are taken into account, but the concept of a phase is missing. +OpenFOAM单相求解器(如*simpleFoam*)并不使用相的概念。由于仅须处理一套温度场和速度场,因此相的概念是不需要的。在单相求解器中,相的性质(粘度、速度、密度等)通过考虑的物理关系相互关联,但相的概念是缺失的。 -##### 35.1.1 A comparison of the phase models in OpenFOAM-2.2 +##### 35.1.1 OpenFOAM-2.2中相模型的对比 -In this section we want to compare the implementation of the phase model class of the two solvers twoPhaseEuler- -Foam and multiphaseEulerFoam. +本节中,我们将对*twoPhaseEulerFoam*和*multiphaseEulerFoam*这两个求解器中相模型类的实现进行比较。 ***twoPhaseEulerFoam*** -The phase model class in twoPhaseEulerFoam-2.2.x collects the properties of a phase and offers an interface -for accessing these properties. Listing 225 shows the essence of the header file of the phase model class. The -listing is syntactically correct, however all pre-processor instruction (e.g. the #include statements) have been -removed. Furthermore, most of the comments have been removed and the formatting has been adapted to -reduce the line number. The purpose of Listing 225 is to present the data members and methods of the class -by actual source code. +*twoPhaseEulerFoam*-2.2.x中的相模型类收集了相的性质,并提供了访问这些性质的接口。清单225展示了相模型类头文件的摘要。该清单在语法上是正确的,但删除了所有预处理器指令(例如`#include`语句)。此外,为减少行数,删除了大部分注释并调整了格式。清单225的目的是通过实际源代码来展示类的数据成员和方法。 ```cpp namespace Foam @@ -82,13 +51,13 @@ namespace Foam class phaseModel { // Private data - dictionary dict_ ; - word name_ ; + dictionary dict_; + word name_; dimensionedScalar d_; dimensionedScalar nu_; - dimensionedScalar rho_ ; + dimensionedScalar rho_; volVectorField U_; - autoPtr < surfaceScalarField > phiPtr_ ; + autoPtr phiPtr_; public: // Member Functions @@ -96,49 +65,36 @@ public: const dimensionedScalar& d() const { return d_; } - const dimensionedScalar& nu () const { return nu_; } + const dimensionedScalar& nu() const { return nu_; } - const dimensionedScalar& rho () const { return rho_; } + const dimensionedScalar& rho() const { return rho_; } const volVectorField& U() const { return U_; } volVectorField& U() { return U_; } - const surfaceScalarField& phi () const { return phiPtr_(); } + const surfaceScalarField& phi() const { return phiPtr_(); } - surfaceScalarField& phi () { return phiPtr_(); } + surfaceScalarField& phi() { return phiPtr_(); } }; } // End namespace Foam ``` -Listing 225: A boiled-down version of the file phaseModel.H +清单225:`phaseModel.H`文件精简版 -The phase model class of twoPhaseEulerFoam-2.2.x contains all phase properties needed for an incompressible -two-phase solver that makes use of an important consequence of being limited to two phase problems. By -taking a look on the members of the class we see that there is no volume fraction field. In two phase problems -one volume fraction field (alpha1) suffices as the volume fraction field of the other phase is instantly known -(alpha2 = 1 - alpha1). Thus, the volume fraction can be treated seperately from other phase information. +*twoPhaseEulerFoam*-2.2.x的相模型类包含了不可压缩二相流求解器所需的所有相性质。局限于二相流问题将导致一个重要结果,该求解器则利用了该结果。查看类的成员,可见不存在体积分数场。在二相流问题中,一个体积分数场(`alpha1`)是足够的,因为另一相的体积分数场可即时得出(`alpha2 = 1 - alpha1`)。因此,可以将体积分数与其他的相信息分开处理。 -Another missing item is the pressure. Most two- or multi-phase Eulerian solvers assume/use a common -pressure for all phases. Thus, the pressure is independent of the phases and can be treated seperately. +另一缺失的项是压力。大部分二相流或多相流欧拉求解器对所有相假设或使用同一压力场。因此,压力与相无关,可单独处理。 ***multiphaseEulerFoam*** -One difference between the phase model class used in twoPhaseEulerFoam and the one used in multiphaseEuler- -Foam follows directly from the simplification made in the two-phase case. When dealing with an arbitrary -number of phases, each phase must keep track of its own volume fraction. Thus, the volume fraction must be -included into the phase model. +*twoPhaseEulerFoam*和*multiphaseEulerFoam*所使用的相模型类的一个差异直接来源于二相流情况下的简化。当要处理任意数量的相时,每个相都必须跟踪其体积分数。因此,体积分数必须包含在相模型中。 -The straight-forward way would be to add another reference to the data members. As the volume fraction -field is a scalar field, this reference would be a reference to a volScalarField. In multiphaseEulerFoam a -more subtle approach was chosen. This also presents the application of another object-oriented programming -technique. +直接方法可以是在数据成员中添加另一个引用。由于体积分数场是标量场,因此这是对一个`volScalarField`的引用。*multiphaseEulerFoam*选择了一个更巧妙的方法,展示了另一种面向对象编程技术的应用。 -The phase model class of multiphaseEulerFoam is derived from the class volScalarField. Thus, the phase -model class is among other things its own the volume fraction field. +*multiphaseEulerFoam*的相模型类派生自`volScalarField`类。因此,除去其他方面不谈,相模型类其本身还是体积分数场。 -Listing 226 shows a stripped version of the header file of multiphaseEulerFoam’s phase model class. Again, -large parts of the file have been removed leaving only the data members and the methods of the class. +清单226展示了*multiphaseEulerFoam*相模型类头文件的精简版。同样,删除了文件的大部分内容,仅保留类的数据成员和方法。 ```cpp namespace Foam @@ -149,17 +105,17 @@ class phaseModel public volScalarField { // Private data - word name_ ; - dictionary phaseDict_ ; + word name_; + dictionary phaseDict_; dimensionedScalar nu_; - dimensionedScalar kappa_ ; + dimensionedScalar kappa_; dimensionedScalar Cp_; - dimensionedScalar rho_ ; + dimensionedScalar rho_; volVectorField U_; - volVectorField DDtU_ ; - surfaceScalarField phiAlpha_ ; - autoPtr < surfaceScalarField > phiPtr_ ; - autoPtr < diameterModel > dPtr_ ; + volVectorField DDtU_; + surfaceScalarField phiAlpha_; + autoPtr phiPtr_; + autoPtr dPtr_; public : @@ -201,12 +157,9 @@ public : } // End namespace Foam ``` -Listing 226: A boiled-down version of the file `phaseModel.H` +清单226:`phaseModel.H`文件精简版 -The statements following the class keyword and the class name indicates the derivation of a class. The class -name (phaseModel) and the name of the class we are deriving from (volScalarField) are separated by a colon -(:). The name of the base class (volScalarField) is preceded by a visibility specifier (public). Here, we see a -prototype of a class definition. The class we define (phaseModel) is derived from a base class (volScalarField). +类关键字和类名后面的语句用于指示类的派生。类名(`phaseModel`)和其基类名(`volScalarField`)用冒号(:)分隔。基类名(`volScalarField`)前缀有可见性说明符(`public`)。这是一个类定义的范例。此处定义的类(`phaseModel`)派生自基类(`volScalarField`)。 ```cpp class phaseModel : public volScalarField @@ -215,81 +168,66 @@ class phaseModel : public volScalarField } ``` -This example highlights, that the class phaseModel is derived from the class volScalarField. This information -alone does no proof that the phase model is its own volume fraction field. However, a glance on the -constructor in the implementation file brings clarity. +该示例强调,`phaseModel`类派生自`volScalarField`类。仅该信息并不能证明相模型就是其本身的体积分数场。然而,看一眼实现文件中的构造函数,就很清晰了。 -In Listing 227 we see, that the first instruction in the initialisation list of the constructor reads the volume -fraction field of the respective phase. This proofes that the phase model is in fact its own volume -fraction field. For an explanation why we come to this conclusion we refer to any C++ textbook or online -resource that covers the concept of inheritance, see e.g. or [57]. +在清单227中可见,构造函数初始化列表中的第一条指令读取对应相的体积分数场。这证明相模型实际上就是它自己的体积分数场。为解释得出该结论的理由,我们尽可能多地参考了涉及继承概念的C++教科书和在线资源,例如和[57]。 ```cpp // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam :: phaseModel :: phaseModel +Foam::phaseModel::phaseModel ( - const word & name , - const dictionary & phaseDict , - const fvMesh & mesh + const word& name, + const dictionary& phaseDict, + const fvMesh& mesh ) : volScalarField ( IOobject ( - " alpha " + name , - mesh . time (). timeName () , - mesh , - IOobject :: MUST_READ , - IOobject :: AUTO_WRITE + " alpha " + name, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE ), mesh ), - name_ ( name ), + name_(name), // code continues ``` +清单227:相模型构造函数的开头数行。 -Listing 227: The first few lines of the constructor of the phase model. - -Besides being its own volume fraction field the phase model class of multiphaseEulerFoam was extended by -several fields bearing information for the simulation of thermodynamics. +除了作为其本身的体积分数场,*multiphaseEulerFoam*的相模型类还扩展了几个带有热力学模拟信息的场。 -We can also observe the rudiment of giving the phase model a more active role. The phase model class -of twoPhaseEulerFoam is simply an information carrier. The phase model of multiphaseEulerFoam features a -method named `correct()`. The `correct()` method is used in many models for actions performed at every time -step. However, in multiphaseEulerFoam-2.2.x this method is empty. +我们还可发现相模型将被赋予更重要作用的雏形。*twoPhaseEulerFoam*的相模型类只是一个信息载体。*multiphaseEulerFoam*的相模型具有一个名为`correct()`的方法。在众多模型中,`correct()`方法被用于每个时间步内执行的操作。然而,在*multiphaseEulerFoam*-2.2.x中,该方法为空。 -With OpenFOAM-2.1.0 the class diameterModel was introduced into multiphaseEulerFoam and compressibleTwoPhaseEulerFoam. -The phase model class of multiphaseEulerFoam uses a diameter model class for keeping -track of the dispersed phase’s diameter. The diameter model offers the choice of computing the diameter of -the dispersed phase elements from thermodynamic quantities besides using a constant diameter. Thus, the data -member `dimensionedScalar d_` is replaced by a reference to a diameter model (`autoPtr dPtr_`). +OpenFOAM-2.1.0之后,`diameterModel`类被引入到了*multiphaseEulerFoam*和*compressibleTwoPhaseEulerFoam*中。*multiphaseEulerFoam*的相模型使用直径模型来跟踪分散相的直径。除了使用恒定直径之外,直径模型还提供了根据热力学参数来计算分散相元素直径的选择。因此,数据成员`dimensionedScalar d_`被直径模型的引用(`autoPtr dPtr_`)所替代。 -##### 35.1.2 A comparison of the phase models in OpenFOAM-2.3 +##### 35.1.2 OpenFOAM-2.3中相模型的对比 -In this section we want to compare the implementation of the phase model class of the two solvers *twoPhaseEuler-Foam* and *multiphaseEulerFoam*. +本节将比较两个求解器*twoPhaseEulerFoam*和*multiphaseEulerFoam*中相模型类的实现。 -**A comment on multiphaseEulerFoam** +**关于*multiphaseEulerFoam*的解释** -The phase model class used for *multiphaseEulerFoam* in OpenFOAM-2.2.x and OpenFOAM-2.3.x differs very little with respect to the class’s methods and members. Listing 228 shows that the header files of the *phaseModel* class of *multiphaseEulerFoam* differs only in the copyright notice. The implementation file shows slightly greater differences[^100]. However, the behaviour of this class can be considered nearly identical in OpenFOAM-2.2.x and -OpenFOAM-2.3.x. +OpenFOAM-2.2.x和OpenFOAM-2.3.x中用于*multiphaseEulerFoam*的相模型类在类的方法和成员上相差无几。清单228显示,*multiphaseEulerFoam*中`phaseModel`类的头文件仅在版权声明上有差别。实现文件则显示出略微更大些的差异[^100]。但是,该类的行为在OpenFOAM-2.2.x和OpenFOAM-2.3.x中几乎是相同的。 ``` user@host:~/OpenFOAM$ diff - OpenFOAM -2.2.x/applications solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/ + OpenFOAM-2.2.x/applications/solvers/multiphase/multiphaseEulerFoam/phaseModel/phaseModel/ phaseModel.H - OpenFOAM -2.3.x/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/ - phaseModel / phaseModel .H + OpenFOAM-2.3.x/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/ + phaseModel/phaseModel.H 5c5 -< \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +< \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation --- -> \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation +> \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation ``` -Listing 228: The output of *diff* for the file `phaseModel.H` of the solver *multiphaseEulerFoam* of the versions OpenFOAM-2.2.x and OpenFOAM-2.3.x as of May 2014[^101]. +清单228:对于OpenFOAM-2.2.x和截至2014年5月的OpenFOAM-2.3.x版本[^101]中*multiphaseEulerFoam*求解器`phaseModel.H`文件的*diff*输出。 ***twoPhaseEulerFoam*** -The two-phase model of twoPhaseEulerFoam-2.3.x makes heavy use of abstractions. The phase model class is used in conjunction with a class for the two-phase system. +*twoPhaseEulerFoam*-2.3.x的两相流模型大量运用了抽象。相模型类与两相流系统类被结合使用。 ```cpp namespace Foam @@ -305,13 +243,13 @@ class phaseModel word name_; dictionary phaseDict_; scalar alphaMax_; - autoPtr thermo_ ; + autoPtr thermo_; volVectorField U_; surfaceScalarField alphaPhi_; surfaceScalarField alphaRhoPhi_; autoPtr phiPtr_; autoPtr dPtr_; - autoPtr > turbulence_; + autoPtr> turbulence_; public: @@ -320,14 +258,14 @@ public: const twoPhaseSystem& fluid() const { return fluid_; } - const phaseModel& otherPhase () const ; + const phaseModel& otherPhase() const; - scalar alphaMax () const { return alphaMax_; } + scalar alphaMax() const { return alphaMax_; } - tmp d() const ; + tmp d() const; const PhaseCompressibleTurbulenceModel& - turbulence() const ; + turbulence() const; PhaseCompressibleTurbulenceModel& turbulence(); @@ -344,11 +282,11 @@ public: tmp mu(const label patchi) const { return thermo_−>mu(patchi); } - tmp kappa () const { return thermo_−>kappa(); } + tmp kappa() const { return thermo_−>kappa(); } tmp Cp() const { return thermo_−>Cp(); } - const volScalarField& rho() cons t { return thermo_−>rho(); } + const volScalarField& rho() const { return thermo_−>rho(); } const volVectorField& U() const { return U_; } @@ -366,190 +304,129 @@ public: surfaceScalarField& alphaRhoPhi() { return alphaRhoPhi_; } - void correct() ; + void correct(); virtual bool read(const dictionary& phaseProperties) ; virtual bool read() { return true; } -} ; +}; } // End namespace Foam ``` -Listing 229: A boiled-down version of the file `phaseModel.H` +清单229:`phaseModel.H`文件精简版 -The data members of the phase model class in *twoPhaseEulerFoam*-2.3.x contain a reference to the two-phase -model class. This makes the phase model class aware of the other phase. The data members also contain a -reference to a turbulence model and a thermophysical model. This is up to now the greatest generalisation we -could observe in the multi-phase solvers of OpenFOAM. +*twoPhaseEulerFoam*-2.3.x中相模型类的数据成员包含对两相流模型类的引用。这使得相模型类能够获知另一相。数据成员还包含对湍流模型和热物理模型的引用。这是目前为止我们在OpenFOAM多相流求解器中观察到的最大规模的泛化。 -#### 35.2 Phase system classes -In a multiphase solver we can not only create an abstraction for the physical phase, e.g. water. We can -also create an abstraction for the multi-phase system, i.e. the entirety of the involved phases. Again, multiphaseEulerFoam -was the forerunner for this idea. Since the introduction of multiphaseEulerFoam there is a -class named multiphaseSystem. In twoPhaseEulerFoam-2.3 the class twoPhaseSystem was introduced. The -most obvious purpose of this class is the implementation of the phase continuity equation. In both solvers the -solution of the continuity equation(s) hides behind the function call fluid.solve(). +#### 35.2 相系统类 -##### 35.2.1 The class twoPhaseSystem +在多相流求解器中,我们不仅可以对物理相(例如水)进行抽象,还可以对多相流系统(即所涉及相的整体)进行抽象。同样,*multiphaseEulerFoam*是该想法的先驱。自推出*multiphaseEulerFoam*以来,便存在名为`multiphaseSystem`的类。*twoPhaseEulerFoam*-2.3则引入了`twoPhaseSystem`类。该类最明显的功能是实现相的连续性方程。在两个求解器中,连续性方程的求解都隐藏在`fluid.solve()`函数内。 -We now take a detailled look on the class twoPhaseSystem. This class was introduced with *twoPhaseEulerFoam*- -2.3 and this class seems to be a consequent continuation of ideas introduced in the class multiphaseSystem. We -focus on the class twoPhaseSystem, since the class multiphaseSystem has not really evolved from the release of -OpenFOAM-2.1 til the release of OpenFOAM-2.3. The header and the implementation file are largely identical. +##### 35.2.1 `twoPhaseSystem`类 -**Phase models** +现在,我们将对`twoPhaseSystem`类进行详细研究。该类随*twoPhaseEulerFoam*-2.3引入,似乎是`multiphaseSystem`类中引入的想法的延续。我们着重关注`twoPhaseSystem`类,因为自OpenFOAM-2.1到OpenFOAM-2.3,`multiphaseSystem`类实际上并没有发展。头文件和实现文件基本上是相同的。 -Two data members of the class are the two involved phase models phase1_ and phase2_. The class provides -methods to access this phase models. There is also a method to access the other phase. As there are only two +**相模型** -phases involved, this operation is possible. +该类中的两个数据成员为涉及的两个相模型`phase1_`和`phase2_`。该类提供访问这些相模型的方法。还有一种方法为访问另一相。由于仅涉及两个相,因此该操作是可行的。 -**Phase pair models** +**相对模型(Phase pair models)** -In order to cover all possible flow situations the momentum exchange models are defined in the case pair-wise -in a separated fashion, i.e. drag for air dispersed in water (bubbly flow) and drag for water dispersed in air -(droplet flow). +为了涵盖所有可能的流动情况,动量交换模型成对分开地进行定义,即分散在水中的空气(气泡流)所受阻力,以及分散在空气中的水(液滴流)所受阻力。 -The classes phasePair and orderedPhasePair provide an elegant way to deal with this situation. The -phase pair models are used for blending the interfacial momentum exchange models. +`phasePair`类和`orderedPhasePair`类提供了一种优雅的方式以应对该情况。这些相对模型用于将界面动量交换模型相混合。 -**Momentum exchange models** +**动量交换模型** -The class has member variables for the interfacial momentum exchange models. Listing 230 shows the members -of the class related to momentum exchange models. The templated class BlendedInterfacialModel<> provides -functionality that is needed for all momentum exchange models. As the class name suggests, the blending is -covered by this class. The template parameter of this class stands for any one of the interfacial momentum -exchange models. +该类含有界面动量交换模型的成员变量。清单230显示了该类中与动量交换模型相关的成员。模板化类`BlendedInterfacialModel<>`为所有动量交换模型提供其所需的功能。正如类名所示,该类含有混合的功能。该类的模板参数代表任一界面动量交换模型。 +```cpp + //- Drag model + autoPtr > drag_; + //- Virtual mass model + autoPtr > virtualMass_; + //- Heat transfer model + autoPtr > heatTransfer_; + //- Lift model + autoPtr > lift_; + //- Wall lubrication model + autoPtr > wallLubrication_; + //- Wall lubrication model + autoPtr > turbulentDispersion_; ``` - // - Drag model - autoPtr < BlendedInterfacialModel < dragModel > > drag_ ; - // - Virtual mass model - autoPtr < BlendedInterfacialModel < virtualMassModel > > virtualMass_ ; - // - Heat transfer model - autoPtr < BlendedInterfacialModel < heatTransferModel > > heatTransfer_ ; - // - Lift model - autoPtr < BlendedInterfacialModel < liftModel > > lift_ ; - // - Wall lubrication model - autoPtr < BlendedInterfacialModel < wallLubricationModel > > wallLubrication_ ; - // - Wall lubrication model - autoPtr < BlendedInterfacialModel < turbulentDispersionModel > > turbulentDispersion_ ; -``` -Listing 230: The declaration of the momentum exchange members of the class twoPhaseSystem in twoPhaseSystem.H +清单230:`twoPhaseSystem.H`中`twoPhaseSystem`类的动量交换成员声明 -A momentum exchange model alone is nice, but what we really need are the contribution to the momentum -equation. Thus, the class twoPhaseSystem provides methods to access the respective force terms or the respective -coefficients. We have seen this force terms and coefficients in action in Section 45.6. +仅动量交换模型本身就很棒了,但我们真正想要的是对动量方程的作用。因此,`twoPhaseSystem`类提供了各个力项或相应系数的访问方法。[45.6](./45.xx.md#456-xx)节展示了这些力项和系数的实际作用。 +```cpp + //- Return the drag coefficient + tmp dragCoeff() const; + //- Return the virtual mass coefficient + tmp virtualMassCoeff() const; + //- Return the heat transfer coefficient + tmp heatTransferCoeff() const; + //- Return the lift force + tmp liftForce() const; + //- Return the wall lubrication force + tmp wallLubricationForce() const; + //- Return the wall lubrication force + tmp turbulentDispersionForce() const; ``` - // - Return the drag coefficient - tmp < volScalarField > dragCoeff () const ; - // - Return the virtual mass coefficient - tmp < volScalarField > virtualMassCoeff () const ; - // - Return the heat transfer coefficient - tmp < volScalarField > heatTransferCoeff () const ; - // - Return the lift force - tmp < volVectorField > liftForce () const ; - // - Return the wall lubrication force - tmp < volVectorField > wallLubricationForce () const ; - // - Return the wall lubrication force - tmp < volVectorField > turbulentDispersionForce () const ; -``` +清单231:`twoPhaseSystem.H`中`twoPhaseSystem`类的动量交换系数访问方法声明 -Listing 231: The declaration of the accessing methods for the momentum exchange coefficients of the class twoPhaseSystem in twoPhaseSystem.H +##### 35.2.2 `multiphaseSystem`类 -##### 35.2.2 The class multiphaseSystem +*multiphaseEulerFoam*求解器采用`multiphaseSystem`类。该类似乎是`twoPhaseSystem`类的前身。 -The solver multiphaseEulerFoam uses the class multiphaseSystem. This class seems to be the ancestor of the -class twoPhaseSystem. +**相对(Phase pair)** -**Phase pair** +`multiphaseSystem`类声明了一个嵌套类`interfacePair`。嵌套类是在另一类中定义的类。因此,嵌套类对于外部是隐藏的[^102]。相对类用于处理表面张力和阻力。根据定义,表面张力是一组相对的性质。 -The class multiphaseSystem declares a nested class interfacePair. A nested class is a class definition within -another class. Thus, the nested class is hidden from the outside world102. -The phase pair class is used to deal with surface tension, which by definition is a property of a pair of phases, -and drag. +#### 35.3 湍流模型 -#### 35.3 Turbulence modelling +##### 35.3.1 建模策略 -##### 35.3.1 Modelling strategies +湍流模型问题可以用下列方式解决。这些方法按其预期计算成本排序。前两种方法计算成本大致相同,而后一种方法在内存和计算时间上绝对是更加昂贵的。但是,每种方法都有其优点和缺点以及适用的算例。 -The problem of turbulence modelling in multi-phase problems can be tackled in one of the following fashions. The -methods are sorted by their perceived computational cost. Whereas the first two methods may be equivalent, -the last is definitely more expensive in terms of memory and computational time. However, each of these -methods has its strengths and weaknesses, and its use cases. +**仅连续相** 该模型求解连续相的湍流特性,并假设连续相和分散相的湍流性质之间存在代数关系。湍流对分散相的影响也可以全部忽略。《Fluent理论指南》[7]中指出:[...] *当次相的浓度极小时,模型适用。在这种情况下,粒子间碰撞可忽略,次相随机运动中的主导过程是主相湍流作用。* 在Fluent中,该方法被称为*分散湍流模型(dispersed turbulence model)*。 -**Continuous phase only** This model solves computes the turbulent properties of the continuous phase and -assumes an algebraic relationship between the turbulent properties of the continuous and the dispersed -phase. The influence of turbulence on the dispersed phase can also be neglected alltogether. In the Fluent -Theory Guide [7] it is noted: [...] is the appropriate model when the concentrations of the secondary -phases are dilute. In this case, interparticle collisions are negligible and the dominant process in the -random motion of the secondary phases is the influence of the primary-phase turbulence. In Fluent this -approach is referred to as dispersed turbulence model. +**混合物** 该方法对所有相的混合物求解湍流模型,也就是说,在湍流模型中加入混合物速度和混合物密度。每个相的湍流量通过混合物和相应相的密度比计算得出。《Fluent理论指南》[7]对该模型的适用性阐述如下:[...] *当各相分离时,即对于分层(或几乎分层)的多相流,以及各相密度比接近1时,模型适用。* -**Mixture** In this approach the turbulence model is evaluated for the mixture of all phases, i.e. the mixture -velocity and mixture density are inserted into the turbulence model. The turbulent quantities of each -individual phase are computed with the density ratio between the mixture and the corresponding phase. -The applicability of this model is described in the Fluent Theory Guide [7] as follows: [...] is applicable -when phases separate, for stratified (or nearly stratified) multiphase flows, and when the density ratio -between phases is close to 1. +**分相** 在该情况下,每个相都具有其本身的湍流特性。由于对每个相都要求解额外的输运方程,因此该模型的计算量是最大的。《Fluent理论指南》[7]指出:[...] *当各相之间的湍流传递起主导作用时,模型适用。* -**Per-phase** In this case each phase has its own turbulent properties. Because there are additional transport -equations to be solved per phase, this model is the most computational intensive. The Fluent Theory -Guide [7] states: [...] is the appropriate choice when the turbulence transfer among the phases plays a -dominant role. +##### 35.3.2 在OpenFOAM中的实现 -##### 35.3.2 Implementation in OpenFOAM +[32.1](./32.Turbulence_Models.md#321-组织方式)节讨论了湍流模型在OpenFOAM中的实现框架。现在,我们将了解多相湍流和OpenFOAM湍流模型框架。 -In Section 32.1 the frameworks for implementing turbulence modelling within OpenFOAM are discussed. Now -we take a look on multi-phase turbulence and OpenFOAM’s frameworks for modelling turbulence. +旧框架(见[32.1.1](./32.Turbulence_Models.md#3211-旧组织方式)节)仅允许使用前两种所述策略,因为多相流求解器仅能采用一种湍流模型。湍流模型通常是求解器中的全局对象,网格以及运行时对象也是如此。 -The old framework, see Section 32.1.1, allow only for the first two of the described strategies, since only -one turbulence model is employed by the multiphase solvers. The turbulence model is generally a global object -within the solver, as is also the mesh or the run-time object. +新框架具有更大的灵活性。在欧拉多相流求解器中,湍流模型已被移至相模型内。因此,各相均具有其各自的湍流模型。[35.3.1](#3531-建模策略)节中所讨论的三种建模策略皆可使用。*twoPhaseEulerFoam*在新框架内的湍流模型将在[45.4](./45.xx.md#454-xx)节中进行讨论。 -The new framework allows for greater flexibility. In the Eulerian multiphase solvers, the turbulence model -has been moved to the phase model. Thus, each phase has its own turbulence model. This allows for all three -modelling strategies discussed in Section 35.3.1. The turbulence modelling employed by twoPhaseEulerFoam -within the new framework is discussed in Section 45.4. +#### 35.4 界面动量交换 -#### 35.4 Interfacial momentum exchange +动量方程右侧含有两类源项。第一项$\mathbf{F}\_{q,i}$是作用在$q$相上的力密度。第二项为力(密度)系数$K\_{qp,i}$与$q$相和$p$相之间相对速度$\mathbf{u}\_{R} = \mathbf{u}\_{p} − \mathbf{u}\_{q}$的乘积。 -On the RHS of the momentum equation there are two types of source terms. The first term $\mathbf{F}\_{q,i}$ is a force density acting on the phase $q$. The second term is a force (density) coefficient $K\_{qp,i}$ which is multiplied by the relative velocity $\mathbf{u}\_{R} = \mathbf{u}\_{p} − \mathbf{u}\_{q}$ between the phases $q$ and $p$. +OpenFOAM中,界面动量传递模型以返回力或力系数的方式进行实现[^103]。对力和力系数进行区分是为方便起见。跟速度直接成比例的项(如阻力)与跟速度间接成比例的项(如虚拟质量力,它与相对速度的时间导数成正比)在处理方式上可能有差异。直接正比于速度的项,其数值上的处理方式与其他项不同。 -The models for interfacial momentum transfer in OpenFOAM are implemented in a way, such that these -models return either a force or a force coefficient103. The distinction between forces and force coefficents is a -matter of convenience. Contributions directly proportional to the velocity, e.g. drag, can be treated differently -than contributions indirectly proportional to the velocity, e.g. the virtual mass force which is proportional to -the time derivative of the relative velocity. Terms directly proportional to the velocity are numerically treated -differently than other terms. - -The interfacial momentum transfer due to drag, lift and virtual mass are based on the force acting on -a single bubble. The turbulent dispersion force is observed when the turbulent eddies of the liquid phase -interact with a swarm of bubbles. This interaction tends to disperse bubble swarms [44]. Figure 90 gives a -schematic representation of the different momentum exchange mechanisms between the liquid and the gas phase. +由阻力、升力和虚拟质量引起的界面动量传递基于单个气泡上的作用力。当液相的湍流涡旋与大量气泡进行相互作用时,可观察到湍流扩散力。这种相互作用往往会分散气泡群[44]。图像90给出了液相和气相间不同动量交换原理的示意图。 ![图像90a](images/fig90a.png)\ -(a) Drag; the black arrow indicates the relative velocity +(a) 阻力;黑色箭头表示相对速度。 ![图像90b](images/fig90b.png)\ -(b) Lift +(b) 升力 ![图像90c](images/fig90c.png)\ -(c) Virtual mass; the purple arrow indicates the relative acceleration +(c) 虚质量;紫色箭头表示相对加速度。 ![图像90d](images/fig90d.png)\ -(d) Turbulent dispersion +(d) 湍流扩散 -Figure 90: Modelling approach on the example of a gas-liquid two-phase system. +图像90:建模方法,以气液两相系统为例。 -#### 35.5 Diameter models +#### 35.5 直径模型 -As mentioned in the previous Section, diameter models were introduced at some point in the multiphase models. -The multiphaseEulerFoam offered since its introduction in version 2.1.0 two diameter models (constant and -isothermal). With twoPhaseEulerFoam-2.3 a further diameter model was introduced, which is available only in -twoPhaseEulerFoam. +如前一节所述,直径模型在某个时候被添加到了多相模型中。自*multiphaseEulerFoam*引入2.1.0版以后,它便提供两个直径模型(恒定和等温)。另一个直径模型则随*twoPhaseEulerFoam*-2.3引入,仅在*twoPhaseEulerFoam*中可用。 @@ -592,20 +469,17 @@ twoPhaseEulerFoam.
-Table 4: Overview of diameter modelling in Eulerian multiphase solvers +表4:欧拉多相流求解器中的直径模型概览 -##### 35.5.1 No model +##### 35.5.1 无模型 -The older versions of twoPhaseEulerFoam ( 2.2.x) use no model for the diameter of the dispersed phase elements (DPE). In all of these versions the phase diameter is a scalar of type dimensionedScalar that is read from the transportProperties dictionary. +*twoPhaseEulerFoam*旧版本(≤ 2.2.*x*)不对分散相元素的直径使用模型。在所有这些版本中,相直径均为`dimensionedScalar`类型的标量,从`transportProperties`字典中读取。 -##### 35.5.2 Constant +##### 35.5.2 恒定直径 -The constantDiameter diameter model is the implementation of a constant diameter in a framework that -allows for a variable diameter. +在可变直径的框架中,`constantDiameter`直径模型是恒定直径的实现。 -Internally, the diameter is still a scalar which is read from transportProperties respectively from phaseProperties. -However, the phase model returns the diameter as a field quantity. Listing 232 shows how a volScalarField -is returned. The private variable d_ is of the type dimensionedScalar. +在内部,直径仍然是一个标量,从`phaseProperties`或`transportProperties`中读取。但是,相模型将直径作为场量返回。清单232显示了`volScalarField`的返回。私有变量`d_`的类型为`dimensionedScalar`。 ```cpp Foam::tmp @@ -619,7 +493,7 @@ const IOobject ( "d", - phase_.U().time().timeName() , + phase_.U().time().timeName(), phase_.U().mesh() ), phase_.U().mesh(), @@ -628,15 +502,13 @@ const ); } ``` +清单232:对`constantDiameter`中的直径进行访问。 -Listing 232: Accessing the diameter in constantDiameter. - -##### 35.5.3 Isothermal +##### 35.5.3 等温模型 -Gas bubbles change their diameter as the ambient pressure changes. The isothermalDiameter model implements -this behaviour by assuming the change of state to be isothermal. +气泡直径随环境压力的变化而变化。`isothermalDiameter`模型通过假设等温变化来实现该行为。 -Generally, the ideal gas law $\eqref{eq52}$ governs the state of a gas. +通常,使用理想气体定律$\eqref{eq52}$来控制气体状态。 $$ pV = nRT @@ -644,7 +516,7 @@ pV = nRT \label{eq52} $$ -under the assumption of an isothermal state +在等温状态的假设下 $$ pV = const @@ -652,7 +524,7 @@ pV = const \label{eq53} $$ -Next we introduce the bubble volume +接下来引入气泡体积 $$ V = \frac{d^{3} \pi}{6} @@ -660,7 +532,7 @@ V = \frac{d^{3} \pi}{6} \label{eq54} $$ -Thus, we gain the relation +因此,得到关系式 $$ p\_{1} d^{3}\_{1} \frac{\pi}{6} = p\_{2} d^{3}\_{2} \frac{\pi}{6} @@ -668,7 +540,7 @@ p\_{1} d^{3}\_{1} \frac{\pi}{6} = p\_{2} d^{3}\_{2} \frac{\pi}{6} \label{eq55} $$ -This leads to the isothermal diameter model +得到等温直径模型 $$ d_{2} = \sqrt[3]{d_1 \frac{p_{1}}{p_{2}}} @@ -676,9 +548,7 @@ d_{2} = \sqrt[3]{d_1 \frac{p_{1}}{p_{2}}} \label{eq56} $$ -For the isothermalDiameter model the user needs to specify a reference pressure and diameter. Listing -233 shows the d() method of the class isothermalDiameter. The reference pressure p0_ and diameter d0_ are -private data members of the class104. With Eqn. $\eqref{eq56}$ the local diameter is computed (Line 10). +对于`isothermalDiameter`模型,用户须指定参考压力和直径。清单233展示了`isothermalDiameter`类的`d()`方法。参考压力`p0_`和直径`d0_`为该类的私有数据成员[^104]。局部直径通过公式$\eqref{eq56}$计算得出(第10行)。 ```cpp Foam::tmp @@ -690,36 +560,28 @@ const "p" ); - return d0_*pow(p0_ /p, 1.0/3.0) ; + return d0_*pow(p0_/p, 1.0/3.0) ; } ``` - -Listing 233: The method d() of the class isothermalDiameter. +清单233:`isothermalDiameter`类的`d()`方法。 ##### 35.5.4 IATE -IATE stands for interfacial area transport equation. This model is based on [33]. The IATE diameter model -solves a transport equation for the interfacial curvature kappai_. ->Solves for the interfacial curvature per unit volume of the phase rather than interfacial area per -unit volume to avoid stability issues relating to the consistency requirements between the phase -fraction and interfacial area per unit volume.\ -Class description in IATE.H +IATE表示界面面积输运方程(interfacial area transport equation)。该模型以[33]为根据。IATE直径模型用于求解界面曲率`kappai_`的输运方程。 -In Section 64 we cover the derviation of the governing equations implemented in OpenFOAM from the equations -in [33]. +>求解相的单位体积界面曲率,而不是单位体积界面面积,以避免由相分数和单位体积界面面积一致性要求导致的稳定性问题。\ +`IATE.H`中的类说明 -#### 35.6 Thermophysical models +第[64](./64.xx.md#64-xx)节中,我们从[33]中的方程出发,对OpenFOAM使用的控制方程进行了推导。 -Each phase in a multi-phase simulation is assigned its own set of models with regards to thermo-physical -properties, such as density, dynamic viscosity and specific heat capacity. The set of available models is discussed -in Section 33. In this section, we focus on the use of thermophysical modelling with respect to multiphase -simulations. +#### 35.6 热物理模型 -##### 35.6.1 A note on using thermophysical properties in BCs -If we want to specify a massflow boundary condition in a multiphase simulation, we need to specify which -density is to be used for computing the velocity BC from the mass flow. Listing 234 shows an example, of how -we can specify massflow BCs. Note, the entry rho, which tells OpenFOAM which density to used to compute -the actual velocity BC. +对于热物理性质,例如密度、动力粘度和比热容,多相流模拟中的每个相都被指定了各自的一组模型。可用模型的集合在第[33](./33.Thermophysical_modelling.md#33--热物理模型)节中进行讨论。本节重点关注 +与多相流模拟相关的热物理模型的使用。 + +##### 35.6.1 边界条件中热物理性质的使用说明 +If we want to specify a massflow boundary condition in a multiphase simulation, we need to specify which density is to be used for computing the velocity BC from the mass flow. Listing 234 shows an example, of how we can specify massflow BCs. Note, the entry rho, which tells OpenFOAM which density to used to compute the actual velocity BC. +如果要在多相流模拟中设定质量流量边界条件,则须明确从质量流量计算速度边界条件时所使用的密度。清单234展示了一个质量流量边界条件设定的例子。注意`rho`条目,OpenFOAM从该项获知用于计算实际速度边界条件的密度。 ``` boundaryField @@ -736,27 +598,15 @@ boundaryField } ``` -Listing 234: Specifying a massflow BC in an U.air file, here we need to specify the phase-density. - -In multiphase solvers, access to the density field is generally handled by the phase-model class. Thus, the -multiphase solvers do not create registered density fields, in contrast to compressible single-phase solvers, such -as rhoPimpleFoam. As access to the density is handled via the phase model’s thermophysical model, this reflects -in the way we refer to the phase’s density when we e.g. specify a massflow BC. +清单234:在`U.air`文件中设定质量流量边界条件,此处须指定相-密度。 -Note, that in Line 7 of Listing 234 a single colon (:) is used as a separator. This can potentially be confused -with the double colons (::), which are used in C++ to separate namespace qualifiers. However, in a certain way, -we find that this is also a sort of namespace, since the thermo prefix indicates that this field is a field which is -provided by the thermophysical model, as opposed to solver-managed fields, such as p or U. +在多相流求解器中,对密度场的访问通常由相模型类处理。因此,与可压缩单相流求解器(如*rhoPimpleFoam*)不同,多相流求解器不会建立注册的密度场。密度的访问通过相模型的热物理模型来进行,这体现在我们引用相密度的方式,例如指定质量流量边界条件时。 -IV This offering is not approved or endorsed by ESI® Group, ESI-OpenCFD® or the OpenFOAM® -Foundation, the producer of the OpenFOAM® software and owner of the OpenFOAM® trademark. 185 +注意,在清单234的第7行中,单冒号(:)被用作分隔符。这可能会与双冒号(::)混淆,双冒号(::)在C++中用于分隔命名空间限定符。但是,在某种意义上这也是一种命名空间,因为前缀`thermo`指示该场量是由热物理模型提供的场量,而不是由求解器管理的场量(如 `p`或`U`)。 -##### 35.6.2 A note on post-processing thermophysical quantities +##### 35.6.2 热物理量后处理的说明 -Section 35.6.1 also applies, when we want to do some post-processing on thermophysical quantities, e.g. write -out the gas-density field as shown in Listing 235. Here, we also use a single colon (:) to separate the thermo -qualifier from the name of the field, i.e. rho.air. Using a double colon, or just the field’s name alone would -result in an error. +对热物理量进行后处理时,例如输出气体密度场(如清单235所示),[35.6.1](#3561-边界条件中热物理性质的使用说明)节同样适用。此处同样使用单冒号(:)来分隔限定符`thermo`和场量名`rho.air`。使用双冒号或仅使用场量名将会导致错误。 ``` writeObjects1 @@ -769,4 +619,4 @@ writeObjects1 writeOption anyWrite; } ``` -Listing 235: Writing the gas-density field to disk, using the writeObjects function object. +清单235:使用函数对象`writeObjects`将气体密度场写入磁盘 \ No newline at end of file -- Gitee