动态接触角的问题



  • 动态接触角的边界条件需要给定一些参数,如下:

    walls
        {
            type           dynamicAlphaContactAngle;
            theta0         45;
            thetaA         60;
            thetaR         30;
            uTheta         0.01;
            limit          gradient;
            value          uniform 0;
        }
    

    这其中thetaA是前进角,thetaR是后退角,theta0是平衡角,这些都知道,但是都要怎么给具体的值呢?他们之前有什么关系呢?还有uTheta查的是velocity scale,具体是什么意思?
    请告诉我一下这些参数的具体物理意义,以及怎么设定具体的值。





  • 你好,很巧我遇到过这个问题。我记得在CFD online, Henry Weller说这个动态接触角就是一个很简单的模型,velocity scale是要实验测量的。在CFD online的其他帖子上,有人说自己就是用随机值(这个我觉得不对,of7里更新了动态接触角,貌似给的值是1,但是我也没看到具体怎么取)

    如果一定要用动态接触角,Kistler dynamic contact angle model是我见过最常用的了。
    372426cc-487b-4074-b57b-feec8fba88c3-image.png



  • @桎梏 铁子这面模拟的啥好东西



  • @东岳 一个半经验型的动态接触角模型,我看好多人都用这个



  • 我今天下午在玩这玩意 用了下动态接触角 感觉很奇妙 :chitang:

    Effect of dynamic contact angle in a volume of fluid (VOF) model for a microfluidic capillary flow

    捕获.JPG



  • @东岳 你植入了这个动态接触角模型么?好搞不?我最近也在犹豫要不要加这个模型



  • @桎梏 木,用的现存的



  • @东岳 如果用现存的动态接触角模型,那你的uTheta之类的是咋设置的,选用的文献的值么还是随机值



  • @桎梏 你把Kistler dynamic contact angle model 植入到openfoam中了么,我知道在fluent中用UDF怎么实现,正在研究怎么在OF中搞,求指导



  • @Peng 抱歉,回复晚了。我目前没在做这方面的内容,可能过一段时间才会考虑加入这个模型



  • @桎梏 没事,我找到了相关的资料了,在研究,有问题再交流。

    分享如下:

    (1) 这里面是Edin Berberovic 编写的code:

    https://www.cfd-online.com/Forums/openfoam-solving/58337-openfoam141dev-new-implementation-dynamickistlergammacontactangle.html

    (2) 这篇文章附件的code,作者对Edin Berberovic 编写的code进行了更新,适用于新版本的openFoam: https://www.sciencedirect.com/science/article/pii/S2352711016300309

    code 地址:
    https://github.com/MahdiNabil/CFD-PC/tree/master/interThermalPhaseFoam/Libraries



  • @Peng 好东西!感谢分享!有问题互相交流!



  • @桎梏 @东岳
    https://github.com/MahdiNabil/CFD-PC/tree/master/interThermalPhaseFoam/Libraries 里面的code 是基于OpenFOAM 2.4.0 的,在OpenFOAM v7 or OpenFOAM v1912 编译的时候,首先要删去 Allwmake.sh 里的 libso。

    然后编译还是会报如下的错误:

    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C: In member function ‘virtual Foam::tmp<Foam::Field<double> > Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField::theta(const fvPatchVectorField&, const fvsPatchVectorField&) const’:
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C:148:38: error: ‘const class Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField’ has no member named ‘dimensionedInternalField’
      148 |             << " of field " << this->dimensionedInternalField().name()
          |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C:149:37: error: ‘const class Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField’ has no member named ‘dimensionedInternalField’
      149 |             << " in file " << this->dimensionedInternalField().objectPath()
          |                                     ^~~~~~~~~~~~~~~~~~~~~~~~
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C: In member function ‘virtual void Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField::write(Foam::Ostream&) const’:
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C:242:27: error: no matching function for call to ‘writeEntry(const char [6], Foam::Ostream&)’
      242 |     writeEntry("value", os);
          |                           ^
    

    应该是版本不兼容引起的吧,请问如何修改,以使其和新版本的openFOAM兼容呢?

    相同的问题参见:
    https://bugs.openfoam.org/view.php?id=3098#bugnotes

    https://www.cfd-online.com/Forums/openfoam-programming-development/168136-new-solver-two-phase-flows-phase-change-heat-transfer-2.html
    目前还没人回答。



  • dimensionedInternalField已经被volScalarField::Internal替换,因此需要全部替换



  • @东岳
    东岳老师,我把代码中的dimensionedInternalField() 替换成了volScalarField::Internal(),但还是报错 ‘Foam::volScalarField’ “is not a base of Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField’。”

    代码替换:

    //   << " of field " << this->dimensionedInternalField().name()
          //   << " in file " << this->dimensionedInternalField().objectPath()
    
               << " of field " << this->volScalarField::Internal().name()
               << " in file " << this->volScalarField::Internal().objectPath()
    

    编译报错:

    error: ‘Foam::volScalarField’ {aka ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’} is not a base of ‘const Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField’
      153 |             << " of field " << this->volScalarField::Internal().name()
          |                                                      ^~~~~~~~
    

    这个错误是因为基类缺少了啥或者少声明了什么变量么?
    新手入门,求老师指点一二,十分感谢! 如有需要我可以附上源文件。

    附详细代码块如下:

    // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
    
    tmp<scalarField> dynamicKistlerAlphaContactAngleFvPatchScalarField::theta
    (
        const fvPatchVectorField& Up,
        const fvsPatchVectorField& nHat
    ) const
    {
        //eb - Lookup and return the patchField of dynamic viscosity of mixture
        //     and surface tension
        if((muName_ != "muEffKistler") || (sigmaName_ != "sigmaKistler"))
        {
            FatalErrorIn
            (
                "dynamicKistlerAlphaContactAngleFvPatchScalarField"
            )   
                << " muEffKistler or sigma set inconsitently, muEffKistler = "
                << muName_ << ", sigmaKistler = " << sigmaName_ << '.' << nl
                << "    Set both muEffKistler and sigmaKistler according to the "
                << "definition of dynamicKistlerAlphaContactAngle"
                << "\n    on patch " << this->patch().name()
    
           //   << " of field " << this->dimensionedInternalField().name()
           //   << " in file " << this->dimensionedInternalField().objectPath()
    
                << " of field " << this->volScalarField::Internal().name()
                << " in file " << this->volScalarField::Internal().objectPath()
    
                << exit(FatalError);
        }
    

    详细报错:

    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C: In member function ‘virtual Foam::tmp<Foam::Field<double> > Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField::theta(const fvPatchVectorField&, const fvsPatchVectorField&) const’:
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C:153:54: error: ‘Foam::volScalarField’ {aka ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’} is not a base of ‘const Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField’
      153 |             << " of field " << this->volScalarField::Internal().name()
          |                                                      ^~~~~~~~
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C:154:53: error: ‘Foam::volScalarField’ {aka ‘Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>’} is not a base of ‘const Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField’
      154 |             << " in file " << this->volScalarField::Internal().objectPath()
          |                                                     ^~~~~~~~
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C: In member function ‘virtual void Foam::dynamicKistlerAlphaContactAngleFvPatchScalarField::write(Foam::Ostream&) const’:
    dynamicKistlerAlphaContactAngle/dynamicKistlerAlphaContactAngleFvPatchScalarField.C:249:27: error: no matching function for call to ‘writeEntry(const char [6], Foam::Ostream&)’
      249 |     writeEntry("value", os);
    


  • FatalErrorIn
            (
                "dynamicKistlerAlphaContactAngleFvPatchScalarField"
            )   
                << " muEffKistler or sigma set inconsitently, muEffKistler = "
                << muName_ << ", sigmaKistler = " << sigmaName_ << '.' << nl
                << "    Set both muEffKistler and sigmaKistler according to the "
                << "definition of dynamicKistlerAlphaContactAngle"
                << "\n    on patch " << this->patch().name()
    
           //   << " of field " << this->dimensionedInternalField().name()
           //   << " in file " << this->dimensionedInternalField().objectPath()
    
                << " of field " << this->volScalarField::Internal().name()
                << " in file " << this->volScalarField::Internal().objectPath()
    
                << exit(FatalError);
    

    直接删掉



  • @东岳 好的,先这样做吧,谢谢!


Log in to reply