Coder Social home page Coder Social logo

ornl-modelica / transform-library Goto Github PK

View Code? Open in Web Editor NEW
54.0 54.0 24.0 38.62 MB

A Modelica based library for modeling thermal hydraulic energy systems and other multi-physics systems

License: Apache License 2.0

Python 2.23% Modelica 92.95% Jupyter Notebook 1.21% C 0.02% Motoko 3.59%

transform-library's People

Contributors

adrpo avatar beutlich avatar greenwoodms06 avatar jdrader86 avatar klfrick2 avatar maltelenz avatar qlambert-pro avatar tbeu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

transform-library's Issues

Kinetic Variable Names

The variable names for the moderator are often labeled as coolant (i.e. Teffref_coolant, alpha_coolant, etc). Several reactor designs have separate moderators and coolants (e.g. RBMK, PHWR, MSR). Recommend changing names of variables to reflect relationship to moderator to be consistent with typical PK nomenclature.
Also, this nomenclature seems to ignore fast reactors and makes things somewhat hardcoded for thermal designs. This is a different error/bug/feature though.

Compatibility with OpenModelica & Windows 10

Describe the bug

First of all, I would like to know if the library is or will be compatible with OpenModelica and Windows? If not, then you can ignore the rest.

I tried loading library with OpenModelica v1.16-0 (64-bit) on Windows 10 but it cannot load due to the issues with two models in the "TRANSFORM/Fluid/Machines/BaseClasses/PumpCharacteristics/HomologousSets/" folder. Particularly the problem is caused by “Axial.mo” & “Mixed.mo”.

[1] 17:15:03 Syntax Error
[D:/Program_files/OpenModelica1.16.0/lib/omlibrary/TRANSFORM/Fluid/Machines/BaseClasses/PumpCharacteristics/HomologousSets/Mixed.mo: 45:7-45:16]: Subscripting modifiers is not allowed. Apply the modification on the whole identifier using an array-expression or an each-modifier.

[2] 17:15:03 Syntax Error
[D:/Program_files/OpenModelica1.16.0/lib/omlibrary/TRANSFORM/Fluid/Machines/BaseClasses/PumpCharacteristics/HomologousSets/Axial.mo: 45:7-45:16]: Subscripting modifiers is not allowed. Apply the modification on the whole identifier using an array-expression or an each-modifier.

[3] 17:15:03 Scripting Error
Failed to load package TRANSFORM (default) using MODELICAPATH D:/Program_files/OpenModelica1.16.0/lib/omlibrary;C:/Users/Eddy/AppData/Roaming/.openmodelica/libraries/.

I think the problem is caused by the dimensions of arrays in the list, were the number of elements are not the same. e.g. table_BAN=[0,0.539726027; 0.222147028, 0.608219178; 0.454467063, 0.712328767; 0.698935764, 0.832876712; 1,0.95890411]

The same error was previously discussed here, and the advise was made to refer to Modelica Specification - 7.2.5 Modifiers for Array Elements.

Nevertheless, I tried deleting “Axial.mo” & “Mixed.mo” and then library loads, but the following messages occur:

[1] 17:17:57 Grammar Warning
[D:/Program_files/OpenModelica1.16.0/lib/omlibrary/TRANSFORM/Fluid/Machines/BaseClasses/PumpCharacteristics/HomologousSets/package.mo: 2:1-10:19]: Axial was referenced in the package.order file, but was not found in package.mo, Axial/package.mo or Axial.mo.

[2] 17:17:57 Scripting Warning
Requested package ModelicaServices of version 3.2.2, but this package was already loaded with version 3.2.3. You might experience problems if these versions are incompatible.

[3] 17:17:57 Scripting Notification
Skipped loading package UserInteraction (0.65,default) using MODELICAPATH D:/Program_files/OpenModelica1.16.0/lib/omlibrary;C:/Users/Eddy/AppData/Roaming/.openmodelica/libraries/ (uses-annotation may be wrong).

[4] 17:17:57 Scripting Notification
You can install the requested package using one of the commands:
installPackage(SDF, "master", exactMatch=true)
installPackage(SDF, "0.4.1", exactMatch=false)
installPackage(SDF, "0.4.1", exactMatch=false).

[5] 17:17:57 Scripting Notification
Skipped loading package SDF (0.4.1,default) using MODELICAPATH D:/Program_files/OpenModelica1.16.0/lib/omlibrary;C:/Users/Eddy/AppData/Roaming/.openmodelica/libraries/ (uses-annotation may be wrong).

The first message occurs as expected due to the missing *.mo files, but at least the library can be loaded.
Messages from 3 to 5 occur only when I am using TRANSFORM library.

Also, maybe problems can be caused by the installation location of the software, which is not default. Besides aforementioned problems there are plenty more, which are caused when trying to run test and other models.

Screenshots

Errors after initial try to load the library.
image
After deleting “Axial.mo” & “Mixed.mo” library loads, but the following messages occur:
image

