buoyangSimpleFoam计算周期性平板



  • 3D平板流边界如下,采用createPatch将流向与展向均为周期性,上下避免设置为壁面

     13     location    "constant/polyMesh";
     14     object      boundary;
     15 }
     16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     17 
     18 6
     19 (
     20     bottom
     21     {
     22         type            wall;
     23         inGroups        1(wall);
     24         nFaces          80000;
     25         startFace       4679200;
     26     }
     27     top
     28     {
     29         type            wall;
     30         inGroups        1(wall);
     31         nFaces          80000;
     32         startFace       4759200;
     33     }
     34     front1
     35     {
     36         type            cyclic;
     37         inGroups        1(cyclic);
     38         nFaces          40000;
     39         startFace       4839200;
     40         matchTolerance  0.0001;
     41         transform       unknown;
     42         neighbourPatch  back1;
     43     }
     44     back1
     45     {
     46         type            cyclic;
     47         inGroups        1(cyclic);
     48         nFaces          40000;
     49         startFace       4879200;
     50         matchTolerance  0.0001;
     51         transform       unknown;
     52         neighbourPatch  front1;
     53     }
     54     in1
     55     {
     56         type            cyclic;
     57         inGroups        1(cyclic);
     58         nFaces          800;
     59         startFace       4919200;
     60         matchTolerance  0.0001;
     61         transform       unknown;
     62         neighbourPatch  out1;
     63     }
     64     out1
     65     {
     66         type            cyclic;
     67         inGroups        1(cyclic);
     68         nFaces          800;
     69         startFace       4920000;
     70         matchTolerance  0.0001;
     71         transform       unknown;
     72         neighbourPatch  in1;
     73     }
     74 )


  • 计算变物性周期性平板流,添加fvOptions文件设置周期性入口速度设定ubar

         location    "constant";
     14     object      fvOptions;
     15 }
     16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     17 
     18 momentumSource
     19 {
     20     type            meanVelocityForce;
     21 
     22     selectionMode   all;
     23 
     24     fields      (U);
     25     Ubar            (0.0005 0 0);
     26 }
    

    0文件里设置边界条件如下

         location    "0";
     14     object      T;
     15 }
     16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     17 
     18 dimensions      [0 0 0 1 0 0 0];
     19 
     20 internalField   uniform 410;
     21 
     22 boundaryField
     23 {
     24     back1
     25     {
     26         type            cyclic;
     27     }
     28 
     29     front1 
     30     {
     31         type            cyclic; 
     32     }
     33 
     34     bottom
     35     {
     36         type            fixedValue;
     37         value           uniform 430;
     38     }
     39 
     40     top
     41     {
     42         type            fixedValue;
     43         value           uniform 410;
     44     }
     45 
     46     out1
     47     {
     48          type           cyclic;
     49     }
     50 
     51     in1
     52     {
     53          type           cyclic;
     54     }
     55 }
    
         location    "0";
     14     object      U;
     15 }
     16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     17 
     18 dimensions      [0 1 -1 0 0 0 0];
     19 
     20 internalField   uniform (0 0 0);
     21 
     22 boundaryField
     23 {
     24     back1
     25     {
     26         type            cyclic;
     27     }
     28 
     29     front1
     30     {
     31         type            cyclic;
     32     }
     33 
     34     bottom
     35     {
     36         type            noSlip;
     37     }
     38 
     39     top
     40     {
     41         type            noSlip;
     42     }
     43 
     44     out1
     45     {
     46         type            cyclic;
     47     }
     48 
     49     in1
     50     {
     51         type            cyclic;
     52     }
    
    3     location    "0";
     14     object      p_rgh;
     15 }
     16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     17 
     18 dimensions      [1 -1 -2 0 0 0 0];
     19 
     20 internalField   uniform 8e6;
     21 
     22 boundaryField
     23 {
     24     back1
     25     {
     26         type            cyclic;
     27     }
     28 
     29     front1
     30     {
     31        type             cyclic;
     32     }
     33 
     34     bottom
     35     {
     36         type           fixedFluxPressure;
     37     }
     38 
     39     top
     40     {
     41         type           fixedFluxPressure;
     42     }
     43 
     44     out1
     45     {
     46         type            cyclic;
     47     }
     48 
     49     in1
     50     {
     51         type            cyclic;
     52     }
    
    13     location    "0";
     14     object      p;
     15 } 
     16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     17      
     18 dimensions      [1 -1 -2 0 0 0 0];
     19      
     20 internalField   uniform 8e6;
     21 
     22 boundaryField
     23 { 
     24     back1
     25     {
     26         type            cyclic;
     15 }
     17 
     20 internalField   uniform 8e6;
     21 
     22 boundaryField
     23 {
     24     back1
     25     {
     26         type            cyclic;
     27     }   
     28     
     29     front1
     30     {
     31         type            cyclic;
     32     }   
     33     
     34     bottom
     35     {
     36         type            fixedFluxPressure;
     37     }   
     38     
     39     top
     40     {
     41         type            fixedFluxPressure;
     42     }   
     43     
     44     out1
     45     {
     46          type           cyclic;
     47     }    
     48     
     49     in1
     50     {
     51           type          cyclic;
     52     } 
    

    层流计算,所以constant/turbulenceProperties设置为laminar,但没有设置laminar的参数,我看OF自带算例laminar中有设置参数,但对参数不太了解就没设

     12     class       dictionary;
     13     object      turbulenceProperties;
     14 } 
     15 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     16 simulationType  laminar;
    
    

    参考channel395设置的离散格式及离散精度

        class       dictionary;
     13     object      fvSchemes;
     14 } 
     15 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     16       
     17 ddtSchemes
      8 FoamFile
      9 {
     10     version     2.0;
     11     format      ascii;
     12     class       dictionary;
     13     object      fvSchemes;
     14 }
     15 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     16 
     17 ddtSchemes
     18 {     
     19     default steadyState;
     20 }   
     21 
     22 gradSchemes
     23 { 
     24     default         Gauss linear;
     25 }
     26 
     27 divSchemes
     28 {
     29     default         none;
     30 
     31     div(phi,U)      Gauss limitedLinear 1;
     32     div(phi,K)      Gauss limitedLinear 1;
     33     div(phi,h)      Gauss limitedLinear 1;
     34     div(phi,k)      Gauss limitedLinear 1;
     35    // div(phi,epsilon) Gauss limitedLinear 1;
     36    // div(phi,omega) bounded Gauss limitedLinear 0.2;
     37     div((phi|interpolate(rho)),p) Gauss limitedLinear 1;
     38     div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
     39 }
     40 
     41 laplacianSchemes
     42 {
     43     default         Gauss linear corrected;
     44 }
     45 
     46 interpolationSchemes
     47 {
     48     default         linear;
     49 }
     50 
     51 snGradSchemes
     52 {
     53     default         corrected;
     54 }
     55 
     56 wallDist
     57 {
     58     method meshWave;
     59 }
    
     13     location    "system";
     14     object      fvSolution;
     15 }
     16 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
     17 
     18 solvers
     19 {
     20     p_rgh
     21     {
     22         solver           GAMG;
     23         tolerance        1e-7;
     24         relTol           0.01;
     25         smoother         DICGaussSeidel;
     26 
     27     } 
     28      
     29     "(U|h|k|epsilon|omega)"
     30     {
     31         solver          smoothSolver;
     32         smoother        symGaussSeidel;
     33         //preconditioner  DILU;
     34         tolerance       1e-8;
     35         relTol          0.1;
     36     }
     37 }
     38 
     39 SIMPLE
     40 {
     41     momentumPredictor no;
     42     nNonOrthogonalCorrectors 0;
     43     //pRefCell       0;
     44     pRefPoint      (0 0.002 0); 
     45     pRefValue      8.0e6;
     46 
     47     residualControl
     48     {
     49         p_rgh           1e-8;
     50         U               1e-8;
     51         h               1e-8;
     52 
     53         // possibly check turbulence fields
     54         "(k|epsilon|omega)" 1e-7;
     55     }
     56 }
     57 
     58 relaxationFactors
     59 {
     60     fields
     61     {
     62         rho             0.000007;
     63         p_rgh           0.000001;
     64     }
     65     equations
     66     {
     67         U               0.00001;
     68         h               0.00001;
     69         "(k|epsilon|omega)" 0.7;
    


  • 计算结果速度ubar和连续性误差发散,温度会超过我给定的温度,导致密度也不符给定温度所对应的密度。求指导!

    Time = 132
    smoothSolver:  Solving for h, Initial residual = 0.0187811, Final residual = 5.63294e-10, No Iterations 1
    GAMG:  Solving for p_rgh, Initial residual = 0.794388, Final residual = 0.233352, No Iterations 1000
    Pressure gradient source: uncorrected Ubar = -0.399802, pressure gradient = -5.88632e+13
    time step continuity errors : sum local = 7.41708e+09, global = -140114, cumulative = -847557
    rho max/min : 118.845 20.83
    ExecutionTime = 621.62 s  ClockTime = 640 s 
    Time = 133
    smoothSolver:  Solving for h, Initial residual = 0.0181793, Final residual = 6.69858e-10, No Iterations 1
    GAMG:  Solving for p_rgh, Initial residual = 0.789481, Final residual = 0.239609, No Iterations 1000
    Pressure gradient source: uncorrected Ubar = 0.579449, pressure gradient = -1.19796e+15
    time step continuity errors : sum local = 7.72821e+09, global = -121341, cumulative = -968897
    rho max/min : 118.845 20.83
    ExecutionTime = 644.5 s  ClockTime = 663 s 
    Time = 134
    smoothSolver:  Solving for h, Initial residual = 0.0175436, Final residual = 6.60026e-10, No Iterations 1
    GAMG:  Solving for p_rgh, Initial residual = 0.787433, Final residual = 0.241788, No Iterations 1000
    Pressure gradient source: uncorrected Ubar = -0.218891, pressure gradient = -7.73639e+14
    time step continuity errors : sum local = 7.86889e+09, global = 279932, cumulative = -688965
    rho max/min : 118.845 20.83
    ExecutionTime = 667.39 s  ClockTime = 686 s
    


  • @Exthan

    relaxationFactors
     59 {
     60     fields
     61     {
     62         rho             0.000007;
     63         p_rgh           0.000001;
     64     }
     65     equations
     66     {
     67         U               0.00001;
     68         h               0.00001;
     69         "(k|epsilon|omega)" 0.7;
    

    为什么这么设置松弛因子



  • @东岳 因为buiyantSimple是稳态的,而且计算发散,所以想着调小松驰因子,至于k.epsion其实可以删掉或者注释掉



  • @Exthan 不知道是边界条件设错了还是应该更换求解器


Log in to reply
 

CFD中文网 2016 - 2020 | 京ICP备15017992号-2