Developer's call, 17.05.2021

Recap

The following issues were merged: :partying_face:

Agenda

Fix compile warnings by jayghoshter · Pull Request #76 · modsim/CADET · GitHub

  • More warnings show up after @sleweke set some compile flags
  • Unused Variables: In some cases, variables are left unused in the release build due cadet_assert() only being defined in Debug builds. We can fix this by not assigning the variables in the Release builds (preprocessor macros). Or just hiding the warnings.
  • Fallthrough in switch: (Discussed on Telegram with @sleweke) An implementation of the siphash() function causes this warning. The fallthrough is intentional, so we can either switch off the warning, or hide it with the [[fallthrough]] decorator. The decorator, however, is c++17 standard and we currently enforce a minimum of c++14

Add MixerSplitter UnitOperation by schmoelder · Pull Request #46 · modsim/CADET · GitHub

Seems not to be possible with the current implementation. Waiting for confirmation by @s.leweke whether this can be hacked into the ModelSystem/connections.

Write out state for every unit operation separately. by schmoelder · Pull Request #73 · modsim/CADET

(@j.hassan)
In the current PR draft, some files were commited which need to be removed. Also, we need to rebase, because changes have been merged to master. Then, as explained in the issue, a function needs to be added to the ModelSystem which returns the start index and length of the model’s slice in the global state vector.

Misc

Advanced Git usage

(@j.rao can you please add your gists/resources)

  • Create and delete branches
  • Merge/Rebase
  • Add/remove remote repositories

What exactly is a DOF in the context of CADET?

Number of state variables of a unit operation.

What exactly is a stride in the CADET UnitOperation model?

Admittedly I forgot to ask but maybe someone can elaborate because I’m curious.

Developer’s Guide

Here is a photo from the first CADET Workshop, where @s.leweke explained the architecture of CADET. Maybe we can use this as a basis for a UML/Overview diagram in our developer’s guide.

A degree of freedom (DOF) is one element in the state vector. Each unit operation maintains a slice of the global state vector. The number of DOFs in a unit operation depends on its discretization (number of axial cells, radial cells, bound states etc.). In addition to its own DOFs (generated by discretization), a unit operation also has a small amount of inlet DOFs. These are always at the beginning of its state vector slice and are used for interconnecting unit operations.

  • numDofs() returns the total number of DOFs of a unit operation (including inlet DOFs)
  • numPureDofs() returns only the number of DOFs created by discretization (excluding inlet DOFs)

In general, a stride is a measure of distance in a linearized multidimensional array or tensor. Let’s say we want to save the matrix

\begin{pmatrix} a_{00} & a_{01} \\ a_{10} & a_{11} \\ a_{20} & a_{21} \end{pmatrix}

in the computer. Because the memory is basically just a large array with a single index, we need to linearize the 2D matrix into a 1D array. To this end, we decide on a numbering, which in CADET is row-major (or C-style):

a_00, a_01, a_10, a_11, a_20, a_21

We simply concatenate the rows to a long array. Now, we still may want to use the (row,col)-index to address the elements. Given a (row, col) index pair, we compute the corresponding linear index by

row * nColsInEachRow + col

where nColsInEachRow is the number of columns in each row of the matrix (in our case 2). This nColsInEachRow is what is commonly called the stride.

In CADET, we have many different strides: The number of DOFs between the first component in two adjacent bulk cells (equal to nComp), the number of DOFs between the first liquid phase component in two adjacent particle cells (nComp + strideBound, where strideBound is the total number of bound states of all components of this particle type), etc.

1 Like