新手求问冲击波管喷出的低马赫数supersonic的 边界条件问题
-
你提供的算例无法运行,报错文件缺失:
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
-
@李东岳
谢谢李老师。还是跟之前一样的错误。。tube里面的气体不往前面流动。
这个是把网格换成六面体的case
sonicFoam
https://www.dropbox.com/s/bb0a0lmzb67h8o1/sonicFoam 3.zip?dl=0rhoCentralFoam
https://www.dropbox.com/s/m5ayc8xkdd9ffi4/rhoCentralFoam.zip?dl=0Ryo
-
感谢李老师回复!
用snappyHexMesh画六面体网格后发现问题解决了!!
但是还有个问题为什么画的网格感觉好多小的瑕疵。。。。而且这还是完全没有细化也没有添加layers的情况。。
还想请老师帮忙看下snappyHexMeshDic。
这个是snappyHexMeshDic:
https://www.dropbox.com/s/ehr4vknk6injnvr/snappyHexMeshDict?dl=0这个是case
https://www.dropbox.com/s/xzhhygrywtj3g2r/1.zip?dl=0Ryo
-
@李东岳 在 新手求问冲击波管喷出的低马赫数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是什么意思。。网上找了很久也没有发现答案。希望老师能解答一下🙏 -
@李东岳
感谢回复🙏现在所在的这个研究室在做用独创的激光CT法观测从冲击波管里面喷出的冲击波密度场。 所以我现在想用OpenFOAM作为CFD工具模拟出冲击波的密度场,然后再和真实实验中的图像数据做对比。
sonicfoam里面计算出的结果没发显示密度,在网上找了个代表密度函数的代码放到controldict里面后可以显示密度了但是不能直接在0文件夹里面调节初始密度场。
这是放在controlDict里面的代码
现在把Oobject::MUST_READ,IObject::AUTO_WRITE加到createFields.H里面后,计算时仍然不读取0文件夹里面的密度边界条件和初始密度场。。
想问还需要编译什么才能直接调节初始场的密度。
麻烦老师啦🙏 -
@李东岳 李老师,现在想重新编译时按照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
。。不知道时怎搞的了。。能帮忙看下哪里出错了吗。
🙏