Skip to content

Commit

Permalink
Merge pull request #402 from AlbertoCuadra/develop
Browse files Browse the repository at this point in the history
Update: comments of all the functions #381
  • Loading branch information
AlbertoCuadra committed Mar 30, 2022
2 parents 3709350 + 79367da commit 5d3e3c9
Show file tree
Hide file tree
Showing 27 changed files with 101 additions and 53 deletions.
10 changes: 5 additions & 5 deletions Settings/self/App/App.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
% empty (none): Generate default self variable assuming as products LS = Soot formation
%
% Optional Args:
% LS (cell): List of species
% obj (class): Class combustion_toolbox_app (GUI)
% type (str): Type 'fast' initialize from the given Databases
% DB_master (struct): Master database
% DB (struct) : Database with custom thermodynamic polynomials functions generated from NASA's 9 polynomials fits
% - LS (cell): List of species
% - obj (class): Class combustion_toolbox_app (GUI)
% - type (str): If value is fast initialize from the given Databases
% - DB_master (struct): Master database
% - DB (struct) : Database with custom thermodynamic polynomials functions generated from NASAs 9 polynomials fits
%
% Returns:
% self (struct): Data of the mixture (initialization - empty), conditions, and databases
Expand Down
6 changes: 3 additions & 3 deletions Settings/self/Species/ListSpecies.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
% empty (none): return default list of species (soot formation)
%
% Optional Args:
% self (struct): Data of the mixture, conditions, and databases
% EquivalenceRatio (float): Equivalence ratio
% EquivalenceRatio_soot (float): Equivalence ratio in which theoretically appears soot
% - self (struct): Data of the mixture, conditions, and databases
% - EquivalenceRatio (float): Equivalence ratio
% - EquivalenceRatio_soot (float): Equivalence ratio in which theoretically appears soot
%
% Returns:
% self (struct): Data of the mixture, conditions, and databases
Expand Down
3 changes: 3 additions & 0 deletions Solver/Functions/root_finding/newton/newton.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
% pP (float): Pressure [bar]
% field (str): Fieldname in Problem Description (PD)
% x0 (float): Guess temperature [K]
%
% Returns:
% Tuple containing
%
% - x (float): Temperature at equilibrium [K]
% - STOP (float): Relative error [-]

Expand Down
3 changes: 3 additions & 0 deletions Solver/Functions/root_finding/steffenson/get_gpoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
% pP (float): Pressure [bar]
% field (str): Fieldname in Problem Description (PD)
% x0 (float): Guess temperature [K]
%
% Returns:
% Tuple containing
%
% - gpoint (float): Fixed point of the function [kJ] (HP, EV) or [kJ/K] (SP, SV)
% - gpoint_relative (float): Fixed relative point of the function [kJ] (HP, EV) or [kJ/K] (SP, SV)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
% Args:
% x0 (float): Guess temperature [K]
% g_vector (struct): Fixed points of the function [kJ] (HP, EV) or [kJ/K] (SP, SV)
%
% Returns:
% point (float): Point of the function [K]

Expand Down
3 changes: 3 additions & 0 deletions Solver/Functions/root_finding/steffenson/steff.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
% pP (float): Pressure [bar]
% field (str): Fieldname in Problem Description (PD)
% x0 (float): Guess temperature [K]
%
% Returns:
% Tuple containing
%
% - x (float): Temperature at equilibrium [K]
% - STOP (float): Relative error [-]

Expand Down
1 change: 1 addition & 0 deletions Solver/Functions/root_finding/steffenson/steff_guess.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
% mix1 (struct): Properties of the initial mixture
% pP (float): Pressure [bar]
% field (str): Fieldname in Problem Description (PD)
%
% Returns:
% x0 (float): Guess temperature [K]

