GithubHelp home page GithubHelp logo

newcleo-dev-team / lbh15 Goto Github PK

View Code? Open in Web Editor NEW
6.0 3.0 2.0 4.53 MB

Compilation of thermo-physical properties for lead/bismuth-based liquid metals for fast reactor technology

License: GNU Lesser General Public License v3.0

Python 100.00%
liquid-metal nuclear-reactor thermodynamic-properties

lbh15's People

Contributors

klucie avatar lelaus avatar ndarmage avatar pandanielen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lbh15's Issues

Add check on properties_path

Check that properties_path variable is not empty when loading properties.
This check is dummy for for liquid metal classes available in the package (Lead, Bismuth and LBE), since they correctly assign the value of the variable.
Anyway, the check must be performed to guarantee the correct execution of user-defined classes extending LiquidMetalInterface for which the properties_path variable might be left empty.

Fix __repr__ method

repr method looks for attribute of LiquidMetal object that does not exist anymore.

Reset of liquid-metal objects

Currently, a liquid metal object is instantiated provided a given thermo-dynamic state at input. When the instance is needed at a different thermo-dynamic state, a new instance must be created. This may imply an inefficient use of memory, especially when the same liquid metal object is wanted.

The possibility of instance reset (at different thermo-dynamic state) shall be considered for future code versions.

Modify the properties sub-package for the implementation of thermochemical properties

For the sake of clarity, modify the properties sub-package structure the handle the large amount of new thermochemical properties.
The sub-package shall look like:


properties/
- __init__.py
- bismuth_properties.py
- lbe_properties.py
- lead_properties.py
- bismuth_thermochemicals/
  - __init__.py
  - diffusivity_in_bismuth.py
  - solubility_in_bismuth.py
  - bismuth_thermochemical_properties.py
- lbe_thermochemicals/
  - __init__.py
  - diffusivity_in_lbe.py
  - solubility_in_lbe.py
  - lbe_thermochemical_properties.py
- lead_thermochemicals/
  - __init__.py
  - diffusivity_in_lead.py
  - solubility_in_lead.py
  - lead_thermochemical_properties.py

The main __init__.py of the package must include all the modules defined in the properties sub-package properly.

In addition, update the code documentation to properly read the new sub-package docstrings.

Property objects shall provide information about correlation features (min, max, etc..) rather than LiquidMetal objects

Currently static method like cp_min, T_at_cp_min are embedded in LiquidMetal (LM) object classes (Lead, Bismuth, LBE). Due to the dynamic methodology of properties addition in LM objects, this approach shall be avoided.
Example of undesired behaviour:
. user adds its own cp correlation for Lead
. user asks for minimum value of cp ->> lbh15 can provide only minimum of cp for "gurvich1991" and "sobolev2011" correlation

Implementation must be in some sense "static": user asks those information without instantiation of specific property or perhaps he needs them to take decision at instantiation phase of LM.
Example:
. user wants to instantiate Bismuth knowing its cp value ->> in order to select the first or second root of the function he probably needs to know which is the function minimum

Set correlation functionality shall impact only instances rather then class itself

In current release, setting correlations to use determines the following undesired behavour:

>>> from lbh15 import Lead
>>> Lead.set_correlation_to_use('cp', 'sobolev2011')
>>> ll = Lead(T=668.15)
>>> ll.cp
146.7859768569852
>>> Lead.set_correlation_to_use('cp', 'gurvich1991')
>>> ll.cp
146.7859768569852
>>> ll2 = Lead(T=668.15)
>>> ll2.cp
146.77472503511203
>>> ll.cp
146.77472503511203

In practice, when a new instance is created, the new corralation impacts also the previously created one, thus changing its cp value. This is because property addition is a class related functionality and it is currently hanlded un new dunder method.

The following points shall be guaranteed:

  • previous instances' properties must not change because of new correlation choice selected via class method.
  • set correlation determines the correlation to use in instances initialized after it has been invoked.
  • instances might have the possibility to change the correlation to use.

Check use of correlation acronyms

Sometimes, correlations from the reference handbook miss the name used as acronym or identifier. In such case, the correlation name is lbh15. Please, check the handbook in case existing names for a correlation were neglected by mistake.

When the user adds his/her own correlation for a given property, this last becomes the default one also in case more correlations were already available. Check the documentation for correct information communicated to the user.

Add check to verify that user specified properties are not abstract

Currently in LiquidMetalInterface object, when custom property objects are loaded, a check is performed to assure that they are childs of PropertyInterface class (but not PropertyInterface itself).

Indeed, the functionality must check that the user provided property is not an abstract class, i.e., that the user has correctly overwritten all the mandatory methods as described in the documentation.

If the check fails for a given property, that one must be skipped to avoid the stop of the program.

Liquid metal density shall depend on pressure as well

In LMFR hydrostatic pressure of the coolant is not negligible. This has an impact on coolant density which is crucial for criticality
calculations. Therefore, lbh15 shall provide correction on density as function of the pressure.

The handbook provides the correlation to adopt in Eq. 2.78

Use standard values from scipy.constants

As in the object of the issue. Standard numerical values for the physical constants must be uniquely defined once. The use of scipy.constants provides all physical constants following a QA approach.

enable latexpdf to generate the documentation

Please add the possibility to generate the documentation by using latexpdf without recurring separately to dvi and pdf document production.

Use the corporate tex class when generating the pdf documentation. Please use the techdoc option to prepare the manual or technical document of lbh15.

Fix loading of duplicate properties

There is no check when loading properties that one was already loaded by a different module. This behaviour shall be fixed to avoid useless looping and fix the output of methods like correlations_available.

Fix check for non injective properties for which the root is not specified

The case in which the property correlation is non-injective and the root to use is not specified is not correctly handled when the property correlation is used for root finding of the temperature.
This does not impact the liquid metal classes available by default in the package but must be done for correct execution of the functionality by user-defined derived classes of LiquidMetalInterface.

Ensure element-wise function evaluation

Make sure that any function is implemented allowing element-wise operations, so that correlations can be called on simple scalars and arrays at the same time. The use of np.array is suggested.

"compute_bounds" Method ("interface.py") Improvement

  • [1] before exploiting the results of the minimization procedure, check the value of the OptimizeResult.success boolean flag;
  • [2] about the rounding operations close to the validity range extrema:
  • [2.A] check whether they are useful, otherwise delete them;
  • [2.B] in case they remain:
  • [2.B.1] apply them to both minimum and maximum values of the validity range for each extremum value;
  • [2.B.2] check the sign of the if statement conditions;
  • [2.B.3] put the tolerance value within the commons;
  • [2.B.4] try to encapsulate the checks within an external private function, thus implementing them only once;
  • [3] about the function to focus on for finding the maximum:
  • [3.A] change it to the opposite of the original correlation;
  • [3.B] put it within the "minimize_scalar()" function arguments directly, without any external def;

Perform code static analysis using pylint

Static analysis is a method of program debugging that is done examining the code without executing it. The process provides undertanding of the code structure and can help ensure that the code adheres to industry standards.

pylint is the common tool used for static analysis of python programs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.