-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates related to electric module #26
Conversation
The class stack is implemented following the same structure of the strand mix class. The only limit of the new class is related to the evaluations of the self and the mutual inductance, since the old method takes into account the radius of the strand. In this method you must impose a self and mutual inductance. For the future a general way to evaluate these parameters must be implemented. That's the reason why also the conductor.py file has been changed. The new class is able to represent 4 different materials inside the stack. Homogenizes non-superconducting materials into a single stab material and performs the same electrical calculations present in the strand mix class. modified: conductor.py modified: stack_component.py
In function current_sharing_temperature_re123 bisection method is used to evaluate the current sharing temperature of the superconductor. In specific cases occurs the error: "r = _zeros._bisect(f, a, b, xtol, rtol, maxiter, args, full_output, disp) ValueError: f(a) and f(b) must have different sign" For this reson T_lower is changed from 3.5 to 0.5, to avoid this problem. modified: properties_of_materials/rare_earth_123.py
Inside properties_of_materials/rare_earth_123.py the formula: TCSRE123[vv] = optimize.bisect( critical_current_density_bisection_re123, T_lower, T_upper, ex_args, xtol=1e-5, ) The formula gave errors related to the bisection formula. In the interval [a, b] as it was chosen f(a) and f(b) had the same sign. For this reason T_lower, i.e. a, was lowered to 0, so as to solve the problem on the bisection formula. modified: properties_of_materials/rare_earth_123.py
Improved the readability of the code and increased its simplicity by removing the multiple indices and distinguishing only two cases: that in which the critical current is =0 and that in which the critical current is other than 0. In the first case, the equivalent resistance will be set equal to the equivalent resistance of the stabilizer part. In the second case, the current divider will be calculated to derive the current on the superconductor, from it with the power law the resistivity of the superconductor will be estimated, and then the equivalent resistance of the stabilizer and superconductor together will be calculated function: get_electric_resistance modified: strand_mixed_component.py
Improved the readability of the code and increased its simplicity by removing the multiple indices and distinguishing only two cases: that in which the critical current is =0 and that in which the critical current is other than 0. In the first case, the equivalent resistance will be set equal to the equivalent resistance of the stabilizer part. In the second case, the current divider will be calculated to derive the current on the superconductor, from it with the power law the resistivity of the superconductor will be estimated, and then the equivalent resistance of the stabilizer and superconductor together will be calculated. fun: get_electric_resistance modified: strand_mixed_component.py
The inductance methods were commented and a constant value was imposed, to confront the results with external references. All the calculation of both the self and the mutual inductance are now evaluated by the code. modified: conductor.py
Two new flags were added: * SELF_INDUCTANCE_MODE_0 = 0 is used to assign a constant value for the self inductance readed from input file conductor_definition.xlsx * CONSTANT_INDUCTANCE = 0 is used to assign a constant value for the mutual inductance readed from input file conductor_definition.xlsx The flags related to mutual inductance were redefined as: * ANALYTICAL_INDUCTANCE = 1 Flag to evaluate inductance analytically * APPROXIMATE_INDUCTANCE = 2 Flag to evaluate inductance using an approximation modified: conductor_flags.py
This reverts commit fbad580.
News privates methods to deal with the inductance evaluation. *__constant_inductance: private method that assigns a constant value to the mutual inductance as defined by the user in variable MUTUAL_INDUCTANCE, in sheet CONDUCTOR_operation of the input file conductor_definition.xlsx. *__constant_self_inductance_evaluation: private method that assigns a constant value to the self inductance that is defined by the user in variable SELF_INDUCTANCE, in sheet CONDICTOR_operation in the input file conductor_definition.xlsx Class: Conductor modified: conductor.py BREAKING CHANGES These methods are called respectively with the new values of flags INDUCTANCE_MODE, SELF_INDUCTANCE_MODE, as follows: INDUCTANCE_MODE = 0 -> __constant_inductance SELF_INDUCTANCE_MODE = 0 -> __constant_self_inductance_evaluation
Modified functions: *__inductance_analytical_calculation *added check on the new mode (value = 0) *added keyword SELF_INDUCTANCE_MODE_0=0 in self_inductance_switch __inductance_approximate_calculation *added check on the new mode (value = 0) *added keyword SELF_INDUCTANCE_MODE_0=0 in self_inductance_switch __build_electric_mass_matrix *added check on the new mode (value = 0) *added keyword CONSTANT_INDUCTANCE=0 in inductance_switch NEED REFACTORING!!! Class: Conductor modified: conductor.py
In the functions: *__mutual_inductance *__self_inductance_mode1 *__self_inductance_mode2 The previous methods for the inductances evaluation are restored. This process was already done in a previous commit, but the commit was reverted by mistake. Class: Conductor modified: conductor.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit gives conflicts that are not trivial to resolve because they are not visible in the file text editor nor in GitHub Desktop. Thus it is ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit gives conflicts that are not trivial to resolve because they are not visible in the file text editor nor in GitHub Desktop. Please, remove it from the pull request.
Updated the instruction that manages the odd behaviour while loading input files (value set to 1 are converted in True) in method __init__. To avoid that other values are converted unexpectedly, the explicit check for value == True is added in this commit. For instance this allows to avoid the conversion of variable INDUCTANCE_MODE = 2 into INDUCTANCE_MODE = 1 (because 2 is equivalent to true but is different from it). Class: Conductor modified: conductor.py
ValueError: Voltage difference along superconductor and stabilizer must be the same. Changes in method solve_current_divider. Class: StrandMixedComponent modified: strand_mixed_component.py
Recap of what is going on here (to try to clear up the mind and keep a reference)
|
Updated the Class StackComponent, 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.
Refactor of the method get_electric_resistance, both in Class StrandMixedComponent and in Class StackComponent. All the previous indices are eliminated and now there are only two cases:
a) if critical_current = 0 the equivalent resistance is equal to the stabilizer resistance
b) if critical_current is not = 0 then the current divider is used.
Inside the 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.
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, in the Class StrandMixedComponent, is modified when the minimum in the vector critical_current is below a certain value. This change has been verified.