动态接触角的问题
-
@东岳
东岳老师,我把代码中的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);
直接删掉
-
@Peng 你好啊,我也在用kistler动态接触角模型,参考的Edin的代码以及MahdiNabil的代码,我的求解器以及lib都编译通过了,但是在运算case的时候报错了,我想请问你遇到这个问题了吗?我用的版本是of4x
*] --> FOAM FATAL ERROR: request for volScalarField muEffKistler from objectRegistry region0 failed available objects of type volScalarField are * ( * interfaceProperties:K * alpha.water * p_rgh * nu * nu1 * nu2 * alpha.air )
-
@xinxinzhou1995 我没有用这个版本额,我用的高版本的还是有问题,你的问题解决了吗?
-
@Peng我的动态接触角模型在of4x和of7都是同一个问题,都是这个muEffkistler找不到,但是我的确是求解器和lib都编译通过了,我一直找不出原因。
-
@xinxinzhou1995 我也是编译成功了,但不知道边界条件里除了要给定前进和后退接触角,还有什么需要定义的吗?这个muName和sigmaName,以及muEffKistler和sigmaKistler的关系是什么样的呢,怎么给定呢?