Skip to content

Commit

Permalink
Merge pull request #322 from CFD-GO/develop
Browse files Browse the repository at this point in the history
Version 6.5
  • Loading branch information
llaniewski authored Oct 9, 2020
2 parents cac2755 + 03135c8 commit 321354f
Show file tree
Hide file tree
Showing 126 changed files with 7,530 additions and 2,927 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Testing the test

on: [ push ]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: CFD-GO/action_TCLB_test@master
with:
repository: ${{ github.repository }}
ref: ${{ github.ref }}
install: true
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
env:
secure: "gDINAbE+apFUrReGDClqtSd4ir1ivFww/EjslD2XA8igmwELA0Kkom3z+X6HiMjlPaNLK5oRoyD7BkFSJ9Sf1i6z2+iLVmqJoOLaexZXM09C557Xmh38DisHTvQf6IVg0TRvQ8DEGDfFMrNr5jjDpXdPYs2sVJPW1Mi0Hwehtvt1Siuxr8bkoa/p6qZLbmhYl6ETGqFXDMmRWKFMaJpJ38BScwWIPgVqwSOcejhEdaPUuGtOYSirUhUDWoSQmOUPfbHfadIAT9+OPDY4p91eQmDQGNj9ZgWMvU8dECrrzE2Z6UfbO+swXmfMWe0BYwEpcGtYMG19y6dEKh4TmrEPR8Y/9SaVFiY/PPm906agKeJdGwHdokYqcjB/STSR83ni+b3qAfIgwYW2pcSMSEpbn+kUp70k9emV3KVJVIg3G/s4fEC1bip5wkBAYInPGa+FmNJTM8Y3iSHeQmuv2zia5od5RJDZg98kf0nXv9iEWEYrQl2KkEGNPK+bsWinA0KES1cZ21aMnPENf7mhyOsUUEYX4oCCxzzR16PCWWx4b7E4SBDweU5DfsEuwByjAImTOArSuofv1QnXynmDDD5W3TVDqx+067pMCE4FLV1yWqqrnaoPpWeWGlhTQStbO3xYSNgUNMma8pYEQStTpdkgXt4gx6RHaCjZwZ/FZx1rZRk="
script:
- tools/install.sh rpackage jsonlite
- tools/install.sh rpackage yaml
- tools/install.sh rpackage XML
- tools/install.sh --rpackage jsonlite
- tools/install.sh --rpackage yaml
- tools/install.sh --rpackage XML
- make configure
- ./configure --disable-cuda
- mkdir -p wiki/xml wiki/images wiki/schema
Expand Down
134 changes: 81 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,81 +1,107 @@
CudneLB - the templated version
===
- [![Build Status](https://travis-ci.org/CFD-GO/TCLB.svg?branch=develop)](https://travis-ci.org/CFD-GO/TCLB) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/master/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://docs.tclb.io/) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3672102.svg)](https://doi.org/10.5281/zenodo.3672102) - Stable release [(`master` branch)](https://github.com/CFD-GO/TCLB/tree/master)
- [![Build Status](https://travis-ci.org/CFD-GO/TCLB.svg?branch=develop)](https://travis-ci.org/CFD-GO/TCLB) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/develop/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://develop.docs.tclb.io/) - Current release [(`develop` branch)](https://github.com/CFD-GO/TCLB/tree/develop)

CudneLB is a MPI+CUDA or MPI+CPU high-performance CFD simulation code, based on Lattice Boltzmann Method.
![TCLB Solver Header](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/header.png)

TCLB Solver
===
TCLB is a MPI+CUDA or MPI+CPU high-performance Computational Fluid Dynamics simulation code, based on the Lattice Boltzmann Method.
It provides a clear interface for calculation of complex physics, and the implementation of new models.

## Installation
- Stable release [(`master` branch)](https://github.com/CFD-GO/TCLB/tree/master):<br/>[![Build Status](https://travis-ci.org/CFD-GO/TCLB.svg?branch=master)](https://travis-ci.org/CFD-GO/TCLB) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/master/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://docs.tclb.io/) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3672102.svg)](https://doi.org/10.5281/zenodo.3973739)
- Current release [(`develop` branch)](https://github.com/CFD-GO/TCLB/tree/develop):<br/>[![Build Status](https://travis-ci.org/CFD-GO/TCLB.svg?branch=develop)](https://travis-ci.org/CFD-GO/TCLB) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/develop/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://develop.docs.tclb.io/)

Just clone the repo (or download the [zip file](https://github.com/CFD-GO/TCLB/archive/master.zip)):
## How to use it

**Install**
```bash
git clone https://github.com/CFD-GO/TCLB.git
cd TCLB
```

If you want a more recent (but less stable) version, you could try the development branch:

**Configure**
```bash
git clone -b develop https://github.com/CFD-GO/TCLB.git
cd TCLB
make configure
./configure --enable-graphics --with-cuda-arch=sm_30
```
**Compile**
```bash
make d2q9
```
**Run**
```bash
CLB/d2q9/main example/flow/2d/karman.xml
```

### Dependencies
## More information

You'll need:
- [R](https://www.r-project.org/)
- packages for R: [optparse](https://cran.r-project.org/package=optparse), [numbers](https://cran.r-project.org/package=numbers), [rtemplate](https://github.com/llaniewski/rtemplate), [gvector](https://github.com/llaniewski/gvector), [polyAlgebra](https://github.com/llaniewski/polyAlgebra)
- [nVidia CUDA](https://developer.nvidia.com/cuda-zone) (if you want to use GPU)
- [python](https://www.python.org/), [numpy](http://www.numpy.org/) (if you want to use the integrated python interpreter)
- [python](https://www.python.org/), [sympy](http://www.sympy.org/) and R package: [rPython](https://cran.r-project.org/package=rPython) (if you want to develop a model using python instead of R)
- [MPI](https://en.wikipedia.org/wiki/Message_Passing_Interface) (e.g. [OpenMPI](http://www.open-mpi.org/))
### Documentation

You can install many of these with the tools/install.sh script (note it requires sudo):
The documentation (including tutorials) is published at
[docs.tclb.io](https://docs.tclb.io/).

```bash
sudo tools/install.sh cuda 6.5-14 # only if your GPU supports cuda
sudo tools/install.sh r
sudo tools/install.sh openmpi
tools/install.sh rdep
sudo tools/install.sh python-dev
tools/install.sh rpython
sudo tools/install.sh module # only on CentOS
```
For the `develop` version, the most recent documentation can be found at
[develop.docs.tclb.io](https://develop.docs.tclb.io/).

You can contribute to the documentation at
[CFD-GO/TCLB_docs](https://github.com/CFD-GO/TCLB_docs).

The `install.sh` script is designed to work on Ubuntu (e.g. on the [Travis-CI](https://travis-ci.org/CFD-GO/TCLB) VMs).
The `install.sh` script should work on CentOS.
You can install the **`sudo`** parts by yourself, and use script to install R packages: rdep and rpython.
### Supported architectures
This code is designed to run on **Linux**. We strongly recommend using Linux for compilation, computation and postprocessing.

Nevertheless, TCLB can be compiled on Windows (CPU only), using the [Windows Subsystem for Linux](https://pl.wikipedia.org/wiki/Windows_Subsystem_for_Linux). It also can be compiled on MacOS (also CPU only). Both Debian and Red Hat based Linux distributions are supported by the `install.sh` script described below, as is MacOS (with `brew` package manager).

### Dependencies

### Compilation
This should work:
For the code to compile and work you'll need a few things:
- [R](https://www.r-project.org/) and some R packages ([optparse](https://cran.r-project.org/package=optparse), [numbers](https://cran.r-project.org/package=numbers), [rtemplate](https://github.com/llaniewski/rtemplate), [gvector](https://github.com/llaniewski/gvector), [polyAlgebra](https://github.com/llaniewski/polyAlgebra))
- [MPI](https://en.wikipedia.org/wiki/Message_Passing_Interface). We recommend [OpenMPI](http://www.open-mpi.org/)
- To use your GPU, you'll need [nVidia CUDA](https://developer.nvidia.com/cuda-zone)
- To integrate TCLB with R, you'll need R package [rinside](https://github.com/eddelbuettel/rinside)
- To integrate TCLB with Python, you'll need [python](https://www.python.org/), [numpy](http://www.numpy.org/) with libraries and headers
- To develop a model using Python, you'll need [python](https://www.python.org/), [sympy](http://www.sympy.org/) and R package: [rPython](https://cran.r-project.org/package=rPython)

You can install many of these with the provided `tools/install.sh` script (note that this requires sudo):
```bash
module load mpi/openmpi-x86_64 # only on CentOS
make configure
./configure --enable-double --enable-graphics --with-cuda-arch=sm_20
# only CPU ./configure --enable-double --disable-cuda
make d2q9
sudo tools/install.sh essentials # Installs essential system packages needed by TCLB
sudo tools/install.sh r # Installs R
sudo tools/install.sh openmpi # Installs OpenMPI
tools/install.sh rdep # Installs needed R packages
sudo tools/install.sh cuda # Installs CUDA (we recommend to do it on your own)
sudo tools/install.sh python-dev # Installs Python libraries with headers
```

## Usage
You can run the `tools/install.sh` script with the `--dry` option, which will print the commands to run, so you can run them on your own.
*We do not recommend running anything with sudo without checking*

### `develop` Branch:
If you want a more recent version, you could try the development branch with `git checkout develop`

This should also work:
### CPU
To compile the code for CPU, you can use the `--disable-cuda` option for `./configure`:
```
./configure --disable-cuda
```
### Parallel run
To run TCLB in parallel (both on multiple CPU and multiple GPU), you can use the standard syntax of MPI parallel run:
```bash
CLB/d2q9/main example/flow/2d/karman.xml
mpirun -np 8 CLB/d2q9/main example/flow/2d/karman.xml
```

## Documentation
### Running on clusters
To assist with using TCLB on HPC clusters (SLURM/PBS), there are scripts provided in the [TCLB_cluster](https://github.com/CFD-GO/TCLB_cluster) repository.

The documentation (including tutorials) is published at
[docs.tclb.io](https://docs.tclb.io/). You can contribute at
[CFD-GO/TCLB_docs](https://github.com/CFD-GO/TCLB_docs).
### LBM-DEM computation
TCLB code can be coupled with Discrete Element Method (DEM) codes, to enable computation of flow with particles.

For the `develop` version, most recent documentation can be found at
[develop.docs.tclb.io](https://develop.docs.tclb.io/).
The DEM codes that TCLB can be integrated with are:
- [LIGGGHTS](https://www.cfdem.com/liggghts-open-source-discrete-element-method-particle-simulation-code)
- [LAMMPS](https://lammps.sandia.gov/)
- [ESYS-Particle](https://launchpad.net/esys-particle)

Refer to the documentation for instructions on compilation and coupling.

## About

### Authors

## Authors
TCLB began development in 2012 with the aim at providing a framework for efficient CFD computations with LBM, mainly for research.

Author: [Łukasz Łaniewski-Wołłk](https://github.com/llaniewski)

Expand All @@ -91,9 +117,11 @@ Contributors:
* [Paweł Obrępalski](https://github.com/PabloOb)
* [Grzegorz Gruszczyński](https://github.com/ggruszczynski)

Developed at: [C-CFD Group](https://c-cfd.meil.pw.edu.pl/) at [Warsaw University of Technology](http://pw.edu.pl/) from 2012
Developed at:
- [Zakład Aerodynamiki](https://meil.pw.edu.pl/ZA/) at [Politechnika Warszawska (Warsaw University of Technology)](http://pw.edu.pl/)
- [School of Mechanical & Mining Engineering](https://www.mechmining.uq.edu.au/) at [University of Queensland](http://uq.edu.au/)

## License
### License

This software is distributed under the [GPL v3 License](LICENSE).

Expand Down
136 changes: 136 additions & 0 deletions example/article/ThermocapillaryFlow/BubbleInteraction_catalyst.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@

#--------------------------------------------------------------

# Global timestep output options
timeStepToStartOutputAt=0
forceOutputAtFirstCall=False

# Global screenshot output options
imageFileNamePadding=0
rescale_lookuptable=False

# Whether or not to request specific arrays from the adaptor.
requestSpecificArrays=False

# a root directory under which all Catalyst output goes
rootDirectory=''

# makes a cinema D index table
make_cinema_table=False

#--------------------------------------------------------------
# Code generated from cpstate.py to create the CoProcessor.
# paraview version 5.8.0
#--------------------------------------------------------------

from paraview.simple import *
from paraview import coprocessing

# ----------------------- CoProcessor definition -----------------------

def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
# state file generated using paraview version 5.8.0

# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------

# trace generated using paraview version 5.8.0
#
# To ensure correct image size when batch processing, please search
# for and uncomment the line `# renderView*.ViewSize = [*,*]`

#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()

# create a new 'XML Partitioned Image Data Reader'
# create a producer from a simulation input
recalcitrantBubble_interaction_smooth_main_VTK_P00_00000530pvti = coprocessor.CreateProducer(datadescription, 'input')

# create a new 'Cell Data to Point Data'
cellDatatoPointData1 = CellDatatoPointData(Input=recalcitrantBubble_interaction_smooth_main_VTK_P00_00000530pvti)
cellDatatoPointData1.CellDataArraytoprocess = ['PhaseField', 'T', 'U']

# create a new 'Iso Volume'
isoVolume1 = IsoVolume(Input=cellDatatoPointData1)
isoVolume1.InputScalars = ['POINTS', 'PhaseField']
isoVolume1.ThresholdRange = [0.0, 0.5]

# create a new 'Connectivity'
connectivity1 = Connectivity(Input=isoVolume1)

# ----------------------------------------------------------------
# finally, restore active source
SetActiveSource(connectivity1)
# ----------------------------------------------------------------

# Now any catalyst writers
cSVWriter1 = servermanager.writers.CSVWriter(Input=connectivity1)
coprocessor.RegisterWriter(cSVWriter1, filename='Connectivity1_%t.csv', freq=1, paddingamount=0, DataMode='None', HeaderType='None', EncodeAppendedData=None, CompressorType='None', CompressionLevel='None')

return Pipeline()

class CoProcessor(coprocessing.CoProcessor):
def CreatePipeline(self, datadescription):
self.Pipeline = _CreatePipeline(self, datadescription)

coprocessor = CoProcessor()
# these are the frequencies at which the coprocessor updates.
freqs = {'input': [1]}
coprocessor.SetUpdateFrequencies(freqs)
if requestSpecificArrays:
arrays = [['PhaseField', 1], ['T', 1], ['U', 1]]
coprocessor.SetRequestedArrays('input', arrays)
coprocessor.SetInitialOutputOptions(timeStepToStartOutputAt,forceOutputAtFirstCall)

if rootDirectory:
coprocessor.SetRootDirectory(rootDirectory)

if make_cinema_table:
coprocessor.EnableCinemaDTable()

return coprocessor


#--------------------------------------------------------------
# Global variable that will hold the pipeline for each timestep
# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
# It will be automatically setup when coprocessor.UpdateProducers() is called the
# first time.
coprocessor = CreateCoProcessor()

#--------------------------------------------------------------
# Enable Live-Visualizaton with ParaView and the update frequency
coprocessor.EnableLiveVisualization(False, 1)

# ---------------------- Data Selection method ----------------------

def RequestDataDescription(datadescription):
"Callback to populate the request for current timestep"
global coprocessor

# setup requests for all inputs based on the requirements of the
# pipeline.
coprocessor.LoadRequestedData(datadescription)

# ------------------------ Processing method ------------------------

def DoCoProcessing(datadescription):
"Callback to do co-processing for current timestep"
global coprocessor

# Update the coprocessor by providing it the newly generated simulation data.
# If the pipeline hasn't been setup yet, this will setup the pipeline.
coprocessor.UpdateProducers(datadescription)

# Write output data, if appropriate.
coprocessor.WriteData(datadescription);

# Write image capture (Last arg: rescale lookup table), if appropriate.
coprocessor.WriteImages(datadescription, rescale_lookuptable=rescale_lookuptable,
image_quality=0, padding_amount=imageFileNamePadding)

# Live Visualization, if enabled.
coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<?xml version="1.0"?>
<CLBConfig version="2.0" output="/scratch/eait/uqtmitc3/thermocapillary/" permissive="true">
<!-- MODEL: d3q27_pf_thermocapillary
First test of temp field
<CLBConfig version="2.0" output="output/" permissive="true">
<!--
MODEL: d3q27_pf_velocity_thermo
Purpose: test bubble migration for paper,
T. Mitchell et al. Computational modelling of
three-dimensional thermocapillary flow of
recalcitrant bubbles using a coupled lattice
Boltzmann-finite difference method, PRE
Created: 17/04/2020
Responsible: @TravisMitchell
-->
Expand All @@ -23,22 +31,22 @@
<Param name="CenterZ" value="80"/>
<Param name="BubbleType" value="-1"/>
<Param name="Density_h" value="1"/>
<Param name="Density_l" value="1"/>
<Param name="Density_l" value="1"/>
<Param name="Viscosity_h" value="0.1"/>
<Param name="Viscosity_l" value="0.1"/>
<Param name="sigma" value="5e-3"/>
<Param name="M" value="0.05"/>
<Param name="IntWidth" value="4"/>
<Param name="T_init" value="16"/>
<Param name="T_ref" value="16"/>
<Param name="dT" value="0.1"/>
<Param name="sigma_T" value="-2.5e-4"/>
<Param name="T_init" value="0" zone="BottomWall"/>
<Param name="T_init" value="32" zone="TopWall"/>
<Param name="cp_h" value="1"/>
<Param name="cp_l" value="1"/>
<Param name="k_h" value="0.1"/>
<Param name="k_l" value="0.1"/>
<Param name="T_init" value="16"/>
<Param name="T_ref" value="16"/>
<Param name="dT" value="0.1"/>
<Param name="sigma_T" value="-2.5e-4"/>
<Param name="T_init" value="0" zone="BottomWall"/>
<Param name="T_init" value="32" zone="TopWall"/>
<Param name="cp_h" value="1"/>
<Param name="cp_l" value="1"/>
<Param name="k_h" value="0.1"/>
<Param name="k_l" value="0.1"/>
</Model>
<Init/>
<Container>
Expand Down
Loading

0 comments on commit 321354f

Please sign in to comment.