Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    如何求解一个场的体平均或者一个面的面平均值,比如体平均温度或者面平均温度

    OpenFOAM
    2
    2
    2208
    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.
    • G
      gzh3369 last edited by

      我知道可以通过paraview的integrate variables filter来进行,想知道controlDict中添加functions是否可以实现?

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

        @gzh3369

        如果公式是这样的话:$x=\frac{\sum V_i x_i}{\sum V_i}$。可以这样:

                forAll(x, celli)//对所有的体x进行计算
                {	    
                    x[celli] = x[celli] *mesh.V()[celli];//此处即为每个网格的x*网格体积
                }
        	
                scalar sumx = gSum(x);//对所有的x*网格体积进行加和
                scalar V = gSum(mesh.V());//计算总网格体积
                scalar Final = sumx/V;//计算体均湍流动能耗散率
                Info << runTime.timeName() <<" volume average x is "<<x<<endl;//输出结果
        

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

        1 Reply Last reply Reply Quote
        • First post
          Last post

        CFD中文网 | 东岳流体 | 京ICP备15017992号-2