139 subroutine initialize(this, chem_spec_data, aero_rep, n_cells)
148 integer(kind=i_kind),
intent(in) :: n_cells
150 type(
property_t),
pointer :: spec_props, reactants, products
151 character(len=:),
allocatable :: key_name, spec_name, string_val
152 integer(kind=i_kind) :: i_spec, i_qty
154 integer(kind=i_kind) :: temp_int
155 real(kind=
dp) :: temp_real
158 if (.not.
associated(this%property_set))
call die_msg(138420387, &
159 "Missing property set needed to initialize reaction")
160 key_name =
"reactants"
162 this%property_set%get_property_t(key_name, reactants), &
163 "Ternary Chemical Activation reaction is missing reactants")
164 key_name =
"products"
166 this%property_set%get_property_t(key_name, products), &
167 "Ternary Chemical Activation reaction is missing products")
170 call reactants%iter_reset()
174 call assert(475375422, reactants%get_property_t(val=spec_props))
176 if (spec_props%get_int(key_name, temp_int)) i_spec = i_spec+temp_int-1
177 call reactants%iter_next()
185 allocate(this%condensed_data_int(num_int_prop_ + &
186 (i_spec + 2) * (i_spec + products%size())))
187 allocate(this%condensed_data_real(num_real_prop_ + products%size()))
188 this%condensed_data_int(:) = int(0, kind=
i_kind)
189 this%condensed_data_real(:) = real(0.0, kind=
dp)
192 this%num_env_params = num_env_param_
197 num_prod_ = products%size()
200 conv_ =
const%avagadro /
const%univ_gas_const * 10.0d0**(-12.0d0)
206 if (.not. this%property_set%get_real(key_name, k0_a_))
then
210 if (.not. this%property_set%get_real(key_name, k0_b_))
then
214 if (.not. this%property_set%get_real(key_name, k0_c_))
then
218 if (.not. this%property_set%get_real(key_name, kinf_a_))
then
222 if (.not. this%property_set%get_real(key_name, kinf_b_))
then
226 if (.not. this%property_set%get_real(key_name, kinf_c_))
then
230 if (.not. this%property_set%get_real(key_name, fc_))
then
234 if (.not. this%property_set%get_real(key_name,
n_))
then
237 key_name =
"time unit"
238 scaling_ = real(1.0, kind=
dp)
239 if (this%property_set%get_string(key_name, string_val))
then
240 if (trim(string_val).eq.
"MIN")
then
241 scaling_ = real(1.0d0/60.0d0, kind=
dp)
246 k0_a_ = k0_a_ * real(1.0d6, kind=
dp)
249 call reactants%iter_reset()
254 react_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
257 call assert_msg(194805707, react_(i_spec).gt.0, &
258 "Missing Ternary Chemical Activation reactant: "//
spec_name)
261 call assert(524590901, reactants%get_property_t(val=spec_props))
263 if (spec_props%get_int(key_name, temp_int))
then
264 do i_qty = 1, temp_int - 1
265 react_(i_spec + i_qty) = react_(i_spec)
267 i_spec = i_spec + temp_int - 1
270 call reactants%iter_next()
275 call products%iter_reset()
280 prod_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
283 call assert_msg(249285493, prod_(i_spec).gt.0, &
284 "Missing Ternary Chemical Activation product: "//
spec_name)
287 call assert(296595438, products%get_property_t(val=spec_props))
289 if (spec_props%get_real(key_name, temp_real))
then
290 yield_(i_spec) = temp_real
295 call products%iter_next()