Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    将2.3版本中自带的kOmega模型改名字后单独编译报错?

    OpenFOAM
    3
    7
    1121
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • 一
      一颗鸭蛋 last edited by

      回复: 在OF2.3.0版本如何编译低版本下的湍流模型?![替代文字](a0041028-0cef-4bb0-850c-9e5139d51c61-图片.png 图片地址)
      照理说应该是能够编译通过的呀?为什么在src/turbulenceModels/incompressible/RAS下所有模型能编译通过,单独编译却不行。

      1 Reply Last reply Reply Quote
      • 一
        一颗鸭蛋 last edited by

        ![替代文字](75841905-60ba-4e00-9c7c-624b2444688c-图片.png 图片地址)
        f3a5d7ae-b719-4178-8f8a-036762ae78b8-图片.png
        然后我将files文件中所有.C文件全部删除后(包括主程序文件),再编译就没有报错,可是这明显不对,,,,郁闷,,,

        1 Reply Last reply Reply Quote
        • 一
          一颗鸭蛋 last edited by

          在其他编译成功的Make/linux64GccDPopt/目录下存在dependencies,将其打开如下:
          8d3c839e-ce7d-4b89-bd51-3b50865e16b8-图片.png
          b411e066-822f-49d2-b9a3-0b9a9b92cd52-图片.png
          在百度文库中找到描述这个错误的方法如上图所示,但是不知道具体应该连接那个库,,,才能正确更新并生成主程序的dep文件。渴望各位前辈指点,,,:baobao:

          1 Reply Last reply Reply Quote
          • 李东岳
            李东岳 管理员 last edited by

            把你Make里面的files和options用代码的形式贴一下

            CFD高性能服务器 http://dyfluid.com/servers.html

            一 1 Reply Last reply Reply Quote
            • 星
              星星星星晴 last edited by

              我没用过2.3 不过一般情况下自己改模型的标准流程是:

              1. copy
              2. 修改文件内模型命名,用sed -i可以批量修改,比如原来叫kOmega,你现在可以改为MykOmega,注意看看是不是所有的class都改了,是不是有的地方不应该改,然后sed就给你全局 修改了?
              3. 修改Make中的files和option
              files中注意你的目标文件名是否已经修改为心的 .C文件
              sprayFoamTest.C//原来是sprayFoam
              //是否输出到你的USER_LIBBIN,
              //而且有一个心的命名,如果成功编译在你的USER_APPBIN中会出现一个新的文件,以你设置的下面的名字命名,例如我的就是sprayFoamTest
              EXE = $(FOAM_USER_APPBIN)/sprayFoamTest
              
              
              首行添加引用的地方
              LIB_USER_SRC = $(WM_PROJECT_USER_DIR)/src
              
              EXE_INC = \
                  -I. \
                  -I../reactingParcelFoam \
                  -I$(LIB_SRC)/finiteVolume/lnInclude \
                  -I${LIB_SRC}/meshTools/lnInclude \
                  -I${LIB_SRC}/sampling/lnInclude \
                  -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
                  -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
                  -I$(LIB_USER_SRC)/lagrangian/basic/lnInclude \
                  -I$(LIB_USER_SRC)/lagrangian/intermediate/lnInclude \
                  -I$(LIB_USER_SRC)/lagrangian/spray/lnInclude \
                  -I$(LIB_USER_SRC)/lagrangian/distributionModels/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
                  -I$(LIB_SRC)/transportModels/compressible/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
                  -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
                  -I$(LIB_SRC)/ODE/lnInclude \
                  -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
                  -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
                  -I$(LIB_SRC)/combustionModels/lnInclude
              
              EXE_LIBS = \
                  -L$(FOAM_USER_LIBBIN) \ //这个地方也别忘了添加,有可能编译的时候找不到改位置 如果不设置的话
                  -lturbulenceModels \
                  -lcompressibleTurbulenceModels \
                  -llagrangian \
                  -llagrangianIntermediate \
                  -llagrangianTurbulence \
                  -llagrangianSpraytest \  //这边要引用你自己修改的模型的名称
                  -lspecie \
                  -lcompressibleTransportModels \
                  -lfluidThermophysicalModels \
                  -lliquidProperties \
                  -lliquidMixtureProperties \
                  -lsolidProperties \
                  -lsolidMixtureProperties \
                  -lthermophysicalFunctions \
                  -lreactionThermophysicalModels \
                  -lSLGThermo \
                  -lchemistryModel \
                  -lradiationModels \
                  -lODE \
                  -lregionModels \
                  -lsurfaceFilmModels \
                  -lcombustionModels \
                  -lfiniteVolume \
                  -lfvOptions \
                  -lmeshTools \
                  -lsampling
              

              希望能帮到你

              在写博士毕业论文,寻找postdoc或者职位中~
              m.sui20@foxmail.com

              一 1 Reply Last reply Reply Quote
              • 一
                一颗鸭蛋 @李东岳 last edited by

                @东岳
                8adbbca4-4cd0-4894-ba3e-9381f41e4a39-图片.png
                e29f8c56-522d-452f-ab9d-d6b89ac42f91-图片.png

                前辈;file和Options的内容如上

                1 Reply Last reply Reply Quote
                • 一
                  一颗鸭蛋 @星星星星晴 last edited by

                  @星星星星晴
                  谢谢你,我已经把这个错误解决了,是因为我在files文档的第一行kOmega231/kOmega231.C应该写成kOmega231.C

                  1 Reply Last reply Reply Quote
                  • First post
                    Last post

                  CFD中文网 | 东岳流体 | 京ICP备15017992号-2
                  论坛登录问题反馈可联系 li.dy@dyfluid.com