# PetscLimiterLimit
Limit the flux 
## Synopsis
```
#include "petscfv.h" 
PetscErrorCode PetscLimiterLimit(PetscLimiter lim, PetscReal flim, PetscReal *phi)
```

## Input Parameters

- ***lim  -*** The PetscLimiter
- ***flim -*** The input field



## Output Parameter

- ***phi  -*** The limited field


Note: Limiters given in symmetric form following Berger, Aftosmis, and Murman 2005
```none
The classical flux-limited formulation is psi(r) where
```
```none
```
```none
r = (u[0] - u[-1]) / (u[1] - u[0])
```
```none
```
```none
The second order TVD region is bounded by
```
```none
```
```none
psi_minmod(r) = min(r,1)      and        psi_superbee(r) = min(2, 2r, max(1,r))
```
```none
```
```none
where all limiters are implicitly clipped to be non-negative. A more convenient slope-limited form is psi(r) =
```
```none
phi(r)(r+1)/2 in which the reconstructed interface values are
```
```none
```
```none
u(v) = u[0] + phi(r) (grad u)[0] v
```
```none
```
```none
where v is the vector from centroid to quadrature point. In these variables, the usual limiters become
```
```none
```
```none
phi_minmod(r) = 2 min(1/(1+r),r/(1+r))   phi_superbee(r) = 2 min(2/(1+r), 2r/(1+r), max(1,r)/(1+r))
```
```none
```
```none
For a nicer symmetric formulation, rewrite in terms of
```
```none
```
```none
f = (u[0] - u[-1]) / (u[1] - u[-1])
```
```none
```
```none
where r(f) = f/(1-f). Not that r(1-f) = (1-f)/f = 1/r(f) so the symmetry condition
```
```none
```
```none
phi(r) = phi(1/r)
```
```none
```
```none
becomes
```
```none
```
```none
w(f) = w(1-f).
```
```none
```
```none
The limiters below implement this final form w(f). The reference methods are
```
```none
```
```none
w_minmod(f) = 2 min(f,(1-f))             w_superbee(r) = 4 min((1-f), f)
```




## See Also
 `PetscLimiterSetType()`, `PetscLimiterCreate()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/fv/interface/fv.c.html#PetscLimiterLimit">src/dm/dt/fv/interface/fv.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/dt/fv/interface/fv.c)


[Index of all FV routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
