Code Monkey home page Code Monkey logo

multidimamr's Introduction

dynamicAMR

Descrition

dynamic meshing with load balancing for hexahedral meshes in 3D and 2D

Library is based on:

Rettenmaier, Daniel, et al. "Load balanced 2D and 3D adaptive mesh refinement in OpenFOAM." SoftwareX 10 (2019): 100317.

link: https://www.sciencedirect.com/science/article/pii/S2352711018301699

port to the OpenFOAM+ version v1812 and v2006,v2012

refinement selection algoritm is based on foam extended 4.1

Getting Started

install OpenFOAM v1812

compile the library

./Allwmake

in case of v2006, v2012:

git checkout v2012
./Allwmake

Prerequisites

Requires OpenFOAM v1812 or v2006,v2012:

https://www.openfoam.com/download/release-history.php

Installing

 git clone https://github.com/HenningScheufler/multiDimAMR
 cd multiDimAMR
 ./Allwmake

Usage

add following lines to the contolDict:

libs
(
   "libdynamicLoadBalanceFvMesh.so"
);
or depending on the openfoam version
libs
(
   dynamicLoadBalanceFvMesh
);

cat decomposeParDict

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                   |
|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

numberOfSubdomains 4;

method          scotch;

constraints
{
    refinementHistoryMultiDim
    {
        //- Decompose cells such that all cell originating from single cell
        //  end up on same processor
        type    refinementHistoryMultiDim;
    }
}

cat balanceParDict:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v1812                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      balanceParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

numberOfSubdomains 4;

method          ptscotch; //clsutered //scotch

constraints
{
    refinementHistoryMultiDim
    {
        //- Decompose cells such that all cell originating from single cell
        //  end up on same processor
        type    refinementHistoryMultiDim;
    }
}
// ************************************************************************* //

refinement selection

the cells to refine are specified in the adaptCriteria dictionary

adaptCriteria
{
    type fieldBounds; // options fieldBounds geometric
    fieldName alpha.water;
    lowerBound 0.001;
    upperBound 0.999;
    nLayer 2; // extends refinement zone by two layers
    maxCellLevel 2; // default value very high number limits the maxium refinement level
    minCellLevel 0; // default value 0 specify minimum refinement level
    negate false; // default false // negates the selection
}

the composedAdaptCriteria enables us to combine the simple functions above by logial operator:

adaptCriteria
{

    type composedAdaptCriteria;
    operation or; // and or xor
    criteria
    (
        interface // refine to the maxRefinement
        {
            type fieldBounds;
            fieldName alpha.water;
            lowerBound 0.01;
            upperBound 0.99;
            nLayer     2;
        }
        fluid // refLvl 2 in fluid
        {
            type fieldBounds;
            fieldName alpha.water;
            lowerBound 0.01;
            upperBound 2;
            maxCellLevel 2;
        }
    );
}

This way we can specify a higher refinement level at the interface than in the fluid or in combination with the geometric refinement option chose only to refine in a given region. Note that the composedAdaptCriteria can also consists of multiple composedAdaptCriteria

Known Issues

  • boundary condition that use function e.g. uniformFixedValue crash if the table function is used see issue #2

    Solution: the issue can be resolved by switching to v2012

  • the load balancing crashes if a domain with no cells is created

    Solution: use more cells or try a different method in balanceParDict kahip seems to work better than ptscotch I

License

This project is licensed under the GPL v3 License - see the LICENSE.md file for details

Acknowledgments

multidimamr's People

Contributors

henningscheufler 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.