Skip to content

Commit

Permalink
Create a postprocessing function for cfd-dem (#1147)
Browse files Browse the repository at this point in the history
Description of the problem
There were no post-processing functions for cfd-dem, so we need framework to organize them
We need the post-processing function which calculate total volume in order to check if total volume is conserved

Description of the solution
Create postprocessing_cfd_dem.cc and call it in cfd_dem_coupling.cc
Create some prameters for prm file

How Has This Been Tested?
Launched several example, and confirmed that the volume calculated with analytical solution is matched with the volume of geometry

Co-authored-by: Victor Oliveira Ferreira <65647639+voferreira@users.noreply.github.com>
Co-authored-by: Bruno Blais <blais.bruno@gmail.com>
  • Loading branch information
3 people committed Jun 6, 2024
1 parent 9f4acd0 commit 2c19eab
Show file tree
Hide file tree
Showing 18 changed files with 656 additions and 0 deletions.
9 changes: 9 additions & 0 deletions applications_tests/lethe-fluid-particles/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ file(COPY dynamic_contact_search_files/dem.triangulation.info DESTINATION "${CMA
file(COPY dynamic_contact_search_files/dem.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")
file(COPY dynamic_contact_search_files/dem.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/dynamic_contact_search.${_build_type}/mpirun=1/")

file(COPY conserve_phase_volumes_files/dem.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem.simulationcontrol DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem.triangulation DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem.triangulation.info DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem.triangulation_fixed.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")
file(COPY conserve_phase_volumes_files/dem.triangulation_variable.data DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/conserve_phase_volumes.${_build_type}/mpirun=1/")

file(COPY liquid_fluidized_bed_files/dem.particles DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/liquid_fluidized_bed.${_build_type}/mpirun=1/")
file(COPY liquid_fluidized_bed_files/dem.pvdhandler DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/liquid_fluidized_bed.${_build_type}/mpirun=1/")
file(COPY liquid_fluidized_bed_files/dem.simulationcontrol DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/liquid_fluidized_bed.${_build_type}/mpirun=1/")
Expand Down Expand Up @@ -74,4 +82,5 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set_tests_properties(lethe-fluid-particles/restart_particle_sedimentation.mpirun=1.debug PROPERTIES TIMEOUT 1200)
set_tests_properties(lethe-fluid-particles/dynamic_contact_search.mpirun=1.debug PROPERTIES TIMEOUT 1200)
set_tests_properties(lethe-fluid-particles/liquid_fluidized_bed.mpirun=1.debug PROPERTIES TIMEOUT 5000)
set_tests_properties(lethe-fluid-particles/conserve_phase_volumes.mpirun=1.debug PROPERTIES TIMEOUT 5000)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Running on 1 MPI rank(s)...
DEM time-step is 2.186842813% of Rayleigh time step
Reading DEM checkpoint
Finished reading DEM checkpoint
10000 particles are in the simulation
Number of active cells: 4500
Number of degrees of freedom: 21504
Volume of triangulation: 0.001
---------------------------------------------------------------
Initializing DEM parameters
Warning: expansion of particle-wall contact list is disabled.
This feature is useful in geometries with concave boundaries.
Finished initializing DEM parameters
DEM time-step is 1e-05 s
--------------
Void Fraction
--------------

*********************************************************************************
Transient iteration: 1 Time: 0.0001 Time step: 0.0001 CFL: 0.00104947
*********************************************************************************
--------------
Void Fraction
--------------
-------------------------------
Volume-Averaged Fluid Dynamics
-------------------------------
----
DEM
----
DEM contact search at dem step 0
Finished 10 DEM iterations
---------------------------------------------------------------
Total volume of fluid: 0.8558614008 m^3
Total volume of particles: 0.1409160992 m^3
Global continuity equation error: -8.247081136e-13 s^-1
Max local continuity error: 2.939360858e-07 s^-1

*********************************************************************************
Transient iteration: 2 Time: 0.0002 Time step: 0.0001 CFL: 0.00467056
*********************************************************************************
--------------
Void Fraction
--------------
-------------------------------
Volume-Averaged Fluid Dynamics
-------------------------------
----
DEM
----
DEM contact search at dem step 9
Finished 10 DEM iterations
---------------------------------------------------------------
Total volume of fluid: 0.8558614008 m^3
Total volume of particles: 0.1409160992 m^3
Global continuity equation error: -1.170125066e-11 s^-1
Max local continuity error: 2.667651567e-07 s^-1

*********************************************************************************
Transient iteration: 3 Time: 0.0003 Time step: 0.0001 CFL: 0.00426005
*********************************************************************************
--------------
Void Fraction
--------------
-------------------------------
Volume-Averaged Fluid Dynamics
-------------------------------
----
DEM
----
DEM contact search at dem step 9
Finished 10 DEM iterations
---------------------------------------------------------------
Total volume of fluid: 0.8558614008 m^3
Total volume of particles: 0.1409160992 m^3
Global continuity equation error: -4.68769759e-12 s^-1
Max local continuity error: 2.432011016e-07 s^-1
253 changes: 253 additions & 0 deletions applications_tests/lethe-fluid-particles/conserve_phase_volumes.prm
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
# Listing of Parameters
#----------------------

set dimension = 3

#---------------------------------------------------
# Simulation Control
#---------------------------------------------------

subsection simulation control
set method = bdf1
set number mesh adapt = 0
set output name = result_
set output frequency = 0
set startup time scaling = 0.6
set time end = 0.0003
set time step = 0.0001
set subdivision = 1
set log precision = 10
end

#---------------------------------------------------
# Restart
#---------------------------------------------------

subsection restart
set checkpoint = false
set frequency = 100
set restart = false
set filename = case
end

#---------------------------------------------------
# FEM
#---------------------------------------------------

subsection FEM
set velocity order = 1
set pressure order = 1
end

#---------------------------------------------------
# Physical Properties
#---------------------------------------------------

subsection physical properties
subsection fluid 0
set kinematic viscosity = 0.0000008379
set density = 996.7775
end
end

#---------------------------------------------------
# Mesh
#---------------------------------------------------

subsection mesh
set type = dealii
set grid type = subdivided_hyper_rectangle
set grid arguments = 15,20,15:-0.05,-0.05,-0.05:0.05,0.05,0.05:true
set initial refinement = 0
set expand particle-wall contact search = false
end

#---------------------------------------------------
# Void Fraction
#---------------------------------------------------

subsection void fraction
set mode = pcm
set read dem = true
set dem file name = dem
set l2 smoothing factor = 0.00000125
set l2 lower bound = 0
set l2 upper bound = 1
set bound void fraction = false
end

#---------------------------------------------------
# CFD-DEM
#---------------------------------------------------

subsection cfd-dem
set grad div = false
set void fraction time derivative = false
set drag force = true
set buoyancy force = true
set shear force = true
set pressure force = true
set drag model = difelice
set coupling frequency = 10
set vans model = modelB
set particle statistics = false
end

#---------------------------------------------------
# Post-processing
#---------------------------------------------------

subsection post-processing

set output frequency = 1

set verbosity = verbose

set calculate phase volumes = true
end

#---------------------------------------------------
# Boundary Conditions
#---------------------------------------------------

subsection boundary conditions
set time dependent = true
set number = 5
subsection bc 0
set id = 0
set type = slip
end
subsection bc 1
set id = 1
set type = slip
end
subsection bc 2
set id = 4
set type = slip
end
subsection bc 3
set id = 5
set type = slip
end
subsection bc 4
set id = 2
set type = function
subsection u
set Function expression = 0
end
subsection v
set Function expression = 0.1
end
subsection w
set Function expression = 0
end
end
end

#---------------------------------------------------
# Timer
#---------------------------------------------------

subsection timer
set type = none
end

#---------------------------------------------------
# Model parameters
#---------------------------------------------------

subsection model parameters
subsection contact detection
set contact detection method = dynamic
set dynamic contact search size coefficient = 0.9
set neighborhood threshold = 1.8
end
subsection load balancing
set load balance method = dynamic
set threshold = 0.5
set dynamic check frequency = 10000
end
set particle particle contact force method = hertz_mindlin_limit_overlap
set particle wall contact force method = nonlinear
set integration method = velocity_verlet
set rolling resistance torque method = no_resistance
end

#---------------------------------------------------
# Physical Properties
#---------------------------------------------------

subsection lagrangian physical properties
set gx = 0
set gy = -9.81
set gz = 0
set number of particle types = 1
subsection particle type 0
set size distribution type = uniform
set diameter = 0.003
set number of particles = 10000
set density particles = 2505
set young modulus particles = 1000000
set poisson ratio particles = 0.3
set restitution coefficient particles = 0.97
set friction coefficient particles = 0.1
set rolling friction particles = 0.2
end
set young modulus wall = 1000000
set poisson ratio wall = 0.3
set restitution coefficient wall = 0.33
set friction coefficient wall = 0.3
set rolling friction wall = 0.3
end

#---------------------------------------------------
# Floating walls
#---------------------------------------------------

subsection floating walls
set number of floating walls = 1
subsection wall 0
subsection point on wall
set x = 0
set y = -0.04
set z = 0
end
subsection normal vector
set nx = 0
set ny = 1
set nz = 0
end
set start time = 0
set end time = 50
end
end

#---------------------------------------------------
# Non-Linear Solver Control
#---------------------------------------------------

subsection non-linear solver
subsection fluid dynamics
set tolerance = 1e-9
set max iterations = 10
set verbosity = quiet
end
end

#---------------------------------------------------
# Linear Solver Control
#---------------------------------------------------

subsection linear solver
subsection fluid dynamics
set method = gmres
set max iters = 5000
set relative residual = 1e-3
set minimum residual = 1e-12
set preconditioner = ilu
set ilu preconditioner fill = 0
set ilu preconditioner absolute tolerance = 1e-14
set ilu preconditioner relative tolerance = 1
set verbosity = quiet
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0 0 10000 14 10000
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
8
Time File
0.05 out.1000.pvtu
0.1 out.2000.pvtu
0.15 out.3000.pvtu
0.2 out.4000.pvtu
0.25 out.5000.pvtu
0.3 out.6000.pvtu
0.35 out.7000.pvtu
0.4 out.8000.pvtu
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Simulation control
dt_0 5e-05
dt_1 5e-05
dt_2 5e-05
dt_3 5e-05
CFL 0
Time 0.4
Iter 8000
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version nproc n_attached_fixed_size_objs n_attached_variable_size_objs n_coarse_cells
5 1 0 1 4500
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 2c19eab

Please sign in to comment.