Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "MarvelTriWettedPerimIC.h" 11 : #include "TriSubChannelMesh.h" 12 : 13 : registerMooseObject("SubChannelApp", MarvelTriWettedPerimIC); 14 : 15 : InputParameters 16 21 : MarvelTriWettedPerimIC::validParams() 17 : 18 : { 19 21 : InputParameters params = TriSubChannelBaseIC::validParams(); 20 21 : params.addClassDescription("Computes wetted perimeter of subchannels in a triangular lattice " 21 : "arrangement in a MARVEL-type micro-reactor"); 22 21 : return params; 23 0 : } 24 : 25 12 : MarvelTriWettedPerimIC::MarvelTriWettedPerimIC(const InputParameters & params) 26 12 : : TriSubChannelBaseIC(params) 27 : { 28 12 : } 29 : 30 : Real 31 37440 : MarvelTriWettedPerimIC::value(const Point & p) 32 : { 33 : // Define geometry parameters. 34 37440 : auto pitch = _mesh.getPitch(); 35 37440 : auto rod_diameter = _mesh.getPinDiameter(); 36 37440 : auto wire_diameter = _mesh.getWireDiameter(); 37 37440 : auto wire_lead_length = _mesh.getWireLeadLength(); 38 37440 : auto rod_circumference = libMesh::pi * rod_diameter; 39 37440 : auto wire_circumference = libMesh::pi * wire_diameter; 40 37440 : auto gap = _mesh.getDuctToPinGap(); 41 37440 : auto r_ref = rod_diameter / 2.0 + gap; 42 37440 : auto theta = std::acos(wire_lead_length / 43 37440 : std::sqrt(std::pow(wire_lead_length, 2) + 44 37440 : std::pow(libMesh::pi * (rod_diameter + wire_diameter), 2))); 45 : // given the channel number, i, it computes the wetted perimeter of 46 : // the subchannel based on the subchannel type: CENTER, EDGE or CORNER. 47 37440 : auto i = _mesh.getSubchannelIndexFromPoint(p); 48 37440 : auto subch_type = _mesh.getSubchannelType(i); 49 : 50 37440 : if (subch_type == EChannelType::CENTER) 51 : { 52 25920 : return 0.5 * rod_circumference + 0.5 * wire_circumference / std::cos(theta); 53 : } 54 11520 : else if (subch_type == EChannelType::EDGE) 55 : { 56 8640 : auto gamma = std::acos(1 - 0.5 * std::pow(pitch / r_ref, 2.0)); 57 8640 : auto alpha = (libMesh::pi - gamma) / 2.0; 58 8640 : auto sector_angle = libMesh::pi / 2.0 - alpha; 59 8640 : return 0.5 * rod_circumference + 0.5 * wire_circumference / std::cos(theta) + 60 8640 : 2.0 * sector_angle * (r_ref); 61 : } 62 : else 63 : { 64 2880 : return (rod_circumference + wire_circumference / std::cos(theta)) / 6.0 + 65 2880 : (libMesh::pi / 3.0) * (r_ref); 66 : } 67 : }