ornl-modelica / transform-library Goto Github PK
View Code? Open in Web Editor NEWA Modelica based library for modeling thermal hydraulic energy systems and other multi-physics systems
License: Apache License 2.0
A Modelica based library for modeling thermal hydraulic energy systems and other multi-physics systems
License: Apache License 2.0
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.
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.
Errors after initial try to load the library.
After deleting “Axial.mo” & “Mixed.mo” library loads, but the following messages occur:
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.
Add tritium examples from journal paper
When trying to use turboTurbine in a model, got an error:
Function TRANSFORM.Math.atan22 is not known in turboTurbine (model TRANSFORM.Fluid.Machines.TurboTurbine).
Variables not present in the model are used in Dialog annotations.
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.
To check the library without any errors.
TRANSFORM.Media.Interfaces.Fluids contains duplicated code from Modelica.Media.Interfaces. Despite being a good modeling practice, the real issue is, that it cannot be handled by automatic conversion (to upcoming MSL v4.0.0), as reported in modelica/ModelicaStandardLibrary#3384 (comment).
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.
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
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.
Transfer from internal git to external github repo
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.
The Readme links to LICENSE.md, but there is none.
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.
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.
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...
The Film Boiling LUT py script needs a set of closing """ for the intro comment.
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.
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.
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.
The reference for Inconel 690 properties has changed to:
http://www.specialmetals.com/assets/smc/documents/alloys/inconel/inconel-alloy-690.pdf
There is an experiment annotation in TRANSFORM.Examples.Demonstrations.Models.BatemanEquations
:
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.
Right now the band of heat transfer smoothing is fixed at +/- 0.02. I suggest allowing for a parameter that the user can access.
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.
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
Some documentation for noname
similar to https://github.com/ORNL-Modelica/TRANSFORM-Library/blob/master/TRANSFORM/Math/GNU_ScientificLibrary/UsersGuide/package.mo
No alts considered
n/a
Add calibration factors with default of 1.0 in order to match real world values
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?
Steps to reproduce the behavior:
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).
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.)
Steps to reproduce the behavior:
A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
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/
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.