# GfsSourceViscosity

### From Gerris

Revision as of 11:33, 20 October 2012Popinet (Talk | contribs) (Reverted edits by Popinet (Talk); changed back to last version by Traumflug) ← Previous diff |
Current revisionPopinet (Talk | contribs) (Rolled back to correct version) |
||

Line 1: |
Line 1: | ||

- | [[GfsSourceDiffusion]] solves the diffusion equation for a scalar quantity, while '''GfsSourceViscosity''' solves the diffusion equation for the velocity (a vector quantity obviously). In the case of a spatially uniform viscosity the two are strictly equivalent since—in the case of an incompressible fluid—the vector diffusion equation for the velocity can be split in independent scalar diffusion equations for each of the Cartesian components of the velocities. | + | GfsSourceViscosity solves the diffusion equation for the velocity (a vector quantity obviously) while [[GfsSourceDiffusion]] solves the diffusion equation for a scalar quantity. In the case of a spatially uniform viscosity the two are strictly equivalent since — in the case of an incompressible fluid — the vector diffusion equation for the velocity can be split in independent scalar diffusion equations for each of the Cartesian components of the velocities. |

To sum up, using GfsSourceViscosity is safe in all cases, regardless of whether the viscosity is uniform. | To sum up, using GfsSourceViscosity is safe in all cases, regardless of whether the viscosity is uniform. | ||

+ | |||

+ | The syntax in parameter files is: | ||

+ | |||

+ | [ [[GfsSourceVelocity]] ] [ [[GfsDiffusion]] ] | ||

+ | |||

+ | where <code>[[GfsDiffusion]]</code> defines the dynamic viscosity of the fluid. | ||

+ | |||

+ | <examples/> |

## Current revision

GfsSourceViscosity solves the diffusion equation for the velocity (a vector quantity obviously) while GfsSourceDiffusion solves the diffusion equation for a scalar quantity. In the case of a spatially uniform viscosity the two are strictly equivalent since — in the case of an incompressible fluid — the vector diffusion equation for the velocity can be split in independent scalar diffusion equations for each of the Cartesian components of the velocities.

To sum up, using GfsSourceViscosity is safe in all cases, regardless of whether the viscosity is uniform.

The syntax in parameter files is:

[ GfsSourceVelocity ] [ GfsDiffusion ]

where `GfsDiffusion`

defines the dynamic viscosity of the fluid.

### Examples

SourceViscosity 0.00078125

`
`

`
`

SourceViscosity {} 0.00313

`
`

`
`

SourceViscosity {} { double Eta = MUF; if (P > 0. && D2 > 0.) { double In = sqrt(2.)*D*D2/sqrt(P); double muI = .32 + (.28)*In/(.4 + In); double Etamin = sqrt(pow(D,3)); Eta = MAX((muI*P)/(sqrt(2.)*D2), Etamin); Eta = MIN(Eta,10); } // Classic trick: use harmonic mean for the dynamic viscosity return 1./(T/Eta + (1. - T)/MUF); } { beta = 1 tolerance = 1e-4 }

`
`

`
`

SourceViscosity (1/Re)

`
`

`
`

SourceViscosity 1e-2*MUR(T1)

`
`

`
`

SourceViscosity 2.*radius/Re*rho(T)

`
`

`
`

SourceViscosity MU

`
`

`
`

SourceViscosity 1./RE

`
`

`
`

SourceViscosity 0.2

`
`

`
`

SourceViscosity 1. { beta = 1 }

`
`

`
`

SourceViscosity {} { double In = sqrt(2.)*D*D2/sqrt(fabs(P)); double muI = .38 + (.26)*In/(.3 + In); return MAX((muI*P)/(sqrt(2.)*D2), 0.); } { beta = 1 }

`
`

`
`

SourceViscosity 1. { beta = 1 }

`
`

`
`

SourceViscosity {} { double mu, ty, N, mumax = 1000.; double m; switch (MODEL) { case 0: /* Newtonian */ mu = 1.; ty = 0.; N = 1.; break; case 1: /* Power-law (shear-thinning) */ mu = 0.08; ty = 0.; N = 0.5; break; case 2: /* Herschel-Bulkley */ mu = 0.0672; ty = 0.12; N = 0.5; break; case 3: /* Bingham */ mu = 1.; ty = 10.; N = 1.; break; } if (D2 > 0.) m = ty/(2.*D2) + mu*exp ((N - 1.)*log (D2)); else { if (ty > 0. || N < 1.) m = mumax; else m = N == 1. ? mu : 0.; } return MIN (m, mumax); } { # Crank-Nicholson does not converge for these cases, we need backward Euler # (beta = 0.5 -> Crank-Nicholson, beta = 1 -> backward Euler) beta = 1 }

`
`

`
`

SourceViscosity mu(T1)

`
`

`
`

SourceViscosity 1e-2

`
`

`
`

SourceViscosity 1e-2

`
`

`
`

SourceViscosity 10

`
`

`
`

SourceViscosity 1./400.

`
`

`
`

SourceViscosity 3.125e-5

`
`

`
`

SourceViscosity MU

`
`

`
`

SourceViscosity MU

`
`

`
`

SourceViscosity 0.0182571749236*MU(T1)

`
`

`
`

SourceViscosity 0.2/(T + 100.*(1. - T))

`
`

`
`

SourceViscosity 1

`
`

`
`

SourceViscosity 1

`
`

`
`

SourceViscosity 1.

`
`

`
`

SourceViscosity 1

`
`

`
`

SourceViscosity Cmu

`
`