Skip to content

Commit bed4f86

Browse files
committed
Update USER_MANUAL.md with cylindrical grid documentation
1 parent a7ad8c1 commit bed4f86

1 file changed

Lines changed: 81 additions & 1 deletion

File tree

docs/USER_MANUAL.md

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# HeatFlow User Manual
22

3-
This manual provides a concise guide to configuring and running simulations using the **HeatFlow** software. The software simulates heat transport using finite difference methods, primarily focusing on the Cattaneo (hyperbolic heat equation) and Fourier models.
3+
This manual provides a concise guide to configuring and running simulations using the **HeatFlow** software. The software simulates heat transport using finite difference methods, primarily focusing on the Cattaneo (hyperbolic heat equation) and Fourier models. Both Cartesian and cylindrical (axisymmetric) coordinate systems are supported.
44

55
## Compilation
66

@@ -55,6 +55,8 @@ This file uses a `KEYWORD = VALUE` format. Comments can be added using `!`.
5555
| `CG_dir` | String | `' '` | Direction for constant gradient (e.g., `'+x'`, `'-y'`). |
5656
| `T_BathCC` | Logical| `F` | Scale constant gradient with DeltaT. |
5757
| `BR` | Double | `1.0` | Bath Ratio (scaling factor). |
58+
| `kappaBoundNr` | Double | `0.0` | Boundary thermal conductivity at the outer radius (cylindrical mode only). |
59+
| `T_BathNr` | Double | `T_Bath` | Bath temperature at the outer radius (cylindrical mode only). |
5860

5961
#### Power
6062
| Keyword | Type | Default | Description |
@@ -91,6 +93,7 @@ All flags default to `.False.`. Set to `.True.` (or `T`) to enable.
9193
- `_Test_Run`: Flag for test runs.
9294
- `_InputTempDis`: Load initial temperature distribution from file.
9395
- `_FullRestart`: Perform a full restart.
96+
- `_CylindricalGrid`: Enable cylindrical (axisymmetric) coordinate system. See [Cylindrical Grid Mode](#cylindrical-grid-mode).
9497

9598
#### Output Control
9699
Defines the region of the grid to write to output.
@@ -163,6 +166,83 @@ Each line in the file (after header) corresponds to one row (X-direction).
163166
- `1:0` means Material ID 1, Heater ID 0 (no heater).
164167
- `1:1` means Material ID 1, Heater ID 1 (active heater).
165168

169+
---
170+
171+
## Cylindrical Grid Mode
172+
173+
HeatFlow supports an axisymmetric cylindrical coordinate system, enabled by setting `_CylindricalGrid = T` in `param.in`. In this mode the standard Cartesian grid is reinterpreted as a 2D radial–axial (r–y) domain:
174+
175+
| Grid axis | Physical meaning | Notes |
176+
| :--- | :--- | :--- |
177+
| **x** | Radial direction (r) | `x=1` is at the centre of the cylinder, increasing outward. |
178+
| **y** | Axial direction (down the cylinder) | Same as Cartesian y. |
179+
| **z** | Azimuthal (unused) | Must be set to `nz = 1`. |
180+
181+
### How it works
182+
183+
The simulation grid in `system.in` is defined as a standard 2D array (`nx × ny`, `nz = 1`). The physical dimensions `Lx` and `Ly` represent the cylinder radius and axial length respectively. Internally, the code makes two adjustments:
184+
185+
1. **Cell volumes** — Each radial shell at index `ix` (with `dr = Lx/nx`) has volume:
186+
187+
`V = π (r_out² − r_in²) × dy × dz`
188+
189+
where `r_in = (ix−1)·dr` and `r_out = ix·dr`.
190+
191+
2. **Heat-matrix conductivities** — The discretised radial heat equation in cylindrical coordinates is `(1/r) ∂/∂r (r κ ∂T/∂r)`. The interface area between adjacent radial shells scales with the interface radius. The code applies correction factors to the radial conductivity terms:
192+
193+
- Inner neighbour: factor = `(ix − 1) / (ix − 0.5)`
194+
- Outer neighbour: factor = `ix / (ix − 0.5)`
195+
196+
Axial (y) conductivities are unchanged.
197+
198+
### Boundary conditions
199+
200+
| Boundary | Behaviour |
201+
| :--- | :--- |
202+
| **r = 0** (centre, `ix = 1` inner face) | Symmetry boundary — zero radial heat flux. Automatic, no user input needed. |
203+
| **r = R** (outer radius, `ix = nx` outer face) | Controlled by `kappaBoundNr` and `T_BathNr` in `param.in`. |
204+
| **y = 0** and **y = Ly** (top/bottom) | Standard Cartesian boundaries (`kappaBoundy1`/`kappaBoundNy`, `T_Bathy1`/`T_Bathy2`). |
205+
206+
> **Note:** In cylindrical mode the Cartesian x and z boundary keywords (`kappaBoundx1`, `kappaBoundNx`, `kappaBoundz1`, `kappaBoundNz`) are not used. Set `kappaBoundNr` and `T_BathNr` instead.
207+
208+
### Example `param.in` (cylindrical)
209+
```
210+
_RunName = cylinder_test
211+
_CylindricalGrid = T
212+
ntime = 1000
213+
time_step = 1e-6
214+
icattaneo = 0
215+
isteady = 0
216+
power_in = 1.0
217+
kappaBoundNr = 0.5
218+
kappaBoundy1 = 0.5
219+
kappaBoundNy = 0.5
220+
T_Bath = 300.0
221+
T_BathNr = 300.0
222+
_WriteToTxt = T
223+
```
224+
225+
### Example `system.in` (cylindrical)
226+
A 10-cell radial × 5-cell axial cylinder, radius 0.005 m, length 0.01 m:
227+
```
228+
10 5 1
229+
0.005 0.01 0.001
230+
231+
! Z=1, Y=1 Row (top)
232+
1:1 1:1 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0
233+
! Z=1, Y=2 Row
234+
1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0
235+
! Z=1, Y=3 Row
236+
1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0
237+
! Z=1, Y=4 Row
238+
1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0
239+
! Z=1, Y=5 Row (bottom)
240+
1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0 1:0
241+
```
242+
Here `x=1,2` at `y=1` are heated (the central core at the top of the cylinder).
243+
244+
---
245+
166246
## Execution
167247

168248
Ensure the `inputs/` directory exists with the three required files. Run the executable from the directory containing `inputs/`.

0 commit comments

Comments
 (0)