新手求问冲击波管喷出的低马赫数supersonic的 边界条件问题



  • 在网上找了很久没有发现有关的解决方法。所以才来请大家能给点指点意见。
    现在想用openFOAM模拟冲击波管喷出的低马赫数冲击波的密度计测。
    边界条件和其他的文件基本copy的tutorial里的nacaAirfoil,关于U文件夹里的internalfield的值是什么意思?然后如果用supersonicfreestream该怎么设定
    p的inlet和outlet该怎么设定(如果用waveTransmissive)
    这几项需要注意什么请指教下,万分感谢!



  • 现在为了简化 想用无粘度而且取消紊流来算。 fvscheme 和fvsolutions用的tutorials 里面的sonic foam里shocktube的例子 但是算出来速度变化不随着时间推进而往前推进 不知道是不是时间步写错了(圆管直径3mm 网格用Gmesh 细化到0.1mm 速度600 时间步按公式算的1e-7)。
    或者是离散设置或者求解器里设置错了。 希望能得到指导下。 真的不知道怎么办了。。万分感谢🙏


  • 管理员

    压力设定请参考:

    outflow
       {
           type            waveTransmissive;
           value           uniform 80000;    //important for correct I/O
           field           p;                //the name of the field that we are working on
           gamma           1.4;              //the ratio of specific heats
           phi             phiv;             //the name of the volumetric flux field ( or if you use the mass flux phi, it will be divided by rho)
           rho             rho;              //the name of the density field
           psi             psi;              //the name of the field that is the deriv. of density with respect to pressure
           lInf            0.05;             //a measure of how far away the far-field condition should be
           fieldInf        80000;            //the far-field value to be applied to p
       }
    

    这是网上找到的,我没有用过。https://openfoamwiki.net/index.php/HowTo_Using_the_WaveTransmissive_Boundary_condition

    U文件夹里的internalfield的值

    表示内部场的速度

    fvscheme 和fvsolutions用的tutorials 里面的sonic foam里shocktube的例子 但是算出来速度变化不随着时间推进而往前推进 不知道是不是时间步写错了(圆管直径3mm 网格用Gmesh 细化到0.1mm 速度600 时间步按公式算的1e-7)。

    类似这种算的不对的问题,很难判断问题在哪 :expressionless:



  • 谢谢李老师回复🙏

    把p换成waveTransmissive的形式结果paraview还是空气不往前流动(只有inlet附近有速度tube其他地方没有速度变化)。
    可能是fvscheme或者fvsolution里面设置出错。自己试了不下于100遍了。还是不行,可以帮忙检查下吗。。🙏

    fvscheme如下

    ddtSchemes
    {
        default         Euler;
    }
    
    gradSchemes
    {
        default         Gauss linear;
    }
    
    divSchemes
    {
        default         none;
        div(phi,U)      Gauss limitedLinear 1;
        div(phi,e)      Gauss limitedLinear 1;
        div(phi,K)      Gauss limitedLinear 1;
        div(phiv,p)     Gauss limitedLinear 1;
        div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
    }
    
    laplacianSchemes
    {
        default         Gauss linear corrected;
    }
    
    interpolationSchemes
    {
        default         linear;
    }
    
    snGradSchemes
    {
        default         corrected;
    }
    
    

    fvsolution 如下

    
    solvers
    {
        "(p|rho)"
        {
            solver          PCG;
            preconditioner  DIC;
            tolerance       1e-6;
            relTol          0.01;
        }
    
        "(p|rho)Final"
        {
            $p;
            relTol          0;
        }
    
        "(U|e|k|nuTilda)"
        {
            solver          smoothSolver;
            smoother        symGaussSeidel;
            tolerance       1e-6;
            relTol          0.01;
        }
    
        "(U|e|k|nuTilda)Final"
        {
            $U;
            relTol          0;
        }
    }
    
    PIMPLE
    {
        momentumPredictor yes;
        nOuterCorrectors 3;
        nCorrectors     1;
        nNonOrthogonalCorrectors 0;
    
        pMinFactor      0.5;
        pMaxFactor      2.0;
    }
    
    }
    
    

    comtroldic如下

    
    application     rhoPimpleFoam;
    
    startFrom       latestTime;
    
    startTime       0;
    
    stopAt          endTime;
    
    endTime         5e-6;
    
    deltaT          1e-7;
    
    writeControl    timeStep;
    
    writeInterval   1;
    
    purgeWrite      0;
    
    writeFormat     binary;
    
    writePrecision  6; //was 6
    
    writeCompression off;
    
    timeFormat      general;
    
    timePrecision   6;
    
    runTimeModifiable yes;
    
    
    }
    


  • 键盘按键不一样按错了 没有高亮代码。抱歉。



  • 用paraview显示的速度只在inlet附近变化 其他部分不变化。求指点下🙏

    /Users/Air/Desktop/屏幕快照 2017-10-17 上午11.52.10.png



  • 0_1508212700850_屏幕快照 2017-10-17 上午11.52.10.png


  • 管理员

    网格多少?小的话我给你试试。



  • @李东岳 直径3mm长30mm的tube 用Gmesh 细化到0.1mm的网格 谢谢李老师!

    0_1508231331950_屏幕快照 2017-10-17 下午6.08.23.png 图片地址)


  • 管理员

    9000个网格?你上传上来我下载试试



  • @李东岳 感谢回复🙏 这个是tube的mesh https://pan.baidu.com/s/1miBVoeO
    这个tube只是为了简便练习下用的 实际想做有个小的3mm长的inlet然后测冲击波从tube里刚喷出那段时间的密度计测,这个是模型的mesh https://pan.baidu.com/s/1cLIYzO

    谢谢李老师


  • 管理员

    最好把整个算例传上来我直接运行。



  • @李东岳 https://pan.baidu.com/s/1kVd1wl5
    Thanks!


  • 管理员

    国外打国内的网站特别慢。百度盘打不开。你把网格发送到沃邮箱li.dy@dyfluid.com

    0_1508933206325_捕获.JPG


  • 管理员

    你提供的算例无法运行,报错文件缺失:

    
    dyfluid@dyfluid:~/桌面/tubecase/10$ ./Allrun 
    Cloning resolved case from .
    Running blockMesh on /home/dyfluid/桌面/tubecase/10/resolved
    Running decomposePar on /home/dyfluid/桌面/tubecase/10/resolved
    
    
    --> FOAM FATAL ERROR: 
    Cannot open file "system/decomposeParDict"
    
        From function int main(int, char**)
        in file foamDictionary.C at line 427.
    
    FOAM exiting
    
    Running sonicFoam in parallel on /home/dyfluid/桌面/tubecase/10/resolved using  processes
    Cloning modelled case from .
    Running blockMesh on /home/dyfluid/桌面/tubecase/10/modelled
    Running decomposePar on /home/dyfluid/桌面/tubecase/10/modelled
    
    
    --> FOAM FATAL ERROR: 
    Cannot open file "system/decomposeParDict"
    
        From function int main(int, char**)
        in file foamDictionary.C at line 427.
    
    FOAM exiting
    
    Running sonicFoam in parallel on /home/dyfluid/桌面/tubecase/10/modelled using  processes
             line 0: warning: Cannot find or open file "resolved/postProcessing/probes/0/p"
             line 0: warning: Cannot find or open file "modelled/postProcessing/probes/0/p"
             line 0: No data in plot
    
    dyfluid@dyfluid:~/桌面/tubecase/10$
    


  • @李东岳 在 新手求问冲击波管喷出的低马赫数supersonic的 边界条件问题 中说:

    Allrun

    李老师,

    感谢回复🙏

    发的文件夹里面的Allrun,Allclean文件是之前tutorial里复制粘贴过来的,忘了给删掉所以不能用,我用的是Gmesh进行网格划分已经划分过了不需要再用blockMesh了,

    另外算这个例子的时候感觉运算量没那么大就没有分cpu去算,所以没有设置decomposeParDict。我现在已经给您加上decomposerParDict文件了如果您想用的话改一下里面的cpu个数就行了,如果不用的话直接在终端输入sonicFoam应该就ok。

    另外,我用的版本是openFoam Plus的mac版的,如果用什么格式不对的话,按照tutorial里的复制一下报错的地方应该就行。

    下面是case的dropbox链接,
    这个是sonicFoam https://www.dropbox.com/s/2t2rc8k3vnl9fqp/sonicFoam.zip?dl=0

    这个是rhoCentralFoam
    https://www.dropbox.com/s/vzgr1r84fvxk1ts/rhoCentralFoam.zip?dl=0

    这两个例子离散格式和用的求解器不一样,这些求解器和离散格式 的意思还没有完全搞懂。。不知道是不是这里出的问题。求老师给看一下,什么样的离散格式和求解器才适合这个例子。

    Ryo


  • 管理员

    我现在下载看看。


  • 管理员

    把你的矩阵求解器这样改一下试试:

    "(p|U|e).*"
        {
            solver          PBiCGStab;
    	preconditioner	DILU;
            smoother        symGaussSeidel;
            tolerance       1e-15;
            relTol          0;
        }
    

    后续还运行不成功的话,我可以帮你继续再看看,不过麻烦把网格做成六面体网格并适当减少网格数量(5万以下) :cheeky:



  • @李东岳
    谢谢李老师。

    还是跟之前一样的错误。。tube里面的气体不往前面流动。
    这个是把网格换成六面体的case
    sonicFoam
    https://www.dropbox.com/s/bb0a0lmzb67h8o1/sonicFoam 3.zip?dl=0

    rhoCentralFoam
    https://www.dropbox.com/s/m5ayc8xkdd9ffi4/rhoCentralFoam.zip?dl=0

    Ryo


  • 管理员

    0_1509368932976_fca96a4a-0978-40c4-a7c1-7fb1f52a6be3-image.png

    你的压力是19600?是低压么。还是196000?

    非常抱歉,你这个网格太多了我笔记本跑不动。为了去掉网格因素,最好使用全六面体网格,你的这个网格还是四面体的。



  • @李东岳

    感谢李老师回复!

    用snappyHexMesh画六面体网格后发现问题解决了!!
    但是还有个问题为什么画的网格感觉好多小的瑕疵。。。。而且这还是完全没有细化也没有添加layers的情况。。
    0_1509435422662_屏幕快照 2017-10-31 下午4.32.55.png

    还想请老师帮忙看下snappyHexMeshDic。
    这个是snappyHexMeshDic:
    https://www.dropbox.com/s/ehr4vknk6injnvr/snappyHexMeshDict?dl=0

    这个是case
    https://www.dropbox.com/s/xzhhygrywtj3g2r/1.zip?dl=0

    Ryo


  • 管理员

    如果可以评分的话,我给snappyHexMesh及格分。直接换网格生成软件做全六面体网格,snappyHexMesh只是为了开源框架搭建的。



  • @李东岳
    谢谢 李老师 有点激动真的快哭了。。


  • 管理员

    0_1509462032948_捕获.JPG



  • @李东岳 感谢老师之前的解答现在又有问题想请教一下。

    现在把层流模型换成RAS KomegaSST乱流模型后结果也顺利出来了,研究目的是观察冲击波密度场变化,于是在controldict里加上了密度function,为了想观察冲击波和重播前面的涡流更清晰,想把初始场密度调成1kg/立方米,但是密度好像是根据粘度和初始压力等算出来的 不能调初始场的密度(修改0文件夹里的rho文件 结果还是没有变化)。想问下怎么调节初始密度场。

    0_1510905617833_屏幕快照 2017-11-17 16.55.47.png




  • 管理员

    密度好像是根据粘度和初始压力等算出来的

    是的,超音速边界条件理论上需要给压力、速度、和温度的边界条件,密度从其中算出来。这是稳定的边界条件

    0_1511164194583_捕获.JPG

    在代码上:

    volScalarField rho
        (
            IOobject
            (
                "rho",
                runTime.timeName(),
                mesh
            ),
            thermo.rho()
        );
    

    所以我觉得你应该通过thermo.rho()函数来给定密度因为rho不是读取出来的。



  • @李东岳 在 新手求问冲击波管喷出的低马赫数supersonic的 边界条件问题 中说:

    volScalar

    感谢回复

    这个代码的意思是修改求解器重新建立一个可单独计算密度的场吗,如果是的话 还需不需要在ControlDic里加rho function。

    然后代码是不是要放在 applications/solvers/compressible/sonicFoam/createFields.H里面?不知道是不是我用的Mac系统,找了一下午找不到createFields.H这个文件。。applications文件夹也没有找到。这些文件是不是隐藏在docker里面,怎么打开这些隐藏文件?
    麻烦老师了🙏

    Ryo



  • @李东岳
    李老师,现在发现openfoam Mac版的applications文件夹好像只存在于docker模拟的虚拟机里面在Mac上找不到。

    用vim在docker状态下找到createfields.H文件了,用vim打开后发现里面已经有一个rho的场存在,代码和您写的是一样的。
    是不是要像速度场那样 加上IOobject::MUST_READ,IObject::AUTO_WRITE这些代码才行,现在还没有完全理解这些代码的含义。比如 "Reading field U\n" << endl里面的这个n和endl是什么意思。。网上找了很久也没有发现答案。希望老师能解答一下🙏

    0_1511493306834_屏幕快照 2017-11-24 12.10.28.jpg


  • 管理员

    \nendl的意思是换行。

    加上IOobject::MUST_READ,IObject::AUTO_WRITE这些代码才行

    对,你加上AUTO_WRITE就会自动写了,然后重新编译一下。

    研究目的是观察冲击波密度场变化,于是在controldict里加上了密度function,

    不是很理解你的这句话哈 :confused:



  • @李东岳
    感谢回复🙏

    现在所在的这个研究室在做用独创的激光CT法观测从冲击波管里面喷出的冲击波密度场。 所以我现在想用OpenFOAM作为CFD工具模拟出冲击波的密度场,然后再和真实实验中的图像数据做对比。
    sonicfoam里面计算出的结果没发显示密度,在网上找了个代表密度函数的代码放到controldict里面后可以显示密度了但是不能直接在0文件夹里面调节初始密度场。
    这是放在controlDict里面的代码
    0_1511771945812_屏幕快照 2017-11-27 17.14.32.png

    现在把Oobject::MUST_READ,IObject::AUTO_WRITE加到createFields.H里面后,计算时仍然不读取0文件夹里面的密度边界条件和初始密度场。。
    0_1511772192335_屏幕快照 2017-11-27 16.24.51.jpg

    想问还需要编译什么才能直接调节初始场的密度。
    麻烦老师啦🙏



  • @李东岳 李老师,现在想重新编译时按照http://openfoamwiki.net/index.php/How_to_add_temperature_to_icoFoam。 这个教程想练一遍,发现wmake的时候出现错误

    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::STARCDCore::STARCDCore()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface(Foam::fileName const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::STARCDCore::starFileName(Foam::fileName const&, Foam::fileFormats::STARCDCore::fileExt)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `typeinfo for Foam::OBJstream'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::vtk::legacy::contentNames'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::reduce(Foam::Vector2D<double>&, Foam::sumOp<Foam::Vector2D<double> > const&, int, int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::OBJstream::~OBJstream()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::freePstreamCommunicator(int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::geometricSurfacePatch::geometricSurfacePatch(Foam::word const&, int, Foam::word const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::UPstream::finishedRequest(int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::scalePoints(double)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::xferPoints()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::DimensionedField<double, Foam::triSurfacePointGeoMesh>::typeName'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::STARCDCore::writePoints(Foam::Ostream&, Foam::Field<Foam::Vector<double> > const&, double)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::xferFaces()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::OBJstream::write(Foam::Vector<double> const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::NASCore::parseNASCoord(Foam::string const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface(Foam::fileName const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::STARCDCore::writeHeader(Foam::Ostream&, Foam::fileFormats::STARCDCore::fileHeader)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::abort()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::vtk::legacy::fileHeader(Foam::vtk::formatter&, std::string const&, std::string const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::DimensionedField<double, Foam::triSurfaceGeoMesh>::typeName'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::subsetMesh(Foam::List<bool> const&, Foam::List<int>&, Foam::List<int>&) const'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::OBJstream::write(Foam::face const&, Foam::UList<Foam::Vector<double> > const&, bool)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::vtk::outputOptions::legacy(bool)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::canRead(Foam::fileName const&, bool)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::STARCDCore::readPoints(Foam::IFstream&, Foam::Field<Foam::Vector<double> >&, Foam::List<int>&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::resetRequests(int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::allocatePstreamCommunicator(int, int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::edgeOwner() const'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::OBJstream::OBJstream(Foam::fileName const&, Foam::IOstream::streamFormat, Foam::IOstream::versionNumber, Foam::IOstream::compressionType)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::OBJstream::write(Foam::UList<Foam::face> const&, Foam::Field<Foam::Vector<double> > const&, bool)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface(Foam::List<Foam::labelledTri> const&, Foam::List<Foam::geometricSurfacePatch> const&, Foam::Field<Foam::Vector<double> > const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::init(int&, char**&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::geometricSurfacePatch::geometricSurfacePatch()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::UPstream::allToAll(Foam::UList<int> const&, Foam::UList<int>&, int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::STARCDCore::readHeader(Foam::IFstream&, Foam::fileFormats::STARCDCore::fileHeader)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::UIPstream::UIPstream(int, Foam::PstreamBuffers&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::~triSurface()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UIPstream::UIPstream(Foam::UPstream::commsTypes, int, Foam::DynamicList<char, 0u, 2u, 1u>&, int&, int, int, bool, Foam::IOstream::streamFormat, Foam::IOstream::versionNumber)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::sumReduce(double&, int&, int, int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::reduce(double&, Foam::minOp<double> const&, int, int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::operator=(Foam::triSurface const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `typeinfo for Foam::vtk::formatter'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::sortedEdgeFaces() const'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::vtk::legacy::dataTypeNames'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::coordSet::coordSet(Foam::word const&, Foam::word const&, Foam::List<Foam::Vector<double> > const&, Foam::List<double> const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface(Foam::List<Foam::labelledTri> const&, Foam::Field<Foam::Vector<double> > const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface(Foam::triSurface const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface(Foam::List<Foam::labelledTri>&, Foam::List<Foam::geometricSurfacePatch> const&, Foam::Field<Foam::Vector<double> >&, bool)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::addValidParOptions(Foam::HashTable<Foam::string, Foam::word, Foam::string::hash>&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libOpenFOAM.so: undefined reference to `Foam::UPstream::exit(int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::vtk::newFormatter(std::ostream&, Foam::vtk::formatType, unsigned int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::vtkUnstructuredReader::vtkUnstructuredReader(Foam::objectRegistry const&, Foam::ISstream&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::operator==(Foam::geometricSurfacePatch const&, Foam::geometricSurfacePatch const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::~triSurface()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libfiniteVolume.so: undefined reference to `Foam::UPstream::waitRequest(int)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::OBJstream::write(Foam::UList<Foam::edge> const&, Foam::UList<Foam::Vector<double> > const&, bool)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::write(Foam::fileName const&, bool) const'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `typeinfo for Foam::triSurface'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::movePoints(Foam::Field<Foam::Vector<double> > const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::DimensionedField<int, Foam::triSurfaceGeoMesh>::typeName'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::triSurface(Foam::triSurface const&)'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::markZones(Foam::List<bool> const&, Foam::List<int>&) const'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::fileFormats::NASCore::NASCore()'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::writeStats(Foam::Ostream&) const'
    /opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/lib/libmeshTools.so: undefined reference to `Foam::triSurface::clearOut()'
    collect2: error: ld returned 1 exit status
    make: *** [/opt/OpenFOAM/OpenFOAM-v1706/platforms/linux64GccDPInt32Opt/bin/my_icoFoam] Error 1
    sh-4.2# 
    

    我在想是不是用mac的原因于是 我又在虚拟机上(linux mint)上试了下,直接告诉我wmke command can not found
    。。不知道时怎搞的了。。能帮忙看下哪里出错了吗。
    🙏



  • @ryo 不是wmke是 wmake,刚才手误


  • 管理员

    在你的Make/option里面添加

    //EXE_INC = \下面加
    -I$(LIB_SRC)/meshTools/lnInclude \
    
    //EXE_LIBS = \下面加
    -lmeshTools \
    

    试试



  • @李东岳 谢谢 回复。🙏
    Make/option里面本来就有这些码。0_1512725181546_屏幕快照 2017-12-08 18.23.08.png


  • 管理员

    不好意思没有mac不能提供建设性意见 :big_mouth:



  • @李东岳 感谢老师回复 🙏

    Mac上还是没有找到什么原因wmake出错,但是在虚拟机(Linux Mint)上在按照openfoam wiki上添加温度的教程编译成功了。
    发现 在createfields.H里加Oobject::MUST_READ,IObject::AUTO_WRITE,和在/systym/controlDict里面加
    0_1513060706790_屏幕快照 2017-12-12 15.37.48.png
    效果一样 都只是根据初始p,U,粘度等来计算密度,不能直接读取0文件夹里面的rho文件。。。
    这是0文件夹里面的rho文件 虽然设置的是1但是计算后在paraview上显示是0.23
    0_1513060816206_屏幕快照 2017-12-12 15.31.18.png
    怎么才能跟fluent一样直接调节初始场密度呢。
    麻烦老师在看下🙏



  • @李东岳
    老师好!发现openfoam是不能直接进入密度场的因为openfoam用的是kinematic viscasity.fluent用的是动力粘度。
    0_1513326954486_屏幕快照 2017-12-14 16.26.35.png
    所以感觉还是得调节p,之前的压力边界条件我设置的是outlet为0.2大气压,inlet为zerogradient。现在调换后inlet为0.2大气压,outlet为zerogradient,initial为1个大气压。然后按照
    0_1513327734658_屏幕快照 2017-12-15 17.46.38.png
    更改fvscheme后达到预期的冲击波外的区域密度场都1左右,但是发现冲击波前面的涡很微弱。
    这是实验得到的图像。冲击波前面有很明显的蓝色的涡。
    0_1513328028553_屏幕快照 2017-11-20 13.59.32.png
    这是openfoam得到的图像,冲击波前面基本没有涡
    0_1513328098516_屏幕快照 2017-12-15 17.52.52.png


  • 管理员

    volScalarField rho
        (
            IOobject
            (
                "rho",
                runTime.timeName(),
                mesh
            ),
            thermo.rho()
        );
    

    OpenFOAM里面的密度是通过thermo.rho()更新的,因此你不能直接给密度。

    更改fvscheme后达到预期的冲击波外的区域密度场都1左右,但是发现冲击波前面的涡很微弱。这是实验得到的图像。冲击波前面有很明显的蓝色的涡。

    云图看起来不是很客观,最好出plot图看看



  • @东岳 Hi!
    又要来麻烦老师了🙏

    之前的涡的存在问题已经解决。原因是因为压力边界条件设置问题,还有发现k和epsilon之前按照公式算的是10的5次方级别的数字 但是我把他调节成0.5也能算而且精度更准,这个还不知道什么原因。。

    现在(其实从之前)就有个关于paraview的问题,把data放到paraview里面显示rho跑第一遍的colour legend和先显示p跑一遍在切换到rho显示的colour legend有些许的不同。

    这是显示rho跑第一遍的图 colour legend只显示到0.23
    0_1542768671839_屏幕快照 2018-11-21 11.46.20.png

    这是先跑完一遍p在切换到rho, colour legend就可以显示到0.06
    0_1542768794615_屏幕快照 2018-11-21 11.46.33.png

    求老师给点指示


  • 管理员

    什么是“先跑一遍rho和先跑完一遍p”... :zoule: :zoule: :zoule:



  • @东岳
    sorry 😂
    先跑一遍rho:把data放到paraview里面选择rho然后点击play
    0_1542872176845_屏幕快照 2018-11-22 16.10.30.png

    先跑一遍p在调节到rho:把data放到paraview里面先选择p然后点击play在从p调节到rho
    0_1542872217819_屏幕快照 2018-11-22 16.09.03.png

    想说的意思可能就是第一遍play显示的数据图像和play完第一遍后切换到其他性质(比如从密度切换到压强,压强切换到密度)后在切换回来显示的不一样。一样的data为什么会显示的不一样呢? 问题解释的可能有点傻,请见谅。。


  • 管理员

    0_1542931053530_捕获.JPG

    你点击一下这个试试



  • @东岳
    懂了,多谢老师。



  • @东岳
    又来麻烦老师了。之前用snappyHexMesh做的网格感觉不好现在想换用icem cfd来做,弄了好几天发现喷口旁边座位阻碍物的圆柱的网格有大瑕疵(表面的都很好),找了很多视频里面都没有找到该怎么去掉圆柱里面这些不需要的网格。
    另外icem cfd做好的网格怎么导入openfoam和paraview现在也没找出来方法。 请老师给点指示。
    0_1543480873745_Inked捕获_LI飞.jpg

    0_1543481633906_3.jpg

    🙏🙏



  • @ryo 不太明白为什么动力粘度就不需要单独设置密度了呢,那如果我需要设置成水的属性,密度为1000kg/m^3,运动粘性系数=1.139×10^-6Pa*s。除了修改属性设置文件transportProperties中的粘度,我怎么保证密度也是我想要的1000kg/m^3呢?希望能指导一二,跪谢



  • @regina Hi!

    openfoam不能直接进入密度场,密度是由其他物理条件(p,u,t...etc)计算出来的,我也想直接设置密度😭。。 我是通过调节初始p,u,t来调节初始的密度。sorry,不知道帮到你了没有。。

    另外你知道我这网格为啥会有这问题吗? 然后我把这网格用fluentToFoam了下发现报错
    0_1543554083798_屏幕快照 2018-11-30 14.00.50.png
    0_1543554101591_屏幕快照 2018-11-30 14.01.05.png

    之前用gmesh这样gmshToFoam都没问题可以转。。


  • 管理员

    @Ryo

    你的网格质量很差,导入的时候有可能出现问题。把你的tin文件上传一下我给你画一个

    这个帖子竟然48楼了 :papa:



  • @东岳 多谢老师
    这是tin文件 传到dropbox上的
    https://www.dropbox.com/s/4zw6pr4f9hvy86v/12345.tin?dl=0
    这是prj文件在dropbox上的
    https://www.dropbox.com/s/997ohw1j55uw2z3/12345.prj?dl=0

    我用snappyHexMesh弄的网格数在180万左右,网格少点没事,感谢老师啦Thanks♪(・ω・)ノ


  • 管理员

    0_1543627323918_捕获.JPG

    你按照我这样分block
    有点事我要出去


Log in to reply
 


CFD中文网 | 东岳流体学术 | 东岳流体商业 | 吉ICP备20003622号-1