File size: 1,612 Bytes
a1b0d0f
 
 
 
 
 
 
 
 
34a423b
 
 
 
a1b0d0f
 
 
 
 
 
 
 
34a423b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
library_name: pytorch
license: other
tags:
  - scientific-computing
  - fluid-dynamics
  - kinetic-theory
---

# Learning the Optimal Linear Hydrodynamic Closure

Code for generating spectral and time-evolution comparisons used in the paper *Learning the Optimal Linear Hydrodynamic Closure*. The main entry point is `Run.py`.

## Model Card

- **Model file:** `DSMC3ModelsExp/DSMC3LearnModelFull6.pt`
- **Type:** PyTorch checkpoint for a learned linear hydrodynamic closure.
- **Use case:** Reproduce spectra and time-evolution figures in this project.
- **Input dependencies:** `spectraV1_225_50_50_250000_5e_06_0_005_1_0_1_0.npz` and `Boltzmann3_macro_values_Adapt_FullExp.pkl`.
- **Limitations:** Intended for research reproduction; validate before use outside the reported setup.

## Setup

Create a fresh environment and install the dependencies:

```bash
conda create -n nc-code python=3.11
conda activate nc-code
pip install -r requirements.txt
```

If you prefer, you can use `venv` instead of Conda.

## Required Files

Before running `Run.py`, make sure these files are present:

- `spectraV1_225_50_50_250000_5e_06_0_005_1_0_1_0.npz`
- `Boltzmann3_macro_values_Adapt_FullExp.pkl`
- `DSMC3ModelsExp/DSMC3LearnModelFull6.pt`

## Run

Run from the repository root:

```bash
python Run.py
```

The script loads the precomputed data and trained model, then writes:

- `spectra.png`
- `dynamics.png`

## Notes

- `Run.py` uses relative paths, so run it from the repository root.
- JAX is set to CPU mode in the script.
- `jax` and `torch` may need platform-specific installation steps on some systems.