OpenFOAM基金会版本中不同版本的sprayFoam和reactingFoam求解器问题
- 
							
							
							
							
在OpenFOAM-8中d的OpenFOAM/OpenFOAM-8/OpenFOAM-8/applications/solvers/lagrangian/sprayFoam文件夹下有sprayFoam求解器。在OpenFOAM-10中对应的OpenFOAM-10/applications/solvers/lagrangian/文件夹下就没有这个求解器文件了。但是我在OpenFOAM-10/tutorials/combustion/reactingFoam/Lagrangian/aachenBomb文件中发现这个案例用的求解器是reactingFoam,当我想使用sparyFoam进行求解,出现了下面提醒: 
 The sprayFoam solver has solver has been replaced by the more general
 reactingFoam solver, which supports compressible reacting flow coupled
 to multiple run-time-selectable lagrangian clouds and surface film modelling.To run with a single cloud rename the constant/*CloudProperties file to 
 constant/cloudProperties.To run with a multiple clouds create a constant/clouds file with a list of the 
 names of clouds in it. Each cloud then has a corresponding
 constant/<cloudName>Properties file.In addition, cloud properties files also now require a "type" entry to specify 
 the type of cloud model used (e.g., thermoCloud, reactingMultiphaseCloud,
 collidingCloud, etc ...).See the following case for an example converted from sprayFoam: $FOAM_TUTORIALS/lagrangian/reactingFoam/aachenBomb然后我对比了OpenFOAM-8的sprayFoam和OpenFOAM-10的reactingFoam两个求解器 
    
 左图为sprayFoam求解器包括的头文件和源文件,右图为reactingFoam的头文件和源文件。发现在reactingFoam中没有createClouds.H头文件
  
 想咨询一下,是版本8的sparyFoam模拟液滴雾化好,还是版本10的reactingFoam模拟效果好。路过大佬麻烦指点一二。
- 
							
							
							
							
							
							
@mingyang 在 OpenFOAM基金会版本中不同版本的sprayFoam和reactingFoam求解器问题 中说: 发现在reactingFoam中没有createClouds.H头文件 因为OpenFOAM-10把这个功能集成到fvModels里了,能看到reactingFoam.C文件里有fvModels.correct()语句,这个函数在fvModels.H里有注释。这些模型最终都体现在方程的源项上,见source函数。 //- Correct the fvModels // e.g. solve equations, update model, for film, Lagrangian etc. virtual void correct(); //- Return source for a compressible equation template<class Type> tmp<fvMatrix<Type>> source ( const volScalarField& rho, const GeometricField<Type, fvPatchField, volMesh>& field ) const;比如文件UEqn.H里的源项就是这个形式: fvModels.source(rho, U)@mingyang 在 OpenFOAM基金会版本中不同版本的sprayFoam和reactingFoam求解器问题 中说: 是版本8的sparyFoam模拟液滴雾化好,还是版本10的reactingFoam模拟效果好。 这个版本的好坏我没对比过,不好说。可以看看有没有哪位大佬做过这个工作。看上面的代码,只能说10面向对象编程更加彻底,也就是模块化,但是确实不好理解。8直接一些,就好理解一点。看个人选择啦。 
- 
							
							
							
							
@wangfei9088 好的,谢谢您的讲解,我大概明白了。我还有一个问题不知道您了不了解。就是在OpenFOAM-8版本中$FOAM_SRC/thermophysicalModels/thermophysicalProperties/liquidProperties这个物性文件夹下没有NH3的物性文件,而在OpenFOAM-10中是存在的。我本来想着参考版本10中的文件改写到版本8中,如下图: 
 OpenFOAM-10中NH3.C的部分代码
  
 OpenFOAM-10中NH3I.H的部分代码
  
 OpenFOAM-8中H2O.C的部分代码
  
 OpenFOAM-8中H2OI.H的部分代码
  
 我发现这两个版本中的代码编写的关键字有点差距,也没找到这部分在OpenFOAM中添加物性的资料。所以想问问大佬。
- 
							
							
							
							
							
							
@mingyang 在 OpenFOAM基金会版本中不同版本的sprayFoam和reactingFoam求解器问题 中说: 两个版本中的代码编写的关键字有点差距 8(NSRDS5ThermophysicalFunction.H)和10(NSRDS5.H)版本的函数名不同,代码是一样的。 //- Evaluate the function and return the result scalar f(scalar, scalar T) const { return a_/pow(b_, 1 + pow(1 - T/c_, d_)); }//- Evaluate the function and return the result virtual scalar value(scalar T) const { return a_/pow(b_, 1 + pow(1 - T/c_, d_)); }8和10的底层代码很多不一样,直接复制粘贴肯定不行。我根据10的NH3代码改写成8的NH3文件了。改变挺大的。 编译之前,Make/files里加一行: 
 liquidProperties/NH3/NH3.C代码贴上,编译没问题,供参考。 
- 
							
							
							
							
							
							
@wangfei9088 感谢感谢,我先看一下大佬你给我的代码,试一下模拟结果。再次感谢。 
- 
							
							
							
							
@wangfei9088 你好,大佬,你改的库文件没有问题,模拟出来的云图我对比了OpenFOAM-10版本的reactingFoam结果。没什么差距,十分感谢!网站可能消息不能及时,后续不知道您方不方便交流,这个是我邮箱: 
 yang52079@outlook.com
 再次感谢!
  
 
			
