Showing posts with label Fluids. Show all posts
Showing posts with label Fluids. Show all posts

Wednesday, November 13, 2019

Saturday, October 19, 2019

Fluids mandatory lectures



Navier-Stokes-equations
[0] Thesis: Parallel architecture to solve NSE https://tel.archives-ouvertes.fr/tel-01152623/document


[1] https://www.quora.com/What-are-the-uses-of-the-Bernoulli-equations-Eulers-equations-and-the-Navier-Stokes-equations-and-when-do-we-apply-them
[2] Prof. Wang http://web.cse.ohio-state.edu/~wang.3602/
[2] http://web.cse.ohio-state.edu/~wang.3602/courses/cse3541-2019-fall/
[2] Course http://web.cse.ohio-state.edu/~wang.3602/courses/cse788-2011-fall/
[2.1] SPH Water Simulation equations http://web.cse.ohio-state.edu/~wang.3602/courses/cse788-2011-fall/results/Yi_Liu/SPH%20Water%20Simulation.htm
[3] https://www.comsol.jp/multiphysics/fluid-flow-conservation-of-momentum-mass-and-energy
[4] Matthias Müller http://matthias-mueller-fischer.ch/
[5] CFD Intro https://www.mathematik.uni-dortmund.de/~kuzmin/cfdintro/lecture1.pdf


Others
[1] CSG https://evanw.github.io/csg.js/

Thursday, September 26, 2019

PCA/WPCA

Video Lectures
[1] SVD to PCA https://www.youtube.com/watch?v=mBcLRGuAFUk

Lectures
[1] https://skymind.ai/wiki/eigenvector
[2] https://www.projectrhea.org/rhea/index.php/PCA_Theory_Examples


[3] PCA Theory Example http://www.cs.otago.ac.nz/cosc453/student_tutorials/principal_components.pdf

[4] Animation 2D PCA https://www.intmath.com/matrices-determinants/eigenvalues-eigenvectors-concept-applet.php


[5] PCA on OpenCV
https://robospace.wordpress.com/2013/10/09/object-orientation-principal-component-analysis-opencv/


[6] Wavelets, Fourier, Kalman http://www.cs.otago.ac.nz/cosc453/





Resources:
[1] https://machinelearningmastery.com/calculate-principal-component-analysis-scratch-python/
[2] https://jakevdp.github.io/PythonDataScienceHandbook/05.09-principal-component-analysis.html
[3] Draw 2D principal axis PCA https://stackoverflow.com/questions/18299523/basic-example-for-pca-with-matplotlib

Thursday, September 12, 2019

SPH on Python

Based on https://pysph.readthedocs.io/en/1.0a1/installation.html
                https://pysph.readthedocs.io/en/latest/installation.html
Examples https://pypi.org/project/PySPH/

python3.2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
python3 -m venv /path/to/new/virtual/environment
 
 
Object arrays cannot be loaded when allow_pickle=False
pip install numpy==1.16.1
pip3 install PyQt5

 [1] SPH on Python https://github.com/pypr/pysph

Saturday, August 31, 2019

Computer Graphics books




Basic in Fluids
Fluid Simulation for Computer Graphics Robert Bridson
The Art of Fluid Animation Jos Stam
Fluid Engine Development Doyub Kim


Fluid Simulations
 

 [1] Mathematics for 3D Game Programming and Computer Graphics


http://canvas.projekti.info/ebooks/Mathematics%20for%203D%20Game%20Programming%20and%20Computer%20Graphics,%20Third%20Edition.pdf
 [2] Computer Graphics Programming in OpenGL with C++
 [3] Opengl http://newton.uam.mx/xgeorge/uea/graficacion/(Morgan%20Kaufmann)%20Advanced%20Graphics%20Programming%20Using%20OpenGL%20(2005).pdf
 [4] 3D Graphics http://www.cse.chalmers.se/edu/year/2018/course/TDA361/LearningModern3DGraphicsProgramming.pdf
 [5]Foundations of 3D Computer Graphics
 [6] Interactive Computer Graphics https://inspirit.net.in/books/academic/Interactive%20Computer%20Graphics.pdf







Thursday, August 29, 2019

