我没用过2.3 不过一般情况下自己改模型的标准流程是:
- copy
- 修改文件内模型命名,用sed -i可以批量修改,比如原来叫kOmega,你现在可以改为MykOmega,注意看看是不是所有的class都改了,是不是有的地方不应该改,然后sed就给你全局 修改了?
- 修改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
希望能帮到你