Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    如何输出场最大温度值这个文件

    OpenFOAM
    4
    8
    4697
    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.
    • M
      myler last edited by

      本人openfoam新手,想要通过openfoam模拟droplet的燃烧过程,希望监测场中最大温度值随时间的变化,想请问一下要如何操作?或者说如何去操控openfoam输出的文件?谢谢!

      1 Reply Last reply Reply Quote
      • C
        CFD中文网 last edited by

        functions
        {
        pressureProbes
        {
        type 				probes;
        functionObjectLibs 	("libsampling.so");
        outputControl 		timeStep;
        outputInterval 		1;
        probeLocations//监控位置
        (
        ( 1 0 0 )
        ( 2 0 0 )
        );
        fields
        (
        T//监控场
        );
        }
        }
        }
        
        

        把上述代码添加到你的controlDict文件中。

        CFD中国标准用户测试帐号
        目前由徐笑笑登录

        M 1 Reply Last reply Reply Quote
        • M
          myler @CFD中文网 last edited by

          @cfd-china 您好,我把这个代码添加到了controlDict文件中,但是这个代码好像只能用来监测指定位置(1 0 0)和(2 0 0)的温度变化?我想要的时能够输出整个场中的温度最大值,请问要如何实现?我用的是sprayFoam solver,过程中terminal上每一个时间点都会显示最大温度和最小温度,但是我想将它以文件形式输出,方便我作图。十分感谢!

          C X 2 Replies Last reply Reply Quote
          • C
            CFD中文网 @myler last edited by

            您好,@myler

            整个场中的温度最大值

            这是一个值对吧?

            过程中terminal上每一个时间点都会显示最大温度和最小温度,但是我想将它以文件形式输出

            如果我理解的正确,你打算把这单独一个值以文件形式输出?:big_mouth:

            CFD中国标准用户测试帐号
            目前由徐笑笑登录

            M 1 Reply Last reply Reply Quote
            • X
              xpqiu 教授 @myler last edited by xpqiu

              @myler

              functions
              {
                  cellSource1
                  {
                      type         cellSource;
                      functionObjectLibs ("libfieldFunctionObjects.so");
                      enabled         yes;
                      outputControl   outputTime;
                      log             yes;
                      valueOutput    yes;
                      source          all;
                      operation       max;
              
                      fields
                      (
                          T
                      );
                  }
              }
              

              这个加到 controlDict 里就能输出最大值了。

              其实还有一种办法,既然你说在终端的输出信息中包括了最大和最小温度,那么如果你保存了终端输出信息,你还可以用 linux 的工具来从那些众多的信息中将你想要的最大和最小信息提取出来,
              比如,假设你的文件名为 log

              cat log | grep "max(" | sed 's/^\ *//g' | cut -d ' ' -f 5
              

              感兴趣的话可以试试这个命令,可能不能完全适合你的情况,你需要做些修改。

              M 1 Reply Last reply Reply Quote
              • M
                myler @xpqiu last edited by

                @xpqiu 用了这个代码问题解决了,十分感谢!:happy:

                J 1 Reply Last reply Reply Quote
                • M
                  myler @CFD中文网 last edited by

                  @cfd-china 问题已经解决了,十分感谢!:happy:

                  1 Reply Last reply Reply Quote
                  • J
                    Jhhu @myler last edited by

                    @myler 用这个代码是将最大值输出至cellSource1的文件夹吗?我也把这个代码添加至了controlDict里面,但是并没有看到最大值的输出结果啊

                    1 Reply Last reply Reply Quote
                    • First post
                      Last post

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