第三类边界条件openfoam已经有现成的呢,可以直接调用。而边界上某个点的温度,可以用探针,通过点的坐标读取。
general
帖子
-
求解固态热传导问题,第三类边界条件如何设置? -
什么样的模拟才叫大涡模拟(LES)?我有一个疑问,有没有什么可靠的实验或者理论方法用于检验大涡模拟的可靠性(DNS除外)?换一种表述方式就是:文献提出的大涡模拟的要求是否具有普适性?在特殊的工况是否应该有更高或者更低的要求。
-
网格数量对LES模型的影响@regina 一个直观的感觉是,网格越小需要解析的小涡就越多,而小涡本只有统计性,所以计算误差较大吧。
-
OpenFoam定义新边界条件问题---通量边界@Jhhu 你好,我最后没有成功,由于时间很紧张,还是使用了商用软件。
-
OpenFoam定义新边界条件问题---通量边界@东岳 好的谢谢东岳老师,我试一下
-
OpenFoam定义新边界条件问题---通量边界有人知道下面这种错误的原因吗?
myicoFoam: symbol lookup error: /home/a/OpenFOAM/a-5.x/platforms/linux64GccDPInt32Opt/lib/libnewFvPatchScalarField.so: undefined symbol: _ZN4Foam21newFvPatchScalarFieldC1ERKNS_7fvPatchERKNS_16DimensionedFieldIdNS_7volMeshEEERKNS_10dictionaryE
-
OpenFoam定义新边界条件问题---通量边界检查发现是在字典中少将libs 写成了lib,修改之后还是出错,不过边界条件可以识别了。
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 PISO: Operating solver in PISO mode Reading transportProperties Reading field p Reading field U Reading field C Reading/calculating face flux field phi Starting time loop Time = 5e-05 Courant Number mean: 7.5e-05 max: 0.194817 smoothSolver: Solving for Ux, Initial residual = 1, Final residual = 2.38974e-06, No Iterations 8 smoothSolver: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #4 Foam::operator/(Foam::UList<double> const&, Foam::UList<double> const&) at ??:? #5 Foam::newFvPatchScalarField::updateCoeffs() at ??:? #6 Foam::fvMatrix<double>::fvMatrix(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:? #7 Foam::fv::gaussLaplacianScheme<double, Foam::SymmTensor<double> >::fvmLaplacianUncorrected(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #8 Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #9 ? at ??:? #10 ? at ??:? #11 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #12 ? at ??:? 浮点数例外 (核心已转储)
C文件
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "newFvPatchScalarField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "surfaceFields.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::newFvPatchScalarField::newFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF ) : fixedValueFvPatchScalarField(p, iF) {} Foam::newFvPatchScalarField::newFvPatchScalarField ( const newFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const fvPatchFieldMapper& mapper ) : fixedValueFvPatchScalarField(ptf, p, iF, mapper) {} Foam::newFvPatchScalarField::newFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const dictionary& dict ) : fixedValueFvPatchScalarField(p, iF, dict, false) { } Foam::newFvPatchScalarField::newFvPatchScalarField ( const newFvPatchScalarField& tppsf ) : fixedValueFvPatchScalarField(tppsf) {} Foam::newFvPatchScalarField::newFvPatchScalarField ( const newFvPatchScalarField& tppsf, const DimensionedField<scalar, volMesh>& iF ) : fixedValueFvPatchScalarField(tppsf, iF) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::newFvPatchScalarField::autoMap ( const fvPatchFieldMapper& m ) { fixedValueFvPatchScalarField::autoMap(m); } void Foam::newFvPatchScalarField::rmap ( const fvPatchScalarField& ptf, const labelList& addr ) { fixedValueFvPatchScalarField::rmap(ptf, addr); } void Foam::newFvPatchScalarField::updateCoeffs() { if (updated()) { return; } const volScalarField& C = db().lookupObject<volScalarField>("C"); gradient_=0.5*C; operator== ( this->patchInternalField()+gradient_/this->patch().deltaCoeffs() ); fixedValueFvPatchScalarField::updateCoeffs(); } //void Foam::newFvPatchScalarField::write(Ostream& os) const //{ // fvPatchScalarField::write(os); //} // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { makePatchTypeField ( fvPatchScalarField, newFvPatchScalarField ); } // ************************************************************************* //
H文件
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class Foam::newFvPatchScalarField Group grpInletBoundaryConditions grpOutletBoundaryConditions Description This boundary condition provides a total temperature condition. Usage \table Property | Description | Required | Default value U | Velocity field name | no | U phi | Flux field name | no | phi psi | Compressibility field name | no | thermo:psi gamma | ratio of specific heats (Cp/Cv) | yes | T0 | reference temperature | yes | \endtable Example of the boundary condition specification: \verbatim <patchName> { type new; T0 uniform 300; } \endverbatim SourceFiles newFvPatchScalarField.C See also Foam::fixedValueFvPatchField \*---------------------------------------------------------------------------*/ #ifndef newFvPatchScalarField_H #define newFvPatchScalarField_H #include "fixedValueFvPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class newFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class newFvPatchScalarField : public fixedValueFvPatchScalarField { // Private data scalarField gradient_; public: //- Runtime type information TypeName("new"); // Constructors //- Construct from patch and internal field newFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>& ); //- Construct from patch, internal field and dictionary newFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>&, const dictionary& ); //- Construct by mapping given newFvPatchScalarField // onto a new patch newFvPatchScalarField ( const newFvPatchScalarField&, const fvPatch&, const DimensionedField<scalar, volMesh>&, const fvPatchFieldMapper& ); //- Construct as copy newFvPatchScalarField ( const newFvPatchScalarField& ); //- Construct and return a clone virtual tmp<fvPatchScalarField> clone() const { return tmp<fvPatchScalarField> ( new newFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference newFvPatchScalarField ( const newFvPatchScalarField&, const DimensionedField<scalar, volMesh>& ); //- Construct and return a clone setting internal field reference virtual tmp<fvPatchScalarField> clone ( const DimensionedField<scalar, volMesh>& iF ) const { return tmp<fvPatchScalarField> ( new newFvPatchScalarField(*this, iF) ); } // Member functions // Access //- Return the total pressure //- Return the total pressure const scalarField& gradient() const { return gradient_; } //- Return reference to the total pressure to allow adjustment scalarField& gradient() { return gradient_; } // Mapping functions //- Map (and resize as needed) from self given a mapping object virtual void autoMap ( const fvPatchFieldMapper& ); //- Reverse map the given fvPatchField onto this fvPatchField virtual void rmap ( const fvPatchScalarField&, const labelList& ); // Evaluation functions //- Update the coefficients associated with the patch field virtual void updateCoeffs(); //- Write //virtual void write(Ostream&) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
-
OpenFoam定义新边界条件问题---通量边界边界条件编译了, .so文件也添加到字典中了,还是提示Unknown patchField type newgrad for patch type wall,这个好让人困惑。。。
-
OpenFoam定义新边界条件问题---通量边界最近尝试修改,整理完成后边界可以编译了,但是放到计算文件中还是报错,提示错误如下,有人知道这是什么原因吗?
Unknown patchField type newgrad for patch type wall Valid patchField types are : (。。。。。(省略) ) file: /home/a/temp/cavity/0/C.boundaryField.wall2flow from line 41 to line 41. From function static Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New(const Foam::fvPatch&, const Foam::DimensionedField<Type, Foam::volMesh>&, const Foam::dictionary&) [with Type = double] in file /home/a/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvPatchFieldNew.C at line 134. FOAM exiting
H文件
#ifndef newgradFvPatchScalarField_H #define newgradFvPatchScalarField_H #include "fixedValueFvPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Class newgradFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class newgradFvPatchScalarField : public fixedValueFvPatchScalarField { // Private data //- Total pressure scalarField gradient_; public: //- Runtime type information TypeName("newgrad"); // Constructors //- Construct from patch and internal field newgradFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>& ); //- Construct from patch, internal field and dictionary newgradFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>&, const dictionary& ); //- Construct by mapping given newgradFvPatchScalarField // onto a new patch newgradFvPatchScalarField ( const newgradFvPatchScalarField&, const fvPatch&, const DimensionedField<scalar, volMesh>&, const fvPatchFieldMapper& ); //- Construct as copy newgradFvPatchScalarField ( const newgradFvPatchScalarField& ); //- Construct and return a clone virtual tmp<fvPatchScalarField> clone() const { return tmp<fvPatchScalarField> ( new newgradFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference newgradFvPatchScalarField ( const newgradFvPatchScalarField&, const DimensionedField<scalar, volMesh>& ); //- Construct and return a clone setting internal field reference virtual tmp<fvPatchScalarField> clone ( const DimensionedField<scalar, volMesh>& iF ) const { return tmp<fvPatchScalarField> ( new newgradFvPatchScalarField(*this, iF) ); } // Member functions // Access //- Return the total pressure const scalarField& gradient() const { return gradient_; } //- Return reference to the total pressure to allow adjustment scalarField& gradient() { return gradient_; } // Mapping functions //- Map (and resize as needed) from self given a mapping object virtual void autoMap ( const fvPatchFieldMapper& ); //- Reverse map the given fvPatchField onto this fvPatchField virtual void rmap ( const fvPatchScalarField&, const labelList& ); // Evaluation functions //- Update the coefficients associated with the patch field virtual void updateCoeffs(); //- Write //virtual void write(Ostream&) const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
C文件
#include "newgradFvPatchScalarField.H" #include "addToRunTimeSelectionTable.H" #include "fvPatchFieldMapper.H" #include "volFields.H" #include "surfaceFields.H" void Foam::newgradFvPatchScalarField::updateCoeffs() { if (updated()) { return; } const volScalarField& C = db().lookupObject<volScalarField>("C"); gradient_=0.5*C; operator== ( this->patchInternalField()+gradient_/this->patch().deltaCoeffs() ); fixedValueFvPatchScalarField::updateCoeffs(); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { makePatchTypeField ( fvPatchScalarField, newgradFvPatchScalarField ); }
-
OpenFoam定义新边界条件问题---通量边界尝试编译过程发现提示.C的173行有问题
wmake libso . g++ -std=c++11 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/home/a/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/a/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude -I/home/a/OpenFOAM/OpenFOAM-5.x/src/OSspecific/POSIX/lnInclude -fPIC -c flowFvPatchScalarField.C -o Make/linux64GccDPInt32Opt/flowFvPatchScalarField.o flowFvPatchScalarField.C: In member function ‘virtual void Foam::flowFvPatchScalarField::updateCoeffs()’: flowFvPatchScalarField.C:173:48: error: qualified-id in declaration before ‘(’ token void Foam::flowFvPatchScalarField::updateCoeffs() ^ /home/a/OpenFOAM/OpenFOAM-5.x/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/flowFvPatchScalarField.o' failed make: *** [Make/linux64GccDPInt32Opt/flowFvPatchScalarField.o] Error 1
对应173行的代码为:
void Foam::flowFvPatchScalarField::updateCoeffs() { const volScalarField& C = db().lookupObject<volScalarField>(C_); gradient_ =5; operator== ( this->patchInternalField() + gradient_/this->patch().deltaCoeffs ); } fixedValueFvPatchScalarField::updateCoeffs(); }
-
OpenFoam定义新边界条件问题---通量边界这边参考网上陈丽萍老师的教程,但是编译总是出错,是不是版本不支持了?我的是5.0版本
-
OpenFoam定义新边界条件问题---通量边界 -
OpenFoam定义新边界条件问题---通量边界最近需要计算一个壁面传热传质的模型,结果发现fluent中的壁面边界条件在组分输运上只有两个选项,一个是质量分数,另一个是零梯度。
所以计划利用openfoam编写一个组分或者热量运输通量的边界条件,参考了网上的一个相关教程(https://wenku.baidu.com/view/67aeca451fd9ad51f01dc281e53a580216fc50ea.html)
但是在创建边界的过程中总是报错。这种边界有人建立过吗?未标题-1.jpg -
利用有限元方法做计算流体好的,谢谢
-
利用有限元方法做计算流体有一个问题,有限元直接就把N-S方程变成代数方程了吗?
利用有限元方法,对不可压缩流体处理过程,有没有像SIMPLE这样的方法? -
openfoam的中间面(interface)边界条件@东岳 谢谢东岳老师
-
openfoam的中间面(interface)边界条件fluent中有fan,porous jump等中间面的边界,但是openfoam中应该怎么处理这种边界呀?
如图(二维),如果一个管道中有一个风扇,可以给中间那条线的两边指定一个压力增量delt_P,用来模拟风机作用下管道流场吗?