Skip to content

Commit

Permalink
Merge pull request #264 from brown-ccv/dev-to-master
Browse files Browse the repository at this point in the history
Dev to master
  • Loading branch information
cpaniaguam authored Apr 10, 2024
2 parents 5d564f3 + 08fe6e1 commit e20bd2e
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 26 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ CSV = "0.10.9"
DataFrames = "1.5.0"
DifferentialEquations = "7.7.0"
IterableTables = "1.0.0"
Memoize = "0.4.4"
Parameters = "0.12.3"
Plots = "1.38.9"
Roots = "2.0.7"
Expand Down
49 changes: 24 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,18 @@ julia> depth = 8e3

julia> # Run simulation
julia> dataframe = chamber(composition, end_time, log_volume_km3, InitialConc_H2O, InitialConc_CO2, log_vfr, depth)
470×11 DataFrame
Row │ time P+dP T eps_g V rho_m rho_x X_CO2 total_mass total_mass_H2O total_mass_CO2
│ Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
10.0 2.1582e8 1046.71 0.00558159 1.58489e9 2400.0 2600.0 0.346043 3.83394e12 1.54039e11 3.85098e9
2100000.0 2.15824e8 1046.71 0.00558131 1.58489e9 2400.0 2600.0 0.34605 3.83395e12 1.54039e11 3.85099e9
37.62058e5 2.15848e8 1046.71 0.0055795 1.5849e9 2400.01 2600.01 0.346101 3.83397e12 1.5404e11 3.85101e9
42.83015e6 2.15924e8 1046.71 0.00557383 1.58491e9 2400.03 2600.03 0.346259 3.83405e12 1.54044e11 3.85109e9
54.89825e6 2.16e8 1046.71 0.00556818 1.58492e9 2400.04 2600.05 0.346418 3.83413e12 1.54047e11 3.85117e9
4672.9764e9 2.23039e8 1043.45 0.00561742 1.58776e9 2401.81 2601.96 0.337852 3.8504e12 1.547e11 3.86751e9
4682.9864e9 2.23399e8 1043.44 0.00559152 1.58782e9 2401.9 2602.06 0.338571 3.85078e12 1.54716e11 3.86789e9
4692.9964e9 2.2376e8 1043.43 0.00556579 1.58788e9 2401.99 2602.15 0.339287 3.85116e12 1.54731e11 3.86828e9
4703.0e9 2.23889e8 1043.43 0.00555656 1.5879e9 2402.02 2602.18 0.339545 3.8513e12 1.54737e11 3.86841e9
461 rows omitted
470×12 DataFrame
Row │ time P+dP T eps_g V rho_m rho_x X_CO2 total_mass total_mass_H2O total_mass_CO2 eps_x
│ Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
10.0 2.1582e8 1046.71 0.00558159 1.58489e9 2400.0 2600.0 0.346043 3.83394e12 1.54039e11 3.85098e9 0.146696
2100000.0 2.15824e8 1046.71 0.00558131 1.58489e9 2400.0 2600.0 0.34605 3.83395e12 1.54039e11 3.85099e9 0.146696
37.61993e5 2.15848e8 1046.71 0.0055795 1.5849e9 2400.01 2600.01 0.346101 3.83397e12 1.5404e11 3.85101e9 0.146698
4682.98643e9 2.23399e8 1043.44 0.00559005 1.58782e9 2401.9 2602.06 0.33863 3.85078e12 1.54716e11 3.8679e9 0.167628
4692.99643e9 2.23759e8 1043.43 0.00556433 1.58788e9 2401.99 2602.15 0.339346 3.85116e12 1.54731e11 3.86828e9 0.16766
4703.0e9 2.23888e8 1043.43 0.00555519 1.5879e9 2402.02 2602.18 0.339601 3.8513e12 1.54737e11 3.86842e9 0.167671
464 rows omitted
```
As noted, the `chamber` function returns a DataFrame containing the solution data with columns described above. Additionally, it automatically creates a directory named with the current timestamp (by default) to store the output files including figures and CSV data files.

Expand All @@ -104,16 +101,18 @@ julia> depth = 8e3
julia> output_dirname = "MyDirname"

julia> chamber(composition, end_time, log_volume_km3, InitialConc_H2O, InitialConc_CO2, log_vfr, depth, output_dirname)
458×11 DataFrame
Row │ time P+dP T eps_g V rho_m rho_x X_CO2 total_mass total_mass_H2O total_mass_CO2
│ Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
10.0 2.1582e8 1405.74 0.00139209 1.58489e9 2420.0 2900.0 0.859079 3.94439e12 3.94903e10 3.94903e9
2100000.0 2.15823e8 1405.74 0.00139197 1.58489e9 2420.0 2900.0 0.859081 3.9444e12 3.94903e10 3.94903e9
4572.99798e9 2.22224e8 1401.01 0.00138553 1.58951e9 2421.66 2901.99 0.856719 3.97782e12 3.98249e10 3.98249e9
4583.0e9 2.22284e8 1401.01 0.00138339 1.58952e9 2421.68 2902.01 0.856746 3.9779e12 3.98257e10 3.98257e9
454 rows omitted
458×12 DataFrame
Row │ time P+dP T eps_g V rho_m rho_x X_CO2 total_mass total_mass_H2O total_mass_CO2 eps_x
│ Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64 Float64
─────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
10.0 2.1582e8 1405.74 0.00139209 1.58489e9 2420.0 2900.0 0.859079 3.94439e12 3.94903e10 3.94903e9 0.149114
2100000.0 2.15823e8 1405.74 0.00139197 1.58489e9 2420.0 2900.0 0.859081 3.9444e12 3.94903e10 3.94903e9 0.149115
36.31887e5 2.1584e8 1405.74 0.00139134 1.5849e9 2420.0 2900.01 0.859088 3.94442e12 3.94905e10 3.94905e9 0.149122
4562.98793e9 2.21924e8 1401.0 0.00139538 1.58945e9 2421.59 2901.91 0.856613 3.97744e12 3.98211e10 3.98211e9 0.17412
4572.99793e9 2.22224e8 1401.01 0.00138474 1.58951e9 2421.66 2902.0 0.856745 3.97782e12 3.9825e10 3.9825e9 0.174241
4583.0e9 2.22286e8 1401.01 0.00138255 1.58952e9 2421.68 2902.01 0.856772 3.9779e12 3.98258e10 3.98258e9 0.174266
452 rows omitted
```
The output directory specified by `output_dirname` contains the generated files.