Computer Configuration:**

  • OS: Windows 10
  • Modelica IDE and version: OpenModelica v1.16-0 (64-bit)

Additional

It would be beneficial if a compiled GNU GSL library would be by default in "TRANSFORM/Resources/Library/OSVERSION", were currently no "win64" folder exists and for an amateur user it might take considerable time to figure out how to accomplish it.

Missing parameters used in Dialog.enable expressions inside annotations

Describe the bug

Variables not present in the model are used in Dialog annotations.

To Reproduce

  1. Enable Dymola pedantic mode from Simulation Setup.
  2. Navigate to TRANSFORM top directory
  3. Right click on TRANSFORM and select Check
  4. See the errors in the messages view:
Undeclared variable: modelStructure_shell
in the Dialog.enable attribute of steamGenerator.lumpPressureAt_shell declared in class TRANSFORM.HeatExchangers.GenericDistributed_HX
Undeclared variable: modelStructure_tube
in the Dialog.enable attribute of steamGenerator.lumpPressureAt_tube declared in class TRANSFORM.HeatExchangers.GenericDistributed_HX
Undeclared variable: modelStructure
in the Dialog.enable attribute of coreSubchannel.lumpPressureAt declared in class TRANSFORM.Nuclear.CoreSubchannels.Regions_3

This happens for TRANSFORM.Nuclear.CoreSubchannels.Regions_1, Regions_2, Regions_3.

Expected behavior

To check the library without any errors.

Computer Configuration (please complete the following information):**

  • OS: Windows 10
  • Modelica IDE and version: Dymola 2021

Trace element nonlinearities

Description

Adding trace elements to water causes extra nonlinearities per component and creates issues with dynamic state selection. I haven't been able to find the state selection option for TRASNFORM components which causes Modelica to often choose the wrong states causing simple models to fail.

To Reproduce

Steps to reproduce the behavior:
add: package Medium = Modelica.Media.Water.StandardWater(extraPropertiesNames={"Tritium"});
change the medium of components to Medium
run any model and verify that the size and number of nonlinear systems increase
Note: Possible that this way of changing medium is wrong but it is the one used in TRANSFORM lecture series(https://www.youtube.com/watch?v=-LWV-svpzGg).

After talking to Claytex they mentioned that adding a trace substance shouldn't increase nonlinearities atleast in normal Modelica components. In addition to this normal Modelica components have stateSelect option in which we can tell Modelica which states to use so it doesn't get confused and end up selecting the wrong one. Is there a potential work around for this issue of nonlinearities?

OS: Windows 10
Dymola 2023x

Kinetics Options - Default Parameters

Suggest adding in default fuels/reactors to the kinetics options. Perhaps 4 options like: 235-U, 233-U, 239-Pu, and custom. This could also be implemented by allowing the user to select from several predefined options and then make modification, thus negating the custom option.
The current implementation loads defaults from a variety of sources (the beta and lambda info is 235-U). I would suggest, in general, that a consistent set of defaults be made available (perhaps PWR for now). Can also draw some of this info from publicly available FSAR/DCD.

Rename Trace Mass to more Generic Trace in Fluid

The fluid library does not impose mass/moles/etc. of the trace components. Need to update the units and annotation to remove confusion. This change does not impact calculations. However, relation to trace mass ports and the HeatAndMass Transfer library retains the mass/mole basis.

UO2 thermal conductivity porosity

UO2 assumes a porosity of 0.05% for density. Update the thermal conductivity to be based on the same porosity using the FM factor from literature reference.

Reactivity weighting function customization

The effective fuel and moderator temperature weighting functions built-in to the subchannel models use the T_effective variable from the pipe model. The T_effective calculation uses mass weighted average (at least for moderator). Typically in kinetics calculations one uses a flux-weighted calculation. My suggestion would be to add a field for temperature weighting factors. The default could remain mass, or could be made powerProfile or powerProfile2 which are more typical.

nParallle confusing

Current nParallel assumes a single component on the interior which means everything external to the component that references the internals must be scaled by nParallel. This is often forgotten. Perhaps it is better to force the nParallel calculations internally...

Remove dependency on Dymola-SDF library

There are a couple heat transfer models that use the Dymola SDF library to interpolate an external table. It would be good to implement a solution that would remove this dependency as SDF library is not publicly available.

CHF Replaceable Model

Recommend making the x_CHF feature of two phase heat transfer a replaceable model. Then we could implement more exciting CHF correlations if we so desired.

Pipe flow initialization

For component TRANSFORM.Fluid.Pipes.GenericPipe_MultiTransferSurface there is a statement for initial value of port b set as:
p_b_start=p_a_start + (if m_flow_a_start > 0 then -1e3 elseif m_flow_a_start < 0 then -1e3 else 0)
shouldn't it be:
p_b_start=p_a_start + (if m_flow_a_start > 0 then 1e3 elseif m_flow_a_start < 0 then -1e3 else 0)
since if flow is positive pressure would be greater at port b.

experiment annotation in non-simulation model?

There is an experiment annotation in TRANSFORM.Examples.Demonstrations.Models.BatemanEquations:

experiment(StopTime=1000, __Dymola_NumberOfIntervals=1000));

