Skip to content
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠
CFD中文网

CFD中文网

  1. CFD中文网
  2. OpenFOAM
  3. New scalar in phaseModel.c

New scalar in phaseModel.c

已定时 已固定 已锁定 已移动 OpenFOAM
30 帖子 3 发布者 19.5k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    在 中回复了 kimy 最后由 编辑
    #13

    @kimy yes, declaration in .H file and definition in .C file.

    declaration of function myBeta() in phaseModel.H

    //- Return the maximum phase-fraction (e.g. packing limit)
            scalar alphaMax() const;
            scalar myBeta() const;
    

    and definition of function myBeta() in phaseModel.C

    Foam::scalar Foam::phaseModel::alphaMax() const
    {
        return alphaMax_;
    }
    
    Foam::scalar Foam::phaseModel::myBeta() const
    {
        return myBeta_;
    }
    

    滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

    异步沟通方式(《posting style》from wiki)(下载后打开):
    https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
    提问的智慧(github在gitee的镜像):
    https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way

    K 1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    在 中回复了 bestucan 最后由 kimy 编辑
    #14

    @bestucan But why alphaMax() was originally defined in the phaseModel.H without any error?

            scalar alphaMax() const
            {
                return alphaMax_;
            }
    

    After I defined only scalar myBeta() in phaseModel.H, the following error occurs:

    In file included from phaseModel/phaseModel.C:26:0:
    phaseModel/phaseModel.H:158:29: error: invalid declarator before 'd'
             tmp<volScalarField> d() const;
                                 ^
    phaseModel/phaseModel.H:162:26: error: non-member function 'const Foam::PhaseCompressibleTurbulenceModel<Foam::phaseModel>& Foam::turbulence()' cannot have cv-qualifier
                 turbulence() const;
    
    
    bestucanB 1 条回复 最后回复
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    在 中回复了 kimy 最后由 编辑
    #15

    @kimy because the position of this part

     scalar alphaMax() const
            {
                return alphaMax_;
            }
    

    in phaseModel.H belong to the declaration of class phaseModel.
    so you do have to name alphaMax() as phaseModel::alphaMax()
    as for "Foam::", just for rigorous.

    "declaration in H and define in C" is not something like ban. just a rule free to follow. and it's a good habit.


    you had edit your last post and delete the important part. I've seen it. you lost a ";". and error also said "invalid declarator before 'd'"

    滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

    异步沟通方式(《posting style》from wiki)(下载后打开):
    https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
    提问的智慧(github在gitee的镜像):
    https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way

    K 1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    在 中回复了 bestucan 最后由 kimy 编辑
    #16

    @bestucan Many thanks. The same error occurs, same as original when I run my case.
    7f6e60aa-3667-4985-9a7e-c16040fec2a6-image.png
    Could you please upload your phaseModel.C and H files here?

    1 条回复 最后回复
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    写于 最后由 编辑
    #17

    pasheModel_and_systemsolve.zip

    systemsolve is where I call myBeta()

    滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

    异步沟通方式(《posting style》from wiki)(下载后打开):
    https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
    提问的智慧(github在gitee的镜像):
    https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way

    K 2 条回复 最后回复
  • K 离线
    K 离线
    kimy
    在 中回复了 bestucan 最后由 编辑
    #18

    @bestucan I am a little bit crazy because my files are totally same as yours.......Still error after run. Note that I did not change the default library into user's library (All of them I leave it as defualt "LIB = $(FOAM_LIBBIN)/liblibcompressibleTwoPhaseSystem"
    ).

    1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    在 中回复了 bestucan 最后由 编辑
    #19

    @bestucan

    Selecting default blending method: none
    Selecting dragModel for (solids in water): SchillerNaumann
    Selecting swarmCorrection for (solids in water): none
    #0  Foam::error::printStack(Foam::Ostream&) at ??:?
    #1  Foam::sigSegv::sigHandler(int) at ??:?
    #2  ? in /lib64/libc.so.6
    #3  ? at ??:?
    #4  __libc_start_main in /lib64/libc.so.6
    #5  ? at ??:?
    Segmentation fault (core dumped)
    
    
    bestucanB 1 条回复 最后回复
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    在 中回复了 kimy 最后由 编辑
    #20

    @kimy do it slowly.

    1 find a normal case which works well. ensure basement is good
    2 add myBeta() only, and not use it. ensure compile works
    3 use cout << myBeta() << "somg flag". ensure function myBeta() works.
    4 use myBeta_ as a constant value in calculation. ensure framework is well.
    5 use myBeta_ as variable

    divide int more step if needed

    then use it as your wish. special case, special solver. If something wrong. there's nothing to do with myBeta(). maybe case? maybe solver? maybe variable overflow?

    you combine all steps into one step. it's hardly to debug.
    have you print myBeta_ value? just same as the value in case file?

    the error message seems not a special error. something about cout (Ostream&)

    滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

    异步沟通方式(《posting style》from wiki)(下载后打开):
    https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
    提问的智慧(github在gitee的镜像):
    https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way

    K 1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    在 中回复了 bestucan 最后由 kimy 编辑
    #21

    @bestucan Thanks. Your suggestions are very helpful. However, the solver met the same error mentioned before. I uploaded my solver and case files. Hope you can see them if you wish (I cannot upload). I modified the solver based on twophaseeulerfoam.

    1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    写于 最后由 编辑
    #22

    2020twoPhaseEulerFoam.zip

    1 条回复 最后回复
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    写于 最后由 编辑
    #23

    I've tried. seems like your OpenFOAM version is different with mine. my version is 8

    滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

    异步沟通方式(《posting style》from wiki)(下载后打开):
    https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
    提问的智慧(github在gitee的镜像):
    https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way

    K 1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    在 中回复了 bestucan 最后由 编辑
    #24

    @bestucan Thanks a lot. What you mean is that you did not meet any problem in your OpenFOAM version? Could you please upload the whole modified solver files here (twophaseeulerfoam)? The files I uploaed above was copied from blueCFD (maybe openfoam 5). Additionally, I am also using HPC where openfoam-v1906 is loaded.

    1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    写于 最后由 编辑
    #25

    This is the solver file of openfoam_v1906

    slurrypipebendsolver.zip

    1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    写于 最后由 编辑
    #26

    I have already reached my goal in another way. Thanks for all helps.

    1 条回复 最后回复
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    写于 最后由 编辑
    #27

    coagulation. complex for me to compile your solver. downloading and compiling openfoam 5 and openfoam v1906 cost lot of time. and several source file end with ".T.C" hadn't been upload.

    emmm..... not a good way to debug.:mihu: we have different OS and different environment.

    anyway, you've solved the problem.:high:

    滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

    异步沟通方式(《posting style》from wiki)(下载后打开):
    https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
    提问的智慧(github在gitee的镜像):
    https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way

    李东岳李 K 2 条回复 最后回复
  • 李东岳李 在线
    李东岳李 在线
    李东岳 管理员
    在 中回复了 bestucan 最后由 编辑
    #28

    @bestucan Thanks for tracking this issue :xiexie:

    http://dyfluid.com/index.html
    需要帮助debug算例的看这个 https://cfd-china.com/topic/8018

    bestucanB 1 条回复 最后回复
  • bestucanB 离线
    bestucanB 离线
    bestucan 版主 大神
    在 中回复了 李东岳 最后由 编辑
    #29

    @东岳 :xinxin2:

    滚来滚去……~(~o ̄▽ ̄)~o 滚来滚去都不能让大家看出来我不是老师么 O_o

    异步沟通方式(《posting style》from wiki)(下载后打开):
    https://www.jianguoyun.com/p/Dc52X2sQsLv2BRiqnKYD
    提问的智慧(github在gitee的镜像):
    https://gitee.com/bestucan/How-To-Ask-Questions-The-Smart-Way

    1 条回复 最后回复
  • K 离线
    K 离线
    kimy
    在 中回复了 bestucan 最后由 编辑
    #30

    @bestucan Thanks for your attention.

    1 条回复 最后回复

  • 登录

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 最新
  • 版块
  • 东岳流体
  • 随机看[请狂点我]