Expand Down
Binary file added notebooks/images/instructions_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/instructions_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added notebooks/images/instructions_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 32 additions & 1 deletion notebooks/notebook_for_chamber.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"set -e\n",
"\n",
"#---------------------------------------------------#\n",
"JULIA_VERSION=\"1.8.2\"\n",
"JULIA_VERSION=\"1.8.5\"\n",
"JULIA_PACKAGES=\"IJulia Chamber\"\n",
"JULIA_NUM_THREADS=2\n",
"#---------------------------------------------------#\n",
Expand Down Expand Up @@ -371,6 +371,37 @@
"depth = 8e3\n",
"dataframe = chamber(composition, end_time, log_volume_km3, InitialConc_H2O, InitialConc_CO2, log_vfr, depth)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Save results to your Google Drive\n",
"To download the output files, mount your Google Drive by following these steps:\n",
"\n",
"1. Change the runtime type to Python.\n",
"\n",
" <img src=\"images/instructions_5.png\" height=320/> <img src=\"images/instructions_6.png\" height=250/>\n",
"\n",
"2. Run the code cell below.\n",
"3. Afterward, you can drag the desired output files into the Drive folder.\n",
"\n",
" <img src=\"images/instructions_7.png\" height=200/>\n",
"\n",
"\n",
"[Notice] Remember to change the runtime type back to Julia before running other Julia code cells."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# runtime type: Python\n",
"from google.colab import drive\n",
"drive.mount('/content/drive')"
]
}
],
"metadata": {
Expand Down

2 comments on commit e20bd2e

@cpaniaguam
Copy link
Member Author

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/104638

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.2.0 -m "<description of version>" e20bd2e53ae957eaa27b48429393471702bc93ba
git push origin v0.2.0

Please sign in to comment.