Anti Aliasing Lectures


Lectures
[1] http://cs248.stanford.edu/winter19content/lectures/02_drawtriangle/02_drawtriangle_slides.pdf
[2] http://graphics.stanford.edu/courses/cs348b-19-spring-content/lectures/08_sampling/08_sampling_slides.pdf
[3] http://www8.cs.umu.se/kurser/TDBC07/HT04/handouts/HO-lecture5.pdf


References:
[1] Super Sample http://hhoppe.com/proj/supersample/
Amortized Supersampling  http://hhoppe.com/supersample.pdf
[2] Sampling https://noahmjacobs.com/graphics/rasterizer/
[3] MultiSampling https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing
[4] Anti Aliasing https://vr.arvilab.com/blog/anti-aliasing

Super-sampling Anti-aliasing Analyzed https://pdfs.semanticscholar.org/ebd9/ddb08c4244fc7df00672cacb420212cdde54.pdf

Comparison for R.T. Applications http://jacoblongazo.com/documents/Anti-Aliasing%20Paper.pdf


Related:
[1] Deep Learning Super resolution (2019) https://arxiv.org/pdf/1808.03344.pdf

Saturday, August 17, 2019

Fluid Simulation:Compile Position Based Dynamics


PositionBasedDynamics is a library for the physically-based simulation of rigid bodies, deformable solids and fluids.

mkdir build
cd build
cmake ..

vi ../Demos/CMakeLists.txt

find_package(OpenMP)
if (OPENMP_FOUND)
     set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif(OPENMP_FOUND)

New Challenges:
Cuda version https://github.com/eric1221bday/PBF_15418

https://github.com/ebirenbaum/ParticleSolver
https://github.com/StoneBird/CIS565-FinalProject
https://github.com/chiwsy/Position_Based_Fluids

Resources:
[1] PBD https://github.com/InteractiveComputerGraphics/PositionBasedDynamics/




OpenCL version
[1] https://github.com/bwiberg/position-based-fluids

$git clone https://github.com/bwiberg/position-based-fluids.git
$cd position-based-fluids
$git submodule update --init --recursive #call dependences
$cmake -DCMAKE_BUILD_TYPE=Debug ..







Monday, August 12, 2019

Fluid Simulation Lectures and Code

MPM From FLIP From PIC

Lectures:

[1] https://en.wikipedia.org/wiki/Material_point_method
[2] SPH Simulation lecture http://web.cse.ohio-state.edu/~wang.3602/courses/cse788-2011-fall/results/Yi_Liu/SPH%20Water%20Simulation.htm

 Video Lectures
[1] Introduction to SPH https://www.youtube.com/watch?v=tAXHCAEgSuE #Spectral processing
[1] SPH Theory https://www.youtube.com/watch?v=3BGKn8PyIHo

Codes:
[1] http://rlguy.com/gridfluidsim/
[2] http://kbladin.se/dmt_projects/fluid_simulation.php

Friday, August 09, 2019

Computer Animation


Resources:
[1] Animación y Simulación Avanzada http://www.mastergraficos.com/asignatura/animacion-simulacion-avanzada/



DualSPHysics Compile



Resources:
[1] code https://github.com/DualSPHysics/DualSPHysics
[2] scripts to execute models https://github.com/fincahuanaco/DualSPHysicsScripts


[3] https://dual.sphysics.org/index.php/downloads/
[4] https://dual.sphysics.org/files/3313/8753/4540/DualSPHysics_v3.0_GUIDE.pdf
[5] https://github.com/DualSPHysics/DualSPHysics/wiki/12.-Testcases#obc7

Update 2021

compile GPU version (CMakeLists.txt will find cuda, display ${CUDA_VERSION} to verify if is getting the right version).

See https://melhorum.blogspot.com/2021/03/cuda-8-on-linux18.html to install CUDA and requeriments.

on DualSPHysics/src/source


mkdir build

cd build

export CC=/usr/bin/gcc-5;CXX=/usr/bin/g++-5 #for cuda 8


export CC=/usr/bin/gcc-6;CXX=/usr/bin/g++-6 #for cuda 9

cmake ..

