Skip to content

Coupling to 0D solver only supported for first equation #592

Description

@michelebucelli

Description

In a number of places, the infrastructure for coupling svMultiPhysics to svZeroDSolver assumes that the coupling is happening for the first equation. This means that e.g. in electromechanics simulations (introduced in #578) the structural mechanics equation needs to be the first. If electrophysiology is the first equation, the 0D solver doesn't run, and no error message or warning is printed to make the user aware of this.

One instance of this is

for (auto& bc : com_mod.eq[0].bc) {
// Check for coupled faces (Dir, Neu via cplBC) or Coupled BCs
if (bc.cplBCptr != -1 || utils::btest(bc.bType, static_cast<int>(consts::BoundaryConditionType::bType_Coupled))) {
com_mod.cplBC.coupled = true;
break;
}
}

The flag com_mod.cplBC.coupled is set to true only if com_mod.eq[0].bc contains some coupled condition. If the coupled condition is in some other equation, then com_mod.cplBC.coupled remains false, and the 0D solver is silently never called.

A similar behavior is happening in a few other places (I could find similar things in Integrator and set_bc.cpp, but there might be a few more).

Reproduction

From the branch of #578, try running an electromechanics simulation coupled to svZeroDSolver for the structure boundary conditions. The first equation must be CEP, the second struct.

Expected behavior

The coupling with the 0D solver should work independently of the ordering of the equations. The ordering of the equations should affect the order in which they are solved in partitioned schemes, but not the BCs that are applied to them.

Should that be impossible (but I don't see why it should), at least an error message should be raised to notify the user that the 0D solver is not being called despite being specified in the XML file.

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions