Skip to content

Commit

Permalink
Add vacuum properties
Browse files Browse the repository at this point in the history
  • Loading branch information
srebughini committed Feb 5, 2024
1 parent 5cfb75e commit f9eb4cd
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions _data/results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
results:
- transport-properties
- thermodynamic-properties
- vacuum-properties
- equilibrium-@-constant-t-p

35 changes: 35 additions & 0 deletions _results/vacuum-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
permalink: /results/vacuum-properties/
---
<h1 class="text-center"><b>Vacuum properties</b></h1>
<h3 class="text-center"><b>Operating conditions and composition</b></h3>
<table class="table table-striped text-left" style="margin:auto" id="input-table">
<tbody>
<tr>
<th scope="row">Temperature <i class="fa-regular fa-temperature-three-quarters"></i></th>
<td id="T"></td>
<td>K</td>
</tr>
<tr>
<th scope="row">Pressure <i class="fa-regular fa-gauge"></i></th>
<td id="P"></td>
<td>Pa</td>
</tr>
<tr>
<th scope="row">Name <i class="fa-regular fa-atom"></i></th>
<th>Mole fraction <i class="fa-regular fa-chart-pie"></i></th>
<th>Mass fraction <i class="fa-regular fa-chart-pie"></i></th>
</tr>
</tbody>
</table>

<h3 class="text-center"><b>Properties</b></h3>
<table class="table table-striped text-left" style="margin:auto" id="output-table">
<tbody>
<tr>
<th scope="row">Property name <i class="fa-regular fa-vial"></i></th>
<th>Value <i class="fa-regular fa-chart-line"></i></th>
<th>Unit dimension <i class="fa-regular fa-scale-balanced"></i></th>
</tr>
</tbody>
</table>
26 changes: 26 additions & 0 deletions assets/js/calculator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var transportPageUrl = "/ASALI/results/transport-properties/";
var thermoPageUrl = "/ASALI/results/thermodynamic-properties/";
var eqTPPageUrl = "/ASALI/results/equilibrium-@-constant-t-p/";
var vacuumPageUrl = "/ASALI/results/vacuum-properties/"
var webAppPageUrl = "/ASALI/pages/webapp/";
var resultsPageUrl = "/ASALI/results/";

Expand Down Expand Up @@ -222,6 +223,10 @@ function estimateMixtureProperties() {
{ "name": "Gibbs free energy", "value": mixture.getMassGibbsFreeEnergy(), "ud": "J/kg" },
{ "name": "Internal energy", "value": mixture.getMassInternalEnergy(), "ud": "J/kg" }
],
"vacuum": [
{ "name": "Mean gas velocity", "value": mixture.getArithmeticMeanGasVelocity(), "ud": "m/s"},
{ "name": "Mean free path", "value": mixture.getMeanFreePath(), "ud": "m"}
],
"temperature": T,
"pressure": P,
"composition": {
Expand Down Expand Up @@ -324,6 +329,24 @@ function showThermoProperties(results, doc) {
}
}

function showVacuumProperties(results, doc) {
/**
* Show the vacuum properties in the results page
*/
let properties = results["vacuum"];
let outputTable = doc.getElementById("output-table")

for (let i = 0; i < properties.length; i++) {
let newRow = outputTable.insertRow(-1);
let nameCell = newRow.insertCell(0);
let valueCell = newRow.insertCell(1);
let udCell = newRow.insertCell(2);
nameCell.innerHTML = properties[i]["name"];
valueCell.innerHTML = parseFloat(properties[i]["value"]).toExponential(3);
udCell.innerHTML = properties[i]["ud"];
}
}

function showEquilibrium(results, doc) {
/**
* Show the equilibrium in the results page
Expand Down Expand Up @@ -384,6 +407,9 @@ function showResults(destinationPageUrl) {
else if (destinationPageUrl.includes(thermoPageUrl)) {
showThermoProperties(results, document);
}
else if (destinationPageUrl.includes(vacuumPageUrl)) {
showVacuumProperties(results, document);
}
else if (destinationPageUrl.includes(eqTPPageUrl)) {
showEquilibrium(results, document);
}
Expand Down

0 comments on commit f9eb4cd

Please sign in to comment.