李老师,还是这个模块,能不能再问下这个临近单元的预测速度是怎么得到的?不也是未知数吗?如果是的话,那么方程13是不是把所有的网格的体心上的值联立在一起求得的?
Y
yuanliangwojt
@yuanliangwojt
帖子
-
有关东岳流体网站中的“CFD:不可压+稳态”模块里边的公式21 -
有关东岳流体网站中的“CFD:不可压+稳态”模块里边的公式21感谢李老师解答,但是我还是不太明白您说的意思,您在网页中说方程21是经过方程18移项得到,所以我觉得更应该是我下边图片中推导的形式,您单单在网页中写了一个移项得到,可能因为我基础薄弱,没能理解怎么就从第n+1个时间步跳到第n个时间步了,还望李老师不吝赐教,感谢
-
有关东岳流体网站中的“CFD:不可压+稳态”模块里边的公式21为什么公式21中第N个网格单元的体心上的速度值是第n个时间步而不是第n+1个时间步上的值?还请李老师亦或各位大佬不吝赐教
-
foamextend5.0求解器编译报错显示”expected unqualified-id before ‘if’“第一次在这个网站上求助各位大佬,报错图片不知道怎么看不了了,不好意思![IWE)}@6(NH98E9LRH@PDEK.png
-
foamextend5.0求解器编译报错显示”expected unqualified-id before ‘if’“下附CourantNo.H文件内容
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | foam-extend: Open Source CFD \\ / O peration | Version: 5.0 \\ / A nd | Web: http://www.foam-extend.org \\/ M anipulation | For copyright notice see file Copyright ------------------------------------------------------------------------------- License This file is part of foam-extend. foam-extend 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. foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>. Global CourantNo Description Calculates and outputs the mean and maximum Courant Numbers. \*---------------------------------------------------------------------------*/ scalar CoNum = 0.0; scalar meanCoNum = 0.0; scalar velMag = 0.0; // HR 26.06.18: A parallel run has at least two cells and therefore at least // one internal face in the global mesh. It may be a processor boundary, but // this is captured by max(mag(phi)). // Old formulation hangs on parallel cases where one partition is degenerated // to a single cell. if (mesh.nInternalFaces() || Pstream::parRun()) { surfaceScalarField magPhi = mag(phi); surfaceScalarField SfUfbyDelta = mesh.surfaceInterpolation::deltaCoeffs()*magPhi; const scalar deltaT = runTime.deltaT().value(); CoNum = max(SfUfbyDelta/mesh.magSf()).value()*deltaT; meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf())).value()*deltaT; velMag = max(magPhi/mesh.magSf()).value(); } else { // Single cell mesh: Co is still defined; use cell formulation const scalar deltaT = runTime.deltaT().value(); const scalar deltaX = Foam::cbrt(mesh.V()[0]); // recover velocity field in a more general way const volVectorField& URef = mesh.db().lookupObject<const volVectorField>("U"); velMag = mag(URef[0]); CoNum = velMag*deltaT/deltaX; meanCoNum = CoNum; } Info<< "Courant Number mean: " << meanCoNum << " max: " << CoNum << " velocity magnitude: " << velMag << endl; // ************************************************************************* //
-
foamextend5.0求解器编译报错显示”expected unqualified-id before ‘if’“#include "fvCFD.H" #include "MULES.H" #include "subCycle.H" #include "interfaceProperties.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" #include "dynamicFvMesh.H" #include "pimpleControl.H" #include "immersedBoundaryPolyPatch.H" #include "immersedBoundaryFvPatch.H" #include "emptyFvPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { # include "setRootCase.H" # include "createTime.H" # include "createDynamicFvMesh.H" pimpleControl pimple(mesh); # include "readGravitationalAcceleration.H" # include "initContinuityErrs.H" # include "createIbMasks.H" # include "createFields.H" # include "createControls.H" # include "correctPhi.H" # include "CourantNo.H" # include "setInitialDeltaT.H"
我在foamextend5.0环境下编写具有IBM方法的两相流求解器,是在foamextend5.0自带的求解器pimpleDyMIbFoam基础上修改的,以上是一部分主程序代码,我在foam extend5.0环境下编译这个求解器,显示如下错误,是在我上边发的代码的第33行
请问各位大佬应该这么修改呢?我确定这个报错路径下的CourantNo.H文件是没有问题的,因为这是系统路径下的文件啊,我也没有修改过,之前使用过这个文件编译其他求解器,也是没有问题的,所以现在不知道问题出在哪里了?
还请各位老师不吝赐教