/// <summary>将输入数据和程序中变量做对应,需要存在输入文件后再调用,全局变量赋值,并简化表示方法,初步计算</summary> public void Recognize() { ///························································ //主要对输入数据的表示方法进行简化处理,被赋值的变量均为[全局变量] //同时可对输入数据进行[简单的]计算 ///························································· InputModel InputData = MyIOManager.InputData; //子通道对象 Channels = InputData.ChannelCollection.Channels; //燃料棒对象 Rods = InputData.RodCollection.Rods; //燃料棒类型集合 RodTypes = InputData.RodTypes; //子通道数 Ni = Channels.Count; //轴向分段数 Nj = InputData.RodCollection.Segment; //燃料棒个数 Nk = Rods.Count; //功率因子 PowerFactor = InputData.Options.PowerFactor.Multiplier; //燃料芯块功率份额 PelletShare = InputData.Options.PowerFactor.PelletShare; //燃料包壳功率份额 CladShare = InputData.Options.PowerFactor.CladShare; //流体中慢化功率份额 FluidShare = InputData.Options.PowerFactor.FluidShare; //临界热流密度CHF计算公式选用 CHF_formula = InputData.Options.DNBR_Formula; //冷却剂模型 Coolent = InputData.MaterialCollection.Fluid; //气体间隙 GasGap = InputData.MaterialCollection.GasGap; //固体材料集合 Materials = InputData.MaterialCollection.Materials; //初始的流量数据模型 MassFlow = InputData.MassFlow; //流体流动方向与垂直方向的夹角cosθ(向上为正;-1~1) Flow_Direction = MassFlow.Flow_Direction; //定位格架模型 Grids = InputData.GridCollection.Grids; foreach (Channel Ch in Channels) { //计算总流通面积 TotalArea += Ch.FlowArea; //计算总湿周 TotalLw += Ch.WetPerimeter; TotalLh += Ch.HotPerimeter; } //计算总的等效直径 TotalDi = 4 * TotalArea / TotalLw; //获取参数计算要求的精确度 i.e.参数小数点后保留位数 Acc = InputData.Options.Precision; //读取瞬态设置 Transient = InputData.Options.Transient; //计算选项 Options = InputData.Options; //迭代控制 Iteration = Options.Iteration; //最大迭代次数 MaxIteration = Iteration.MaxIteration; //迭代收敛因子 SigmaLimit = Iteration.Sigma; //包壳分段数(计算温度) CladSegment = Options.CladSegment; //芯块分段数(计算温度) PelletSegment = Options.PelletSegment; //消息输出 MsgCenter.ShowMessage("子通道数:" + Ni); MsgCenter.ShowMessage("轴向分段:" + Nj); MsgCenter.ShowMessage("燃料棒数:" + Nk); MsgCenter.ShowMessage("流动方向:" + Flow_Direction); MsgCenter.ShowMessage("迭代方式:" + Iteration.IterationType.ToString()); MsgCenter.ShowMessage("是否计算瞬态:" + MyIOManager.InputData.Options.Transient.Use.ToString()); }
/// <summary> /// 计算燃料棒稳态温度场 /// </summary> /// <param name="Nj">轴向分段数</param> /// <param name="Nk">燃料棒数</param> /// <param name="coolent">冷却剂</param> /// <param name="channels">通道结合</param> /// <param name="rods">燃料棒集合</param> /// <param name="rodTypes">燃料棒类型集合</param> /// <param name="materials">材料集合</param> /// <param name="channelsFlow">已经得到的子通道稳态流体计算结果</param> /// <param name="gasGap">气体间隙模型对象</param> /// <param name="options">计算选项集合</param> /// <returns></returns> public List <RodTemperature> Caculate_Rods_Temperature_Steady( int Nj, int Nk, Fluid coolent, List <Channel> channels, List <Rod> rods, List <RodType> rodTypes, List <Material> materials, List <ChannelFlow> channelsFlow, GasGap gasGap, Options options) { Main.MsgCenter.ShowMessage("--------计算燃料棒温度场--------"); //燃料棒温度集合 返回数据 List <RodTemperature> RodsTemperature = new List <RodTemperature>(); //包壳分段数 var CladSegment = options.CladSegment; //芯块分段数 var PelletSegment = options.PelletSegment; //功率因子 var powerFactor = options.PowerFactor.Multiplier; //包壳功率份额 var cladShare = options.PowerFactor.CladShare; //芯块功率份额 var pelletShare = options.PowerFactor.PelletShare; //冷却剂中功率份额 var fluidShare = options.PowerFactor.FluidShare; //计算结果准确度设置 var acc = options.Precision; //燃料棒周围主流流体温度 Matrix <double> Tf = Matrix <double> .Build.Dense(Nj, Nk, 0); //燃料棒周围主流流体对流换热系数 Matrix <double> h = Matrix <double> .Build.Dense(Nj, Nk, 0); Matrix <double> massFlowDensity = Matrix <double> .Build.Dense(Nj, Nk, 0); //遍历所有燃料棒 for (int k = 0; k < Nk; k++) { //新建一个用于存储一个燃料棒输出的对象 RodTemperature RodkTemperature = new RodTemperature { Index = rods[k].Index, SubRods = new List <SubRodTemperature>(), }; //径向温度节点数 int size = CladSegment + PelletSegment + 2; //燃料棒k的温度场 矩阵 Matrix <double> RodTField = Matrix <double> .Build.Dense(Nj, size, 0); //是否找到燃料类型 bool isTypeFound = false; RodType rodType = new RodType(); //找到燃料棒k的燃料棒类型 foreach (RodType type in rodTypes) { if (type.Index == rods[k].Type) { rodType = type; //找到了燃料棒类型 isTypeFound = true; break; } } //如果未找到燃料棒类型 if (!isTypeFound) { Main.MsgCenter.ShowMessage(String.Format("燃料棒{0}未找到匹配的{1}燃料棒类型", k, rods[k].Type)); } //寻找燃料棒固体材料数据 Material Clad = new Material(); Material Pellet = new Material(); foreach (var material in materials) { if (material.Index == rodType.CladMaterialIndex) { Clad = material; } else if (material.Index == rodType.PelletMaterialIndex) { Pellet = material; } } //燃料棒直径 double d_rod = rodType.Diameter; //燃料芯块直径 double d_pellet = rodType.PelletDiameter; //燃料包壳厚度 double clad_thickness = rodType.CladThickness; //气体间隙通过计算得出 double gap_thickness = (d_rod - d_pellet) * 0.5 - clad_thickness; //分段计算燃料棒温度场 for (int j = 0; j < Nj; j++) { //分段长度 double Lj = rods[0].SubPowerCollection[j].To - rods[0].SubPowerCollection[j].From; //接触的全部角度 double TotalAngle = 0; double Xe = 0; FluidData FluidJ; //遍历与[燃料棒k] 接触的 子通道,找到流体外部边界条件 foreach (ContactedChannel EachContactedChannel in rods[k].ContactedChannel) { //与燃料棒k接触的所有子通道流体物性参数计算结果 ChannelFlow ChannelFlowOfContactChannel = new ChannelFlow(); //找到与燃料棒接触的子通道计算结果 foreach (ChannelFlow channelFlow in channelsFlow) { //通道数据 index和连接的通道 index相同 if (channelFlow.ChannelIndex == EachContactedChannel.Index) { ChannelFlowOfContactChannel = channelFlow; } } FluidJ = ChannelFlowOfContactChannel.FluidDatas[j]; h[j, k] += FluidJ.h * EachContactedChannel.Angle; Tf[j, k] += FluidJ.Temperature * EachContactedChannel.Angle; Xe = FluidJ.Xe * EachContactedChannel.Angle; //质量流密度 massFlowDensity[j, k] += FluidJ.Velocity * FluidJ.Density * EachContactedChannel.Angle; //累加接触的角度份额 TotalAngle += EachContactedChannel.Angle; } //加权平均对流换热系数 h[j, k] = h[j, k] / TotalAngle; //加权平均流体温度 Tf[j, k] = Tf[j, k] / TotalAngle; //加权平均热平衡含气率 Xe = Xe / TotalAngle; //加权平均质量流密度 massFlowDensity[j, k] = massFlowDensity[j, k] / TotalAngle; //线性功率,单位W/M double Linearpower = rods[k].SubPowerCollection[j].Value * powerFactor; //体热源W/m3 double fi_pellet = Linearpower * pelletShare / (0.25 * PI * d_pellet * d_pellet); //clad面积 double cladArea = 0.25 * PI * (d_rod * d_rod - (d_rod - 2 * clad_thickness) * (d_rod - 2 * clad_thickness)); //包壳 体热流密度 double fi_clad = Linearpower * cladShare / cladArea; //包壳分段长度 double deltaR_clad = clad_thickness / CladSegment; //芯块分段长度 double deltaR_pellet = d_pellet * 0.5 / PelletSegment; //包壳外表面 - 热流密度 double q = Linearpower * (1 - fluidShare) / (PI * d_rod); //包壳外表面 - 温度 double Tw = q / h[j, k] + Tf[j, k]; //内推温度场 RodTField[j, 0] = Tw; //稳态,温度场由外向内内推 for (int layer = 0; layer < CladSegment; layer++) { //外径 double r_outside = 0.5 * d_rod - deltaR_clad * layer; //内径 double r_inside = 0.5 * d_rod - deltaR_clad * (layer + 1); //层平均半径 double r_av = (r_inside + r_outside) * 0.5; //已经内推过的层面积 double layerArea = PI * (d_rod * d_rod * 0.25 - r_inside * r_inside); //内推过的层发热线功率 double layerHeat = layerArea * fi_clad; //层导热热阻ln(d2/d1)/2π lamd l Clad.K.Get(vectorT[layer]) double R_layer = Math.Log(r_outside / r_inside) / (2 * PI * Clad.GetK(RodTField[j, layer]) * Lj); //内推节点 RodTField[j, layer + 1] = (Linearpower - layerHeat) * Lj * R_layer + RodTField[j, layer]; } //稳态下气体间隙传递的热流密度(导出热量等于芯块Pellet产热) double q_gap = Linearpower * pelletShare / (PI * d_pellet); //芯块外表面温度 RodTField[j, CladSegment + 1] = RodTField[j, CladSegment] + q_gap / gasGap.Get_h(); //计算燃料棒 for (int layer = 0; layer < PelletSegment; layer++) { //外径 double r_outside = 0.5 * d_pellet - deltaR_pellet * layer; //内径 double r_inside = 0.5 * d_pellet - deltaR_pellet * (layer + 1); //层平均半径 double r_av = (r_inside + r_outside) * 0.5; //已经内推过的层面积 double layerArea = PI * (0.25 * d_pellet * d_pellet - r_inside * r_inside); //层发热线功率 double layerHeat = layerArea * fi_pellet; //层导热热阻ln(d2/d1)/2π*lamd*l Clad.K.Get(vectorT[layer]) double R_layer = Math.Log(r_outside / r_inside) / (2 * PI * Clad.GetK(RodTField[j, layer]) * Lj); RodTField[j, layer + CladSegment + 2] = (Linearpower * pelletShare - layerHeat) * Lj * R_layer + RodTField[j, layer + CladSegment + 1]; } //芯块中心温度(根据有内热源传热方程) RodTField[j, PelletSegment + CladSegment + 1] = RodTField[j, PelletSegment + CladSegment] + 0.25 * fi_pellet / Pellet.GetK(RodTField[j, PelletSegment + CladSegment]) * deltaR_pellet * deltaR_pellet; //计算临界热流密度 double q_critical = Q_Critical(Xe, d_rod, massFlowDensity[j, k], coolent.GetHf(Tf[j, k]), coolent.GetH(Tf[j, k]), options.DNBR_Formula); //设置输出对象(燃料棒k第j段) SubRodTemperature subRodTemperature = new SubRodTemperature { Index = j, //一些重要观测点温度 CladOutsideT = Math.Round(RodTField[j, 0], acc.T), CladInsideT = Math.Round(RodTField[j, CladSegment], acc.T), PelletOutsideT = Math.Round(RodTField[j, CladSegment + 1], acc.T), PelletCenterT = Math.Round(RodTField[j, PelletSegment + CladSegment + 1], acc.T), //对流换热系数 h = Math.Round(h[j, k], acc.h), //热流密度 Q = Math.Round(q, 1), //临界热流密度 Qc = Math.Round(q_critical, 1), //DNBR DNBR = Math.Round(q_critical / q, 3), //温度向量 TemperatureVector = RodTField.Row(j), }; //加入计算结果集合 RodkTemperature.SubRods.Add(subRodTemperature); }//---结束轴向J循环 RodsTemperature.Add(RodkTemperature); //输出消息提示 Main.MsgCenter.ShowMessage(String.Format("燃料棒{0}:", rods[k].Index)); Main.MsgCenter.ShowMessage(RodTField.ToMatrixString(Nj, PelletSegment + CladSegment + 2)); }//结束燃料棒k循环 return(RodsTemperature); }