Skip to content

Commit

Permalink
fix: molar_density * molar_enthalpy = pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
everythingfunctional committed Oct 11, 2022
1 parent 3565471 commit f26da3d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "quaff"
version = "0.7.8"
version = "0.7.7"
license = "MIT"
author = "Brad Richardson"
maintainer = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion quaff_asserts/fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "quaff_asserts"
version = "0.7.8"
version = "0.7.7"
license = "MIT"
author = "Brad Richardson"
maintainer = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion quaff_garden_asserts/fpm.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "quaff_garden_asserts"
version = "0.7.8"
version = "0.7.7"
license = "MIT"
author = "Brad Richardson"
maintainer = "[email protected]"
Expand Down
6 changes: 3 additions & 3 deletions src/quaff/interquantity_operators_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ module quaff_interquantity_operators_m
module procedure mass_times_acceleration
module procedure mass_times_burnup
module procedure mass_times_enthalpy
module procedure molar_density_times_molar_enthalpy
module procedure molar_density_times_volume
module procedure molar_enthalpy_times_amount
module procedure molar_mass_times_amount
Expand Down Expand Up @@ -105,7 +106,6 @@ module quaff_interquantity_operators_m
module procedure mass_divided_by_density
module procedure mass_divided_by_molar_mass
module procedure mass_divided_by_volume
module procedure molar_density_divided_by_molar_enthalpy
module procedure molar_enthalpy_divided_by_molar_mass
module procedure molar_specific_heat_divided_by_molar_mass
module procedure number_divided_by_frequency
Expand Down Expand Up @@ -531,14 +531,14 @@ elemental function mass_times_enthalpy(mass, enthalpy) result(energy)
energy%joules = mass%kilograms * enthalpy%joules_per_kilogram
end function

elemental function molar_density_divided_by_molar_enthalpy( &
elemental function molar_density_times_molar_enthalpy( &
molar_density, molar_enthalpy) result(pressure)
type(molar_density_t), intent(in) :: molar_density
type(molar_enthalpy_t), intent(in) :: molar_enthalpy
type(pressure_t) :: pressure

pressure%pascals = &
molar_density%mols_per_cubic_meter / molar_enthalpy%joules_per_mol
molar_density%mols_per_cubic_meter * molar_enthalpy%joules_per_mol
end function

elemental function molar_density_times_volume(molar_density, volume) result(amount)
Expand Down
8 changes: 4 additions & 4 deletions test/interquantity_test.f90
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function test_interquantity_operators() result(tests)
, it("2 mol/m^3 * 3 m^3 = 6 mol", check_molar_density_times_volume) &
, it("2 m^3 * 3 mol/m^3 = 6 mol", check_volume_times_molar_density) &
, it("6 kg/m^3 / 3 kg/mol = 2 mol/m^3", check_density_divided_by_molar_mass) &
, it("2 mol/m^3 * 3 J/mol = 6 Pa", check_molar_density_divided_by_molar_enthalpy) &
, it("2 mol/m^3 * 3 J/mol = 6 Pa", check_molar_density_times_molar_enthalpy) &
])
end function test_interquantity_operators

Expand Down Expand Up @@ -817,11 +817,11 @@ pure function check_density_divided_by_molar_mass() result(result_)
(6.d0.unit.KILOGRAMS_PER_CUBIC_METER) / (3.d0.unit.KILOGRAMS_PER_MOL))
end function

pure function check_molar_density_divided_by_molar_enthalpy() result(result_)
pure function check_molar_density_times_molar_enthalpy() result(result_)
type(result_t) :: result_

result_ = assert_equals( &
2.d0.unit.PASCALS, &
(6.d0.unit.MOLS_PER_CUBIC_METER) / (3.d0.unit.JOULES_PER_MOL))
6.d0.unit.PASCALS, &
(2.d0.unit.MOLS_PER_CUBIC_METER) * (3.d0.unit.JOULES_PER_MOL))
end function
end module

0 comments on commit f26da3d

Please sign in to comment.