Expand Down
4 changes: 2 additions & 2 deletions Solver/Functions/set_prop.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
% self (struct): Data of the mixture, conditions, and databases
%
% Optional Args:
% field (str): Fieldname in Problem Description (PD)
% value (float): Value/s to assing in the field in Problem Description (PD)
% - field (str): Fieldname in Problem Description (PD)
% - value (float): Value/s to assing in the field in Problem Description (PD)
%
% Returns:
% self (struct): Data of the mixture, conditions, and databases
Expand Down
1 change: 1 addition & 0 deletions Solver/Rocket/compute_rocket_parameters.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
%
% Args:
% mix2 (struct): Properties of the mixture at the outlet of the chamber
% mix3 (struct): Properties of the mixture at the throat
%
% Returns:
% mix3 (struct): Properties of the mixture at the throat
Expand Down
12 changes: 7 additions & 5 deletions Solver/Rocket/rocket_performance.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
% mix1 (struct): Properties of the initial mixture
%
% Optional Args:
% mix2 (struct): Properties of the mixture at the outlet of the chamber (previous calculation)
% mix3 (struct): Properties of the mixture at the throat (previous calculation)
% - mix2 (struct): Properties of the mixture at the outlet of the chamber (previous calculation)
% - mix3 (struct): Properties of the mixture at the throat (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the initial mixture
% mix2 (struct): Properties of the mixture at the outlet of the chamber
% mix3 (struct): Properties of the mixture at the throat
% Tuple containing
%
% - mix1 (struct): Properties of the initial mixture
% - mix2 (struct): Properties of the mixture at the outlet of the chamber
% - mix3 (struct): Properties of the mixture at the throat

% Assign values
if nargin == 3, mix2 = get_struct(varargin{1}); else, mix2 = []; end
Expand Down
2 changes: 2 additions & 0 deletions Solver/chemical_equilibrium/complete_combustion.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
% phi (float): Equivalence ratio [-]
%
% Returns:
% Tuple containing
%
% - moles (float): Equilibrium composition [moles] at defined temperature
% - species (str): Species considered in the complemte combustion model

Expand Down
2 changes: 2 additions & 0 deletions Solver/chemical_equilibrium/equilibrium.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
% mix1 (struct): Properties of the initial mixture
%
% Returns:
% Tuple containing
%
% - N0 (float): Equilibrium composition [moles] for the given temperature [K] and pressure [bar]
% - STOP (float): Relative error [-]

Expand Down
2 changes: 2 additions & 0 deletions Solver/chemical_equilibrium/equilibrium_dT.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
% mix1 (struct): Properties of the initial mixture
%
% Returns:
% Tuple containing
%
% - dNi_T (float): Thermodynamic derivative of the moles of the species respect to temperature
% - dN_T (float): Thermodynamic derivative of the moles of the mixture respect to temperature

Expand Down
2 changes: 2 additions & 0 deletions Solver/chemical_equilibrium/equilibrium_dp.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
% mix1 (struct): Properties of the initial mixture
%
% Returns:
% Tuple containing
%
% - dNi_p (float): Thermodynamic derivative of the moles of the species respect to pressure
% - dN_p (float): Thermodynamic derivative of the moles of the mixture respect to pressure

Expand Down
2 changes: 2 additions & 0 deletions Solver/chemical_equilibrium/equilibrium_ions.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
% mix1 (struct): Properties of the initial mixture
%
% Returns:
% Tuple containing
%
% - N0 (float): Equilibrium composition [moles] for the given temperature [K] and pressure [bar]
% - STOP (float): Relative error [-]

Expand Down
6 changes: 4 additions & 2 deletions Solver/shocks_detonations/cj_detonation.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
% mix2 (struct): Properties of the mixture in the post-shock state (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2 (struct): Properties of the mixture in the post-shock state
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2 (struct): Properties of the mixture in the post-shock state

% Unpack input data
[self, mix1, mix2] = unpack(self, mix1, varargin);
Expand Down
14 changes: 8 additions & 6 deletions Solver/shocks_detonations/compute_guess_det.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
% overdriven (float): Overdriven ratio [-] respect to the sound velocity of the mixture
%
% Returns:
% P (float): Pressure ratio [-]
% T (float): Temperature ratio [-]
% M1 (float): Pre-shock Mach number [-]
% R (float): Density ratio [-]
% Q (float): Dimensionless Heat release []
% STOP (float): Relative error [-]
% Tuple containing
%
% - P (float): Pressure ratio [-]
% - T (float): Temperature ratio [-]
% - M1 (float): Pre-shock Mach number [-]
% - R (float): Density ratio [-]
% - Q (float): Dimensionless Heat release []
% - STOP (float): Relative error [-]

% Paramenters
gamma1 = mix1.gamma;
Expand Down
6 changes: 4 additions & 2 deletions Solver/shocks_detonations/det_oblique_beta.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
% mix2 (struct): Properties of the mixture in the post-shock state (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2 (struct): Properties of the mixture at the post-shock state
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2 (struct): Properties of the mixture at the post-shock state

% Unpack input data
[self, mix1, mix2] = unpack(self, mix1, overdriven, beta, varargin);
Expand Down
12 changes: 7 additions & 5 deletions Solver/shocks_detonations/det_oblique_theta.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
% theta (float): Deflection angle [deg]
%
% Optional Args:
% mix2_1 (struct): Properties of the mixture in the post-shock state - weak detonation (previous calculation)
% mix2_2 (struct): Properties of the mixture in the post-shock state - strong detonation (previous calculation)
% - mix2_1 (struct): Properties of the mixture in the post-shock state - weak detonation (previous calculation)
% - mix2_2 (struct): Properties of the mixture in the post-shock state - strong detonation (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2_1 (struct): Properties of the mixture in the post-shock state - weak detonation
% mix2_2 (struct): Properties of the mixture in the post-shock state - strong detonation
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2_1 (struct): Properties of the mixture in the post-shock state - weak detonation
% - mix2_2 (struct): Properties of the mixture in the post-shock state - strong detonation

% Unpack input data
[self, mix1, mix2_1, mix2_2] = unpack(self, mix1, overdriven, theta, varargin);
Expand Down
6 changes: 4 additions & 2 deletions Solver/shocks_detonations/overdriven_detonation.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
% mix2 (struct): Properties of the mixture in the post-shock state (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2 (struct): Properties of the mixture in the post-shock state
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2 (struct): Properties of the mixture in the post-shock state

% Unpack input data
[self, mix1, mix2] = unpack(self, mix1, overdriven, varargin);
Expand Down
8 changes: 5 additions & 3 deletions Solver/shocks_detonations/shock_ideal_gas.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
% M1 (float): Pre-shock Mach number [-]
%
% Returns:
% R (float): Density ratio [-]
% P (float): Pressure ratio [-]
% T (float): Temperature ratio [-]
% Tuple containing
%
% - R (float): Density ratio [-]
% - P (float): Pressure ratio [-]
% - T (float): Temperature ratio [-]

R = (gamma + 1) .* M1.^2 ./ ((gamma - 1) .* M1.^2 + 2);
P = (2 * gamma * M1.^2 - (gamma - 1)) ./ (gamma + 1);
Expand Down
6 changes: 4 additions & 2 deletions Solver/shocks_detonations/shock_incident.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
% mix2 (struct): Properties of the mixture in the post-shock state (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2 (struct): Properties of the mixture in the post-shock state
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2 (struct): Properties of the mixture in the post-shock state

% Unpack input data
[self, mix1, mix2] = unpack(self, mix1, u1, varargin);
Expand Down
6 changes: 4 additions & 2 deletions Solver/shocks_detonations/shock_oblique_beta.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
% mix2 (struct): Properties of the mixture in the post-shock state (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2 (struct): Properties of the mixture at the post-shock state
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2 (struct): Properties of the mixture at the post-shock state

% Unpack input data
[self, mix1, mix2] = unpack(self, mix1, u1, beta, varargin);
Expand Down
10 changes: 6 additions & 4 deletions Solver/shocks_detonations/shock_oblique_reflected_theta.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
% mix5_2 (struct): Properties of the mixture in the post-shock state of the reflected shock - strong shock (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state of the incident shock
% mix2 (struct): Properties of the mixture in the post-shock state of the incident shock
% mix5_1 (struct): Properties of the mixture in the post-shock state of the reflected shock - weak shock
% mix5_2 (struct): Properties of the mixture in the post-shock state of the reflected shock - strong shock
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state of the incident shock
% - mix2 (struct): Properties of the mixture in the post-shock state of the incident shock
% - mix5_1 (struct): Properties of the mixture in the post-shock state of the reflected shock - weak shock
% - mix5_2 (struct): Properties of the mixture in the post-shock state of the reflected shock - strong shock

% Unpack input data
[self, mix1, mix2, mix5] = unpack(self, mix1, u2, theta, mix2, varargin);
Expand Down
12 changes: 7 additions & 5 deletions Solver/shocks_detonations/shock_oblique_theta.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
% theta (float): Deflection angle [deg]
%
% Optional Args:
% mix2_1 (struct): Properties of the mixture in the post-shock state - weak shock (previous calculation)
% mix2_2 (struct): Properties of the mixture in the post-shock state - strong shock (previous calculation)
% - mix2_1 (struct): Properties of the mixture in the post-shock state - weak shock (previous calculation)
% - mix2_2 (struct): Properties of the mixture in the post-shock state - strong shock (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2_1 (struct): Properties of the mixture in the post-shock state - weak shock
% mix2_2 (struct): Properties of the mixture in the post-shock state - strong shock
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2_1 (struct): Properties of the mixture in the post-shock state - weak shock
% - mix2_2 (struct): Properties of the mixture in the post-shock state - strong shock

% Unpack input data
[self, mix1, mix2_1, mix2_2] = unpack(self, mix1, u1, theta, varargin);
Expand Down
6 changes: 4 additions & 2 deletions Solver/shocks_detonations/shock_polar.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
% mix2 (struct): Properties of the mixture in the post-shock state (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state
% mix2 (struct): Properties of the mixture at the post-shock state with the shock polar results
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state
% - mix2 (struct): Properties of the mixture at the post-shock state with the shock polar results

% Unpack input data
[self, mix1, mix2] = unpack(self, mix1, u1, varargin);
Expand Down
8 changes: 5 additions & 3 deletions Solver/shocks_detonations/shock_reflected.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
% mix5 (struct): Properties of the mixture in the post-shock state of the reflected shock (previous calculation)
%
% Returns:
% mix1 (struct): Properties of the mixture in the pre-shock state of the incident shock
% mix2 (struct): Properties of the mixture at the post-shock state of the incident shock
% mix5 (struct): Properties of the mixture in the post-shock state of the reflected shock
% Tuple containing
%
% - mix1 (struct): Properties of the mixture in the pre-shock state of the incident shock
% - mix2 (struct): Properties of the mixture at the post-shock state of the incident shock
% - mix5 (struct): Properties of the mixture in the post-shock state of the reflected shock

% Unpack input data
[self, mix1, mix2, mix5] = unpack(self, mix1, u1, mix2, varargin);
Expand Down

0 comments on commit 5d3e3c9

Please sign in to comment.