Skip to content

Commit 5811eb0

Browse files
Merge pull request #1107 from CombustionToolbox/develop
Update: include `mixArray1` and `mixArray2` objects as outputs for `JumpConditionSolver` class
2 parents 905540a + 240745f commit 5811eb0

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

+combustiontoolbox/+shockdetonation/@JumpConditionsSolver/JumpConditionsSolver.m

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251

252252
end
253253

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

277277
% Compute jump conditions
278-
jumpConditions = getJumpData(obj);
278+
[jumpConditions, mixArray1, mixArray2] = getJumpData(obj);
279279

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

284-
% Interpolate results into a smaller grid
285-
reduceSize(obj, jumpConditions);
284+
% Interpolate results into a smaller grid (only if nargout == 1)
285+
if nargout == 1
286+
jumpConditions = reduceSize(obj, jumpConditions);
287+
end
286288

287289
% Timer
288290
obj.time = toc(obj.time);
@@ -297,8 +299,10 @@
297299
jumpConditions.Gammas1 = getGammas1(obj, jumpConditions);
298300
jumpConditions.Gammas3 = getGammas3(obj, jumpConditions);
299301

300-
% Interpolate results into a smaller grid
301-
jumpConditions = reduceSize(obj, jumpConditions);
302+
% Interpolate results into a smaller grid (only if nargout == 1)
303+
if nargout == 1
304+
jumpConditions = reduceSize(obj, jumpConditions);
305+
end
302306

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

423427
methods (Access = private)
424428

425-
function jumpConditions = getJumpData(obj)
429+
function [jumpConditions, mixArray1, mixArray2] = getJumpData(obj)
426430
% Get jump conditions
427431
%
428432
% Args:
@@ -432,6 +436,8 @@ function printTime(obj)
432436
%
433437
% Returns:
434438
% jumpConditions (struct): Structure containing the jump conditions
439+
% mixArray1 (Mixture): Mixture object for the pre-shock state
440+
% mixArray2 (Mixture): Mixture object for the post-shock state
435441

436442
% Print status
437443
fprintf('Solving jump conditions... ');

+combustiontoolbox/+shockdetonation/@ShockSolver/ShockSolver.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
%
160160
% Args:
161161
% obj (EquilibriumSolver): EquilibriumSolver object
162-
% mix1 (Mixture): initial Mixture object
162+
% mix1 (Mixture): Initial Mixture object
163163
%
164164
% Optional Args:
165165
% * mixGuess_i (Mixture): Mixture object from previous calculation

0 commit comments

Comments
 (0)