Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@

end

function jumpConditions = solve(obj, mixArray, varargin)
function [jumpConditions, mixArray1, mixArray2] = solve(obj, mixArray, varargin)
% Solve the jump conditions for the given mixture
%
% Args:
Expand All @@ -275,14 +275,16 @@
obj.time = tic;

% Compute jump conditions
jumpConditions = getJumpData(obj);
[jumpConditions, mixArray1, mixArray2] = getJumpData(obj);

% Solve Gammas (calorically perfect gas)
if obj.equilibriumSolver.caloricGasModel.isPerfect()
[jumpConditions.Gammas1, jumpConditions.Gammas2, jumpConditions.Gammas3] = obj.getGammasPerfect(jumpConditions.gamma1, jumpConditions.M1);

% Interpolate results into a smaller grid
reduceSize(obj, jumpConditions);
% Interpolate results into a smaller grid (only if nargout == 1)
if nargout == 1
jumpConditions = reduceSize(obj, jumpConditions);
end

% Timer
obj.time = toc(obj.time);
Expand All @@ -297,8 +299,10 @@
jumpConditions.Gammas1 = getGammas1(obj, jumpConditions);
jumpConditions.Gammas3 = getGammas3(obj, jumpConditions);

% Interpolate results into a smaller grid
jumpConditions = reduceSize(obj, jumpConditions);
% Interpolate results into a smaller grid (only if nargout == 1)
if nargout == 1
jumpConditions = reduceSize(obj, jumpConditions);
end

% Clean instabilities close to 0/0
jumpConditions = obj.cleanInstabilities(jumpConditions);
Expand Down Expand Up @@ -422,7 +426,7 @@ function printTime(obj)

methods (Access = private)

function jumpConditions = getJumpData(obj)
function [jumpConditions, mixArray1, mixArray2] = getJumpData(obj)
% Get jump conditions
%
% Args:
Expand All @@ -432,6 +436,8 @@ function printTime(obj)
%
% Returns:
% jumpConditions (struct): Structure containing the jump conditions
% mixArray1 (Mixture): Mixture object for the pre-shock state
% mixArray2 (Mixture): Mixture object for the post-shock state

% Print status
fprintf('Solving jump conditions... ');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
%
% Args:
% obj (EquilibriumSolver): EquilibriumSolver object
% mix1 (Mixture): initial Mixture object
% mix1 (Mixture): Initial Mixture object
%
% Optional Args:
% * mixGuess_i (Mixture): Mixture object from previous calculation
Expand Down