Is this intentional, or is this class intended for use as a component, like it is in TRANSFORM.Examples.Demonstrations.Examples.BatemanEquations_Test?

If it is not supposed to be a simulation model, the experiment annotation should probably be removed.

Density Reactivity Coefficient

Suggest adding a moderator density coefficient as a replacement for moderator temperature coefficient. Should keep the MTC option because that is sometimes preferred, but just add a MDC option.

Install guide for `noname` dependency

Is your feature request related to a problem? Please describe.

On Windows. I'm trying to run TRANSFORM.Math.Interpolation.Models.Examples.Interpolation_2D_Test which needs noname.lib which I think is supposed to be complied from https://cloud.cees.ornl.gov/gitlab/dalg24/noname It would be nice to have transform tell people these dependencies.

FWIW, the cmake script in noname appears to target linux or perhaps needs some un-doc'd dependencies like patch and autotools. It also applies a patch to gsl then installs gsl, which is odd considering gsl is a separate dependency here. To get around autotools I just passed my complied gsl via cmake in but realized since my version is mismatch (2.7 vs 2.5) and I don't have the patch, something is likely wrong. I didn't appear to get a noname.lib either but I digress as these are probably issues for that repo.

oh one more that is more than just windows woes: noname doesn't have a license attached

Describe the solution you'd like

Some documentation for noname similar to https://github.com/ORNL-Modelica/TRANSFORM-Library/blob/master/TRANSFORM/Math/GNU_ScientificLibrary/UsersGuide/package.mo

Describe alternatives you've considered

No alts considered

Additional context

n/a

TRANSFORM and ExternalMedia are incompatibles

Describe the bug

Hello,

I am working with Dymola and am looking to use the TRANSFORM library to model a molten salt SMR. I have found an interesting example of CO2 loop in TRANSFORM.Examples.SupercriticalCO2.Examples.SCO2Loop

However this example does not simulate. It seems that some classes have not been imported, especially the ExternalMedia class (located in TRANSFORM.Media) which contains the CO2 related information.

I found on the TRANSFORM github an independent ExternalMedia library which solves this problem. However, it requires Modelica 3.2.1 while TRANSFORM needs Modelica 4.0

So I'm currently stuck. Can you do anything to solve this problem?

To Reproduce

Steps to reproduce the behavior:

  1. Go to TRANSFORM.Examples.SupercriticalCO2.Examples.SCO2Loop
  2. Click on simulate
  3. See error

Computer Configuration (please complete the following information):**

  • OS: Windows 10 Entreprise
  • Modelica IDE and version: Dymola under the 3DEXPERIENCE from DassaultSystem

Void fraction based two phase heat transfer smoothing

Instead of using equilibrium quality to base the smoothing of the heat transfer regimes, I suggest using void fraction. Using a value of 0.97 +/- 0.02 aligns well with other codes.
In my testing the use of void fraction provides a smoother transition between boiling and single phase vapor avoiding stair-stepping behavior at low(er) pressure (<7 MPa).

ExternalMedia test case not functional

Describe the bug

The example model in Media\ExternalMedia\Examples errors using the ExternalMedia library (DLL)
from GitHub (https://github.com/modelica-3rdparty/ExternalMedia).

Error:

Attempting to redeclare function surfaceTension when the original was not replaceable.
Context: TRANSFORM.Media.ExternalMedia.CoolProp.Hydrogen
In file: path/to/TRANSFORM/Media/ExternalMedia/CoolProp/Hydrogen

Can you advice on how to link ExternalMedia with Transform (e.g. re-compilation, etc.)

@veeshy

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Computer Configuration (please complete the following information):**

  • OS: [e.g. Windows 10]
  • Modelica IDE and version: [e.g. Dymola 2020]

Additional context

Add any other context about the problem here.

license

In the ReadMe, you mention the Modelica License, but just recently, the Modelica Association has switched to the BSD 3-clause license:
modelica/ModelicaStandardLibrary#2320

Maybe you could also consider switching to that license, or any other OSI certified license?
https://choosealicense.com/appendix/
https://opensource.org/licenses

If you indeed decide to switch to an OSI certified license, you should also convert the License.pdf file into a License.md or License.txt file (also see #1) so that it is text based and not binary and tools can read it.
https://blog.github.com/2016-09-21-license-now-displayed-on-repository-overview/
https://blog.github.com/2017-11-03-search-repositories-by-license/

Fix filename cases

I loaded TRANSFORM into dymola (2019) on ubuntu and got warnings/errors that 2 files were not found. Looks like their filenames were typo'd. If yall develop on a case-insensitive system this probably is not an issue so you woudln't have seen it.

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.