Hello,

I have the following code to compute and add up fluxes through boundary cells of certain type after each step:


          Scalar fluxes[FluidSystem::numComponents] = {0};

          for (const auto& element : elements(this->gridGeometry().gridView()))
          {
              auto fvGeometry = localView(this->gridGeometry());
              fvGeometry.bindElement(element);

              auto elemVolVars = localView(gridVariables.curGridVolVars());
              elemVolVars.bind(element, fvGeometry, curSol);

              auto elemFluxVarsCache = localView(gridVariables.gridFluxVarsCache());

              for (auto&& scvf : scvfs(fvGeometry))
              {
                  if (scvf.boundary())
                  {
                      const auto boundaryMarkerId = gridDataPtr_->getBoundaryDomainMarker(scvf.boundaryFlag());

                      if (boundaryMarkerId == 888)
                      {
                          auto neumannFluxes = neumann(element, fvGeometry, elemVolVars, elemFluxVarsCache, scvf);                           neumannFluxes *= scvf.area() * elemVolVars[scvf.insideScvIdx()].extrusionFactor();

                          for (int i = 0; i < FluidSystem::numComponents; i++)
                              fluxes[i] += neumannFluxes[i];
                      }
                  }
              }
          }


It works in single-process mode but not in multi-process. I think this has to do with the grid being divided between processes? How do I adapt this post-processing code to this scheme?


Best regards,

Dmitry


_______________________________________________
DuMux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to