Skip to content

Add generalized 1D column unit#436

Merged
jbreue16 merged 3 commits intojb/devfrom
feature/dg2d
Jun 24, 2025
Merged

Add generalized 1D column unit#436
jbreue16 merged 3 commits intojb/devfrom
feature/dg2d

Conversation

@jbreue16
Copy link
Contributor

@jbreue16 jbreue16 commented Jun 10, 2025

todo

  • implement new interface, see https://github.com/cadet/CADET-Specification/issues/4
    • throw out particle type multiplexing: assume parTypeDep, with the oprion to specify parTypeIndependence which will be used to compute the joint parameter sensitivity using only one AD direction.
  • allow arbitrary nParType (including 0) that can be any of the particle models implemented
  • implement tests
    • GRM tests
    • LRMP tests
    • further tests
      • mixed particle type Jacobian & num. ref. test
      • npartype=0 test
  • move $c^p, c^s$ initial condition interface to particle group

@jbreue16
Copy link
Contributor Author

jbreue16 commented Jun 10, 2025

Interface changes:

  • field NPARTYPE defaults to zero, i.e. becomes mandatory when particles are used
  • new group particle_type_000 for every particle type with the respective index
  • NBOUND is moved into the particle group(s)
  • multiplexes (e.g. FILM_DIFFUSION_MULTIPLEX) exclude partype multiplex. some multiplexes which only had partype, e.g. ADSORPTION_MODEL_MULTIPLEX, REACTION_MODEL_PARTICLES_MULTIPLEX are deprecated.
  • New fields are used to specify parameter dependence as used in parameter sensitivities:, FILM_DIFFUSION_PARTYPE_DEPENDENT, BINDING_PARTYPE_DEPENDENT and REACTION_PARTYPE_DEPENDENT, PAR_SURFDIFFUSIN_DEP_PARTYPE_DEPENDENT, PAR_RADIUS_PARTYPE_DEPENDENT, PAR_CORERADIUS_PARTYPE_DEPENDENT, PAR_POROSITY_PARTYPE_DEPENDENT, PORE_ACCESSIBILITY_PARTYPE_DEPENDENT, PAR_DIFFUSION_PARTYPE_DEPENDENT,
    the internal MultiplexMode remains the same and is derived as before but with the additional information from the new partype dependence field.
  • parameter dependencies for sensitivities now must be specified via PAR_RADIUS_PARTYPE_DEPENDENT etc. otherwise, parameter is assumed to be dependent on the particle type.
  • REACTION_MODEL_PARTICLES -> REACTIN_MODEL in each particle group
  • if needed, particles have their own discretization group (only General rate particle for now)
  • initial conditions of $c^p, c^s$ were moved to particles: INIT_CS (formerly INIT_Q) and INIT_CP. in the case of particle type independent bindings, it is checked if initial conditions are the same across particle models

@jbreue16
Copy link
Contributor Author

jbreue16 commented Jun 12, 2025

By introducing the following kind of loops

bool paramExists = false;
for (int parType = 0; parType < _disc.nParType; parType++)
{
	const bool paramExistsNow = _particle[parType].setSensitiveParameter(_sensParams, pId, adDirection, adValue);
	paramExists = paramExists || paramExistsNow;

	if (paramExists)
	{
		// continue loop for particle type independent parameters to set the respective parameter sensitivity in all particle types
		if ((pId.particleType != ParTypeIndep && parType == pId.particleType) || (pId.particleType == ParTypeIndep && parType == _disc.nParType - 1))
		{
			LOG(Debug) << "Found parameter " << pId << ": Dir " << adDirection << " is set to " << adValue;
			return true;
		}
	}
}

parameter sensitivities with particle type independence will be set for all particle types that have this parameter. I.e. e.g. for a parameter type independent surface diffusion sensitivity, the sensitivity is set for all particle types that have this parameter.

@jbreue16 jbreue16 force-pushed the feature/dg2d branch 5 times, most recently from 88ea861 to 0a850ea Compare June 19, 2025 09:49
@jbreue16 jbreue16 force-pushed the feature/dg2d branch 5 times, most recently from 8f136b5 to b6918a4 Compare June 23, 2025 20:34
jbreue16 added a commit that referenced this pull request Jun 24, 2025
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
jbreue16 added a commit that referenced this pull request Jun 24, 2025
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
jbreue16 added a commit that referenced this pull request Jun 24, 2025
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
jbreue16 added a commit that referenced this pull request Jun 24, 2025
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
jbreue16 added a commit that referenced this pull request Jun 24, 2025
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
jbreue16 added a commit that referenced this pull request Jun 24, 2025
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
jbreue16 added a commit that referenced this pull request Jun 24, 2025
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
Implement new particle interface, maintain the old one for GRM, LRMP
units

Fix interface of homogeneous particles

Add tests: GRM, LRMP, and mixed general rate and homogeneous particle
type tests

Allow nParType=0, i.e. DPF(R)
@jbreue16 jbreue16 merged commit 71f82b6 into jb/dev Jun 24, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in CADET Repositories Jun 24, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant