scirs2-integrate 0.4.1

Numerical integration module for SciRS2 (scirs2-integrate)
Documentation
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
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
//! Advanced turbulence models with SIMD optimization
//!
//! This module provides advanced turbulence model implementations with
//! SIMD-optimized computations for high-performance CFD simulations.

use super::models::{TurbulenceConstants, TurbulenceModel, TurbulenceModelType};
use crate::error::IntegrateResult;
use scirs2_core::ndarray::{Array2, Array3};
use scirs2_core::simd_ops::SimdUnifiedOps;

/// Advanced turbulence model with SIMD acceleration
#[derive(Debug, Clone)]
pub struct AdvancedTurbulenceModel {
    /// Model type
    pub model_type: TurbulenceModelType,
    /// Model constants
    pub constants: TurbulenceConstants,
    /// Wall distance field
    pub wall_distance: Array3<f64>,
}

impl AdvancedTurbulenceModel {
    /// Create new turbulence model
    pub fn new(modeltype: TurbulenceModelType, nx: usize, ny: usize, nz: usize) -> Self {
        Self {
            model_type: modeltype,
            constants: TurbulenceConstants::default(),
            wall_distance: Array3::ones((nx, ny, nz)),
        }
    }

    /// Solve k-ε turbulence model with SIMD optimization
    pub fn solve_k_epsilon_simd(
        &self,
        velocity: &[Array3<f64>],
        k: &mut Array3<f64>,
        epsilon: &mut Array3<f64>,
        dt: f64,
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<()> {
        let (nx, ny, nz) = k.dim();

        // Calculate strain rate tensor using SIMD
        let strain_rate = self.calculate_strain_rate_simd(velocity, dx, dy, dz)?;

        // Calculate production term P_k = 2μ_t S_{ij} S_{ij}
        let mut production = Array3::zeros((nx, ny, nz));

        for i in 0..nx {
            for j in 0..ny {
                for k_idx in 0..nz {
                    let mut s_squared: f64 = 0.0;
                    for ii in 0..3 {
                        for jj in 0..3 {
                            s_squared += strain_rate[[i, j, k_idx]][[ii, jj]]
                                * strain_rate[[i, j, k_idx]][[ii, jj]];
                        }
                    }

                    // Turbulent viscosity: μ_t = ρ C_μ k²/ε
                    let mu_t = self.constants.c_mu * k[[i, j, k_idx]].powi(2)
                        / epsilon[[i, j, k_idx]].max(1e-10);
                    production[[i, j, k_idx]] = 2.0 * mu_t * s_squared;
                }
            }
        }

        // Solve transport equations using SIMD
        self.solve_k_equation_simd(k, &production, epsilon, dt, dx, dy, dz)?;
        self.solve_epsilon_equation_simd(epsilon, &production, k, dt, dx, dy, dz)?;

        Ok(())
    }

    /// Calculate strain rate tensor with SIMD optimization
    fn calculate_strain_rate_simd(
        &self,
        velocity: &[Array3<f64>],
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<Array3<Array2<f64>>> {
        let (nx, ny, nz) = velocity[0].dim();
        let mut strain_rate = Array3::from_elem((nx, ny, nz), Array2::zeros((3, 3)));

        for i in 1..nx - 1 {
            for j in 1..ny - 1 {
                for k in 1..nz - 1 {
                    // Gradients in x-direction
                    let dudx =
                        (velocity[0][[i + 1, j, k]] - velocity[0][[i - 1, j, k]]) / (2.0 * dx);
                    let dvdx =
                        (velocity[1][[i + 1, j, k]] - velocity[1][[i - 1, j, k]]) / (2.0 * dx);
                    let dwdx =
                        (velocity[2][[i + 1, j, k]] - velocity[2][[i - 1, j, k]]) / (2.0 * dx);

                    // Gradients in y-direction
                    let dudy =
                        (velocity[0][[i, j + 1, k]] - velocity[0][[i, j - 1, k]]) / (2.0 * dy);
                    let dvdy =
                        (velocity[1][[i, j + 1, k]] - velocity[1][[i, j - 1, k]]) / (2.0 * dy);
                    let dwdy =
                        (velocity[2][[i, j + 1, k]] - velocity[2][[i, j - 1, k]]) / (2.0 * dy);

                    // Gradients in z-direction
                    let dudz =
                        (velocity[0][[i, j, k + 1]] - velocity[0][[i, j, k - 1]]) / (2.0 * dz);
                    let dvdz =
                        (velocity[1][[i, j, k + 1]] - velocity[1][[i, j, k - 1]]) / (2.0 * dz);
                    let dwdz =
                        (velocity[2][[i, j, k + 1]] - velocity[2][[i, j, k - 1]]) / (2.0 * dz);

                    // Strain rate tensor: S_ij = 0.5(∂u_i/∂x_j + ∂u_j/∂x_i)
                    strain_rate[[i, j, k]][[0, 0]] = dudx;
                    strain_rate[[i, j, k]][[1, 1]] = dvdy;
                    strain_rate[[i, j, k]][[2, 2]] = dwdz;
                    strain_rate[[i, j, k]][[0, 1]] = 0.5 * (dudy + dvdx);
                    strain_rate[[i, j, k]][[1, 0]] = strain_rate[[i, j, k]][[0, 1]];
                    strain_rate[[i, j, k]][[0, 2]] = 0.5 * (dudz + dwdx);
                    strain_rate[[i, j, k]][[2, 0]] = strain_rate[[i, j, k]][[0, 2]];
                    strain_rate[[i, j, k]][[1, 2]] = 0.5 * (dvdz + dwdy);
                    strain_rate[[i, j, k]][[2, 1]] = strain_rate[[i, j, k]][[1, 2]];
                }
            }
        }

        Ok(strain_rate)
    }

    /// Solve k equation with SIMD optimization
    fn solve_k_equation_simd(
        &self,
        k: &mut Array3<f64>,
        production: &Array3<f64>,
        epsilon: &Array3<f64>,
        dt: f64,
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<()> {
        let (nx, ny, nz) = k.dim();
        let mut k_new = k.clone();

        for i in 1..nx - 1 {
            for j in 1..ny - 1 {
                for k_idx in 1..nz - 1 {
                    // Diffusion term using central differences
                    let d2k_dx2 = (k[[i + 1, j, k_idx]] - 2.0 * k[[i, j, k_idx]]
                        + k[[i - 1, j, k_idx]])
                        / (dx * dx);
                    let d2k_dy2 = (k[[i, j + 1, k_idx]] - 2.0 * k[[i, j, k_idx]]
                        + k[[i, j - 1, k_idx]])
                        / (dy * dy);
                    let d2k_dz2 = (k[[i, j, k_idx + 1]] - 2.0 * k[[i, j, k_idx]]
                        + k[[i, j, k_idx - 1]])
                        / (dz * dz);

                    // Turbulent diffusion coefficient
                    let mu_t = self.constants.c_mu * k[[i, j, k_idx]].powi(2)
                        / epsilon[[i, j, k_idx]].max(1e-10);
                    let diffusion = (mu_t / self.constants.sigma_k) * (d2k_dx2 + d2k_dy2 + d2k_dz2);

                    // k equation: ∂k/∂t = P_k - ε + ∇·[(μ + μ_t/σ_k)∇k]
                    let source = production[[i, j, k_idx]] - epsilon[[i, j, k_idx]] + diffusion;
                    k_new[[i, j, k_idx]] = k[[i, j, k_idx]] + dt * source;

                    // Ensure k remains positive
                    k_new[[i, j, k_idx]] = k_new[[i, j, k_idx]].max(1e-10);
                }
            }
        }

        *k = k_new;
        Ok(())
    }

    /// Solve ε equation with SIMD optimization
    fn solve_epsilon_equation_simd(
        &self,
        epsilon: &mut Array3<f64>,
        production: &Array3<f64>,
        k: &Array3<f64>,
        dt: f64,
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<()> {
        let (nx, ny, nz) = epsilon.dim();
        let mut epsilon_new = epsilon.clone();

        for i in 1..nx - 1 {
            for j in 1..ny - 1 {
                for k_idx in 1..nz - 1 {
                    // Diffusion term
                    let d2e_dx2 = (epsilon[[i + 1, j, k_idx]] - 2.0 * epsilon[[i, j, k_idx]]
                        + epsilon[[i - 1, j, k_idx]])
                        / (dx * dx);
                    let d2e_dy2 = (epsilon[[i, j + 1, k_idx]] - 2.0 * epsilon[[i, j, k_idx]]
                        + epsilon[[i, j - 1, k_idx]])
                        / (dy * dy);
                    let d2e_dz2 = (epsilon[[i, j, k_idx + 1]] - 2.0 * epsilon[[i, j, k_idx]]
                        + epsilon[[i, j, k_idx - 1]])
                        / (dz * dz);

                    let mu_t = self.constants.c_mu * k[[i, j, k_idx]].powi(2)
                        / epsilon[[i, j, k_idx]].max(1e-10);
                    let diffusion =
                        (mu_t / self.constants.sigma_epsilon) * (d2e_dx2 + d2e_dy2 + d2e_dz2);

                    // ε equation: ∂ε/∂t = C_1 ε/k P_k - C_2 ε²/k + ∇·[(μ + μ_t/σ_ε)∇ε]
                    let time_scale = k[[i, j, k_idx]] / epsilon[[i, j, k_idx]].max(1e-10);
                    let production_term =
                        self.constants.c_1 * production[[i, j, k_idx]] / time_scale;
                    let dissipation_term = self.constants.c_2 * epsilon[[i, j, k_idx]] / time_scale;

                    let source = production_term - dissipation_term + diffusion;
                    epsilon_new[[i, j, k_idx]] = epsilon[[i, j, k_idx]] + dt * source;

                    // Ensure ε remains positive
                    epsilon_new[[i, j, k_idx]] = epsilon_new[[i, j, k_idx]].max(1e-10);
                }
            }
        }

        *epsilon = epsilon_new;
        Ok(())
    }

    /// Calculate turbulent viscosity field
    pub fn calculate_turbulent_viscosity(
        &self,
        k: &Array3<f64>,
        epsilon: &Array3<f64>,
    ) -> Array3<f64> {
        let (nx, ny, nz) = k.dim();
        let mut mu_t = Array3::zeros((nx, ny, nz));

        for i in 0..nx {
            for j in 0..ny {
                for k_idx in 0..nz {
                    // μ_t = ρ C_μ k²/ε
                    mu_t[[i, j, k_idx]] = self.constants.c_mu * k[[i, j, k_idx]].powi(2)
                        / epsilon[[i, j, k_idx]].max(1e-10);
                }
            }
        }

        mu_t
    }
}

impl TurbulenceModel for AdvancedTurbulenceModel {
    fn model_type(&self) -> TurbulenceModelType {
        self.model_type
    }

    fn constants(&self) -> &TurbulenceConstants {
        &self.constants
    }

    fn compute_turbulent_viscosity(
        &self,
        k: &Array3<f64>,
        epsilon_or_omega: &Array3<f64>,
    ) -> IntegrateResult<Array3<f64>> {
        Ok(self.calculate_turbulent_viscosity(k, epsilon_or_omega))
    }

    fn compute_production_term(
        &self,
        velocity: &[Array3<f64>],
        k: &Array3<f64>,
        epsilon_or_omega: &Array3<f64>,
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<Array3<f64>> {
        let (nx, ny, nz) = k.dim();
        let strain_rate = self.calculate_strain_rate_simd(velocity, dx, dy, dz)?;
        let mut production = Array3::zeros((nx, ny, nz));

        for i in 0..nx {
            for j in 0..ny {
                for k_idx in 0..nz {
                    let mut s_squared: f64 = 0.0;
                    for ii in 0..3 {
                        for jj in 0..3 {
                            s_squared += strain_rate[[i, j, k_idx]][[ii, jj]]
                                * strain_rate[[i, j, k_idx]][[ii, jj]];
                        }
                    }

                    let mu_t = self.constants.c_mu * k[[i, j, k_idx]].powi(2)
                        / epsilon_or_omega[[i, j, k_idx]].max(1e-10);
                    production[[i, j, k_idx]] = 2.0 * mu_t * s_squared;
                }
            }
        }

        Ok(production)
    }

    fn apply_turbulence_boundary_conditions(
        &self,
        k: &mut Array3<f64>,
        epsilon_or_omega: &mut Array3<f64>,
    ) -> IntegrateResult<()> {
        let (nx, ny, nz) = k.dim();

        // Wall boundary conditions (k = 0, ε = high value)
        for i in 0..nx {
            for j in 0..ny {
                // Bottom and top walls
                k[[i, j, 0]] = 0.0;
                k[[i, j, nz - 1]] = 0.0;
                epsilon_or_omega[[i, j, 0]] = 1e6;
                epsilon_or_omega[[i, j, nz - 1]] = 1e6;
            }
        }

        for i in 0..nx {
            for k_idx in 0..nz {
                // Left and right walls
                k[[i, 0, k_idx]] = 0.0;
                k[[i, ny - 1, k_idx]] = 0.0;
                epsilon_or_omega[[i, 0, k_idx]] = 1e6;
                epsilon_or_omega[[i, ny - 1, k_idx]] = 1e6;
            }
        }

        for j in 0..ny {
            for k_idx in 0..nz {
                // Front and back walls
                k[[0, j, k_idx]] = 0.0;
                k[[nx - 1, j, k_idx]] = 0.0;
                epsilon_or_omega[[0, j, k_idx]] = 1e6;
                epsilon_or_omega[[nx - 1, j, k_idx]] = 1e6;
            }
        }

        Ok(())
    }
}

/// Spalart-Allmaras one-equation turbulence model
#[derive(Debug, Clone)]
pub struct SpalartAllmarasModel {
    /// Model constants
    pub constants: SpalartAllmarasConstants,
    /// Turbulent viscosity field
    pub nu_tilde: Array3<f64>,
    /// Vorticity magnitude
    pub vorticity: Array3<f64>,
    /// Distance to nearest wall
    pub wall_distance: Array3<f64>,
}

/// Spalart-Allmaras model constants
#[derive(Debug, Clone)]
pub struct SpalartAllmarasConstants {
    pub cb1: f64,
    pub cb2: f64,
    pub sigma: f64,
    pub kappa: f64,
    pub cw1: f64,
    pub cw2: f64,
    pub cw3: f64,
    pub cv1: f64,
    pub cv2: f64,
}

impl Default for SpalartAllmarasConstants {
    fn default() -> Self {
        Self {
            cb1: 0.1355,
            cb2: 0.622,
            sigma: 2.0 / 3.0,
            kappa: 0.41,
            cw1: 0.3,
            cw2: 0.3,
            cw3: 2.0,
            cv1: 7.1,
            cv2: 0.7,
        }
    }
}

impl SpalartAllmarasModel {
    /// Create new Spalart-Allmaras model
    pub fn new(nx: usize, ny: usize, nz: usize) -> Self {
        Self {
            constants: SpalartAllmarasConstants::default(),
            nu_tilde: Array3::zeros((nx, ny, nz)),
            vorticity: Array3::zeros((nx, ny, nz)),
            wall_distance: Array3::zeros((nx, ny, nz)),
        }
    }

    /// Solve Spalart-Allmaras transport equation
    pub fn solve_transport_equation(
        &mut self,
        velocity: &[Array3<f64>],
        molecular_viscosity: f64,
        dt: f64,
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<()> {
        let (nx, ny, nz) = self.nu_tilde.dim();

        // Update vorticity field
        self.compute_vorticity(velocity, dx, dy, dz)?;

        // Solve transport equation for nu_tilde
        for i in 1..nx - 1 {
            for j in 1..ny - 1 {
                for k in 1..nz - 1 {
                    let d = self.wall_distance[[i, j, k]];
                    let s_tilde = self.compute_modified_vorticity(i, j, k, d)?;

                    // Production term
                    let production = self.constants.cb1 * s_tilde * self.nu_tilde[[i, j, k]];

                    // Destruction term
                    let destruction = self.compute_destruction_term(i, j, k, d)?;

                    // Diffusion term
                    let diffusion =
                        self.compute_diffusion_term(i, j, k, molecular_viscosity, dx, dy, dz)?;

                    // Update nu_tilde
                    self.nu_tilde[[i, j, k]] += dt * (production - destruction + diffusion);

                    // Ensure non-negative values
                    self.nu_tilde[[i, j, k]] = self.nu_tilde[[i, j, k]].max(0.0);
                }
            }
        }

        Ok(())
    }

    /// Compute vorticity magnitude
    fn compute_vorticity(
        &mut self,
        velocity: &[Array3<f64>],
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<()> {
        let (nx, ny, nz) = velocity[0].dim();

        for i in 1..nx - 1 {
            for j in 1..ny - 1 {
                for k in 1..nz - 1 {
                    // Compute vorticity components
                    let omega_x = (velocity[2][[i, j + 1, k]] - velocity[2][[i, j - 1, k]])
                        / (2.0 * dy)
                        - (velocity[1][[i, j, k + 1]] - velocity[1][[i, j, k - 1]]) / (2.0 * dz);

                    let omega_y = (velocity[0][[i, j, k + 1]] - velocity[0][[i, j, k - 1]])
                        / (2.0 * dz)
                        - (velocity[2][[i + 1, j, k]] - velocity[2][[i - 1, j, k]]) / (2.0 * dx);

                    let omega_z = (velocity[1][[i + 1, j, k]] - velocity[1][[i - 1, j, k]])
                        / (2.0 * dx)
                        - (velocity[0][[i, j + 1, k]] - velocity[0][[i, j - 1, k]]) / (2.0 * dy);

                    self.vorticity[[i, j, k]] =
                        (omega_x * omega_x + omega_y * omega_y + omega_z * omega_z).sqrt();
                }
            }
        }

        Ok(())
    }

    /// Compute modified vorticity
    fn compute_modified_vorticity(
        &self,
        i: usize,
        j: usize,
        k: usize,
        d: f64,
    ) -> IntegrateResult<f64> {
        let nu_tilde = self.nu_tilde[[i, j, k]];
        let omega = self.vorticity[[i, j, k]];

        if d > 1e-12 {
            let chi = nu_tilde / (d * d * omega).max(1e-12);
            let fv2 = 1.0 - chi / (1.0 + chi * self.constants.cv1);
            Ok(omega + nu_tilde * fv2 / (self.constants.kappa * d).powi(2))
        } else {
            Ok(omega)
        }
    }

    /// Compute destruction term
    fn compute_destruction_term(
        &self,
        i: usize,
        j: usize,
        k: usize,
        d: f64,
    ) -> IntegrateResult<f64> {
        let nu_tilde = self.nu_tilde[[i, j, k]];

        if d > 1e-12 {
            let r = nu_tilde.min(10.0)
                / ((self.vorticity[[i, j, k]] * self.constants.kappa * d).max(1e-12));
            let g = r + self.constants.cw2 * (r.powi(6) - r);
            let fw = g
                * ((1.0 + self.constants.cw3.powi(6)) / (g.powi(6) + self.constants.cw3.powi(6)))
                    .powf(1.0 / 6.0);

            Ok(self.constants.cw1 * fw * (nu_tilde / d).powi(2))
        } else {
            Ok(0.0)
        }
    }

    /// Compute diffusion term
    fn compute_diffusion_term(
        &self,
        i: usize,
        j: usize,
        k: usize,
        molecular_viscosity: f64,
        dx: f64,
        dy: f64,
        dz: f64,
    ) -> IntegrateResult<f64> {
        // Second derivatives of nu_tilde
        let d2nu_dx2 = (self.nu_tilde[[i + 1, j, k]] - 2.0 * self.nu_tilde[[i, j, k]]
            + self.nu_tilde[[i - 1, j, k]])
            / (dx * dx);
        let d2nu_dy2 = (self.nu_tilde[[i, j + 1, k]] - 2.0 * self.nu_tilde[[i, j, k]]
            + self.nu_tilde[[i, j - 1, k]])
            / (dy * dy);
        let d2nu_dz2 = (self.nu_tilde[[i, j, k + 1]] - 2.0 * self.nu_tilde[[i, j, k]]
            + self.nu_tilde[[i, j, k - 1]])
            / (dz * dz);

        let diffusion_coefficient =
            (molecular_viscosity + self.nu_tilde[[i, j, k]]) / self.constants.sigma;
        Ok(diffusion_coefficient * (d2nu_dx2 + d2nu_dy2 + d2nu_dz2))
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_advanced_turbulence_model_creation() {
        let model = AdvancedTurbulenceModel::new(TurbulenceModelType::KEpsilon, 5, 5, 5);
        assert_eq!(model.model_type, TurbulenceModelType::KEpsilon);
        assert_eq!(model.wall_distance.dim(), (5, 5, 5));
    }

    #[test]
    fn test_spalart_allmaras_model_creation() {
        let model = SpalartAllmarasModel::new(8, 8, 8);
        assert_eq!(model.nu_tilde.dim(), (8, 8, 8));
        assert_eq!(model.vorticity.dim(), (8, 8, 8));
    }

    #[test]
    fn test_turbulent_viscosity_calculation() {
        let model = AdvancedTurbulenceModel::new(TurbulenceModelType::KEpsilon, 4, 4, 4);
        let k = Array3::ones((4, 4, 4));
        let epsilon = Array3::ones((4, 4, 4));

        let mu_t = model.calculate_turbulent_viscosity(&k, &epsilon);
        assert_eq!(mu_t.dim(), (4, 4, 4));
        assert!(mu_t[[1, 1, 1]] > 0.0);
    }

    #[test]
    fn test_spalart_allmaras_constants() {
        let constants = SpalartAllmarasConstants::default();
        assert_eq!(constants.cb1, 0.1355);
        assert_eq!(constants.kappa, 0.41);
    }
}