/// <summary> /// Mesh Constructor /// </summary> /// <param name="local_ErrorHandler">Main UI ErrorHandler</param> /// <param name="LayerList">LayerList generated via the custom Geometry class files (TEMGeometry.cs for example)</param> public Mesh(ErrorHandler local_ErrorHandler, List<Layer> LayerList) { Mesh_Errors = local_ErrorHandler; t_Nodes = 0; NodeList = new List<Node>(); Generate_Mesh_ByLayer(LayerList); Find_X_max_Y_max(); SetBoundaryNodes(LayerList); }
/// <summary> /// Constructor for BoundaryConditions class /// </summary> /// <param name="Nodal_Array">Node array with which to apply the boundary conditions to</param> /// <param name="local_ErrorHandler">Errorhandler to pass messages to the Main UI</param> /// <param name="T_Base">Constant temperature of the south face of the TEM in Kelvin</param> /// <param name="h_Top">Heat transfer coefficient (initial) operating off of the top surface of the TEM</param> /// <param name="T_inf">Ambient temperature utilized for the convective coefficient off of the top surface</param> public BoundaryConditions(Node[][] Nodal_Array, ErrorHandler local_ErrorHandler, bool[] BC_CONVECTION, bool[] BC_CONST_T, bool[] BC_ADIABATIC, float[] h, float[] T_INFINITY, float[] T_CONST) { Nodes = Nodal_Array; BC_ErrorHandler = local_ErrorHandler; BC_h = BC_CONVECTION; BC_T = BC_CONST_T; BC_Adiabatic = BC_ADIABATIC; h_Coefficient = h; Constant_T = T_CONST; T_inf = T_INFINITY; Check_Boundary_Condition(); Apply_Boundary_Conditions(); }
private void Main_Load(object sender, EventArgs e) { myError = new ErrorHandler(this); }
// Constructor, currently requires the passing of the local ErrorHandler (on the main form) and the Material Name /// <summary> /// Material Constructor /// </summary> /// <param name="local_ErrorHandler">Main UI ErrorHandler</param> /// <param name="Material_Name">String name to assign to material, ie "Copper"</param> public Material(ErrorHandler local_ErrorHandler, string Material_Name) { Material_Errors = local_ErrorHandler; Mat_Name = Material_Name; }
// Default constructor for the MaterialManager class. Error handler is passed in to allow for reporting of errors // through the base class, Material. /// <summary> /// Manages Materials, eventually to be updated to include temperature based thermophysical property interpolation /// </summary> /// <param name="local_ErrorHandler">Main UI ErrorHandler</param> public MaterialManager(ErrorHandler local_ErrorHandler) { MaterialManager_Errors = local_ErrorHandler; Material_List = new List<Material>(); Create_Materials(); }
public Solver(ErrorHandler local_ErrorHandler, Node[][] NodeArray) { Solver_ErrorHandler = local_ErrorHandler; Nodes = NodeArray; }
// Default constructor of Node object // // Requires passing in of the local error handler so messages can be passed into the main UI, in addition // to the specification of CV width in both X and Y directions, as well as the physical position on both // the x and y axis. The node indices (i,j) are also specified. /// <summary> /// Node Constructor /// </summary> /// <param name="local_ErrorHandler">ErrorHandler to pass messages to the main UI</param> /// <param name="x_POS">Physical location in the x-direction [m]</param> /// <param name="y_POS">Physical location in the y-direction [m]</param> /// <param name="p_Node_ID">Node ID (starts at 0 to N_Nodes)</param> /// <param name="p_Layer_ID">Layer at which this created node resides</param> public Node(ErrorHandler local_ErrorHandler, float x_POS, float y_POS, int p_Node_ID, int p_Layer_ID) { NodeErrors = local_ErrorHandler; x_pos = x_POS; y_pos = y_POS; Node_ID = p_Node_ID; Layer_ID = p_Layer_ID; Boundary_Flag = ""; }
// Constructor for the TEMGeometry.cs class. Requires passing in of the local error // handler but nothing else. Every other value is generated from other classes as // the TEMGeometry is very specific. This file is one of the few that might require // editing as the solution process marches on /// <summary> /// Constructor for TEM Geometry /// </summary> /// <param name="localErrorHandler">Main UI ErrorHandler</param> public TEMGeometry(ErrorHandler localErrorHandler) { Geometry_Errors = localErrorHandler; // Initializes a new List of Layers Layer_List = new List<Layer>(); Coord_List = new List<float[]>(); Coord_List.Add(Coord_Ceramic_Base_Bottom); Coord_List.Add(Coord_Ceramic_Base_Top); Coord_List.Add(Coord_Left_Air_Gap); Coord_List.Add(Coord_Right_Air_Gap); Coord_List.Add(Coord_First_Bot_CU); Coord_List.Add(Coord_Last_Bot_CU); Coord_List.Add(Coord_Cu_Bottom); Coord_List.Add(Coord_Cu_Top); Coord_List.Add(Coord_BiTE); Coord_List.Add(Coord_Top_AirGaps); Coord_List.Add(Coord_Bottom_AirGaps); // Function to modify dimensions (which are entered in mm) to m ConvertUnits(Coord_List); // Function to generate the geometry of the TEM GenerateGeometry(); // Checks coordinate pairs and cv areas for errors CheckPoints(); // Iterates over each layer in the TEM geometry and reports the calculated layer ID and area. This code // may be eventually removed as the code matures foreach (Layer layer in Layer_List) { //Geometry_Errors.Post_Error("Layer ID: " + layer.getID().ToString() + ": " + layer.Layer_Area.ToString()); } }
// Layer() // // Layer constructor which requires the initialization of both coordinate pairs, material name // and the ErrorHandler function to be passed in. /// <summary> /// Layer Constructor /// </summary> /// <param name="local_ErrorHandler">Main UI ErrorHandler</param> /// <param name="x_0">X-coordinate, upper left corner</param> /// <param name="y_0">Y-coordinate, upper left corner</param> /// <param name="x_f">X-coordinate, lower right corner</param> /// <param name="y_f">Y-coordinate, lower right corner</param> /// <param name="Mat_Name">Material for this layer</param> /// <param name="n_Nodes">Number of nodes for this layer</param> public Layer(ErrorHandler local_ErrorHandler, float x_0, float y_0, float x_f, float y_f, string Mat_Name, int n_Nodes) { Layer_Errors = local_ErrorHandler; Layer_Material = Mat_Name; Check_Positioning(x_0, y_0, x_f, y_f); Layer_Rectangle = new Rectangle(x_0, y_0, x_f, y_f); Layer_x0 = x_0; Layer_xf = x_f; Layer_y0 = y_0; Layer_yf = y_f; Layer_Area = Layer_Rectangle.Area(); Nodes = n_Nodes; Layer_ID = LayerID++; }
/// <summary> /// Constructor of the NodeInitializer Class. /// </summary> /// <param name="Nodes">Node Array of Numeric Model</param> /// <param name="local_ErrorHandler">Error Handler for Message Passing</param> /// <param name="Materials">Material Manager which holds all the material properties</param> /// <param name="Layers">List of Layers holding material information for each node inside of it</param> public NodeInitializer(Node[][] Nodes, ErrorHandler local_ErrorHandler, MaterialManager Materials, List<Layer> Layers, float dt, float Amps, bool is_Warming_Top) { this.dt = dt; this.Amps = Amps; this.is_Warming_Top = is_Warming_Top; x_Max_DX = 0.0f; y_Max_DY = 0.0f; max_X = 0.0f; max_Y = 0.0f; foreach (Node[] node_array in Nodes) { foreach (Node node in node_array) { if (node.x_pos > x_Max_DX) x_Max_DX = node.x_pos; if (node.y_pos > y_Max_DY) y_Max_DY = node.y_pos; } } foreach (Layer layer in Layers) { if (layer.Layer_xf > max_X) max_X = layer.Layer_xf; if (layer.Layer_y0 > max_Y) max_Y = layer.Layer_y0; } LayerList = Layers; NodeArray = Nodes; Node_I_ErrorHandler = local_ErrorHandler; Mat_Manager = Materials; x_MinpDX = Nodes[0][0].x_pos; y_MinpDY = Nodes[0][0].y_pos; Assign_Materials(); Calculate_DxDy(); Initialize_Heat_Generation(Amps, is_Warming_Top); // Passed in 5.0f value represents an initialization current... this needs to be fed in Initialize_Influence_Coefficients(Nodes); // Must come after heat generation initialization }