CFD中文网

    CFD中文网

    • 登录
    • 搜索
    • 最新

    请问怎么修改只读文件etc/controlDict里的参数?

    OpenFOAM
    3
    5
    888
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • H
      hotairballon1997 最后由 编辑

      如题,因为我现在用的openfoam是在超算中心里的模块,参数文件都是只读的。但是我想修改etc/controlDict里面的mpiBufferSize这一项,不知道该怎么实现?

      以前在1712(或者一些其他的版本)中是可以通过,复制一个用户自定义的controlDict文件在目录$HOME/.OpenFOAM/v1712/controlDict中,从而编辑这个文件就可以实现修改。但是在之后的1912(我现在用的版本)中这一功能好像没有了,不起作用。不知道有没有别的途径可以修改mpiBufferSize这一参数?

      1 条回复 最后回复 回复 引用
      • bestucan
        bestucan 版主 副教授 最后由 编辑

        https://www.openfoam.com/releases/openfoam-v1712/parallel.php
        这里的一句:

        as a setting in the OptimisationSwitches dictionary located in the \$WM_PROJECT_DIR/etc/controlDict file, or the per-user override in the /.OpenFOAM/v1712/controlDict file or per-case override in the $FOAM_CASE/system/controlDict file

        试试这个 or per-case 的方法:mihu:

        滚来滚去……~(~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/blob/master/README-zh_CN.md

        1 条回复 最后回复 回复 引用
        • H
          hotairballon1997 最后由 编辑

          谢谢回复,这个就是我之前提到的放在$HOME/.OpenFOAM/v1712/controlDict中可以覆盖etc/controlDict中的参数。但是这个功能好像只在1712,1812中有效,但是在1912版本中就不行了:135:

          bestucan 1 条回复 最后回复 回复 引用
          • 李东岳
            李东岳 管理员 最后由 编辑

            1712

            Note
            #     Many environment variables can be overridden using a <prefs.sh> file
            #     from one of these locations:
            #     * user-specific:
            #         * ~/.OpenFOAM/$WM_PROJECT_VERSION
            #         * ~/.OpenFOAM
            #     * group-specific:
            #         * $WM_PROJECT_SITE/site/$WM_PROJECT_VERSION
            #         * $WM_PROJECT_SITE/site
            #     * general:
            #         * $WM_PROJECT_DIR/etc
            #
            #     Any changes made to this bashrc file may be lost with the next upgrade.
            

            2006

            Description
            #     The OpenFOAM environment for POSIX shell (eg, bash,dash,zsh,...).
            #     Source manually or from the ~/.bashrc or ~/.profile files.
            #
            #     Most settings can be overridden with a <prefs.sh> file:
            #
            #       - Base values (eg, from system admin):
            #         -  $WM_PROJECT_DIR/etc/prefs.sh
            #
            #       - User or group values (first file found):
            #         -  ~/.OpenFOAM/$FOAM_API/prefs.sh
            #         -  ~/.OpenFOAM/prefs.sh
            #         -  $WM_PROJECT_SITE/$FOAM_API/etc/prefs.sh
            #         -  $WM_PROJECT_SITE/etc/prefs.sh
            #
            #     Some settings can also be overridden on the command-line when
            #     sourcing this file. For example,
            #
            #       . /path/etc/bashrc WM_COMPILER=Clang WM_LABEL_SIZE=64
            

            有些变化,你试试?

            线上CFD课程开始报名:http://www.dyfluid.com/class.html

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

            1 条回复 最后回复 回复 引用
            • bestucan
              bestucan 版主 副教授 @hotairballon1997 最后由 编辑

              @hotairballon1997 看着我真诚的眼神,告诉我,你看了我的帖子

              or per-case override in the $FOAM_CASE/system/controlDict file

              你懂我的意思吧.jpg

              滚来滚去……~(~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/blob/master/README-zh_CN.md

              1 条回复 最后回复 回复 引用
              • First post
                Last post