热压通风p_rgh边界条件设置
-
各位大佬,小白请教(Openfoam org V12):
想问一下在设置热压通风下的缝隙开孔渗透风时,我采用了prghTotalPressure边界,设定:room_window { type prghTotalPressure; p0 uniform 0; }
设定pRef在文件constant/pRef
为101325问题在于如此计算的渗透风速过高 不符合常理,1.2高差的窗户居然上边缘风速有3.5m/s。
初步排查因该确认为 prghTotalPressure中的p0为固定值pRef,外界压力没有随高差下降,导致流域内的p_rgh全为正值,且不同高度处的 p_rgh差值近似为 rg*高差
所以想要请教一下各位前辈:
1.是否是我的边界设置错误
2.如果是p0的问题 我该如何设置随高度变化的外部压力呢(用ai帮忙写的压力边界会使计算直接发散,如下):room_window { type codedFixedValue; value $internalField; name simplePrghPressure; code #{ // 简化版本 - 手动指定重力 const vector g(0, -9.81, 0); // 重力矢量 // 硬编码字段名 const word rhoName = "rho"; const word UName = "U"; // 获取边界场 const fvPatchScalarField& rhoBoundary = patch().lookupPatchField<volScalarField, scalar>(rhoName); const fvPatchVectorField& UBoundary = patch().lookupPatchField<volVectorField, vector>(UName); // 获取坐标 const vectorField& C = patch().Cf(); scalarField p0(C.size()); // 参考参数 const scalar p0_ref = 0; // 参考压力 const scalar H_ref = 0; // 参考高度 const scalar rho_ref = 1.2; // 参考密度 (kg/m³) // 线性压力分布 forAll(C, i) { scalar h = C[i].y() - H_ref; p0[i] = p0_ref - rho_ref * mag(g) * h; } // 计算prghTotalPressure vectorField hVector(C.size()); forAll(C, i) { hVector[i] = vector(0, C[i].y() - H_ref, 0); } operator== ( p0 - 0.5*rhoBoundary*magSqr(UBoundary) - rhoBoundary*(g & hVector) ); #}; // 必需字段 rho rho; U U; }
-
非常抱歉,之前提问的过于仓促
问题是我在将窗缝应用上述p_rgh边界后,存在计算出的渗透风速过大的问题。
1.p_rgh结果分布
2.窗缝法向风速
理论上,窗缝上下边缘在不计室内对流的情况下,上下窗缝压差应该为:
$\Delta P = \Delta\rho\cdot g \cdot H$
$\Delta \rho$为室内外温度下的空气密度差
假设室内25℃,室外35℃,室内外密度差约为:$0.0385 kg/m^3$
本例窗户高 $H$为1.2$m$。
计算得上下窗缝边缘的压差应当约为:$\Delta P = 0.0385 \times 9.81 \times 1.2 =0.453 Pa$
显然不足以支撑图中如此大的风速,便怀疑压力边界使用错误(即帖子最初的提问)下面是窗缝的其他边界条件:
//T room_window { type inletOutlet; inletValue uniform 308.15;//35℃ value uniform 308.15; }
//U room_window { type pressureInletOutletVelocity; tangentialVelocity uniform (0 0 0 ); value uniform (0 0 0); }
//p room_window { type calculated; value uniform 101325;}
k、e、alphat、nut不再列出
-
@李东岳
机械送风是速度入口 机械排风为压力出口机械送风边界条件:
//U room_supplyAir { type fixedValue; value uniform (0 -3 0); }
//p_rgh room_supplyAir { type fixedFluxPressure; value uniform 0; }
//p room_supplyAir { type calculated; value uniform 101325; }
//T room_supplyAir { type fixedValue; value uniform 293.15; }
机械排风边界条件:
//U room_returnAir { type zeroGradient; }
//p_rgh room_returnAir { type prghPressure; p uniform 0; value uniform 0; }
//p room_returnAir { type calculated; value uniform 101325; }
//T room_returnAir { type zeroGradient; }
-
@李东岳
我感觉是压力边界除了问题,prghTotalPressure如相关介绍:其中的 $p_0$ 是标量定值,但理论上窗外的热空气也会随高度下降而总压下降的。
然后自己请AI帮忙写了随高度变化$p_0$的边界codedFixedValue,但是一应用就发散,计算不了,粘贴前文代码:room_window { type codedFixedValue; value $internalField; name simplePrghPressure; code #{ // 简化版本 - 手动指定重力 const vector g(0, -9.81, 0); // 重力矢量 // 硬编码字段名 const word rhoName = "rho"; const word UName = "U"; // 获取边界场 const fvPatchScalarField& rhoBoundary = patch().lookupPatchField<volScalarField, scalar>(rhoName); const fvPatchVectorField& UBoundary = patch().lookupPatchField<volVectorField, vector>(UName); // 获取坐标 const vectorField& C = patch().Cf(); scalarField p0(C.size()); // 参考参数 const scalar p0_ref = 0; // 参考压力 const scalar H_ref = 0; // 参考高度 const scalar rho_ref = 1.2; // 参考密度 (kg/m³) // 线性压力分布 forAll(C, i) { scalar h = C[i].y() - H_ref; p0[i] = p0_ref - rho_ref * mag(g) * h; } // 计算prghTotalPressure vectorField hVector(C.size()); forAll(C, i) { hVector[i] = vector(0, C[i].y() - H_ref, 0); } operator== ( p0 - 0.5*rhoBoundary*magSqr(UBoundary) - rhoBoundary*(g & hVector) ); #}; // 必需字段 rho rho; U U; }