Skip to content

Commit b541e1e

Browse files
authored
bug fix to SA function (#39)
1 parent dd08832 commit b541e1e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/aero_reps/aero_rep_single_particle.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ void aero_rep_single_particle_get_interface_surface_area__m2(
223223
int phase_model_data_id_first = -1;
224224
int phase_model_data_id_second = -1;
225225
double radius;
226+
int i_part = aero_phase_idx_first / TOTAL_NUM_PHASES_;
227+
aero_phase_idx_first -= i_part * TOTAL_NUM_PHASES_;
228+
aero_phase_idx_second -= i_part * TOTAL_NUM_PHASES_;
226229

227230
// Find the layer each phase (first and second) exist in
228231
int i_phase_count = 0;

test/unit_aero_rep_data/test_aero_rep_single_particle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ int test_surface_area_layer(ModelData * model_data, N_Vector state) {
180180
for( int i = 0; i < N_JAC_ELEM+2; ++i ) partial_deriv[i] = 999.9;
181181

182182
aero_rep_get_interface_surface_area__m2(model_data, AERO_REP_IDX,
183-
AERO_PHASE_IDX_1 - NUM_AERO_PHASE,
184-
AERO_PHASE_IDX_2 - NUM_AERO_PHASE,
183+
AERO_PHASE_IDX_1,
184+
AERO_PHASE_IDX_2,
185185
&eff_sa, &(partial_deriv[1]));
186186

187187
// calculate the volume density of the layer interface

0 commit comments

Comments
 (0)