133 subroutine initialize(this, chem_spec_data, aero_rep, n_cells)
142 integer(kind=i_kind),
intent(in) :: n_cells
144 type(
property_t),
pointer :: spec_props, reactants, products
145 character(len=:),
allocatable :: key_name, spec_name, string_val
146 integer(kind=i_kind) :: i_spec, i_qty
148 integer(kind=i_kind) :: temp_int
149 real(kind=
dp) :: temp_real
152 if (.not.
associated(this%property_set))
call die_msg(255324828, &
153 "Missing property set needed to initialize reaction")
154 key_name =
"reactants"
156 this%property_set%get_property_t(key_name, reactants), &
157 "Arrhenius reaction is missing reactants")
158 key_name =
"products"
160 this%property_set%get_property_t(key_name, products), &
161 "Arrhenius reaction is missing products")
164 call reactants%iter_reset()
168 call assert(243342975, reactants%get_property_t(val=spec_props))
170 if (spec_props%get_int(key_name, temp_int)) i_spec = i_spec+temp_int-1
171 call reactants%iter_next()
176 allocate(this%condensed_data_int(num_int_prop_ + &
177 (i_spec + 2) * (i_spec + products%size())))
178 allocate(this%condensed_data_real(num_real_prop_ + products%size()))
179 this%condensed_data_int(:) = int(0, kind=
i_kind)
180 this%condensed_data_real(:) = real(0.0, kind=
dp)
183 this%num_env_params = num_env_param_
188 num_prod_ = products%size()
191 conv_ =
const%avagadro /
const%univ_gas_const * 10.0d0**(-12.0d0)
197 if (.not. this%property_set%get_real(key_name, a_))
then
200 key_name =
"time unit"
201 if (this%property_set%get_string(key_name, string_val))
then
202 if (trim(string_val).eq.
"MIN")
then
207 if (this%property_set%get_real(key_name, temp_real))
then
208 c_ = -temp_real/
const%boltzmann
211 .not.this%property_set%get_real(key_name, temp_real), &
212 "Received both Ea and C parameter for Arrhenius equation")
215 if (.not. this%property_set%get_real(key_name, c_))
then
220 if (.not. this%property_set%get_real(key_name, d_))
then
224 if (.not. this%property_set%get_real(key_name, b_))
then
228 if (.not. this%property_set%get_real(key_name, e_))
then
232 call assert_msg(344705857, .not. ((b_.ne.real(0.0, kind=
dp)) &
233 .and.(d_.eq.real(0.0, kind=
dp))), &
234 "D cannot be zero if B is non-zero in Arrhenius reaction.")
237 call reactants%iter_reset()
242 react_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
245 call assert_msg(751684145, react_(i_spec).gt.0, &
246 "Missing Arrhenius reactant: "//
spec_name)
249 call assert(796763915, reactants%get_property_t(val=spec_props))
251 if (spec_props%get_int(key_name, temp_int))
then
252 do i_qty = 1, temp_int - 1
253 react_(i_spec + i_qty) = react_(i_spec)
255 i_spec = i_spec + temp_int - 1
258 call reactants%iter_next()
263 call products%iter_reset()
268 prod_(i_spec) = chem_spec_data%gas_state_id(
spec_name)
271 call assert_msg(234495887, prod_(i_spec).gt.0, &
272 "Missing Arrhenius product: "//
spec_name)
275 call assert(451185800, products%get_property_t(val=spec_props))
277 if (spec_props%get_real(key_name, temp_real))
then
278 yield_(i_spec) = temp_real
283 call products%iter_next()