make In some cases you need to reduce cuda version to execute simulation. in case of GeForce GTX 460(with Driver Version: 390.59). I was forced to change from cuda9(supported) to cuda8(supported too) to execute simulations with around 360k particles.


Make Model

[1] https://www.freecadweb.org/




SPH Solvers and related


Resources:
[1] Code Catalog https://spheric-sph.org/sph-projects-and-codes
[2] GPUSPH https://www.gpusph.org/downloads/
Not compile by g++>4.9 (require Cuda)

$git clone https://github.com/gpusph/gpusph.git
$CC=/usr/bin/gcc-4.9 CXX=/usr/bin/g++-4.9 make
$make
 
[3] Crixus(Boundary definition) https://github.com/Azrael3000/Crixus

[4] C++ library that enables computations over a set of particles or points in N-dimensional space (cell list, kd-tree or hyper oct-tree) https://github.com/aboria/Aboria
[5] Previous to Aboria https://github.com/martinjrobins/SPH-DEM



Thursday, August 08, 2019

Ocean References - Sources


https://www.fxguide.com/fxfeatured/siggraph-day-1-and-digipro/
ocean android https://arm-software.github.io/opengl-es-sdk-for-android/ocean_f_f_t.html
blender flip https://blendermarket.com/posts/flip-fluids-10-tips-to-improve-your-blender-workflow
standfor physic animation http://physbam.stanford.edu/

fast gpu fluid gvdb http://www.cs.utah.edu/~kwu/gvdb_sim.html

cuda openpbd http://joelgross.me/projects/pbf.html

others
[1] https://www.cs.cmu.edu/~kmcrane/Projects/GPUFluid/
[2] https://www.yiningkarlli.com/projects/arielflip.html
[3] https://developer.nvidia.com/nvidia-flow
[4] https://github.com/rlguy/Blender-FLIP-Fluids
[5] http://www.smart-coding.net/tag/irregular-sea-wave/
[6] http://revers.keep.pl/
[7] https://developer.nvidia.com/content/fluid-simulation-alice-madness-returns
[8] http://peterkutz.com/sph/

Thursday, August 01, 2019

To read

https://www.maxwell.vrac.puc-rio.br/colecao.php?strSecao=resultado&nrSeq=12140@1
https://www.maxwell.vrac.puc-rio.br/colecao.php?strSecao=resultado&nrSeq=11074@2

Code:

 [3] https://github.com/NCCA/NGL
 https://www.sidefx.com/download/houdini-for-linux/
 [4] SPH/Muller https://github.com/bigthetaio/mueller-sph
       Tutorial https://bigtheta.io/2017/07/08/implementing-sph-in-2d.html
       Dependences: 
       sudo apt install freeglut3-dev
       sudo apt install libeigen3-dev
Surface Reconstruction :
[1] Detail Preserved Surface Reconstruction from
Point Cloud
{2}Deep Level Sets: Implicit Surface Representations for 3D Shape Inference
https://math.berkeley.edu/~sethian/2006/Papers/sethian.annualreview.2003.pdf
https://ascelibrary.org/doi/10.1061/%28ASCE%29SU.1943-5428.0000159
 [3] surface reconstruction from volume fraction https://arxiv.org/pdf/1801.05382.pdf
[4] Level Set methods for fluid interfaces https://www.ljll.math.upmc.fr/~frey/ftp/NM491/11.Sethian%20J.A.,%20Smereka%20P.,%20Level%20set%20methods%20for%20fluid%20interfaces.pdf

Write Scheme
[1] Fluid Simulation on AR https://cgl.ethz.ch/Downloads/Publications/Papers/2019/Tia19a/Tia19a.pdf


Model 3D:
Scene to 3D pose model
https://www.profillic.com/paper/arxiv:1907.11346


Thesis:
 [0]  https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/
 [1] Position Based Fluid https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc16/09/mpthesis.pdf
 [2] https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc18/07/M_Volpicelli_i7630684_MScMajorProject_Report.pdf
 [3] https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc16/15/thesis.pdf
 [4] Museth http://www.museth.org/Ken/Publications_files/meis2013_abstract_museth.pdf


Relate Concepts:

https://en.wikipedia.org/wiki/Volume_rendering
https://link.springer.com/chapter/10.1007/978-3-642-76286-4_5#citeas
https://arxiv.org/pdf/1812.04233.pdf
http://pages.mtu.edu/~chaoliw/research/vg05-pmvrt.pdf
http://idav.ucdavis.edu/~okreylos/ResDev/VolVis/index.html
http://faculty.cs.tamu.edu/schaefer/research/wavelet_rasterization.pdf
https://en.wikipedia.org/wiki/Rasterisation
https://en.wikipedia.org/wiki/Voxel
https://en.wikipedia.org/wiki/3D_rendering
https://en.wikipedia.org/wiki/3D_computer_graphics
https://en.wikipedia.org/wiki/Computer_animation

Others

 [2] mapreduce on Python http://hplgit.github.io/map-reduce4sci/doc/pub/MapReduce.html

Points processing and Modeling


Surface Points

Resources:
[1] HPR Python https://github.com/williamsea/Hidden_Points_Removal_HPR

References:
[1] http://www.weizmann.ac.il/math/ronen/sites/math.ronen/files/uploads/katz_tal_basri_-_direct_visibility_of_point_sets.pdf
[2] https://www.cv-foundation.org/openaccess/content_iccv_2015/papers/Katz_On_the_Visibility_ICCV_2015_paper.pdf
[3] 2010 binary orientation tree http://graphics.im.ntu.edu.tw/docs/pg10.pdf
[4] 2014 Image Space Rendering of Point Clouds Using the HPR Operator
[5] https://www.lcg.ufrj.br/thesis/renan-machado-silva-MSc.pdf

3D Modeling
[1] Benchmark http://caor-mines-paristech.fr/en/research/point-cloud-and-3d-modeling-pc3dm/
[2] CFD on 3D Point Set Surfaces http://caor-mines-paristech.fr/en/research/point-cloud-and-3d-modeling-pc3dm/
[3] 

Sunday, July 21, 2019

Fluid Simulation Lectures

Software:
[1] https://google.github.io/liquidfun/
[2] http://www.palabos.org/software/download
[3] Games https://github.com/gameprogcpp/code

References:
[1] NVidia FLIP
http://www.cemyuksel.com/research/papers/fast_fluid_simulations_with_sparse_volumes_on_the_gpu.pdf
https://link.springer.com/article/10.1007/s40722-016-0062-6
https://ascelibrary.org/doi/abs/10.1061/%28ASCE%29HY.1943-7900.0001132?src=recsys
http://www.danenglesson.com/images/portfolio/FLIP/rapport.pdf
http://www.cs.jhu.edu/~misha/MyPapers/ToG13.pdf

Resources:
[1] https://blog.yiningkarlli.com/2014/02/flip-meshing-pipeline.html
[2] https://www.yiningkarlli.com/projects/arielflip.html
https://www.lancemore.jp/ls-dyna/index_en.html
https://www.lancemore.jp/ls-dyna/example_471.html
https://cfd.direct/openfoam/user-guide/v6-dambreak/
https://books.google.com.br/books?id=G-d1DwAAQBAJ&pg=PA779&lpg=PA779&dq=dam+break+simulation+code
 https://www.youtube.com/watch?v=GQvOlkQqRk0
 https://dual.sphysics.org/2ndusersworkshop/2016/Dominguez_Fourtakas_PPT_2ndUsersWorshop_161205_GF.pdf

Friday, July 19, 2019

OpenFoam



https://unicfd.ru/en/training-tracks/learning-how-to-use-free-surface-flows-in-openfoam-4-1/
https://www.scribd.com/document/44776293/OpenFoam-Examples

Monday, July 01, 2019

Video file to gif animation

ffmpeg can create gif from mp4/mpeg file, but create low quality, for resolve this we need to create a palette for increase quality.

Create palette colors
$ffmpeg -i file.mpeg -vf fps=15,scale=-1:-1:flags=lanczos,palettegen  palette.png

Use palette for create gif from complete mp4 file
$ffmpeg -i file.mp4 -i palette.png -filter_complex "fps=15,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" out_full.gif

