GithubHelp home page GithubHelp logo

zfengyan / geocfd Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9.5 MB

Process geometry for CFD simulation.

License: GNU General Public License v3.0

CMake 0.07% C++ 99.93%
cfd-simulation cityjson cplusplus cpp geometry json internal-faces

geocfd's Introduction

geoCFD

License: GPL v3

Process geometry for CFD simulation - remove internal faces between adjacent buildings.

  • support for all LoD levels in cityjson(lod 1.2, lod 1.3, lod 2.2).

  • support multithreading process (for one adjacent block).

  • support exporting as .json file or .off file.

  • visualisation:

    ninja

  • validate the result file via:

Usage

Compile and build it, run the command ./geocfd --help to print the usage information:

usage: geocfd --dataset=string --adjacency=string --path_result=string [options] ...
options:
  -d, --dataset               dataset (.json) (string)
  -a, --adjacency             adjacency file (.txt) (string)
  -p, --path_result           where the results will be saved (string)
  -l, --lod                   lod level (double [=2.2])
  -m, --minkowski             minkowski value (double [=0.01])
  -e, --target edge length    target edge length for remeshing (double [=3])
      --remesh                activate remeshing processing (warning: time consuming)
      --multi                 activate multi threading process
      --json                  output as .json file format
      --off                   output as .off file format
      --all                   adjacency file contains all adjacent blocks
      --help                  print this message

Note

  • for all adjacency mode, multi threading should not be enabled (if enabled from the console, it will be switched off).

    The reason is multi threading didn't work as desired when reading all adjacencies.

  • for all adjacency mode, flag --all must be provided.

examples

example 1 - read in one adjacency file, enable multi threading, output as .off file:

./geocfd -d 3dbag_v210908_fd2cee53_5907.json -a adjacency5.txt -p D:\SP\geoCFD\data --multi --off

dataset: dataset

adjacency file: adjacency5.txt

example 2 - read in all adjacencies file, in combination with --all flag:

./geocfd -d dataset.json -a adjacencies.txt -p D:\geoCFD\data --all --off

dataset: dataset

adjacencies file: adjacencies.txt

Note

  • if the program does not exit, you may need to re-open your console again and re-run it. (for example, dataset_2).

    This may be due to the complex geometry of the buildings in dataset_2, one of the buildings contain holes.

  • the minkowski param is set to 0.01 by default.

    The param can be altered, but proceed with caution, too small minkowski param may not fill the holes of the building in dataset_2.

Prerequisite

CGAL - The version should be above 5.0 since we can use the header-only, which means we don't have to manually compile CGAL.

install CGAL via vcpkg:

check this ->

install vcpkg

Download CGAL for Windows

Compile info

C++ Standard: C++ 11

Compiler: MSVC

Generator: Ninja

Commands:

"..\MICROSOFTVISUALSTUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  
-G "Ninja"  
-DCMAKE_BUILD_TYPE:STRING="RelWithDebInfo" 
-DCMAKE_INSTALL_PREFIX:PATH="..\geoCFD\out\install\x64-Release" 
-DCMAKE_C_COMPILER:FILEPATH="../MicrosoftVisualStudio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe" 
-DCMAKE_CXX_COMPILER:FILEPATH="../MicrosoftVisualStudio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe"  
-DCMAKE_MAKE_PROGRAM="..\MICROSOFTVISUALSTUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" 
-DCMAKE_TOOLCHAIN_FILE="../dev/vcpkg/scripts/buildsystems/vcpkg.cmake" 

The commands are the information of compiler and generator(for example, the file path of cl.exe and ninja.exe), which should be generated by your IDE automatically.

Other platforms

If you use other platforms (such as Linux or MacOS), you can refer to CMakeLists.txt file and use it to build a CMake project using src, include and data folder.

Attention

  • if the input adjacency file contains multiple adjacent blocks, be sure to add --all flag, otherwise geoCFD may exit with unkown errors.
  • currently multi threading doesn't work with the input of multiple adjacent blocks, thus even the flag --multi is specified, geoCFD will not enable multi threading process.
  • there is one possibility that minkowski sum will be in executing status for unkown time, if so restart geoCFD.
  • remeshing is sort of beta version, it should be warned that remeshing will be time-consuming, thus it is not recommended to activate.
  • it may take time for multiple adjacent blocks.
  • all adjacencies file need to meet some specific "format", see here for an example (please be aware that if you download the .txt file you will find it contains 19 lines but in GitHub it only shows 18 lines).

geocfd's People

Contributors

zfengyan avatar

Watchers

 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.