Skip to content

Commit

Permalink
added z to each isosteric writer output
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Box committed Nov 13, 2023
1 parent ef55ff4 commit ba3183c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SorptionModels"
uuid = "44adabc6-386d-4db0-bb6e-0f7b06129544"
authors = ["Will <[email protected]> and contributors"]
version = "0.1.53"
version = "0.1.54"

[deps]
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Expand Down
4 changes: 3 additions & 1 deletion src/ModelAnalyses/IsostericHeatOfSorption.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct IsostericHeatAnalysis <: AbstractIsostericHeatAnalysis
isosteric_heat_at_conc # J/mol
isosteric_entropy_at_conc # j/(mol*K)
pre_exponential_factors # (cc/cc) / MPa
z_values
end

"""
Expand Down Expand Up @@ -100,5 +101,6 @@ function IsostericHeatAnalysis(isotherms::AbstractVector{<:IsothermData}, eosmod
return IsostericHeatAnalysis(
isotherms, sorption_models, sampled_concentrations,
temperatures, inverse_temps, pressure_curves, ln_pressure_curves,
isosteric_heat_at_conc, isosteric_entropy_at_conc, pre_exponential_factors)
isosteric_heat_at_conc, isosteric_entropy_at_conc, pre_exponential_factors,
all_z_values)
end
5 changes: 4 additions & 1 deletion src/ModelAnalyses/WebbIsostericHeat.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


struct WebbIsostericHeatAnalysis <: AbstractIsostericHeatAnalysis
isotherms
sorption_models
Expand All @@ -10,6 +11,7 @@ struct WebbIsostericHeatAnalysis <: AbstractIsostericHeatAnalysis
isosteric_heat_at_conc # J/mol
isosteric_entropy_at_conc # j/(mol*K)
pre_exponential_factors # (cc/cc) / MPa
z_values
end

"""
Expand Down Expand Up @@ -104,5 +106,6 @@ function WebbIsostericHeatAnalysis(isotherms::AbstractVector{<:IsothermData}, eo
return WebbIsostericHeatAnalysis(
isotherms, sorption_models, sampled_concentrations,
temperatures, inverse_temps, pressure_curves, ln_inv_vol_curves,
isosteric_heat_at_conc, isosteric_entropy_at_conc, pre_exponential_factors)
isosteric_heat_at_conc, isosteric_entropy_at_conc, pre_exponential_factors,
external_compressibilities)
end
16 changes: 15 additions & 1 deletion src/Writers/WriteIsostericHeat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,21 @@ function write_analysis(analysis::AbstractIsostericHeatAnalysis, workbook::XLSX.
sheet[writer_row_position + 1, writer_col_position + idx, dim=1] = [measurement.(vec_meas).val for vec_meas in vec]
end
end


writer_row_position += num_isotherms + 2
sheet[writer_row_position, writer_col_position] = "PV/RT for each sampled point"
writer_row_position += 1
sheet[writer_row_position, writer_col_position] = "Sampled CC/CC"
sheet[writer_row_position, writer_col_position + 1, dim=2] = [measurement(conc).val for conc in analysis.sampled_concentrations]
writer_row_position +=1
sheet[writer_row_position, writer_col_position] = "T (K)"
sheet[writer_row_position + 1, writer_col_position, dim=1] = [measurement(temp).val for temp in analysis.temperatures]

for (idx, vec) in enumerate(analysis.z_values)
sheet[writer_row_position, writer_col_position + idx] = "Z"
sheet[writer_row_position + 1, writer_col_position + idx, dim=1] = [measurement.(vec_meas).val for vec_meas in vec]
end


# finally, show the found isosteric heats as a function of concentration
writer_row_position += num_isotherms + 2
Expand Down
3 changes: 1 addition & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,6 @@ precision = 5
eos_z(p, t) = compressibility_factor(eos_ch4, p, t)
wish_analysis_no_eos = SorptionModels.WebbIsostericHeatAnalysis(isotherms)
wish_analysis = SorptionModels.WebbIsostericHeatAnalysis(isotherms, eos_z)
@show wish_analysis_no_eos.isosteric_heat_at_conc

end

Expand Down Expand Up @@ -541,7 +540,7 @@ precision = 5
@test mob_fact_analysis.thermodynamic_factors[3].val 1.0216144834304761
@test therm_fact_analysis.thermodynamic_factors[3] == mob_fact_analysis.thermodynamic_factors[3]
end

# Partial Immobilization Model
@testset "Partial Immobilization Model" begin
model = DualModeModel(56.8, 7.4, 26.1; use_fugacity=true)
Expand Down

2 comments on commit ba3183c

@Boxylmer
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95229

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.54 -m "<description of version>" ba3183cbe89841e7cadd2179155f3660238b4d67
git push origin v0.1.54

Please sign in to comment.