Skip to content

Potential inconsistency in automatic chemical desorption for ionic products (UCLCHEM) #174

Description

@mystyrya

Hello,

I have been testing the standard UCLCHEM network (with grains enabled) and encountered a reproducible issue related to automatically generated chemical desorption reactions (LHDES/ERDES). I encountered this issue while running the standard test models provided with UCLCHEM (using the default network and scripts/run_uclchem_tests.py). I have made some unrelated modifications to the code, which may have revealed a latent inconsistency.

During the run, the code reaches the chemical desorption routine (desorptionFraction) with reactions whose product cannot be mapped onto gasIceList, resulting in productIndex(1)=0. This leads to a crash unless a safeguard is added.

After debugging, I found that this occurs for specific reactions (e.g. indices 800 and 846 in the generated network), both producing the ion H2CS+.

Key observations:

The function add_chemdes_reactions() generates LHDES/ERDES reactions automatically from LH/ER reactions.
Products are converted from surface/bulk to gas phase by stripping #/@.
However, no check is performed to ensure that the resulting gas-phase products are present in gasIceList.
In these specific cases, the product is an ion (H2CS+) which appears not to have a corresponding surface/bulk counterpart, so it is not included in gasIceList.
As a result, desorptionFraction cannot map the product and productIndex(1)=0.

There seems to be a mismatch between:

the assumptions in rates.f90 (which requires a strict 1:1 mapping between LH and LHDES reactions),
and the fact that some automatically generated LHDES reactions produce species that are not supported by the desorption framework.

A minimal workaround is to add a guard in desorptionFraction:

IF (productIndex(1) .EQ. 0) THEN
desorptionFraction = 0.d0
RETURN
END IF

This allows the code to run correctly and effectively suppresses chemical desorption for such cases.

However, this suggests a possible inconsistency in the logic of add_chemdes_reactions(), where reactions with unsupported products (e.g. ions without grain counterparts) are still generated.

I would be happy to provide further details or test additional fixes if needed.

Best regards,
Francesca

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions