diff --git a/+combustiontoolbox/+shockdetonation/@JumpConditionsSolver/JumpConditionsSolver.m b/+combustiontoolbox/+shockdetonation/@JumpConditionsSolver/JumpConditionsSolver.m index f03008a4d..3e41c82f9 100644 --- a/+combustiontoolbox/+shockdetonation/@JumpConditionsSolver/JumpConditionsSolver.m +++ b/+combustiontoolbox/+shockdetonation/@JumpConditionsSolver/JumpConditionsSolver.m @@ -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: @@ -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); @@ -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); @@ -422,7 +426,7 @@ function printTime(obj) methods (Access = private) - function jumpConditions = getJumpData(obj) + function [jumpConditions, mixArray1, mixArray2] = getJumpData(obj) % Get jump conditions % % Args: @@ -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... '); diff --git a/+combustiontoolbox/+shockdetonation/@ShockSolver/ShockSolver.m b/+combustiontoolbox/+shockdetonation/@ShockSolver/ShockSolver.m index 9c35c1b31..3cb1867e0 100644 --- a/+combustiontoolbox/+shockdetonation/@ShockSolver/ShockSolver.m +++ b/+combustiontoolbox/+shockdetonation/@ShockSolver/ShockSolver.m @@ -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