README.md 5.14 KB
Newer Older
1
2
3
4
5
# Thermophysical Properties
This project provides an interface for thermophysical properties used in molten salt systems.

All properties are evualted as saturated liquid.

Henderson, Shane's avatar
Henderson, Shane committed
6
7
 Data derivation is described in:

Henderson, Shane's avatar
Henderson, Shane committed
8
9
 Henderson, Shane, Agca, Can, McMurray, Jake W., and Lefebvre, Robert Alexander. Saline: An API for Thermophysical Properties.
 United States: N. p., 2021.
Henderson, Shane's avatar
Henderson, Shane committed
10
11

 Units:
12
13
14
  - Conductivity  - Watts per Meter-Kelvin (W/m K)
  - Pressure      - Kilopascal (kPa)
  - Temperature   - Kelvin (K)
Henderson, Shane's avatar
Henderson, Shane committed
15
  - Enthalpy      - Joule per mole (J/mole)
16
17
18
19
20
21
22
23
24
  - Viscosity     - Centipoise (cP) or milli Newton-second per square Meter (mN.s/m^2)
  - Specific Heat - Joules per Kelvin Mole (J/K mole)
  - Density       - Grams per Cubic Centimeter (g/cc)

## Design
The [`Thermophysical_Properties`](./src/thermophysical_properties.hh) class wraps a [`Data_Store`](./src/data_store.hh) instance.

The `Data_Store` interface provides an integration point for data and the data format and type (e.g.,CSV vs HDF5, functional vs tabular).

Henderson, Shane's avatar
Henderson, Shane committed
25
The Data_Store has a convenience class `View` to insulate Data_Store access.
26
27
28
29
30
31
32


>Note:: Pressure parameters are ignored, currently.


>Note:: Current data integrated is incorporated via the [`Default_Data_Store`](./src/default_data_store.hh)

Henderson, Shane's avatar
Henderson, Shane committed
33
# Getting Started
34
For individuals wanting to compile the code from source, below are the tested requirements and configurations.
35

36
## Requirements
Henderson, Shane's avatar
Henderson, Shane committed
37
38
39
* C/C++ compiler C++11 compliant/capable
* CMake 3.16 or newer
* Git 2.15+ (Recommended)
40

41
## Configuration and Compilation
Henderson, Shane's avatar
Henderson, Shane committed
42
43
44
45
46
47
48
49
50
51
The Paths used below, `~/saline` and `~/build/saline`, are totally arbitrary. Feel free to chose paths that work for your workflow.

* Obtain local copy of source code
  * Via ssh (Requires [XCAMS](https://xcams.ornl.gov/xcams/) account)
    * [Setup ssh access](https://docs.gitlab.com/ee/user/ssh.html) (if not already completed)
      * Generate ssh key
      * Save ssh key to Gitlab profile [code.ornl.gov](https://code.ornl.gov/-/profile/keys)
    * Clone saline `git clone git@code.ornl.gov:NEAMS/saline.git ~/saline`
  * Via https:
    * Clone saline `https://code.ornl.gov/neams/saline.git ~/saline`
52
53
* Change directory into saline `cd ~/saline`
* Create a build directory `mkdir -p ~/build/saline`
Henderson, Shane's avatar
Henderson, Shane committed
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
* Change into the build directory `cd ~/build/saline`
* Configure the build:
  * Linux/Macos:
  ```
    cmake \
      -DBUILD_SHARED_LIBS:BOOL=ON \
      -DCMAKE_BUILD_TYPE:STRING=RELEASE \
      -Dsaline_ENABLE_TESTS:BOOL=ON \
      ~/saline
    make
  ```
  * Windows
  ```
    cmake \
      -DBUILD_SHARED_LIBS:BOOL=ON \
      -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=BOOL=ON \
      ~\saline
    cmake --build .\ --target ALL_BUILD --config Release
  ```
  * Additional Saline specific configuration options will be covered as they are added.
* Run tests using `ctest`
  * A satisfactory build should yield test results like this (total number of tests may change at any time)
  ```
  100% tests passed, 0 tests failed out of 18

  Total Test time (real) =   0.46 sec
  ```
  >Note:: Testing is enabled by default and has a dependency on[googletest](https://github.com/google/googletest).
  Cmake resolves this dependency at configuration time using [FetchContent](https://cmake.org/cmake/help/v3.16/module/FetchContent.html).

  The option `-Dsaline_ENABLE_TESTS:BOOL=OFF` will disable testing if desired.

### Language Extension

Wrappers are generated for the [`Thermophysical_Properties`](./src/thermophysical_properties.hh) and the [`Default_Data_Store`](./src/default_data_store.hh) classes.

An experimental feature [`r_kister_data_store`](./src/r_kister_data_store.hh) is also wrapped, but casual users are discouraged from using this feature at this time.

#### Enabling Fortran Support

Fortran wrappers are currently generated during the development cycle. Unfortunately this process is not public at this time.

The Fortran compiler must be 2003 compliant and support the ISO_C_BINDINGS.
97

Henderson, Shane's avatar
Henderson, Shane committed
98
To enable Fortran, pass the option `-Dsaline_ENABLE_Fortran:BOOL=ON` as in:
99
```
Henderson, Shane's avatar
Henderson, Shane committed
100
101
102
103
104
105
    cmake \
      -DBUILD_SHARED_LIBS:BOOL=ON \
      -DCMAKE_BUILD_TYPE:STRING=RELEASE \
      -Dsaline_ENABLE_TESTS:BOOL=ON \
      -Dsaline_ENABLE_Fortran:BOOL=ON \
      ~/saline
106
107
```

Henderson, Shane's avatar
Henderson, Shane committed
108
#### Enabling Python Support
109

Henderson, Shane's avatar
Henderson, Shane committed
110
111
112
113
114
115
116
117
118
119
Python Wrappers are generated using [SWIG-4.0.2](https://www.swig.org/download.html).

To enable Python, pass the option `-Dsaline_ENABLE_Python:BOOL=ON` as in:
```
    cmake \
      -DBUILD_SHARED_LIBS:BOOL=ON \
      -DCMAKE_BUILD_TYPE:STRING=RELEASE \
      -Dsaline_ENABLE_TESTS:BOOL=ON \
      -Dsaline_ENABLE_Python:BOOL=ON \
      ~/saline
120
```
121

Henderson, Shane's avatar
Henderson, Shane committed
122
#### Additional Languages
123

Henderson, Shane's avatar
Henderson, Shane committed
124
Wrappers are added on an as needed basis. Thanks to [SWIG](https://www.swig.org) this process is relatively painless. Different languages have different requirements though, so mileage varies.
125

Henderson, Shane's avatar
Henderson, Shane committed
126
# Contributions
127

Henderson, Shane's avatar
Henderson, Shane committed
128
129
130
At this time the main development repository is protected. Users with [XCAMS](https://xcams.ornl.gov/xcams/) accounts are welcome to join this project and submit issues/branches to this repository for consideration.
Contributors with UCAMS accounts may be invited to join the development repository directly.
Users without UCAMS or [XCAMS](https://xcams.ornl.gov/xcams/) access should contact mstdb@ornl.gov for guidance on comment submission.