Use palette for create gif from mp4 file (from 0:55 and 9seconds)
$ffmpeg -ss 0:55 -t 9 -i file.mp4 -i palette.png -filter_complex "fps=15,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" out_fraction.gif

Without palette
$ffmpeg -i imagebind.mp4  -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - imagebind.gif


Convert png files list to mp4 (two ways)

$avconv -r 20 -i buffer/plot%d.png -b:v 4000k animation_h1.mp4

$ffmpeg -i buffer/plot%d.png -r 20 -b 4M animation_h2.mp4

Convert jpg files into mp4
$ffmpeg -framerate 1 -i frames/f%d.jpg -r 2 -pix_fmt yuv420p video.mp4
$ffmpeg -framerate 10 -i Dragon.%04d.png -r 2 -pix_fmt yuv420p video.mp4



Cut/Extract video fraction same quality no filter/codec
$ffmpeg -ss 3:19 -t 4 -i Moana_WaterFX.mp4 -vcodec copy -acodec copy Moana_f3.mp4

Convert mp4 to gif using palette and resizing
$ffmpeg -i psplat2_4k.mp4 -i palette_psplat2_4k.png -filter_complex "fps=15,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" -s 346x264 psplat2_4k.gif

$ffmpeg -i fluidhoudini.mp4 -i palette.png -filter_complex "fps=15,scale=-1:-1:flags=lanczos[x];[x][1:v]paletteuse" -s 640x480 fluidhoudini_palette_640.gif



Crop image video
To crop a 528×336 section, starting from position (264, 30):

ffmpeg -i first_256.mp4 -filter:v "crop=528:336:264:30" -c:a copy first_256_crop.mp4 
#ffmpeg -i in.mp4 -filter:v "crop=out_w:out_h:x:y" out.mp4
 

Error on Image Magick (convert) 

convert-im6.q16: cache resources exhausted

open file /etc/ImageMagick-6/policy.xml and change

<policy domain="resource" name="disk" value="1GiB"/>

To

<policy domain="resource" name="disk" value="8GB"/>
 
Or
 
<!-- disable ghostscript format types -->
<policy domain="coder" rights="none" pattern="PS" />
<policy domain="coder" rights="none" pattern="EPS" />
<policy domain="coder" rights="none" pattern="PDF" /> <------- Here!!
<policy domain="coder" rights="none" pattern="XPS" />

To

<policy domain="coder" rights="read | write" pattern="PDF" /> 

#Change by code

sed -i -E 's/name="memory" value=".+"/name="memory" value="1GiB"/g' /etc/ImageMagick-6/policy.xml
sed -i -E 's/name="map" value=".+"/name="map" value="1GiB"/g' /etc/ImageMagick-6/policy.xml
sed -i -E 's/name="area" value=".+"/name="area" value="1GiB"/g' /etc/ImageMagick-6/policy.xml
sed -i -E 's/name="disk" value=".+"/name="disk" value="4GiB"/g' /etc/ImageMagick-6/policy.xml

Recommended resolution & aspect ratios

For the default 16:9 aspect ratio, encode at these resolutions:

  • 2160p: 3840x2160
  • 1440p: 2560x1440
  • 1080p: 1920x1080
  • 720p: 1280x720
  • 480p: 854x480
  • 360p: 640x360
  • 240p: 426x240
 
Online tools
[1] Crop gifs https://ezgif.com
 
 
 
 
 

Thursday, March 21, 2019

Cuda Installation resources





Cuda 10:
[1] last version https://developer.nvidia.com/cuda-downloads
Cuda 8:

#error -- unsupported GNU version! gcc versions later than 5 are not supported!
#error -- unsupported GNU version! gcc versions later than 5 are not supported!


$ sudo ln -s /usr/bin/gcc-4.9 /usr/local/cuda/bin/gcc
$ sudo ln -s /usr/bin/g++-4.9 /usr/local/cuda/bin/g++
 
 

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).



[1] https://developer.nvidia.com/cuda-80-ga2-download-archive

Running apps

Runtastic (I uninstalled because force to update your device - Internet connection problems) Runkeeper  (Wrong GPS tracking) Strava   (Curr...