GithubHelp home page GithubHelp logo

zhulianhua / dugksfoam Goto Github PK

View Code? Open in Web Editor NEW
78.0 12.0 27.0 2.06 MB

An OpenFOAM solver for Boltzmann model equation using discrete unified gas kinetic scheme

License: MIT License

Shell 0.42% C++ 43.76% C 54.29% Python 1.53%

dugksfoam's Introduction

dugksFoam

An OpenFOAM solver for the Boltzmann model equations using discrete unified gas kinetic scheme [1,2,3].

Key features

  • Solving discrete velocity Boltzmann equation;
  • Based on Shakhov-BGK collision model;
  • Using discrete unified gas kinetic scheme (Asymptotic preserving property);
  • A standard OpenFOAM solver;
  • Arbitrary unstructured meshes;
  • MPI parallel computing capability;
  • 1D & 2D & 3D in a single solver;
  • Post processing tools of OpenFOAM are ready to use;
  • Various boundary condition types.

Installation and documentation

NOTE: Tested on the following OpenFOAM versions :

  • 2.4.0, gcc/intel
  • 3.0.0, gcc
  • 3.0.1, gcc
  • 4.0, gcc
  • 4.1 gcc/intel
  • 6.0, gcc
of240 # change the version code according your OF installation
cd dugksFoam/src
./Allwmake

See documentation at doc/dugksFoam.pdf.

References

dugksfoam's People

Contributors

sanguinariojoe avatar zhulianhua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dugksfoam's Issues

farfield boundary condition for external flow problems (flow around bodies)

Hi, everyone!

Problem description

I want to use dugksFoam to calculate the low-speed incompressible flow passing a micro-cylinder. I found cases like internal flow problems (only wall boundary condition is needed) and supersonic flow around a body in the user guide and published papers using dugksFoam, so I decided to try a supersonic-flow-around-a-2-D-cylinder case first. The case appears in Discrete unified gas kinetic scheme on unstructured meshes.

However, the description of the farfield BC in the user guide is a bit vague, which reads: "To specify such a boundary type, just set the boundary types as fixedValue, and provide the free-stream flow condition as the boundary values in 0/rho, 0/U and 0/T." If the velocity on the whole outer boundary is set to fixedValue, how can the flow field adjust to a steady state? I tried setting the BC as the user guide suggested, but the solving soon diverged. I changed fixedValue to farField; the solving has not diverged yet but the result is weird.

So, how should I specify the farfield BC?
Can dugksFoam be used to calculate the incompresible external flow problem?
(I post this issue in parallel-cdugksFoam at first. Hope it doesn't bother and many thanks.)

Details of the settings

fvDVMparas
{
    xiMax       xiMax [0 1 -1 0 0 0 0]    5.053155000000000e+03;
    xiMin       xiMin [0 1 -1 0 0 0 0]   -5.053155000000000e+03;
    nDV               89;       // Number of discrete velocity, shoud be 4*Z + 1 if using compound N-C quardrature
}

gasProperties
{
    R            R [0 2 -2 -1 0 0 0] 207.85; // Specific gas constant
    omega        0.81;              // VHS viscosity ~ Temperature index
    Tref         Tref [0 0 0 1 0 0 0] 273.0; // Reference temperature
    muRef        muRef [1 -1 -1 0 0 0 0] 2.117e-5;
    Pr           0.6667; // Prantl number
}

0/U

boundaryField
{
    cylinder
    {
        type            fixedValue;
        value           uniform (0 0 0);
    }
    farfield
    {
        type            farField;
        value 		uniform (1538.73 0 0);        
    }
    frontAndBack
    {
        type            empty;
    }
}

0/T

boundaryField
{
    cylinder
    {
        type            fixedValue;
        value           uniform 273;
    }
    farfield
    {
        type            farField;
        value           uniform 273;
    }
    frontAndBack
    {
        type            empty;
    }
}

0/rho

boundaryField
{
    cylinder
    {
        type            calculatedMaxwell;
        value           uniform 8.598e-5;  // dummy
    }
    farfield
    {
        type            farField;
        value           uniform 8.598e-5;
    }
    frontAndBack
    {
        type            empty;
    }
}

Result

The solution time interval is about 2e-8, and the flow fields of U, T, and rho at 3e-4

Better create a MPI compilation stuff??

In the user manual you suggest to override C++ OpenFOAM rules:

Change the compier from CXX to MPICXX, because we implemented
the velocity-space parallel feature which use the standard alone MPI
instead of the Pstream library of OpenFOAM.
cp $WM_DIR/rules/$WM_ARCH$WM_COMPILER/c++ \
$WM_DIR/rules/$WM_ARCH$WM_COMPILER/c++.bak
sed -i "s/$WM_CXX/mpicxx/" \
$WM_DIR/rules/$WM_ARCH$WM_COMPILER/c++

The obvious drawback is that you are editing OpenFOAM installed rules, which may affects future compilations (bad for rockies). Instead of that, you can create alternative compilation rules:

cp -r $WM_DIR/rules/$WM_ARCH$WM_COMPILER "$WM_DIR/rules/$WM_ARCH"MPI
export WM_COMPILER=MPI
sed -i "s/$WM_CXX/mpicxx/" $WM_DIR/rules/$WM_ARCH$WM_COMPILER/c++

It's a bit more complicated, but cleaner in my opinion, since you are actually not changing nothing in the OF installation.

Repeating the calculation?

In the function Foam::discreteVelocity::updateGHsurf() , gSurf_ = (1.0 - relaxFactor)gSurf_ + relaxFactorgEq; has already calculated all the boundary fields (operator overloading calculates both the interior and boundary fields). Why is there a need to explicitly iterate through forAll(gSurfPatch, facei) and calculate the boundary fields again?

OpenFoam10

There are problems compiling the code on OpenFoam10

python3 setDV.py update

setDV.py may have some error when use python3. In "def dvGH", the variable "N" can replace with "int(N)" and in "def dvNC", "for i in range(nBy4)" can replace with "for i in range(int(nBy4))".

add support of optimal high-order discrete velocity set

Used optimized discrete velocity for 2D and 3D flows, instead of using tensor product of 1D Gauss-Hermite discrete velocity to construct for 2D&3D cases. Add option to use discrete equilibrium distribution function to save computing time and improve conservation property of collision term.

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.