Navigation

    CFD中文网

    CFD中文网

    • Login
    • Search
    • 最新

    不均匀温度边界 热流密度

    OpenFOAM
    1
    1
    169
    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.
    • H
      hongjiewang last edited by

      目前我只会做到在边界某段添加固定温度,整个边界都使用热流密度条件也是可以的,请问如何在边界的某段添加热流密度边界~比如下面这段0.000333<=x<=0.000666使用热流边界 应该如何修改~

      OUTLET
      {
          type            codedFixedValue;
          name            heated;
          value           uniform 300;
          
              codeInclude
              #{
                  #include "fvCFD.H"
              #};
      
              codeOptions
              #{
                  -I$(LIB_SRC)/finiteVolume/lnInclude \
                  -I$(LIB_SRC)/meshTools/lnInclude
              #};
      
      	    //libs needed to visualize BC in paraview
      	    codeLibs
      	    #{
          	-lmeshTools \
          	-lfiniteVolume
      	    #};
      
              code
              #{
                  /*const IOdictionary& d = static_cast<const IOdictionary&>
      			(
                      dict.parent().parent()
                  );
                  const fvMesh& mesh = refCast<const fvMesh>(d.db());
                  const label id = mesh.boundary().findPatchID("OUTLET");
                  const fvPatch& patch = mesh.boundary()[id];*/
      
                  
                  scalarField T(patch().size(), 300);	
      
                  forAll(T, i)
                  {
                      const scalar x = patch().Cf()[i][0];
                      //const scalar y = patch.Cf()[i][1];
                      //const scalar z = patch.Cf()[i][2];
                      if(x>=0.000333||x<=0.000666)
                      {
      	         T[i] = 400;
      	     }
      	     else
      	     {
      	         T[i] = 300;
      	     }    
                  }
      
                  (*this)==T;//T.writeEntry("", os);
              #};
           
      }
      
      1 Reply Last reply Reply Quote
      • First post
        Last post

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