Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for no slip conditions #339

Merged
merged 13 commits into from
Feb 16, 2024
56 changes: 53 additions & 3 deletions src/schemes/boundary/dummy_particles/dummy_particles.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
@doc raw"""
BoundaryModelDummyParticles(initial_density, hydrodynamic_mass, state_equation,
density_calculator, smoothing_kernel, smoothing_length)
BoundaryModelDummyParticles(initial_density, hydrodynamic_mass,
density_calculator, smoothing_kernel,
smoothing_length; viscosity=NoViscosity(),
state_equation=nothing, correction=nothing)

## Arguments
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
- `initial_density`: Vector holding the initial density of each boundary particles
- `hydrodynamic_mass`: Vector holding the "hydrodynamic mass" of each boundary particles
- `density_calculator`: Option to compute the hydrodynamic boundary density. For more
information see description below.
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
- `smoothing_kernel`: Smoothing kernel should be the same as for the adjacent fluid system
- `smoothing_length`: Smoothing length should be the same as for the adjacent fluid system


# Keywords
- `state_equation`: This should be the same as for the adjacent fluid system
(see e.g. [`StateEquationIdealGas`](@ref)).
- `correction`: Correction method of the adjacent fluid system (see TODO)
- `viscosity`: Slip (default) or no-slip condition. See description below for further
information
LasNikas marked this conversation as resolved.
Show resolved Hide resolved

Boundaries modeled as dummy particles, which are treated like fluid particles,
but their positions and velocities are not evolved in time. Since the force towards the fluid
Expand Down Expand Up @@ -33,8 +51,10 @@ f_{ab} = m_a m_b \left( \frac{p_a}{\rho_a^2} + \frac{p_b}{\rho_b^2} \right) \nab
The quantities to be defined here are the density ``\rho_b`` and pressure ``p_b``
of the boundary particle ``b``.

## Hydrodynamic density of dummy particles

We provide five options to compute the boundary density and pressure, determined by the `density_calculator`:
1. With [`AdamiPressureExtrapolation`](@ref), the pressure is extrapolated from the pressure of the
1. (Recommended) With [`AdamiPressureExtrapolation`](@ref), the pressure is extrapolated from the pressure of the
fluid according to (Adami et al., 2012), and the density is obtained by applying the inverse of the state equation.
This option usually yields the best results of the options listed here.
2. With [`SummationDensity`](@ref), the density is calculated by summation over the neighboring particles,
Expand All @@ -56,6 +76,36 @@ We provide five options to compute the boundary density and pressure, determined
This option is not recommended due to stability issues. See [`PressureMirroring`](@ref)
for more details.

## No-slip conditions

For the interaction of dummy particles and fluid particles, Adami (Adami et al. 2012)
imposes a no-slip boundary condition by assigning a wall velocity ``v_w`` to the dummy particle.
LasNikas marked this conversation as resolved.
Show resolved Hide resolved

The wall velocity of particle ``a`` is calculated from the prescribed boundary particle
velocity ``v_a`` and the smoothed velocity field
```math
v_w = 2 v_a - \frac{\sum_b v_b W_{ab}}{\sum_b W_{ab}},
```
where the sum is over all fluid particles.

By simply omitting the viscous interaction (choosing `viscosity=NoViscosity()`) a free-slip
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
wall boundary condition is applied. By choosing a viscosity model for `viscosity`, a non-slip
condition is imposed. The viscosity model should be the same as for the adjacent fluid system
(see [`ViscosityAdami`](@ref) and [`ArtificialViscosityMonaghan`](@ref)).

# Examples

```julia
# Free-slip condition
boundary_model = BoundaryModelDummyParticles(densities, masses, AdamiPressureExtrapolation(),
smoothing_kernel, smoothing_length))

# No slip condition
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
boundary_model = BoundaryModelDummyParticles(densities, masses, AdamiPressureExtrapolation(),
smoothing_kernel, smoothing_length),
viscosity=ViscosityAdami(nu))

```
## References:
- S. Adami, X. Y. Hu, N. A. Adams.
"A generalized wall boundary condition for smoothed particle hydrodynamics".
Expand Down
12 changes: 1 addition & 11 deletions src/schemes/fluid/viscosity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ end
end

@doc raw"""
ViscosityAdami(; nu)
ViscosityAdami(; nu, epsilon=0.01)
Copy link
Collaborator

@svchb svchb Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be some note here how to choose nu and like in ArtificialViscosityMonaghan that epsilon is not a parameter that normally needs to be changed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nu ist just the physical kinematic viscosity.
image

I can add:

  • epsilon=0.01: Parameter to prevent singularities and is usually chosen as 0.01

?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so I might have done it wrong than. Because I have used two viscosities and setting the viscosity of the boundary one to a nu that results in a wall velocity near 0.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, that the velocity of the boundary (the dummy particle velocity) is not zero but the geometric wall velocity is zero when using the viscous interaction with the fluid.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sry what I meant was the fluid velocity next to the wall.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a simulation I did few weeks ago. There is a very high gradient.

image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it worked for me as well I just used a larger viscosity for the boundary viscosity than in the bulk.


Viscosity by Adami (Adami et al. 2012).
The viscous interaction is calculated with the shear force for incompressible flows given by
Expand All @@ -117,16 +117,6 @@ The inter-particle-averaged shear stress is
```
where ``\eta_a = \rho_a \nu_a`` with ``\nu`` as the kinematic viscosity.

For the interaction of dummy particles (see [`BoundaryModelDummyParticles`](@ref)) and fluid particles,
Adami (Adami et al. 2012) imposes a no-slip boundary condition by assigning a wall velocity ``v_w``
to the boundary particle.

The wall velocity of particle ``a`` is calculated from the prescribed boundary particle velocity ``v_a`` and the smoothed velocity field
```math
v_w = 2 v_a - \frac{\sum_b v_b W_{ab}}{\sum_b W_{ab}},
```
where the sum is over all fluid particles.

# Keywords
- `nu`: Kinematic viscosity
- `epsilon=0.01`: Parameter to prevent singularities
Expand Down