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



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

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


  • Linux讲师 OpenFOAM讲师

    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:



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



  • 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
    

    有些变化,你试试?


  • Linux讲师 OpenFOAM讲师

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

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

    你懂我的意思吧.jpg


Log in to reply