Tags: MAHTEP/OPENSC2
Tags
The set of commits between v3.7.3 and v3.8.0 (the present tag) introd…
…uces the concept of adaptive mesh in OpenSc2.
The commits introduce new functions or methods that constitute the algorithm; moreover the funciton that allows to adapt the mesh, adaptive_mesh in module adaptive_mesh_function.py, is called afther the thermal hydraulic solution of the problem to eventually update the mesh for the next thermal hydraulic time step.
The algorithm behind the adaptive mesh is based on the detection of the quench fronts.
When the temperature of an instance of class StackComponent or StrandMixedComponent crosses the current sharing temperature, a quench front is found. The regions nearby a quench front are typically characterized by strong gradients and needs mesh refinement. Thus, in those regions the mesh is locally refined adding M - 1 (soft) nodes, with M being the number of evenly spaced elements in which each elements that needs local refinement is further discretized. This parameter is specified by the user in input file conductor_grid.xlsx in variable NELEMS_REFINEMENT. Since the quench front propagates, the added soft nodes may also be removed when they are no longer needed. This process is called mesh coarsening. By definition, hard nodes belongs to the initial grid and they are not removed during the coarsening process; soft nodes are the ones added during local mesh refinement and could be removed during mesh coarsening. For more info on the algorithm contact laura.savoldi@polito.it.
The adaptive grid is triggered setting flag ITYMSH = 2 (adaptive grid from initial uniform grid) or ITYMSH = 3 (adaptive grid from initial refined grid).
**BREAKING CHANGES**
Input files
* new variable NELEMS_REFINEMENT in input file template_conductor_grid.xlsx, used to specify the number of elements used to locally discretize elements that needs refinement if the mesh is adaptive (ITYMSH = 2 or ITYMSH = 3).
Functions/methods
Class Conductor, modified -> conductor.py
* method __update_grid_features has new input argument grid_features and returns an updated version of grid_features.
Python modules
* new python module adaptive_mesh_functions.py
**BUG FIX**
**NEW FUNCTIONS/METHODS**
* modified -> utility_functions/adaptive_mesh_functions.py
* detect_quench_front
* eval_gaussian_mesh_density
* update_mesh
* set_node
* refine_mesh
* coarse_mesh
* adaptive_mesh
* Class: Conductor, modified -> conductor.py
* interp_solution_on_new_mesh
* update_syslod_on_new_mesh
* update_cond_mesh_related_features
* update_dict_step_on_static_mesh
* __update_grid_features_adapt_mesh
* update_contact_perimeters
* Class: FluidComponent, modified -> fluid_component.py
* update_coordinates_of_barycenter
* Class: JacketComponent, modified -> jacket_component.py
* update_coordinates_of_barycenter
* Class: SolidComponent, modified -> solid_component.py
* update_coordinates_of_barycenter
* Class: StackComponent, modified -> stack_component.py
* update_coordinates_of_barycenter
* Class: StrandMixedComponent, modified -> strand_mixed_component.py
* update_coordinates_of_barycenter
* Class: StrandStabilizerComponent, modified -> strand_stabilizer_component.py
* update_coordinates_of_barycenter
**NEW ATTRIBUTES**
New attribute tau (angular discretization) in the following classes:
* FluidComponent
* JacketComponent
* StackComponent
* StrandMixedComponent
* StrandStabilizerComponent
This attribute is used to correctly update the coordinates of barycenter of each conductor component if the mesh is adaptive.
* The code does not create folders Space_convergence and Time_converg…
…ence in the output directory as well as the Benchmark folder to simplify the path tree and remove folders that could be not clear to the user.
* The code does not save information related to space and time convergence (in order to do this analysis the user should organize by hisself/herself according to his/her needs).
* Real implementation some correction already discussed in tag message v3.7.0, but that where actually missing because not pulled on the local branch after the pull request from A. Mortara. Below a summary of the main changes:
* Class StrandMixedComponent: to avoid the ValueError that arises in the check on the voltage along stabilizer that must be equal to the voltage along superconductor, the tollerance in the method solve_current_divider is modified when the minimum in the vector critical_current is below a certain value. This change has been verified.
* Class StackComponent: evaluation of the equivalent electric resisitivity of not superconductign materials constituting the stack of tapes according to the formula $\rho_{el,eq} = A_{notsc} * (\sum_i(A_i/\rho_{el,i}))^{-1}$; this is to fix an error introduced by mistake.
* Class StackComponent: added a change to the accepted tolerance for calculating the current divider between sc and not-sc, to avoid later errors in checking the voltage differences seen on the sc-side and not-sc-side, which is present in certain case studies.
* Class Conductor: added check that solid component object is an istance of StackComponent exploiting function isistance in operating_conditions_em and in __eval_gauss_point_em. This is done to guarantee that all the properties of meterials are correctly updated at each time step for all solid component object.
* Changed definition of operating current density for calculation of current sharing temperature. Where previously the ratio of total operating current divided by the strand cross section was considered, now the actual fraction of current sharing within the strand is considered. To do this was necessary to initialise the current _along value equal to op_current value for the first time step inside method get_current of class SolidComponent, and to change the computation of jop inside method eval_tcs of class Strand.
**BUG FIX**
* T_cs evaluated from current_along
* modified: strand_component.py
* assignment of current_along at t=0
* modified: solid_component.py
* update of electrical resistivity for Stack
* modified: conductor.py
* ValueError in method get_electric_resistance
* modified: stack_component.py
* TypeError in function check_flag_value
* Class: Simulation
* modified: simulation.py
* ValueError in _compute_density_and_mass_flow_rates
* Class: StackComponent
* modified: stack_component.py
* KeyError in method eval_tcs
* Class: SolidComponent
* modified: solid_component.py
* IndexError in fun time_and_event_synchronization
* Class: Conductor
* modified: conductor.py
**NEW FUNCTIONS/METHODS**
**DELETED FUNCTIONS/METHODS**
* modified: utility_functions/output.py
* save_convergence_data
Include some commits of branch mit_period_path1_joule_fix in the curr… …ent development branch (electric_module). Changes are mainly related to refactoring of methods of Class Simulation and Conductors. * Class Simulation: update methods conductor_instance, __init__ * Class Conductor: update methods __init__, __inductance_approximate_calculation, __inductance_analytical_calculation, __build_electric_mass_matrix, conductor_components_instance * Class Conductor: removed method __check_coupling_sheet_names; removed attribute workbook_sheet_name. **INCLUDED COMMITS** List of commits from branch mit_period_path1_joule_fix included with this tag message in branch electric_method: * 582b265 refactor: replace set with namedtuple in SHEET_NAME * f13a1f3 refactor: replace attribute workbook_sheet_name * ae3c13e refactor: in method conductor_components_instance * b40de4b chore: rename namedtuple fields * 102d9d4 fix: typo in dictionary SHEET_NAME * 1ec7820 refactor: use variable SHEET_NAME in __init__ * b51b5f2 refactor: replace set with namedtuple in SHEET_NAME * b714ea5 feat: remove method __check_coupling_sheet_names * 37ab8a6 chore: use function check_sheet_name in method conductor_instance * b0b4516 feat: new function check_sheet_names * 5393d87 feat: new dictionary in module conductor_flags.py * 48b7fbe chore: update method conductor_instance in class Simulation N.B. the overal number of actual commits created is 9 and not 12 since some correction and refactoring are collapsed in a single commit in this procedure. **NEW FUNCTIONS/METHODS** Modified: utility_functions/auxiliary_functions.py * check_sheet_names **DELETED FUNCTIONS/METHODS** Class Conductor * __check_coupling_sheet_names
Changes that introduces adaptive time step, a better management of th…
…e saving of the spatial distributions at user defined time steps and an improved control and synchronization of the events at user defined time steps. A summary of the main changes is reported below.
* Time step adaptivity with a "home-made" algorithm based only on the variation of the solution from two consecutive thermal hydraulic time steps. No error is evaluated wrt a most accurate solution (obtained for instance halving the time step), thus none of the time step is discharged. At each thermal hydraulic solution, the new time step is evaluated basing on the variation of the solution wrt the previous time step. The newly defined time step is then increased, decreased or kept equal to the previous value by means of tuning parameters. This kind of time step adaptivity can be triggered setting flag IADAPTIME = 1 in input file transitory_input.xlsx. Function get_time_step is updated and refactored. For question related to accuracy and stability of the approach, write to laura.savoldi@polito.it.
* Spatial distributions at user defined time steps (in sheet Spatial_distribution of input file conductor_diagnostic.xlsx) are evaluated by linear interpolation if user specifies values that are not marked as simulation time steps. This fixed FileNotFound error that may have been found in the previous version of the code. Functions store_spatial_distributions and save_simulation_space are updated and refactored.
* In order to increase the control on event initiation with the thermal hydraulic time step, after calling function get_time_step in the while loop of the solution, two new functions are called.
1. The first one time_and_event_synchronization checks that $|t_{k+1} - t_e| < \epsilon$ with $t_{k+1} = t_k + dt$ the next thermal hydraulic time for the i-th conductor, $t_e$ the time of athe next event, $dt$ the thermal hydraulic time step from get_time_step and $\epsilon$ the uncertainty associated to the time step. If the above inequality is verified, the next thermal-hydraulic time is set equal to $t_e$, meaning that the two actually coincides. This allows to not mess up with event detection. The thermal-hydraulic time step that will follow the event detection is forced to be the minimum one.
2. The second one acts if time_and_event_synchronization does not detect any event. If it is the case, function force_time_step will check if $t_k < t_e < t_{k+1}$, meaning that the next event will be missed. To avoid this, the function forces the thermal hydraulic time step to $dt_f = t_e - t_k$ so that $t_{k+1} = t_e$. Also in this case, after event detection, the next time step is forced to be the minimum one.
Both those functions works both with fixed and adaptive time step.
**BREAKING CHANGES**
* Input files
* new variables in input file template_transitory_input.xlsx:
* MLT_UPPER -> multiplier to increase the adaptive time step
* MLT_LOWER -> multiplier to decrease the adaptive time step
* TIME_STEP -> to specify the value of the time step for the thermal-hydraulic loop. If flag IADAPTIME = 0, TIME_STEP value is used as uniform time step for the thermal-hydraulic loop; if flag IADAPTIME = 1 or 2, TIME_STEP value may be tuned according to the adaptive time step criterion.
* Function/methods
* removed ad hoc time adaptivity in fuction get_time_step -> Removed ad hoc to emulate time adaptivity for simulation whith feeder CS3U2 in function get_time_step. Do not use STPMIN; it is tuned on the AC loss time evolution. Activated setting IADPTIME = 3 in input file transitory_input.xlsx. This value of the flag is no longer available.
* new private method __check_event_time_main_input -> Private method that checks if each difference between the ending and the beginning of the heating defined in input file conductor_operation.xlsx can be discretized with at least 10 time steps. If it is not the case, an error is raised.
* new method __check_event_time_aux_input -> Private method that checks if each difference between the time collected in variable l_event can be discretized with at least 10 time steps. If it is not the case, an error is raised. Those values come form the auxiliary input files for heating and/or current. The difference is evaluated as l_event[1:] - l_event[:-1].
* Python modules
* new python module utils_global_info.py
* new python module simulation_global_info.py
**BUG FIX**
* wrong index in function eval_eigenvalues
* modified: utility_functions/transient_solution_functions.py
* missing arg to get_time_step in method conductor_solution
* Class: Simulation.
* modified: simulation.py
* ModuleNotFoundError in module transient_solution_functions.py
* modified: utility_functions/transient_solution_functions.py
* TypeError in method __init__ of class Simulation
* Class: Simulation
* modified: simulation.py
* UnboundLocalError in function get_time_step
* modified: utility_functions/transient_solution_functions.py
* pass by assignement side effect in function eval_sub_array_norm -> this was the error preventing the correct functioning of the adaptive time step algorithm
* modified: utility_functions/transient_solution_functions.py
* UnboundLocalError in function get_time_step
* modified: utility_functions/transient_solution_functions.py
* KeyError in conductor_components_instance class Conductor
* Class: Conductor, FluidComponent, JacketComponent, StackComponent, StrandMixedComponent, StrandStabilizerComponent
* modified: conductor.py
* modified: fluid_component.py
* modified: jacket_component.py
* modified: stack_component.py
* modified: strand_mixed_component.py
* modified: strand_stabilizer_component.py
* AttributeError in method __initialize_store_sd
* Class: Conductor
* modified: conductor.py
* ValueError in method conductor_solution
* Class: Conductor
* modified: conductor.py
* AttributeError in method store_spatial_distributions
* Class: Conductor
* modified: conductor.py
* KeyError in method store_spatial_distributions
* Class: JacketComponent, StrandStabilizerComponent
* modified: jacket_component.py
* modified: strand_stabilizer_component.py
* KeyError in method store_interp_spatial_distributions
* Class: Conductor
* modified: conductor.py
* FileNotFoundError in method conductor_solution -> this is an old error that occurred if the user defined time at which saving the spatial distributions where not a multiple of the time step. Fixed exploiting interpolation between time step and a finer synchronization between event and simulation time.
* Class: Simulation
* modified: simulation.py
* KeyError in method __get_cost_and_var_htc_interfaces
* Class: Conductor
* modified: conductor.py
* AttributeError in method __initialize_store_sd
* Class: Conductor
* modified: conductor.py
* TypeError in function save_sd_nodal_comp
* modified: utility_functions/output.py
* TypeError in function save_sd_gauss_comp
* modified: utility_functions/output.py
* ValueError in function save_cond_htc_sd
* modified: utility_functions/output.py
**NEW FUNCTIONS/METHODS**
* Class: Conductor, modified -> conductor.py
* store_spatial_distributions
* store_interp_spatial_distributions
* __get_cost_and_var_htc_interfaces
* __store_sd_components
* __store_sd_htc_conductor
* __store_sd_conductor
* store_spatial_distributions_t0
* store_interp_spatial_distributions
* __initialize_attr_sd
* __collect_event_time
* move_to_next_event
* append_time
* __collect_event_time_aux_input
* modified -> utility_functions/auxiliary_functions.py
* check_flag_value
* interp_at_t_save
* modified -> utility_functions/output.py
* save_sd_nodal_comp
* save_sd_gauss_comp
* save_cond_htc_sd
* modified -> utility_functions/transient_solution_functions.py
* user_adaptive_time_step
* time_and_event_synchronization
* force_time_step
* Classes: SolidComponent, JacketComponent, StackComponent, StrandMixedComponent and StrandStabilizerComponent; modified -> jacket_component.py, solid_component.py, stack_component.py, strand_mixed_component.py, strand_stabilizer_component.py
* __initialize_store_sd
Changes coming from the Pull Request made by A. Mortara.
Follows a summary of the updates.
* Class StackComponent: finalize implementation with the same idea behind the Class StrandMixedComponent.
* Fixed the lower limit for the bisection method in the method current_sharing_temperature_re123. This limit is now set to 0 to avoid error given by bisection method.
* Class StrandMixedComponent and StackComponent: refactor of the method get_electric_resistance. All the previous indices are eliminated and now there are only two cases:
1. if critical_current = 0 the equivalent resistance is equal to the stabilizer resistance
2. if critical_current is not = 0 then the current divider is used.
* Class Conductor: many chages were made to permitt a constant value of the mutual inductance and the self inductance set by the user in the input file conductor_definition.xlsx, in sheet CONDUCTOR_operation.
* Class StrandMixedComponent: to avoid the ValueError that arises in the check on the voltage along stabilizer that must be equal to the voltage along superconductor, the tollerance in the method solve_current_divider is modified when the minimum in the vector critical_current is below a certain value. This change has been verified.
* Class StackComponent: evaluation of the equivalent electric resisitivity of not superconductign materials constituting the stack of tapes according to the formula $\rho_{el,eq} = A_{notsc} * (\sum_i(A_i/\rho_{el,i}))^{-1}$; this is to fix an error introduced by mistake.
* Class StackComponent: added a change to the accepted tolerance for calculating the current divider between sc and not-sc, to avoid later errors in checking the voltage differences seen on the sc-side and not-sc-side, which is present in certain case studies.
* Class Conductor: added check that solid component object is an istance of StackComponent exploiting function isistance in operating_conditions_em and in __eval_gauss_point_em. This is done to guarantee that all the properties of meterials are correctly updated at each time step for all solid component object.
* Changed definition of operating current density for calculation of current sharing temperature. Where previously the ratio of total operating current divided by the strand cross section was considered, now the actual fraction of current sharing within the strand is considered. To do this was necessary to initialise the current _along value equal to op_current value for the first time step inside method get_current of class SolidComponent, and to change the computation of jop inside method eval_tcs of class Strand.
BUG FIX
* T_cs evaluated from current_along
* modified: strand_component.py
* assignment of current_along at t=0
* modified: solid_component.py
* update of electrical resistivity for Stack
* modified: conductor.py
* ValueError in method get_electric_resistance
* modified: stack_component.py
Update input files of the Test Driven Development test cases to the l…
…atest version
Added missing sheets or variables, updated variable names and removed no longer used variable/sheets in the following sets of input files
* CASE_1_ITER_like_LTS
* CASE_2_ENEA_HTS_CICC
* CASE_3_HTS_HVDC
Documentation and formatting of input file is also improved.
Lots of work should still be done to improve input file readability and documentation.
BUG FIX
* Input files
* KeyError: 'Worksheet CONDUCTOR_operation does not exist.'
* input file: ../TDD_examples/CASE_2_ENEA_HTS_CICC/conductor_definition.xlsx
* KeyError: 'stabilizer_material'.
* input file: ../TDD_examples/CASE_1_ITER_like_LTS/conductor_1_input.xlsx
* input file: ../TDD_examples/CASE_2_ENEA_HTS_CICC/conductor_1_input.xlsx
* FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/daniele.placido/3D Objects/OPENSC2/TDD_examples/CASE_2_ENEA_HTS_CICC\\alpha.xlsx'
* input file: ../TDD_examples/CASE_2_ENEA_HTS_CICC/conductor_definition.xlsx
* input file: ../TDD_examples/CASE_3_HTS_HVDC/conductor_definition.xlsx
* KeyError: 0
* input file: ../TDD_examples/CASE_3_HTS_HVDC/conductor_1_input.xlsx
* NameError: ERROR in method __init__ of class Conductor: kind object STR_SC does not exist.
Please check cell A1 in sheet <Worksheet "STACK"> of file conductor_1_input.xlsx.
* input file: ../TDD_examples/CASE_3_HTS_HVDC/conductor_1_input.xlsx
* input file: ../TDD_examples/CASE_3_HTS_HVDC/conductor_1_operation.xlsx
TEST
An updated version of the TDD test case senarios equivalent to the input used to test v3.2.1 was used to compare the present version of the OpenSc2 (v3.5.2) against the outcome of the simulations carried out to check the refactoring of function step (see tag v3.2.1). The outcome of the comparison are overal in agreement with the simulation carried out with version v3.2.1. Some differences in SolidComponent temperature in the heated region can be explained considering that in tag v3.4.2 an importand bug fix was introduced, namely SolidComponent properties do not update at each time step if the electric module was not involved in the simulation.
Fixed KeyError related to keyword VARIABLE_CONTACT_PERIMETERS in foll…
…owing methods of class Conductors.
* __check_heading_variable_contact_perimeter
* __check_variable_contact_perimeter_consistency
* __check_variable_contact_perimeter_coordinate
* __check_variable_contact_perimeter_surplus_info
Improved flexibility and checks in the fixed refined mesh (see sectio… …n BUG FIX and below) Assumptions: 1. initial and final node delimiting the refined region belong to this region. Therefore, the number of nodes in the other regions coicides with the number of elements. Dealt with the edge case in which the in the region to the left (right) of the refined region the numer of nodes is not sufficient to have a uniform mesh, but there is only coarsening. In this case a check on the quality of the mesh is performed and an error is eventually raised. Besides, a check on the quality of the refined mesh is carried out if the region left (right) to the refined region is provided with a uniform mesh after coarsening. The check raises an error if the discretization pitch of the uniform mesh (dx) is lower than the last computed discretization pitch used for coarsening (dx_coarse), i.e., if dx < dx_coarse an error is raised. BREAKING CHANGES * Input files * new variables DXINCRE_LEFT and DXINCRE_RIGHT in file conductor_grid.xlsx * removed variable DXINCRE from file conductor_grid.xlsx (replaced by DXINCRE_LEFT and DXINCRE_RIGHT) BUG FIX * (left) edge case in refined axial spatial discretization * function: fixed_refined_spatial_discretization * module: utility_functcion/initialization_functions.py * (right) edge case in refined axial spatial discretization * function: fixed_refined_spatial_discretization * module: utility_functcion/initialization_functions.py * (left) edge case in refined angular spatial discretization * function: fixed_refined_angular_discretization * module: utility_functcion/initialization_functions.py * (right) edge case in refined angular spatial discretization * function: fixed_refined_angular_discretization * module: utility_functcion/initialization_functions.py NEW FUNCTIONS * check_refined_grid_quality in module utility_functcion/initialization_functions.py
1. Allow SolidComponent properties to update at each time step (see s… …ection BUG FIX) 2. Improved saving of the protected version of the input file to be used as metadata and reminder of the simulation (see section BUG FIX) BUG FIX * SolidComponent properties do not update at each time step Quick fix to the following silent bug: solid components thermophysical, electromagnetic and critical properties do not update at each time step if flag conductor.inputs ["I0_OP_MODE"] == IOP_NOT_DEFINED. This will not cause the simulation to stop, but will give reasonable but wrong output. Since all solid component properties are updated in method operating_conditions_em of class Conductor, a quick fix is to explicitly call this method when flag conductor.inputs["I0_OP_MODE"] == IOP_NOT_DEFINED and let method electric_method of class Conductor call it in all the other cases. A better fix would involve a complete refactoring of at least methods operating_conditions_th and operating_conditions_em of class Conductor and should be done later. * Class: Simulation * module: simulation.py * heating does not start at correct time step in method get_heat * Class: SolidComponent * module: solidc_omponent.py * missing rows in aux files in method save_input_files When saving auxiliary input files, first two rows are removed. Now each type of input file is saved properly and relevant informations are no nonger losed. * Class: Simulation * module: simulation.py * fixed_refined_angular_discretization returns a mesh with two coincident nodes * module: utility_functions/initialization_functions.py * multiplier usage in method eval_transp_coeff Use multiplyer when flag HTC_coice is both positive or negative * Class: Conductor * module: conductor.py
Added the possibility to really assign a variable conductive heat tra…
…nsfer coefficient between solid component interfaces.
Assumptions:
1. constant interface thickness, it may be actually variable in case of variable contact perimeter.
2. constant multiplier, it may be actually a function of the contact perimeter, temperature and magnetic field.
3. neglected component curvature radius, i.e., the geometry is alweys a slab.
Under the above assumptions the conductive heat transfer coefficient is evaluated as
$htc_{cond} = 1.0 / (R_{comp1} + R_{contact} + R_{comp2}) \quad W/m^2/K$
Where
* $R_{comp1}$ is the thermal resistance of component 1
* $R_{contact}$ is the thermal contact resistance between components, read from sheet thermal_contact_resistance of input file conductor_coupling.xlsx
* $R_{comp2}$ is the thermal resistance of component 2
With
$R_{comp_i} = k_i / \tau_{i,j} \quad m^2K/W$
and
* $k_i$ is the thermal conductivity of the i-th component of the interface
* $\tau_{i,j}$ is the thickness of component i when in contact with component j; this is read from sheet interf_thickness of input file conductor_coupling.xlsx
BREAKING CHANGES
* Input files
* new sheet thermal_contact_resistance in input file conductor_coupling.xlsx
* sheet interface_thickness in file conductro_coupling.xlsx is not only valid for Fluid Components but is valid for all conductor components, including Environment
* matrix in sheet interface_thickness of file conductro_coupling.xlsx should be fully filled, with the exception of the main diagonal, since matrix in the general case is no loger symmetric.
* Source code
* sheet interface_thickness in file conductro_coupling.xlsx is fully read (with the exception of the main diagonal) since matrix in the general case is no longer symmetric.
BUG FIX
* ValueError: Found not valid sheets name in input file case1_conductor_1_coupling.xlsx.List of not valid sheet names:['interf_thickness']. List of valid sheet names: {'electric_conductance', 'contact_HTC', 'HTC_multiplier', 'trans_transp_multiplier', 'open_perimeter_fract', 'HTC_choice', 'thermal_contact_resistance', 'view_factors', 'contact_perimeter_flag', 'electric_conductance_mode', 'contact_perimeter', 'intef_thickness'}
* method: __check_coupling_sheet_names
* Class: Conductor
* module: conductor.py
* ValueError
* method: __check_thermal_contact_resistance_values
* Class: Conductor
* module: conductor.py
* AttributeError: 'Conductor' object has no attribute 'dict_df_variable_contact_perimeter'
* method: __check_heading_variable_contact_perimeter
* Class: Conductor
* module: conductor.py
* KeyError: 'total_thermal_conductivity'.
This error is mainly due to the fact that variable conductive heat transfer coefficients are introduced as a new feature of the code.
This fix is quite complicated since it involves several changes in two modules, namely conductor.py and simulation.py.
Below the main changes to make the fix.
Module conductor.py, class Conductor:
1. call method self.operating_conditions_em before method self.operating_conditions_th_initialization in method self.initialization.
2. removed loop on SolidComponents to evaluate thermophisical properties, since they are evaluated when method self.operating_conditions_em is called in both nodal and Gauss points
3. evaluate SolidComponents thermophisical properties in method self.operating_conditions_em
4. new private method self.__eval_temperature_solids_gauss_point
5. call method self.__eval_temperature_solids_gauss_point at the beginning of method self.__eval_gauss_point_em
6. remove evaluation of temperature of SolidComponents in Gauss point from method self.__eval_gauss_point_th since it is evaluated in method self.__eval_gauss_point_em; doctring is evaluated accordingly
Module simulation.py, class Simulation:
1. call method conductor.operating_conditions_th after the end of the electric loop in method self.conductor_solution.
* Class: Conductor, Simulation
* module: conductor.py, simulation.py
TEST
* [x] Test1: negative values in sheet thermal_contact_resistance in input file conductor_coupling.xlsx -> expected raise error
PreviousNext