# sandbox/ghigo/README

This ‘README’ provides on overview of the content of my sandbox.

# Blood Flow Modeling

## Code

- 1D blood flow model
- 1D blood flow model with 2nd-order hydrostatic reconstruction
- Adaptive mesh refinement compatible with hydrostatic reconstruction

## 1D blood flow examples

- Inviscid wave propagation in an artery
- Inviscid tourniquet
- Inviscid analytic solution by O. Delestre
- Viscous wave propagation
- Thacker solution - Oscillations in an aneurysm
- Steady solution in a stenosis
- Inviscid wave propagation in a tapered artery

## 1D blood flow examples with 2nd-order hydrostatic reconstruction

and mesh adaptation

- Inviscid wave propagation in an artery:
- Inviscid tourniquet:
- Inviscid analytic solution by O. Delestre:
- Thacker solution - Oscillations in an aneurysm:
- Steady solution in a stenosis:
- Inviscid wave propagation in a tapered artery:

# Particle-Ladden Flows

## Code

- myembed.h: modified embed.h
*csm1*: volume fraction from the previous timestep, used to track emerged and submerged cells in case of a moving embedded boundary;- flag
*emerged*: used to indicate if emerged cells have been updated and should be used when extrapolating or restricting/refining on trees; - modified bilinear_embed to avoid the use of values in emerged cells (
*csm1=0*) when the emerged cells have not yet been updated (flag*emerged=false*); - should we also modify
*restriction_average*for the multigrid solver?

- 2D/3D interpolation of cell centered field on embedded boundary: embed_interpolate
- 2D/3D force computation on embedded boundaries: embed_force;
- 2D/3D torque computation on embedded boundaries: embed_torque;
- Neumann to Dirichlet boundary condition on embedded boundary (reverse engineering of the dirichlet_gradient): neumann_scalar;
- extrapolation of a cut-cell cell-centered value: embed_extrapolation. Only linear polynomial extrapolation is used to avoid unphysical extrapolated values;

- small cell treatment in update_tracer: accounts for (i) a non-zero face-velocity
*uf*boundary conditions on the embedded boundary and (ii) the variation of the volume of the cut-cell in case of a moving embedded boundary. See Colella et al., 2006, Schneiders et al., 2013 and Miller and Trebotich, 2012).

- myembed-tree-moving.h: modified embed-tree.h
- modification of restriction_embed_linear and refine_embed_linear to avoid the use of values in emerged cells (
*csm1=0*) when the emerged cells have not yet been updated (flag*emerged=false*); - correction of error on boundary index when using embed_gradient.

- modification of restriction_embed_linear and refine_embed_linear to avoid the use of values in emerged cells (

#### Navier-Stokes equations

- mypoisson.h: modified poisson.h
- in project, the r.h.s. \nabla \cdot u_f now takes into account non-zero face-velocity
*uf*boundary conditions on embedded boundary.

- in project, the r.h.s. \nabla \cdot u_f now takes into account non-zero face-velocity
- myembed-moving.h: functions and hooks to the centered.h events to account for moving embedded boundaries:
- solid rigid body velocity Dirichlet boundary condition: \displaystyle \mathbf{u} = \mathbf{u_p} + \omega_p \times \mathbf{r}.
- moving body Neumann boundary condition: \displaystyle \frac{\partial p}{\partial n} = -\rho_f \frac{\mathrm{D} \mathbf{u}}{\mathrm{D}t} \cdot \mathbf{n} = -\rho_f \left( \frac{\mathrm{d} \mathbf{u_p}}{\mathrm{d}t} + \frac{\mathrm{d} \mathbf{\omega_p}}{\mathrm{d}t} \times \mathbf{r} + \mathbf{\omega_p} \times \mathbf{\omega_p} \times \mathbf{r} \right) \cdot \mathbf{n}.
- modified embed_gradient to account for both the acceration
*a*and solid rigid body acceleration when performing restriction operations in pathological situations; - hook the the event
*stability*to account for solid body velocity when computing the timestep; - hook to the event
*advection_term*to update solid (*cs=0*) and emerged (*csm1=0*) cells, using the function embed_extrapolate.

#### Advection-diffusion of a tracer field

- mytracer.h: modified tracer.h
- hook to the event
*advection_term*to update solid (*cs=0*) and emerged (*csm1=0*) cells, using the function embed_extrapolate.

- hook to the event
- mydiffusion.h: modified diffusion.h
- multiplied all non-Laplacian by
*cs*.

- multiplied all non-Laplacian by

#### Fluid-particle coupling

- myembed-particle.h: functions and hooks to the centered.h events to account for moving particles.

## Test cases

#### Poisson equation

- Poisson equation on a 2D complex domain with Dirichlet boundary conditions:
- Poisson equation on a 2D complex domain with Neumann boundary conditions:
- Poisson equation on a 3D complex domain with Dirichlet boundary conditions:
- Poisson equation on a 3D complex domain with Neumann boundary conditions:

#### Heat equation

Note that in the following examples, only 3 points have been used to obtain spatial convergence orders. This is done to speedup computations on the wiki. However, similar orders of convergence are obtained using 4 points.

- Heat equation in a 3D sphere with time-dependent Dirichlet boundary conditions:
- Heat equation in a 3D sphere with time-dependent Neumann boundary conditions:
- Heat equation in a shrinking 3D sphere with time-dependent Dirichlet boundary conditions - effect of submerged cells:
- Heat equation in a shrinking 3D sphere with time-dependent Neumann boundary conditions - effect of submerged cells:
- Heat equation in a expanding 3D sphere with time-dependent Dirichlet boundary conditions - effect of emerged cells:
- Heat equation in a expanding 3D sphere with time-dependent Neumann boundary conditions - effect of emerged cells:

#### Stokes equations

- Poiseuille flow in a periodic channel inclined at 45 degrees
- Couette flow between rotating cylinders:
- Wannier flow between rotating excentric cylinders
- Stream flow past a periodic array of cylinders: hydrodynamic forces computation
- Stream flow past a periodic array of spheres:
- Stokes flow through a complex porous medium
- Stokes flow through a complex porous medium, randomly refined
- Stream flow past sphere: hydrodynamic force computation
- Rotational flow around a sphere: hydrodynamic torque computation
- Sphere moving (but fixed) near a wall in a quiescent flow: hydrodynamic force computation
- Stream flow past cylinder moving at the same speed:
- fixed embedded boundaries, uniform mesh
- moving embedded boundaries, uniform mesh
- moving embedded boundaries, adaptive mesh
- fixed embedded boundaries, uniform mesh, double projection
- moving embedded boundaries, uniform mesh, double projection
- moving embedded boundaries, adaptive mesh, double projection

#### Advection-diffusion equation

- Advection-diffusion around a cylinder at Pe=100 with imposed face-velocity
*uf*: - Advection-diffusion around a sphere at Pe=50 with imposed face-velocity
*uf*: - Advection-diffusion around a cylinder at Re = 40 with Dirichlet boundary conditions for the tracer:
- Advection-diffusion around a cylinder at Re = 1 with Neumann boundary conditions for the tracer:
- Advection-diffusion around a sphere at Re = 40 with Dirichlet boundary conditions for the tracer:

#### Navier-Stokes equations

- Stability of the embedded face velocity interpolation
- Hydrostatic balance with refined embedded boundaries
- Hydrostatic balance with refined embedded boundaries in 3D
- Stream flow past cylinder moving at the same speed:
- fixed embedded boundaries, uniform mesh
- moving embedded boundaries, uniform mesh
- moving embedded boundaries, adaptive mesh
- fixed embedded boundaries, uniform mesh, double projection
- moving embedded boundaries, uniform mesh, double projection
- moving embedded boundaries, adaptive mesh, double projection

- Vortex shedding behind a cylinder for different Re:
- Vortex shedding behind a confined circular cylinder for different Re:
- Starting flow around a cylinder at Re=1000:
- Rotation cylinder in a steam flow at Re=200:

#### Navier-Stokes equations, free motion of embedded boundary

#### Test cases for moving embedded boundaries with imposed motion

- Cylinder moving at the same speed as the fluid: Re=1000
- with single projection: moving_steady2x.c
- with double projection: moving_steady2y.c

- Oscillating cylinder in a quiescent fluid at Re=100 and KC=5: comparison with results from Dutsch et al., 1998
- with single projection: oscillating1x.c
- with double projection: oscillating1y.c

- Oscillating cylinder in a quiescent fluid at Re=200 and KC=10: comparison with results from Dutsch et al., 1998
- with single projection: oscillating2x.c
- with double projection: oscillating2y.c

- Oscillating sphere in a quiescent fluid at Re=40 and St=3.2: comparison with results from Schneiders et al., 2013
- with double projection: oscillating4x.c

- Vertically oscillating cylinder in a stream flow at Re=185: comparison with results from Guilmineau et al.,2002
- f=0.8f_0 with single projection: oscillating3x.c
- f=1.2f_0 with double projection: oscillating3y.c

- Starting flow around a moving cylinder: comparison with starting flow around an static cylinder
- Re = 1000: moving_starting1x.c
- Re = 9500 (underresolved): moving_starting2x.c

- Starting vortex of a NACA2414 airfoil:
- Flow past a cylinder: computation of the Strouhal number St for different 200 \leq Re \leq 500
- static cylinder with double projection: strouhal.c
- moving cylinder with double projection: moving_strouhal.c

- Flow past a square cylinder: computation of the Strouhal number St for different 250 \leq Re \leq 1000 and comparison with Okajima & al., 1982
- static cylinder with double projection: square1.c
- moving cylinder with double projection: moving_square1.c

- Flow past a rectangular cylinder (B/H=2): computation of the Strouhal number St for different 250 \leq Re \leq 1000 and comparison with Okajima & al., 1982
- static cylinder with double projection: square2.c
- moving cylinder with double projection: moving_square2.c

- Pitching NACA0015 airfoil: comparison with Schneiders et al., 2013 (results for Ma=0.3)
- 2D, with double projection: pitching-naca0015.c

#### Test cases for moving embedded boundaries with fluid-solid coupling

- Cylinder settling in a square box for Ga = 1: comparison with drag correction of Faxén,1946
- with single projection: settling_cylinder1x.c
- with double projection: settling_cylinder1y.c

#### Test cases for moving embedded boundaries with passive scalar

- Translating cylinder at Re=40 and Pe=100:
- single projection and passive scalar on the bottom half ot the domain and Dirichlet boundary conditions f=0: moving_scalar1x.c
- double projection and passive scalar with Dirichlet boundary conditions f=1: moving_scalar1y.c

- Translating cylinder at Re=400: test Strouhal number St of the Bénard–von Kármán Vortex Street
- single projection and passive scalar with Pe=100 and Neumann boundary conditions \nabla f \cdot n = 1: moving_scalar2x.c
- double projection and passive scalar with Pe = 1 and Neumann boundary conditions \nabla f \cdot n = 1: moving_scalar2y.c

## Potential bugs?

## References

[schneiders2013] |
L. Schneiders, D. Hartmann, M. Meinke, and W. Schroder. An accurate moving boundary formulation in cut-cell methods. |

[miller2012] |
G. Miller and D. Trebotich. An embedded boundary method for the navier–stokes equations on a time-dependent domain. |

[colella2006] |
Phillip Colella, Daniel Graves, Benjamin Keen, and Modiano David. A cartesian grid embedded boundary method for hyperbolic conservation laws. |

[guilmineau2002] |
E. Guilmineau and P. Queutey. A numerical simulation of vortex shedding from an oscillating circular cylinder. |

[dutsch1998] |
H. Dutsch, F. Durst, S. Becker, and H. Lienhart. Low-reynolds-number flow around an oscillating circular cylinder at low keulegan-carpenter numbers. |

[okajima1982] |
A. Okajima. Strouhal numbers of rectangular cylinders. |

[faxen1946] |
O.H. Faxen. Forces exerted on a rigid cylinder in a viscous fluid between two parallel fixed planes. |