Git Product home page Git Product logo

dlbfoam's Introduction

DLBFoam: Dynamic load balancing for fast reactive simulations

OpenFOAM 8

DLBFoam is an open-source library for OpenFOAM. It introduces dynamic load balancing and a zonal reference mapping model for fast chemistry calculation in parallel simulations.

Why do I need this?

Load imbalance in parallel reactive simulations is an issue that causes very long simulation times in OpenFOAM simulations utilizing finite-rate chemistry.

DLBFoam introduces runtime load balancing through MPI routines to minimize the load imbalance between ranks and gain speed-up. The implementation details can be found in our paper [1].

drawing
Figure: A demonstration of how load balancing model works compared to standard model.

Compilation

DLBFoam does not require any third-party dependency. After sourcing OpenFOAM-8, simply execute:

./Allwmake

Usage

Once the compilation is successful, any case running with standard OpenFOAM can be easily converted to use DLBFOAM, following these steps:

  • The DLBFoam should be linked to the solver. Add the following to your system/controlDict file:
libs
(
    "libchemistryModel_DLB.so" 
);
  • Select chemistry solver method as loadBalanced in constant/chemistryProperties:
chemistryType
{
    solver          ode;
    method          loadBalanced;
}
  • Add the loadbalancing subdictionary to the same chemistryProperties file:
loadbalancing
{
    active true;
    log	true;
}
  • (Optional) Set the refmapping as active in chemistryProperties file if you want to use the reference mapping method (you have to add an empty refmapping{} dict even if you do not use it):
refmapping
{
    active  true;
    
    mixtureFractionProperties
    {
        oxidizerMassFractions
        {
            N2       0.77;
            O2       0.23;
        }

        fuelMassFractions
        {
            NC12H26       1.0;
        }

        #include "$FOAM_CASE/constant/thermo.compressibleGasGRI"
    }
    tolerance	1e-4;  // mixture fraction tolerance
    deltaT	2; // temperature tolerance
}

Reference mapping uses mixture fraction (Z) and maps a reference solution to reference cells satisfying a condition.

The entry above sets the Z=0 and Z=1 conditions from given mass fractions. For each CFD iteration it finds a reference solution where Z<tolerance and solves the chemistry. Subsequent cells following the same condition are mapped from this reference solution.

Optional: When deltaT is explicitly set, the mapper also checks the temperature between reference solution and other reference cells and ensures: abs(Tcell-Tref)<deltaT.

  • Run the case normally with OpenFOAM's reactive solvers.

For a working example, check the tutorials given in tutorials folder.

Directory structure

├── src
└── thermophysicalModels
│    └── chemistryModel
│        ├── chemistryModel
│        │   └── loadBalancedChemistryModel
│        │       ├── LoadBalancedChemistryModel    // Main chemistry class
│        ├── loadBalancing
│        │   ├── algorithms_DLB                    // Some useful algorithms used
│        │   ├── ChemistryLoad                     // Chemistry load object
│        │   ├── ChemistryProblem                  // Chemistry problem object
│        │   ├── ChemistrySolution                 // Chemistry solution object
│        │   ├── LoadBalancerBase                  // Load balancer base class
│        │   ├── LoadBalancer                      // Load balancer implementation class
│        │   ├── RecvBuffer                        // Receive MPI buffer object
│        │   ├── runtime_assert                    // Assert functions for debugging
│        │   ├── SendBuffer                        // Send MPI buffer object
│        └── refMapping
│            ├── mixtureFraction                   // Mixture fraction implementation
│            ├── mixtureFractionRefMapper          // Reference mapper implementation class
│
├── tutorials                                      // Tutorials
└── unittests                                      // Unit tests to check if compilation is successful

Getting help and reporting bugs

Please submit a GitHub issue if you found a bug in the program. If you need help with the software or have further questions, contact [email protected].

Citation

If you use our model, please cite the publication describing its implementation [1].

References

[1] Tekgul, Peltonen, Kahila, Kaario, Vuorinen (2020). DLBFoam: An open-source dynamic load balancing model for fast reacting flow simulations in OpenFOAM

dlbfoam's People

Contributors

hamsteri15 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.