Adding surface diffusion dependence for GRM in CADET-process

Hello CADET team,

It looks like there is no way to set surface diffusion dependence in CADET-process as there is in CADET (like with the liquid_salt_power or liquid_salt_exponential or liquid_salt_colloidal_affinity parameters).

I would like to convert the existing models that I have set up in CADET to CADET-process, but I am using the surface diffusion dependence in CADET.

Do you think I would be able to work with you guys to add that? I would like to learn to do it myself so that I can add things like this for myself in the future, but I am not confident on the process. The post about Adding bindings for binding models in CADET-process was helpful but I am not sure how different the process would be for other things like this.

2 Likes

I had a quick look into this, and integrating PAR_SURFDIFFUSION_DEP into CADET-Process should be straightforward since it only influences PAR_SURFDIFFUSION.

These are the steps needed:

  1. Add the Parameter to cadetAdapter.py:
  • Add PAR_SURFDIFFUSION_DEP following the CADET-Process naming conventions to the section GeneralRateModel.
  1. Add it as an Attribute to the GeneralRateModel class in unitOperation.py:
  • Define it as an attribute of the GeneralRateModel.

If you’d like to try implementing this yourself, you can create a PR to dev in CADET-Process. I’ll be happy to assist if you encounter any issues.

Additionally, tagging @j.schmoelder.

Best,
Hannah

2 Likes

Thanks, I have made a pull request, though I am not sure if I have done everything correctly.

I added the following parameters:

'PAR_SURFDIFFUSION_DEP': 'surface_diffusion_dependence',
'PAR_SURFDIFFUSION_EXPFACTOR': 'surface_diffusion_exponent_factor',
'PAR_SURFDIFFUSION_EXPARGMULT': 'surface_diffusion_exponent_multiplier',
'PAR_SURFDIFFUSION_POWFACTOR': 'surface_diffusion_power_factor',
'PAR_SURFDIFFUSION_POWEXP': 'surface_diffusion_power_exponent',
'PAR_SURFDIFFUSION_LOGKEQFACTOR': 'surface_diffusion_logkeq_factor',
'PAR_SURFDIFFUSION_LOGKEQEXP': 'surface_diffusion_logkeq_exponent',
'PAR_SURFDIFFUSION_LOGKEQCONST': 'surface_diffusion_logkeq_constant',

I am most unsure about how these should be added to the GeneralRateModel class in unitOperation.py because the existing surface diffusion parameter was added using a setter as below

@property
def surface_diffusion(self):
    return self._surface_diffusion

@surface_diffusion.setter
def surface_diffusion(self, surface_diffusion):
    if isinstance(self.binding_model, NoBinding):
        raise CADETProcessError(
            "Cannot set surface diffusion without binding model."
        )
    self._surface_diffusion = surface_diffusion
    
    self.parameters['_surface_diffusion'] = surface_diffusion

I am not really sure how this works, I have never used this type of functions before, but I just followed this format for the other parameters. I hope that makes sense.

1 Like