134 subroutine initialize(this, chem_spec_data, aero_phase, aero_rep, n_cells)
145 integer(kind=i_kind),
intent(in) :: n_cells
147 type(
property_t),
pointer :: spec_props, reactants, products
148 character(len=:),
allocatable :: key_name, spec_name, string_val
149 integer(kind=i_kind) :: i_spec, i_qty
151 integer(kind=i_kind) :: temp_int
152 real(kind=
dp) :: temp_real
155 if (.not.
associated(this%property_set))
call die_msg(255324828, &
156 "Missing property set needed to initialize reaction")
157 key_name =
"reactants"
159 this%property_set%get_property_t(key_name, reactants), &
160 "Arrhenius reaction is missing reactants")
161 key_name =
"products"
163 this%property_set%get_property_t(key_name, products), &
164 "Arrhenius reaction is missing products")
167 call reactants%iter_reset()
171 call assert(243342975, reactants%get_property_t(val=spec_props))
173 if (spec_props%get_int(key_name, temp_int)) i_spec = i_spec+temp_int-1
174 call reactants%iter_next()
179 allocate(this%condensed_data_int(num_int_prop_ + &
180 (i_spec + 2) * (i_spec + products%size())))
181 allocate(this%condensed_data_real(num_real_prop_ + products%size()))
182 this%condensed_data_int(:) = int(0, kind=
i_kind)
183 this%condensed_data_real(:) = real(0.0, kind=
dp)
186 this%num_env_params = num_env_param_
191 num_prod_ = products%size()
194 conv_ =
const%avagadro /
const%univ_gas_const * 10.0d0**(-12.0d0)
200 if (.not. this%property_set%get_real(key_name, a_))
then
203 key_name =
"time unit"
204 if (this%property_set%get_string(key_name, string_val))
then
205 if (trim(string_val).eq.
"MIN")
then
210 if (this%property_set%get_real(key_name, temp_real))
then
211 c_ = -temp_real/
const%boltzmann
214 .not.this%property_set%get_real(key_name, temp_real), &
215 "Received both Ea and C parameter for Arrhenius equation")
218 if (.not. this%property_set%get_real(key_name, c_))
then
223 if (.not. this%property_set%get_real(key_name, d_))
then
227 if (.not. this%property_set%get_real(key_name, b_))
then
231 if (.not. this%property_set%get_real(key_name, e_))
then
235 call assert_msg(344705857, .not. ((b_.ne.real(0.0, kind=
dp)) &
236 .and.(d_.eq.real(0.0, kind=
dp))), &
237 "D cannot be zero if B is non-zero in Arrhenius reaction.")
240 call reactants%iter_reset()
245 react_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
248 call assert_msg(751684145, react_(i_spec).gt.0, &
249 "Missing Arrhenius reactant: "//
spec_name)
252 call assert(796763915, reactants%get_property_t(val=spec_props))
254 if (spec_props%get_int(key_name, temp_int))
then
255 do i_qty = 1, temp_int - 1
256 react_(i_spec + i_qty) = react_(i_spec)
258 i_spec = i_spec + temp_int - 1
261 call reactants%iter_next()
266 call products%iter_reset()
271 prod_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
274 call assert_msg(234495887, prod_(i_spec).gt.0, &
275 "Missing Arrhenius product: "//
spec_name)
278 call assert(451185800, products%get_property_t(val=spec_props))
280 if (spec_props%get_real(key_name, temp_real))
then
281 yield_(i_spec) = temp_real
286 call products%iter_next()