Skip to content

Commit 2e8703c

Browse files
author
Ames
committed
Fix doctests
1 parent 69413cf commit 2e8703c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/ShockTube.jl

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The function calculates:
4141
# Examples
4242
```jldoctest; setup = :(using PyThermo, PyThermo.ShockTube, Unitful)
4343
julia> driven = Mixture(["He" => 0.95, "acetone" => 0.05], T = 18u"°C", P = 85u"kPa")
44-
Mixture(95.0% helium, 5.00% acetone, 291.1 K, 8.500e+04 Pa)
44+
Mixture(95% He, 5% acetone, 291.1 K, 8.500e+04 Pa)
4545
4646
julia> shocked, velocity = shockjump(driven, 2.2);
4747
@@ -102,7 +102,7 @@ julia> driven = Mixture(["He" => 0.95, "acetone" => 0.05], T = 18u"°C", P = 85u
102102
103103
julia> driver_calc = driverpressure(driver, driven, 2.2);
104104
105-
julia> round(pressure(driver_calc), digits=2)
105+
julia> round(typeof(1.0u"MPa"), pressure(driver_calc), digits=2)
106106
3.73 MPa
107107
```
108108
@@ -160,8 +160,8 @@ julia> result = shockcalc(driver, driven, 2.2);
160160
julia> result.Ms
161161
2.2
162162
163-
julia> round(pressure(result.shocked), digits=3)
164-
481.9 kPa
163+
julia> round(typeof(1.0u"kPa"), pressure(result.shocked), digits=1)
164+
481.8 kPa
165165
```
166166
167167
# See Also
@@ -276,8 +276,8 @@ and all relevant wave speeds. All properties can be accessed using dot notation.
276276
# Fields
277277
- `p_star::Unitful.Pressure`: Pressure at the interface (star region)
278278
- `u_star::Unitful.Velocity`: Velocity at the interface (star region)
279-
- `rho_star_L::typeof(1.0u"kg/m^3")`: Density of left gas in star region
280-
- `rho_star_R::typeof(1.0u"kg/m^3")`: Density of right gas in star region
279+
- `rho_star_L::Unitful.Density`: Density of left gas in star region
280+
- `rho_star_R::Unitful.Density`: Density of right gas in star region
281281
- `T_star_L::Unitful.Temperature`: Temperature of left gas in star region
282282
- `T_star_R::Unitful.Temperature`: Temperature of right gas in star region
283283
- `S_L::Unitful.Velocity`: Left wave speed (shock or rarefaction head)
@@ -294,17 +294,17 @@ julia> right = Species("SF6", P=100u"kPa", T=300u"K");
294294
295295
julia> sol = riemann_interface(left, right);
296296
297-
julia> sol.p_star
298-
272.57 kPa
297+
julia> round(u"kPa", sol.p_star, digits=2)
298+
319.59 kPa
299299
300-
julia> sol.u_star
301-
233.9 m s^-1
300+
julia> round(u"m/s", sol.u_star, digits=1)
301+
155.8 m s^-1
302302
```
303303
304304
# See Also
305305
- [`riemann_interface`](@ref): Function that creates `RiemannSolution` objects
306306
"""
307-
struct RiemannSolution{P<:Unitful.Pressure, V<:Unitful.Velocity, D<:typeof(1.0u"kg/m^3"), T<:Unitful.Temperature}
307+
struct RiemannSolution{P<:Unitful.Pressure, V<:Unitful.Velocity, D<:Unitful.Density, T<:Unitful.Temperature}
308308
p_star::P
309309
u_star::V
310310
rho_star_L::D
@@ -389,10 +389,10 @@ julia> right = Species("SF6", P=100u"kPa", T=300u"K");
389389
julia> sol = riemann_interface(left, right);
390390
391391
julia> round(ustrip(u"kPa", sol.p_star), digits=1)
392-
272.6
392+
319.6
393393
394394
julia> round(ustrip(u"m/s", sol.u_star), digits=1)
395-
233.9
395+
155.8
396396
```
397397
398398
Shock tube convenience method:
@@ -404,7 +404,7 @@ julia> test_gas = Species("SF6");
404404
julia> sol = riemann_interface(driven, test_gas, 1.5);
405405
406406
julia> round(ustrip(u"m/s", sol.S_contact), digits=1)
407-
256.2
407+
159.2
408408
```
409409
410410
# See Also
@@ -486,7 +486,7 @@ julia> test_gas = Species("SF6");
486486
julia> sol = riemann_interface(driven, test_gas, 1.5);
487487
488488
julia> round(ustrip(u"m/s", sol.S_contact), digits=1)
489-
256.2
489+
159.2
490490
```
491491
"""
492492
function riemann_interface(left::Chemical, right::Chemical, Ms::Real)

0 commit comments

Comments
 (0)