proteus.TransportCoefficients module

Classes for implementing the coefficients of transport equations.

TC_base defines the interface. The classes derived from TC_base in this module define common PDE’s.

Inheritance diagram of proteus.TransportCoefficients

class proteus.TransportCoefficients.TC_base(nc=2, mass={}, advection={}, diffusion={}, potential={}, reaction={}, hamiltonian={}, variableNames=None, stress={}, sparseDiffusionTensors={}, useSparseDiffusion=True, movingDomain=False)[source]

This is the base class for coefficients of the vector transport equation with nc components. The coefficients and their derivative are evaluated at a time t over an array of solution values, u, at an array of points x.

methods:

evaluate(t,c) – t, time, is a float, c is a dictionary of x,u, and coefficients

members:

nc – (number of components) integer mass – ({{}} logically nc x nc) ‘linear’ or ‘nonlinear’ advection – ({{}} logically nc x nc) ‘constant’, ‘linear’ or ‘nonlinear’ diffusion – ({{{}}} logically nc x nc x nc) ‘constant’ or ‘nonlinear’ potential – ({{}} logically nc x nc) ‘u’ or ‘nonlinear’ reaction – ({{}} logically nc x nc) ‘constant’,’linear’, or ‘nonlinear’ hamiltonian – ({{}} logically nx x nc) ‘linear’ or ‘nonlinear’ stencil – ([set(),] nc x nc) indicates jacobian block structure variableNames – (number of components) string describing the component

These dictionaries indicate which coefficients are nonzero and how the non-zero coefficietns depend on the solution variables. The dictionaries will be used like sparse multi-dimensional arrays. These flags are used to deduce the terms in the PDE and allow optimizations in special cases. Non-existant values imply that the equation for that component has no term corresponding to the given coefficient.

\[\]

a_{i,j} = 1

Set the number of components (equations) of the PDE and initialize the dicitionaries describing the form of the coefficients. Strings naming each component (used for viewing and archiving) and a structure defining the sparsity pattern of diffusion tensors may also be provided.

evaluate(t, c)[source]

Evaluate the coefficients at a given time, t, using the coefficient storage passed in as the dictionary c.

initializeMesh(mesh)[source]

Give the TC object access to the mesh for any mesh-dependent information.

initializeElementQuadrature(t, cq)[source]

Give the TC object access to the element quadrature storage

initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]

Give the TC object access to the element boundary quadrature storage

initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]

Give the TC object access to the exterior element boundary quadrature storage

initializeGeneralizedInterpolationPointQuadrature(t, cip)[source]

Give the TC object access to the generalized interpolation point storage. These points are used to project nonlinear potentials (phi).

updateToMovingDomain(t, c)[source]
attachModels(modelList)[source]

Give the TC object access to other models in a loosely coupled split operator formulation (e.g. a transport equation for concentration might get velocity from a flow equation)

preStep(t, firstStep=False)[source]

Give the TC object an opportunity to modify itself before the time step.

postStep(t, firstStep=False)[source]

Give the TC object an opportunity to modify itself after the time step.

allocateDummyCoefficients(c=None, nPoints=101, uMax=1.0, uMin=0.0, nSpace=1)[source]

Allocate some coefficient dictionaries to use for viewing the coefficients

plotCoefficientFunctions(t, ctemp)[source]

Plot the coefficients

class proteus.TransportCoefficients.LinearVADR_ConstantCoefficients(nc=1, M=[0], A=[0], B=[0], C=[0], rFunc=None, useSparseDiffusion=True)[source]

Bases: proteus.TransportCoefficients.TC_base

This class implements constant coefficients with no cross-component diffusion for a system of advection-diffuion-reaction equations.

evaluate(t, c)[source]
linearADR_ConstantCoefficientsEvaluate()[source]

Evaluate the coefficients of a scalar vtransport equation for the linear, constant coefficients case

class proteus.TransportCoefficients.LinearVADR_ConstantCoefficients_skew(nc=1, M=0, A=0, B=0, C=0)[source]

Bases: proteus.TransportCoefficients.TC_base

This class implements constant coefficients for a skew symmetric system, mainly for testing and debugging

evaluate(t, c)[source]
linearADR_ConstantCoefficientsEvaluate()[source]

Evaluate the coefficients of a scalar vtransport equation for the linear, constant coefficients case

class proteus.TransportCoefficients.LinearVADR_ConstantCoefficients_upper(nc=1, M=0, A=0, B=0, C=0)[source]

Bases: proteus.TransportCoefficients.TC_base

This class implements constant coefficients with upper diagonal coupling

evaluate(t, c)[source]
linearADR_ConstantCoefficientsEvaluate()[source]

Evaluate the coefficients of a scalar vtransport equation for the linear, constant coefficients case

class proteus.TransportCoefficients.LinearVADR_ConstantCoefficients_lower(nc=1, M=0, A=0, B=0, C=0)[source]

Bases: proteus.TransportCoefficients.TC_base

This class implements constant coefficients with lower diagonal coupling

evaluate(t, c)[source]
linearADR_ConstantCoefficientsEvaluate()[source]

Evaluate the coefficients of a scalar vtransport equation for the linear, constant coefficients case

class proteus.TransportCoefficients.LinearVADR_ConstantCoefficients_full(nc=1, M=0, A=0, B=0, C=0)[source]

Bases: proteus.TransportCoefficients.TC_base

This class implements constant coefficients with full coupling

evaluate(t, c)[source]
linearADR_ConstantCoefficientsEvaluate()[source]

Evaluate the coefficients of a scalar vtransport equation for the linear, constant coefficients case

class proteus.TransportCoefficients.NonlinearVADR_pqrst(nc=1, M={0: 0.0}, A={0: 1.0}, B={0: 0.0}, C={0: 0.0}, p={0: 1.0}, q={0: 1.0}, r={0: 1.0}, s={0: 1.0}, t={0: 0.0})[source]

Bases: proteus.TransportCoefficients.TC_base

This class implements simple monomial nonlinear coefficients with no cross-component diffusion for a system of advection-diffuion-reaction equations.

evaluate(t, c)[source]
nonlinearADR_pqrstEvaluate()[source]

Evaluate the coefficients of a scalar vtransport equation for simple monomial coefficients

class proteus.TransportCoefficients.NonlinearVADR_pqrst_full(nc=1, M={0: 0.0}, A={0: 1.0}, B={0: 0.0}, C={0: 0.0}, p={0: 1.0}, q={0: 1.0}, r={0: 1.0}, s={0: 1.0}, t={0: 0.0})[source]

Bases: proteus.TransportCoefficients.TC_base

This class implements the simple nonlinear ADR equation with full coupling

evaluate(t, c)[source]
nonlinearADR_pqrstEvaluate()[source]

Evaluate the coefficients of a scalar vtransport equation for simple monomial coefficients

class proteus.TransportCoefficients.UnitSquareRotation[source]

Bases: proteus.TransportCoefficients.TC_base

Conservative linear advection with a rotating velocity field

evaluate(t, c)[source]
unitSquareRotationEvaluate()[source]

Coefficients for rotating velocity field on the unit square

class proteus.TransportCoefficients.UnitCubeRotation[source]

Bases: proteus.TransportCoefficients.TC_base

Conservative linear advection with a rotating velocity field in 3d

evaluate(t, c)[source]
unitCubeRotationEvaluate()[source]

Coefficients for rotating velocity field on the unit cube

class proteus.TransportCoefficients.NavierStokes(rho=998.2, nu=1.004e-06, g=[0.0, 9.8], nd=2)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for the incompressible Navier-Stokes equations.

evaluate(t, c)[source]
NavierStokes_2D_Evaluate()[source]

evaluate the coefficients of the 2D Navier-Stokes equations

NavierStokes_3D_Evaluate()[source]

evaluate the coefficients of the 3D Navier-Stokes equations

class proteus.TransportCoefficients.ShallowWater(g=9.8, nd=1, h_eps=1e-08, bedFrictionCoefficient=0.0, bedFrictionPower=1.0, bathymetryFunc=None, bathymetryGradientFunc=None, eddyViscosity=0.0)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for the shallow water equations.

Right hand side for bed friction looks like \(-\tau_b/\rho\) where the bed friction stress is

\[\tau_b = \rho C_f \vec u \|\vec u\| C_f = g b/h^{a}\]

\(b = n^2\) for Mannings law –> bedFrictionCoefficient \(a = 1/3\) for Mannings law –> bedFrictionPower

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
initializeGeneralizedInterpolationPointQuadrature(t, cip)[source]
evaluate(t, c)[source]
shallowWater_1D_Evaluate()[source]

Evaluate the coefficients of the shallow water equations in 1D

shallowWater_2D_Evaluate()[source]

Evaluate the coefficients of the shallow water equations in 2D

class proteus.TransportCoefficients.DiscreteLaplaceOperator(nd=2, nu=1.0)[source]

Bases: proteus.TransportCoefficients.TC_base

A coefficient class to construct the discrete Laplace Operator.

This class defines the coefficients necessary to construct the discrete Laplace operator \(A\) where

\[a^{c}_{i,j} = \int_{T} \nabla \phi^{c}_{i} \cdot \nabla \phi^{c}_{j} dT\]

for all \(T \in \Omega\), \(c=1,...,nc\) and \(\phi^{c}_{i}, i=1,...,k\) is a basis for component \(c\).

evaluate(t, c)[source]
Laplace_2D_Evaluate()[source]

evaluate the coefficients of the distcrete 2D Laplace operator

Laplace_3D_Evaluate()[source]

evaluate the coefficients of the discrete 3D Laplace operator

class proteus.TransportCoefficients.Stokes(rho=998.2, nu=1.004e-06, g=[0.0, 9.8], nd=2, steady=True, weakBoundaryConditions=True)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for the Stokes equations.

attachModels(modelList)[source]
evaluate(t, c)[source]
Stokes_2D_Evaluate()[source]

evaluate the coefficients of the 2D Stokes equations

Stokes_3D_Evaluate()[source]

evaluate the coefficients of the 3D Stokes equations

class proteus.TransportCoefficients.StokesP(rho=998.2, nu=1.004e-06, g=[0.0, 9.8], nd=2, steady=True)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for the Stokes equations.

evaluate(t, c)[source]
StokesP_2D_Evaluate()[source]

evaluate the coefficients of the 2D Stokes equations

StokesP_3D_Evaluate()[source]

evaluate the coefficients of the 3D Stokes equations

class proteus.TransportCoefficients.TwophaseNavierStokes_LS_SO(epsFact=1.5, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=None)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for two incompresslble fluids governed by the Navier-Stokes equations and separated by a sharp interface represented by a level set function

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
TwophaseNavierStokes_LS_SO_2D_Evaluate()[source]

evaluate the coefficients of the 2D Navier-Stokes equations

TwophaseNavierStokes_LS_SO_3D_Evaluate()[source]

evaluate the coefficients of the 3D Navier-Stokes equations

class proteus.TransportCoefficients.TwophaseNavierStokes_ST_LS_SO(epsFact=1.5, sigma=72.8, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=None, KN_model=None, epsFact_density=None, stokes=False, sd=True, movingDomain=False, useRBLES=0.0)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for two incompresslble fluids governed by the Navier-Stokes equations and separated by a sharp interface represented by a level set function

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
updateToMovingDomain(t, c)[source]
evaluate(t, c)[source]
TwophaseNavierStokes_ST_LS_SO_2D_Evaluate()[source]

evaluate the coefficients of the 2D Navier-Stokes equations with surface tension

TwophaseNavierStokes_ST_LS_SO_2D_Evaluate_sd()[source]

evaluate the coefficients of the 2D Navier-Stokes equations with surface tension

TwophaseNavierStokes_ST_LS_SO_3D_Evaluate()[source]

evaluate the coefficients of the 3D Navier-Stokes equations with surface tension

TwophaseNavierStokes_ST_LS_SO_3D_Evaluate_sd()[source]

evaluate the coefficients of the 3D Navier-Stokes equations with surface tension

class proteus.TransportCoefficients.ThreephaseNavierStokes_ST_LS_SO(epsFact=1.5, sigma=72.8, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, rho_s=998.2, nu_s=1.004e-06, g=[0.0, -9.8], nd=2, LS_model=None, KN_model=None, epsFact_density=None, defaultSolidProfile=None, defaultFluidProfile=None, stokes=False, ptsFile=None, boundaryPenaltyCoef=1.0, volumePenaltyCoef=1000.0)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for two incompresslble fluids governed by the Navier-Stokes equations and separated by a sharp interface represented by a level set function

readPTS(ptsFile)[source]
signedDistance(x)[source]
attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
ThreephaseNavierStokes_ST_LS_SO_2D_Evaluate()[source]

evaluate the coefficients of the 2D Navier-Stokes equations with surface tension and a possible mobile rigid solid phase

ThreephaseNavierStokes_ST_LS_SO_3D_Evaluate()[source]

evaluate the coefficients of the 2D Navier-Stokes equations with surface tension and a possible mobile rigid solid phase

class proteus.TransportCoefficients.TwophaseStokes_LS_SO(epsFact=1.5, rho_0=998.2, nu_0=1.005e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=1, steady=False)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for two incompresslble fluids governed by the Stokes equations and seperated by a sharp interface represented by a level set function

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
TwophaseStokes_LS_SO_2D_Evaluate()[source]

evaluate the coefficients of the 2D Stokes equations

TwophaseStokes_LS_SO_3D_Evaluate()[source]

evaluate the coefficients of the 3D Stokes equations

class proteus.TransportCoefficients.TwophaseNavierStokes_VOF_SO(epsFact=1.5, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=1)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for two incompresslble fluids governed by the Navier-Stokes equations and separated by a sharp interface represented by a volume of fluid (volume fraction) function

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
TwophaseNavierStokes_VOF_SO_2D_Evaluate()[source]

evaluate the coefficients of the 2D Navier-Stokes equations

TwophaseNavierStokes_VOF_SO_3D_Evaluate()[source]

evaluate the coefficients of the 3D Navier-Stokes equations

class proteus.TransportCoefficients.TwophaseStokes_VOF_SO(epsFact=1.5, rho_0=998.2, nu_0=1.005e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, 9.8], nd=2, LS_model=1, steady=False)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for two incompresslble fluids governed by the Stokes equations and seperated by a sharp interface represented by a volume of fluid function

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
TwophaseStokes_VOF_SO_2D_Evaluate()[source]

evaluate the coefficients of the 2D Stokes equations

TwophaseStokes_VOF_SO_3D_Evaluate()[source]

evaluate the coefficients of the 3D Stokes equations

class proteus.TransportCoefficients.NCLevelSetCoefficients(V_model=0, RD_model=None, ME_model=1, EikonalSolverFlag=0, checkMass=True, epsFact=1.5)[source]

Bases: proteus.TransportCoefficients.TC_base

attachModels(modelList)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
preStep(t, firstStep=False)[source]
postStep(t, firstStep=False)[source]
updateToMovingDomain(t, c)[source]
evaluate(t, c)[source]
class EikonalSolver(levelSolverType, F, relativeTolerance=0.0, absoluteTolerance=1e-08, maxSolverIts=100, frontTolerance=0.0001, frontInitType='magnitudeOnly', bandTolerance=-0.01, eikonalVariable=0, localReconstruction=None, printInfo=False)[source]

Simple wrapper for special purpose Eikonal equation solvers on a single level. Current types allowed:

FMMEikonalSolver
FSWEikonalSolver
convertFromC0P1Rep(dofin, dofout)[source]

allow output FEM space to be something besides C0P1 and convert from C0P1 to expected representation here

convertToC0P1Rep(dofin, dofout, interpType='min')[source]

allow input FEM space to be something besides C0P1 and then convert to expected representation here

info()[source]
solve(u, r, b=None)[source]
class NCLevelSetCoefficients.FMMEikonalSolver(mesh, dofMap, nSpace, localSolverType='QianEtalV2', frontInitType='magnitudeOnly', debugLevel=3)[source]

Encapsulate naive implementation of Fast Marching Methods on unstructured grids for

\[\|\grad T\| = 1/F\]

\(T = 0\) on \(\Gamma\)

1d local solver is standard upwind approximation

2d local solver variations: acute triangulations version 1 or version 2 from Qian Zhang etal 07 obtuse triangulation not implemented

3d local solver varitions: not fully checked

For now, the input should be non-negative!

cfmmfsw = <module 'proteus.cfmmfsw' from '/home/cekees/proteus/proteus/cfmmfsw.so'>[source]
solve(phi0, T, nodalSpeeds=None, zeroTol=0.0001, trialTol=0.1, verbose=0)[source]

Test first order fast marching method algorithm for eikonal equation

|grad T | = 1, phi(

ec x) = 0, x in Gamma

assuming phi_0 describes initial location of interface Gamma and has reasonable values (absolute values) for T close to Gamma. Here T can be interpreted as the travel time from Gamma.

Right now assumes global node numbers <–> global dofs but this can be fixed easily Input

phi0: dof array from P1 C0 FiniteElementFunction holding initial condition

T : dof array from P1 C0 FiniteElementFunction for solution

Output T(

ec x_n) : travel time from initial front to node ( ec x_n)

Internal data structures

Status
: status of nodal point (dictionary)
-1 –> Far
0 –> Trial 1 –> Known

Trial : nodal points adjacent to front tuples (index,val) stored in heap

TODO
have return flag
class NCLevelSetCoefficients.FSWEikonalSolver(mesh, dofMap, nSpace, iterAtol=1e-08, iterRtol=0.0, maxIts=100, localSolverType='QianEtalV2', frontInitType='magnitudeOnly', refPoints=None, orderApprox=1, LARGE=1.234e+28, debugLevel=3)[source]
Encapsulate naive implementation of Fast Marching Methods on unstructured grids
for
\[\|\grad T\| = 1/F\]

\(T = 0\) on \(\Gamma\)

1d local solver is standard upwind approximation

2d local solver variations: acute triangulations version 1 or version 2 from Qian Zhang etal 07 obtuse triangulation not implemented

3d local solver variations: not fully checked

For now, the input should be non-negative!

cfmmfsw = <module 'proteus.cfmmfsw' from '/home/cekees/proteus/proteus/cfmmfsw.so'>[source]
solve(phi0, T, nodalSpeeds=None, zeroTol=0.0001, trialTol=0.1, verbose=0)[source]

Test first order fast sweeping method algorithm for eikonal equation

|grad T | = 1, phi(

ec x) = 0, x in Gamma

assuming phi_0 describes initial location of interface Gamma and has reasonable values (absolute values) for T close to Gamma. Here T can be interpreted as the travel time from Gamma.

Right now assumes global node numbers <–> global dofs but this can be fixed easily Input

phi0: dof array holding P1 C0 FiniteElementFunction holding initial condition

T : dof array holding P1 C0 FiniteElementFunction for solution

Output T(

ec x_n) : travel time from initial front to node ( ec x_n)

Internal data structures

Status
: status of nodal point (dictionary)
0 –> Not Known (Trial) 1 –> Known

Order : ordering of points in domain using l_p metric from fixed reference points

NCLevelSetCoefficients.ncLevelSetCoefficientsEvaluate()[source]

evaluate the coefficients of the non-conservative level set advection equation

class proteus.TransportCoefficients.CLevelSetCoefficients(V_model=0, RD_model=-1, ME_model=1, EikonalSolverFlag=0, checkMass=True)[source]

Bases: proteus.TransportCoefficients.TC_base

attachModels(modelList)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
preStep(t, firstStep=False)[source]
postStep(t, firstStep=False)[source]
evaluate(t, c)[source]
class EikonalSolver(levelSolverType, F, relativeTolerance=0.0, absoluteTolerance=1e-08, maxSolverIts=100, frontTolerance=0.0001, frontInitType='magnitudeOnly', bandTolerance=-0.01, eikonalVariable=0, localReconstruction=None, printInfo=False)[source]

Simple wrapper for special purpose Eikonal equation solvers on a single level. Current types allowed:

FMMEikonalSolver
FSWEikonalSolver
convertFromC0P1Rep(dofin, dofout)[source]

allow output FEM space to be something besides C0P1 and convert from C0P1 to expected representation here

convertToC0P1Rep(dofin, dofout, interpType='min')[source]

allow input FEM space to be something besides C0P1 and then convert to expected representation here

info()[source]
solve(u, r, b=None)[source]
class CLevelSetCoefficients.FMMEikonalSolver(mesh, dofMap, nSpace, localSolverType='QianEtalV2', frontInitType='magnitudeOnly', debugLevel=3)[source]

Encapsulate naive implementation of Fast Marching Methods on unstructured grids for

\[\|\grad T\| = 1/F\]

\(T = 0\) on \(\Gamma\)

1d local solver is standard upwind approximation

2d local solver variations: acute triangulations version 1 or version 2 from Qian Zhang etal 07 obtuse triangulation not implemented

3d local solver varitions: not fully checked

For now, the input should be non-negative!

cfmmfsw = <module 'proteus.cfmmfsw' from '/home/cekees/proteus/proteus/cfmmfsw.so'>[source]
solve(phi0, T, nodalSpeeds=None, zeroTol=0.0001, trialTol=0.1, verbose=0)[source]

Test first order fast marching method algorithm for eikonal equation

|grad T | = 1, phi(

ec x) = 0, x in Gamma

assuming phi_0 describes initial location of interface Gamma and has reasonable values (absolute values) for T close to Gamma. Here T can be interpreted as the travel time from Gamma.

Right now assumes global node numbers <–> global dofs but this can be fixed easily Input

phi0: dof array from P1 C0 FiniteElementFunction holding initial condition

T : dof array from P1 C0 FiniteElementFunction for solution

Output T(

ec x_n) : travel time from initial front to node ( ec x_n)

Internal data structures

Status
: status of nodal point (dictionary)
-1 –> Far
0 –> Trial 1 –> Known

Trial : nodal points adjacent to front tuples (index,val) stored in heap

TODO
have return flag
class CLevelSetCoefficients.FSWEikonalSolver(mesh, dofMap, nSpace, iterAtol=1e-08, iterRtol=0.0, maxIts=100, localSolverType='QianEtalV2', frontInitType='magnitudeOnly', refPoints=None, orderApprox=1, LARGE=1.234e+28, debugLevel=3)[source]
Encapsulate naive implementation of Fast Marching Methods on unstructured grids
for
\[\|\grad T\| = 1/F\]

\(T = 0\) on \(\Gamma\)

1d local solver is standard upwind approximation

2d local solver variations: acute triangulations version 1 or version 2 from Qian Zhang etal 07 obtuse triangulation not implemented

3d local solver variations: not fully checked

For now, the input should be non-negative!

cfmmfsw = <module 'proteus.cfmmfsw' from '/home/cekees/proteus/proteus/cfmmfsw.so'>[source]
solve(phi0, T, nodalSpeeds=None, zeroTol=0.0001, trialTol=0.1, verbose=0)[source]

Test first order fast sweeping method algorithm for eikonal equation

|grad T | = 1, phi(

ec x) = 0, x in Gamma

assuming phi_0 describes initial location of interface Gamma and has reasonable values (absolute values) for T close to Gamma. Here T can be interpreted as the travel time from Gamma.

Right now assumes global node numbers <–> global dofs but this can be fixed easily Input

phi0: dof array holding P1 C0 FiniteElementFunction holding initial condition

T : dof array holding P1 C0 FiniteElementFunction for solution

Output T(

ec x_n) : travel time from initial front to node ( ec x_n)

Internal data structures

Status
: status of nodal point (dictionary)
0 –> Not Known (Trial) 1 –> Known

Order : ordering of points in domain using l_p metric from fixed reference points

CLevelSetCoefficients.cLevelSetCoefficientsEvaluate()[source]

evaluate the coefficients of the conservative level set advection equation

class proteus.TransportCoefficients.VOFCoefficients(LS_model=-1, V_model=0, RD_model=-1, ME_model=1, EikonalSolverFlag=0, checkMass=True, epsFact=0.0)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeMesh(mesh)[source]
attachModels(modelList)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
preStep(t, firstStep=False)[source]
postStep(t, firstStep=False)[source]
updateToMovingDomain(t, c)[source]
evaluate(t, c)[source]
class EikonalSolver(levelSolverType, F, relativeTolerance=0.0, absoluteTolerance=1e-08, maxSolverIts=100, frontTolerance=0.0001, frontInitType='magnitudeOnly', bandTolerance=-0.01, eikonalVariable=0, localReconstruction=None, printInfo=False)[source]

Simple wrapper for special purpose Eikonal equation solvers on a single level. Current types allowed:

FMMEikonalSolver
FSWEikonalSolver
convertFromC0P1Rep(dofin, dofout)[source]

allow output FEM space to be something besides C0P1 and convert from C0P1 to expected representation here

convertToC0P1Rep(dofin, dofout, interpType='min')[source]

allow input FEM space to be something besides C0P1 and then convert to expected representation here

info()[source]
solve(u, r, b=None)[source]
class VOFCoefficients.FMMEikonalSolver(mesh, dofMap, nSpace, localSolverType='QianEtalV2', frontInitType='magnitudeOnly', debugLevel=3)[source]

Encapsulate naive implementation of Fast Marching Methods on unstructured grids for

\[\|\grad T\| = 1/F\]

\(T = 0\) on \(\Gamma\)

1d local solver is standard upwind approximation

2d local solver variations: acute triangulations version 1 or version 2 from Qian Zhang etal 07 obtuse triangulation not implemented

3d local solver varitions: not fully checked

For now, the input should be non-negative!

cfmmfsw = <module 'proteus.cfmmfsw' from '/home/cekees/proteus/proteus/cfmmfsw.so'>[source]
solve(phi0, T, nodalSpeeds=None, zeroTol=0.0001, trialTol=0.1, verbose=0)[source]

Test first order fast marching method algorithm for eikonal equation

|grad T | = 1, phi(

ec x) = 0, x in Gamma

assuming phi_0 describes initial location of interface Gamma and has reasonable values (absolute values) for T close to Gamma. Here T can be interpreted as the travel time from Gamma.

Right now assumes global node numbers <–> global dofs but this can be fixed easily Input

phi0: dof array from P1 C0 FiniteElementFunction holding initial condition

T : dof array from P1 C0 FiniteElementFunction for solution

Output T(

ec x_n) : travel time from initial front to node ( ec x_n)

Internal data structures

Status
: status of nodal point (dictionary)
-1 –> Far
0 –> Trial 1 –> Known

Trial : nodal points adjacent to front tuples (index,val) stored in heap

TODO
have return flag
class VOFCoefficients.FSWEikonalSolver(mesh, dofMap, nSpace, iterAtol=1e-08, iterRtol=0.0, maxIts=100, localSolverType='QianEtalV2', frontInitType='magnitudeOnly', refPoints=None, orderApprox=1, LARGE=1.234e+28, debugLevel=3)[source]
Encapsulate naive implementation of Fast Marching Methods on unstructured grids
for
\[\|\grad T\| = 1/F\]

\(T = 0\) on \(\Gamma\)

1d local solver is standard upwind approximation

2d local solver variations: acute triangulations version 1 or version 2 from Qian Zhang etal 07 obtuse triangulation not implemented

3d local solver variations: not fully checked

For now, the input should be non-negative!

cfmmfsw = <module 'proteus.cfmmfsw' from '/home/cekees/proteus/proteus/cfmmfsw.so'>[source]
solve(phi0, T, nodalSpeeds=None, zeroTol=0.0001, trialTol=0.1, verbose=0)[source]

Test first order fast sweeping method algorithm for eikonal equation

|grad T | = 1, phi(

ec x) = 0, x in Gamma

assuming phi_0 describes initial location of interface Gamma and has reasonable values (absolute values) for T close to Gamma. Here T can be interpreted as the travel time from Gamma.

Right now assumes global node numbers <–> global dofs but this can be fixed easily Input

phi0: dof array holding P1 C0 FiniteElementFunction holding initial condition

T : dof array holding P1 C0 FiniteElementFunction for solution

Output T(

ec x_n) : travel time from initial front to node ( ec x_n)

Internal data structures

Status
: status of nodal point (dictionary)
0 –> Not Known (Trial) 1 –> Known

Order : ordering of points in domain using l_p metric from fixed reference points

VOFCoefficients.VOFCoefficientsEvaluate()[source]

evaluate the coefficients of the conservative level set advection equation

class proteus.TransportCoefficients.LevelSetNormalCoefficients(epsFact=1.5, LSModel_index=-1, phi_func=None)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeMesh(mesh)[source]
attachModels(modelList)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.LevelSetCurvatureCoefficients(epsFact=0.0, LSModel_index=3, grad_phi_func=None, sd=True, nd=None)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeMesh(mesh)[source]
attachModels(modelList)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
levelSetCurvatureCoefficientsEvaluate()[source]

evaluate the coefficients of the level set curvature equation

class proteus.TransportCoefficients.LevelSetConservation(applyCorrection=True, epsFactHeaviside=0.0, epsFactDirac=1.0, epsFactDiffusion=2.0, LSModel_index=3, V_model=2, me_model=5, VOFModel_index=4, checkMass=True, sd=True, nd=None, applyCorrectionToDOF=True)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeMesh(mesh)[source]
attachModels(modelList)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
preStep(t, firstStep=False)[source]
postStep(t, firstStep=False)[source]
evaluate(t, c)[source]
levelSetConservationCoefficientsEvaluate()[source]

evaluate the coefficients of the volume conservation correction for level set methods

levelSetConservationCoefficientsEvaluate_sd()[source]

evaluate the coefficients of the volume conservation correction for level set methods

class proteus.TransportCoefficients.ConservativeHeadRichardsL2projMualemVanGenuchten(hydraulicConductivity, gravity, density, thetaS, thetaR, alpha, n, m)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
conservativeHeadRichardsL2projBndMualemVanGenuchtenHomEvaluate()[source]

evaluate the coefficients of Richards’ equation w/ L_2 proj on element boundaries

conservativeHeadRichardsL2projMualemVanGenuchtenHomEvaluate()[source]

evaluate the coefficients of Richards’ equation w/ L_2 proj

class proteus.TransportCoefficients.ConservativeHeadRichardsL2projMualemVanGenuchtenBlockHet(hydraulicConductivity, gravity, density, setParamsFunc)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
conservativeHeadRichardsL2projMualemVanGenuchtenHetEvaluate()[source]

evaluate the coefficients of Richards’ equation w/ L_2 proj

class proteus.TransportCoefficients.ConservativeHeadRichardsMualemVanGenuchten(hydraulicConductivity, gravity, density, thetaS, thetaR, alpha, n, m, beta=0.0)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
conservativeHeadRichardsMualemVanGenuchtenHomEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConservativeSatRichardsMualemVanGenuchten(hydraulicConductivity, gravity, density, thetaS, thetaR, alpha, n, m)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
conservativeSatRichardsMualemVanGenuchtenHomEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConservativeTotalHeadRichardsMualemVanGenuchten(hydraulicConductivity, gravity, density, thetaS, thetaR, alpha, n, m)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
conservativeTotalHeadRichardsMualemVanGenuchtenHomEvaluate()[source]

evaluate the coefficients of Richards’ equation in terms of h=psi+z

proteus.TransportCoefficients.VGM_to_BCB_Simple(vgm_alpha, vgm_n)[source]
proteus.TransportCoefficients.BCB_to_VGM_Simple(bcb_pd, bcb_lambda)[source]
proteus.TransportCoefficients.VGM_to_BCB_Johns(vgm_alpha, vgm_n)[source]
proteus.TransportCoefficients.VGM_to_BCB_MorelSeytoux(vgm_alpha, vgm_n)[source]
class proteus.TransportCoefficients.ConservativeHeadRichardsBrooksCoreyBurdine(hydraulicConductivity, gravity, density, thetaS, thetaR, lambdab, pd, beta=0.0)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
conservativeHeadRichardsBrooksCoreyBurdineHomEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConservativeHeadRichardsMualemVanGenuchtenHet(hydraulicConductivity, gravity, density, thetaS, thetaR, alpha, n, m)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
conservativeHeadRichardsMualemVanGenuchtenHetEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConservativeHeadRichardsBrooksCoreyBurdineHet(hydraulicConductivity, gravity, density, setParamsFunc)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
conservativeHeadRichardsBrooksCoreyBurdineHetEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConservativeHeadRichardsMualemVanGenuchtenBlockHet(hydraulicConductivity, gravity, density, setParamsFunc)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
conservativeHeadRichardsMualemVanGenuchtenHetEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConservativeHeadRichardsMualemVanGenuchtenBlockHetV2(Ks_block, vgm_n_block, vgm_alpha_block, thetaR_block, thetaSR_block, gravity, density, beta)[source]

Bases: proteus.TransportCoefficients.TC_base

version of Re where element material type id’s used in evals

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
conservativeHeadRichardsMualemVanGenuchtenHetEvaluateV2()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.SeepageBrezis(Ks_block, vgm_n_block, vgm_alpha_block, thetaR_block, thetaSR_block, gravity, density, beta, epsFact=1.5)[source]

Bases: proteus.TransportCoefficients.TC_base

version of Re where element material type id’s used in evals

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
seepageBrezis()[source]

evaluate the coefficients of the seepage free boundary problem

class proteus.TransportCoefficients.ConservativeHeadRichardsJLeverett(phi_block, psiD_block, ns_block, nk_block, S_wirr_block, S_nwr_block, kr0_block, gravity, density, beta)[source]

Bases: proteus.TransportCoefficients.TC_base

version of Re where element material type id’s used in evals

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
conservativeHeadRichardsJLeverettEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConservativeHeadRichardsJLeverettAni(phi_block, psiD_block, ns_block, nk_block, S_wirr_block, S_nwr_block, kr0x_block, kr0y_block, kr0z_block, gravity, density, beta)[source]

Bases: proteus.TransportCoefficients.TC_base

version of Re where element material type id’s used in evals

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
conservativeHeadRichardsJLeverettAniEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.ConstantVelocityLevelSet(b=[1.0, 0.0], lsModelId=0)[source]

Bases: proteus.TransportCoefficients.TC_base

attachModels(modelList)[source]
evaluate(t, c)[source]
constantVelocityLevelSetEvaluate()[source]

evaluate the coefficients for level set equation with constant velocity (1,2,3)D

class proteus.TransportCoefficients.UnitSquareVortexLevelSet[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
unitSquareVortexLevelSetEvaluate()[source]

evaluate the coefficients for level set equation with oscillating vortex 2D

class proteus.TransportCoefficients.RotatingVelocityLevelSet[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
unitSquareRotationLevelSetEvaluate()[source]

evaluate the coefficients for level set equation with rotating velocity 2D

class proteus.TransportCoefficients.EikonalEquationCoefficients(rhsval=1.0)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
eikonalEquationEvaluate()[source]

evaluate the coefficients for Eikonal Equation

class proteus.TransportCoefficients.RedistanceLevelSet(applyRedistancing=True, epsFact=2.0, nModelId=None, u0=None, rdModelId=0, penaltyParameter=0.0)[source]

Bases: proteus.TransportCoefficients.TC_base

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
preStep(t, firstStep=False)[source]
postStep(t, firstStep=False)[source]
getICDofs(cj)[source]
updateToMovingDomain(t, c)[source]
evaluate(t, c)[source]
static setZeroLSweakDirichletBCs(vt)[source]
static setZeroLSweakDirichletBCs2(vt)[source]
static setZeroLSweakDirichletBCs3(vt)[source]
redistanceLevelSetCoefficientsEvaluate()[source]

evaluate the coefficients for level set redistancing equation

class proteus.TransportCoefficients.RedistanceLevelSetWithWeakPenalty(applyRedistancing=True, epsFact=2.0, penaltyParameter=1.0, nModelId=None, u0=None, rdModelId=0)[source]

Bases: proteus.TransportCoefficients.RedistanceLevelSet

evaluate(t, c)[source]
redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate()[source]

evaluate the coefficients for level set redistancing equation including a weak penalty

class proteus.TransportCoefficients.RedistanceLevelSetSandF(applyRedistancing=True, epsFact=2.0, nModelId=1, u0=None, rdModelId=-1, vofModelId=4, massCorrModelId=5, checkMass=True)[source]

Bases: proteus.TransportCoefficients.RedistanceLevelSet

evaluate(t, c)[source]
redistanceLevelSetSandFCoefficientsEvaluate()[source]

evaluate the coefficients for level set redistancing equation using Sussman and Fatemi volume correction

class proteus.TransportCoefficients.ConservativeHead2PMualemVanGenuchten(hydraulicConductivity, gravity, density, thetaS, thetaR, alpha, n, m)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
conservativeHeadRichardsMualemVanGenuchtenHomEvaluate()[source]

evaluate the coefficients of Richards’ equation

class proteus.TransportCoefficients.PoissonEquationCoefficients(aOfX, fOfX, nc=1, nd=2, l2proj=None, timeVaryingCoefficients=False)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
L2projectEvaluate()[source]

just project scalar quantity onto constants for a mesh entity

class proteus.TransportCoefficients.LinearElasticity(E=1.0, nu=0.75, g=[0.0, 9.8], nd=2)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
LinearElasticity_1D_Evaluate()[source]

evaluate the coefficients of the linear elasticity equation in 1D

LinearElasticity_2D_Evaluate()[source]

evaluate the coefficients of the linear elasticity equation in 2D

LinearElasticity_3D_Evaluate()[source]

evaluate the coefficients of the linear elasticity equation in 3D

class proteus.TransportCoefficients.MovingMesh(E=1.0, nu=0.3, g=[0.0, 0.0], nd=2, moveMesh=True)[source]

Bases: proteus.TransportCoefficients.TC_base

initializeMesh(mesh)[source]
attachModels(modelList)[source]
postStep(t, firstStep=False)[source]
evaluate(t, c)[source]
MovingMesh_1D_Evaluate()[source]

evaluate the coefficients of the linear elasticity equation in 1D

MovingMesh_2D_Evaluate()[source]

evaluate the coefficients of the linear elasticity equation in 2D

MovingMesh_3D_Evaluate()[source]

evaluate the coefficients of the linear elasticity equation in 3D

class proteus.TransportCoefficients.kEpsilon(flowModelID=0, nd=2, c_mu=0.09, c_1=0.126, c_2=1.92, c_epsilon=0.07, sigma_k=1.0, sigma_e=1.29, g=[0.0, -9.8], nu=1.004e-06, rho=998.0)[source]

Bases: proteus.TransportCoefficients.TC_base

Basic k-epsilon model for incompressible flow from Hutter etal Chaper 11

\(\bar{\vec v} = <\vec v>\) Reynolds-averaged (mean) velocity \(\vec v^{'} =\) turbulent fluctuation

assume \(\vec v = <\vec v> + \vec v^{'}\), with \(<\vec v^{'}> = 0\)

Reynolds averaged NS equations

\[\deld \bar{\vec v} = 0\]
\[\pd{\bar{\vec v}}{t} + \deld \left(\bar{\vec v} \outer \bar{\vec v}\right) -\nu \deld \ten \bar{D} + \frac{1}{\rho}\grad \bar p - \frac{1}{rho}\deld \ten{R} = 0\]

Reynolds stress term

\[\ten R = -\rho <\vec v^{'}\outer \vec v^{'}> \frac{1}{\rho}\ten{R} = 2 \nu_t \bar{D} - \frac{2}{3}k\ten{I} D_{ij}(\vec v) = \frac{1}{2} \left( \pd{v_i}{x_j} + \pd{v_j}{x_i}) \ten D \bar{\ten D} = D(<\vec v>), \ten D^{'} = \ten D(\vec v^{'})\]

k-epsilon tranport equations

\[\pd{k}{t} + \deld (k\bar{\vec v}) - \deld\left[\left(\frac{\nu_t}{\sigma_k} + \nu\right)\grad k \right] - 4\nu_t \Pi_{D} + \epsilon = 0\]
\[\pd{\varepsilon}{t} + \deld (\varepsilon \bar{\vec v}) - \deld\left[\left(\frac{\nu_t}{\sigma_\varepsilon} + \nu\right)\grad \varepsilon \right] - 4c_1 k \Pi_{D} + c_2 \frac{\epsilon^2}{k} = 0\]
attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
kEpsilon_2D_Evaluate()[source]

Evaluate the coefficients for standard incompressible flow k-epsilon model

kEpsilon_2D_Evaluate_sd()[source]

Evaluate the coefficients for standard incompressible flow k-epsilon model

kEpsilon_3D_Evaluate_sd()[source]

Evaluate the coefficients for standard incompressible flow k-epsilon model 3D

class proteus.TransportCoefficients.kEpsilon_k(flowModelID=0, epsilonModelID=2, nd=2, c_mu=0.09, sigma_k=1.0, g=[0.0, -9.8], nu=1.004e-06, rho=998.0)[source]

Bases: proteus.TransportCoefficients.TC_base

Basic k-epsilon model for incompressible flow from Hutter etal Chaper 11 but solves for just k assuming epsilon computed independently and lagged in time

\(\bar{\vec v} = <\vec v>\) Reynolds-averaged (mean) velocity

\(\vec v^{'} =\) turbulent fluctuation

assume \(\vec v = <\vec v> + \vec v^{'}\), with \(<\vec v^{'}> = 0\)

Reynolds averaged NS equations

\[\deld \bar{\vec v} = 0 \pd{\bar{\vec v}}{t} + \deld \left(\bar{\vec v} \outer \bar{\vec v}\right) -\nu \deld \ten \bar{D} + \frac{1}{\rho}\grad \bar p - \frac{1}{rho}\deld \ten{R} = 0\]

Reynolds stress term

\[\ten R = -\rho <\vec v^{'}\outer \vec v^{'}> \frac{1}{\rho}\ten{R} = 2 \nu_t \bar{D} - \frac{2}{3}k\ten{I} D_{ij}(\vec v) = \frac{1}{2} \left( \pd{v_i}{x_j} + \pd{v_j}{x_i}) \ten D \bar{\ten D} = D(<\vec v>), \ten D^{'} = \ten D(\vec v^{'})\]

k-epsilon tranport equations

\[\pd{k}{t} + \deld (k\bar{\vec v}) - \deld\left[\left(\frac{\nu_t}{\sigma_k} + \nu\right)\grad k \right] - 4\nu_t \Pi_{D} + \epsilon = 0 \pd{\varepsilon}{t} + \deld (\varepsilon \bar{\vec v}) - \deld\left[\left(\frac{\nu_t}{\sigma_\varepsilon} + \nu\right)\grad \varepsilon \right] - 4c_1 k \Pi_{D} + c_2 \frac{\epsilon^2}{k} = 0\]

\(k\) – turbulent kinetic energy = <vec v^{‘}dot vec v^{‘}> \(\varepsilon\) – turbulent dissipation rate = 4 nu <Pi_{D^{‘}}> \(\nu\) – kinematic viscosity (mu/rho) \(\nu_t\) – turbulent viscosity = c_mu frac{k^2}{varepsilon}

\[\Pi_{\ten A} = \frac{1}{2}tr(\ten A^2) = 1/2 \ten A\cdot \ten A \ten D \cdot \ten D = \frac{1}{4}\left[ (4 u_x^2 + 4 v_y^2 + 1/2 (u_y + v_x)^2 \right] 4 \Pi_{D} = 2 \frac{1}{4}\left[ (4 u_x^2 + 4 v_y^2 + 1/2 (u_y + v_x)^2 \right] = \left[ (2 u_x^2 + 2 v_y^2 + (u_y + v_x)^2 \right]\]

\(\sigma_k\) – Prandtl number approx 1 \(\sigma_e\) – c_{mu}/c_e

\[c_{\mu} = 0.09, c_1 = 0.126, c_2 = 1.92, c_{\varepsilon} = 0.07\]
attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
kEpsilon_k_2D_Evaluate_sd()[source]

Evaluate the coefficients for k assuming lagged epsilon for standard incompressible flow k-epsilon model

kEpsilon_k_3D_Evaluate_sd()[source]

Evaluate the coefficients for k assuming lagged epsilon for standard incompressible flow k-epsilon model

class proteus.TransportCoefficients.kEpsilon_epsilon(flowModelID=0, kModelID=1, nd=2, c_mu=0.09, c_1=0.126, c_2=1.92, c_epsilon=0.07, sigma_e=1.29, g=[0.0, -9.8], nu=1.004e-06, rho=998.0)[source]

Bases: proteus.TransportCoefficients.TC_base

Basic k-epsilon model for incompressible flow from Hutter etal Chaper 11 but solves for just epsilon assuming k lagged

\(\bar{\vec v} = <\vec v>\) Reynolds-averaged (mean) velocity

\(\vec v^{'}\) = turbulent fluctuation

assume \(\vec v = <\vec v> + \vec v^{'}\), with \(<\vec v^{'}> = 0\)

Reynolds averaged NS equations

\[\deld \bar{\vec v} = 0 \pd{\bar{\vec v}}{t} + \deld \left(\bar{\vec v} \outer \bar{\vec v}\right) -\nu \deld \ten \bar{D} + \frac{1}{\rho}\grad \bar p - \frac{1}{rho}\deld \ten{R} = 0\]

Reynolds stress term

\[\ten R = -\rho <\vec v^{'}\outer \vec v^{'}> \frac{1}{\rho}\ten{R} = 2 \nu_t \bar{D} - \frac{2}{3}k\ten{I} D_{ij}(\vec v) = \frac{1}{2} \left( \pd{v_i}{x_j} + \pd{v_j}{x_i}) \ten D \bar{\ten D} = D(<\vec v>), \ten D^{'} = \ten D(\vec v^{'})\]

k-epsilon tranport equations

\[\pd{k}{t} + \deld (k\bar{\vec v}) - \deld\left[\left(\frac{\nu_t}{\sigma_k} + \nu\right)\grad k \right] - 4\nu_t \Pi_{D} + \epsilon = 0\]
\[\pd{\varepsilon}{t} + \deld (\varepsilon \bar{\vec v}) - \deld\left[\left(\frac{\nu_t}{\sigma_\varepsilon} + \nu\right)\grad \varepsilon \right] - 4c_1 k \Pi_{D} + c_2 \frac{\epsilon^2}{k} = 0\]

\(k\) – turbulent kinetic energy = <vec v^{‘}dot vec v^{‘}> \(\varepsilon\) – turbulent dissipation rate = 4 nu <Pi_{D^{‘}}> \(\nu\) – kinematic viscosity (mu/rho) \(\nu_t\) – turbulent viscosity = c_mu frac{k^2}{varepsilon}

\[ \begin{align}\begin{aligned}\Pi_{\ten A} = \frac{1}{2}tr(\ten A^2) = 1/2 \ten A\cdot \ten A \ten D \cdot \ten D = \frac{1}{4}\left[ (4 u_x^2 + 4 v_y^2 + 1/2 (u_y + v_x)^2 \right]\\ 4 \Pi_{D} = 2 \frac{1}{4}\left[ (4 u_x^2 + 4 v_y^2 + 1/2 (u_y + v_x)^2 \right] = \left[ (2 u_x^2 + 2 v_y^2 + (u_y + v_x)^2 \right]\end{aligned}\end{align} \]

\(\sigma_k\) – Prandtl number approx 1 \(\sigma_e\)\(c_{\mu}/c_e\)

:math:c_{mu} = 0.09, c_1 = 0.126, c_2 = 1.92, c_{varepsilon} = 0.07`

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
kEpsilon_epsilon_2D_Evaluate_sd()[source]

Evaluate the coefficients for epsilon assuming lagged epsilon for standard incompressible flow k-epsilon model

kEpsilon_epsilon_3D_Evaluate_sd()[source]

Evaluate the coefficients for epsilon assuming lagged epsilon for standard incompressible flow k-epsilon model

class proteus.TransportCoefficients.ReynoldsAveragedNavierStokes_kEpsilon(epsFact=1.5, sigma=72.8, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=None, KN_model=None, epsFact_density=None, stokes=False, sd=True, movingDomain=False, c_mu=0.09, KEmodelID=None)[source]

Bases: proteus.TransportCoefficients.TwophaseNavierStokes_ST_LS_SO

The coefficients for incompresslble fluid governed by the Navier-Stokes equations assuming k-epsilon model for turbulence

KEmodelID = [m1,m2] if using two separate models for k and epsilon otherwise should be just an integer id

attachModels(modelList)[source]
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
ReynoldsAveragedNavierStokes_kEpsilon_2D_Update()[source]

Update the NS coefficients for RANS terms in standard incompressible flow k-epsilon model

ReynoldsAveragedNavierStokes_kEpsilon_2D_Update_sd()[source]

Update the NS coefficients for RANS terms in standard incompressible flow k-epsilon model

class proteus.TransportCoefficients.ReynoldsAveragedNavierStokes_AlgebraicClosure(epsFact=1.5, sigma=72.8, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=None, KN_model=None, epsFact_density=None, stokes=False, sd=True, movingDomain=False, turbulenceClosureFlag=None)[source]

Bases: proteus.TransportCoefficients.TwophaseNavierStokes_ST_LS_SO

The coefficients for incompresslble fluid governed by the Navier-Stokes equations assuming k-epsilon model for turbulence

class proteus.TransportCoefficients.TwophaseReynoldsAveragedNavierStokes_AlgebraicClosure(epsFact=1.5, sigma=72.8, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=None, KN_model=None, epsFact_density=None, stokes=False, sd=True, movingDomain=False, turbulenceClosureFlag=None, smagorinskyConstant_0=0.1, smagorinskyConstant_1=0.1, epsFact_smagorinsky=0.33)[source]

Bases: proteus.TransportCoefficients.TwophaseNavierStokes_ST_LS_SO

The coefficients for incompresslble fluid governed by the Navier-Stokes equations assuming k-epsilon model for turbulence

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
preStep(t, firstStep=False)[source]
evaluate(t, c)[source]
calculateEddyViscosity_Smagorinsky2P_2D()[source]

Calculate simple Smagorinsky eddy viscosity with smoothed Heaviside for 2p calculation

calculateEddyViscosity_Smagorinsky2P_3D()[source]

Calculate simple Smagorinsky eddy viscosity with smoothed Heaviside for 2p calculation

calculateEddyViscosity_Smagorinsky_2D()[source]

Calculate simple Smagorinsky eddy viscosity

calculateEddyViscosity_Smagorinsky_3D()[source]

Calculate simple Smagorinsky eddy viscosity

eddyViscosity_2D_Update()[source]

Update the NS coefficients with eddy viscosity from some closure model

eddyViscosity_2D_Update_sd()[source]

Update the NS coefficients with eddy viscosity from some closure model

eddyViscosity_3D_Update()[source]

Update the NS coefficients with eddy viscosity from some closure model

eddyViscosity_3D_Update_sd()[source]

Update the NS coefficients with eddy viscosity from some closure model

class proteus.TransportCoefficients.ViscousBurgersEqn(v=[1.0, 0.0, 0.0], nu=0.0, nc=1, nd=3, useHJ=False)[source]

Bases: proteus.TransportCoefficients.TC_base

evaluate(t, c)[source]
burgersDiagonalVelEvaluate()[source]

Burgers equations coefficients for a diagonal velocity field

burgersDiagonalVelHJEvaluate()[source]

Burgers equations coefficients for a diagonal velocity field

class proteus.TransportCoefficients.BuckleyLeverettLiuExample(nu=0.0, nc=1, nd=2)[source]

Bases: proteus.TransportCoefficients.TC_base

5 spot example from Liu 93 Siam paper.

S_t + deld (

ec a f(S)) = 0

f(S) = S^2 / (0.2 - 0.4 S + 1.2 S^2)

ec a = (pd{phi}{x},pd{phi}{y})

phi = 0.01 log(sqrt{x^2 + y^2})

However, note that his example is for S=0 injecting into S=1 background saturation using his definition of f

evaluate(t, c)[source]
evaluateBuckleyLeverettLiuExample()[source]

Simplified Buckley Leverett example with potential for velocity field

class proteus.TransportCoefficients.VolumeAveragedNavierStokesFullDevStress(rho=998.2, mu=0.001, g=[0.0, -9.8], nd=2, meanGrainSize=0.01, setParamsFunc=None, stokesOnly=False, meanGrainSizeTypes=None, porosityTypes=None)[source]

Bases: proteus.TransportCoefficients.TC_base

The coefficients for incompressible fluid in a porous domain governed by the Navier-Stokes equations

VolumeAveragedNavierStokesFullDevStress_2D_Evaluate()[source]

evaluate the coefficients of the volume-averaged 2D Navier-Stokes equations

VolumeAveragedNavierStokesFullDevStress_3D_Evaluate()[source]

evaluate the coefficients of the volume-averaged 3D Navier-Stokes equations

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
initializeGeneralizedInterpolationPointQuadrature(t, cip)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.VolumeAveragedTwophaseNavierStokes(epsFact=1.5, sigma=72.8, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=3, KN_model=None, epsFact_density=None, meanGrainSize=0.01, setParamsFunc=None, stokes=False, sd=True, movingDomain=False, turbulenceClosureFlag=None, smagorinskyConstant_0=0.1, smagorinskyConstant_1=0.1, epsFact_smagorinsky=0.33, meanGrainSizeTypes=None, porosityTypes=None, killNonlinearDrag=False, waveFlag=None, waveHeight=0.01, waveCelerity=1.0, waveFrequency=1.0, waveNumber=2.0, waterDepth=0.5, Omega_s=[[0.45, 0.55], [0.2, 0.4], [0.0, 1.0]], epsFact_source=1.0)[source]

Bases: proteus.TransportCoefficients.TwophaseReynoldsAveragedNavierStokes_AlgebraicClosure

The coefficients for two incompresslble fluids governed by the Navier-Stokes equations and separated by a sharp interface represented by a level set function

VolumeAveragedTwophaseNavierStokes_ST_LS_SO_2D_Evaluate()[source]

evaluate the coefficients of the Volume-Averaged 2D Navier-Stokes equations with surface tension

VolumeAveragedTwophaseNavierStokes_ST_LS_SO_2D_Evaluate_sd()[source]

evaluate the coefficients of the Volume-Averaged 2D Navier-Stokes equations with surface tension

VolumeAveragedTwophaseNavierStokes_ST_LS_SO_3D_Evaluate()[source]

evaluate the coefficients of the Volume-Averaged 3D Navier-Stokes equations with surface tension

VolumeAveragedTwophaseNavierStokes_ST_LS_SO_3D_Evaluate_sd()[source]

evaluate the coefficients of the Volume-Averaged 3D Navier-Stokes equations with surface tension

calculateWaveFunction3d_ref()[source]

generate continuity source term for driving waves following Liu etal

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
preStep(t, firstStep=False)[source]
evaluateForcingTerms(t, c, mesh=None, mesh_trial_ref=None, mesh_l2g=None)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.VolumeAveragedVOFCoefficients(LS_model=-1, V_model=0, RD_model=-1, ME_model=1, EikonalSolverFlag=0, checkMass=True, epsFact=0.0, setParamsFunc=None)[source]

Bases: proteus.TransportCoefficients.VOFCoefficients

VolumeAveragedVOFCoefficientsEvaluate()[source]

evaluate the coefficients of the conservative level set advection equation with variable porosity

copyExteriorElementBoundaryValuesFromElementBoundaryValues()[source]

copy quantity in element boundary quadrature array to one that lives only on exterior element boundaries

attachModels(modelList)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.GroundwaterTransportCoefficients(nc=1, omega=0.3, alpha_L=1.0, alpha_T=0.2, d=1.3e-09)[source]

Bases: proteus.TransportCoefficients.TC_base

groundwaterTransportCoefficientsEvaluate()[source]

Evaluate the coefficients of linear advective-diffusion transport in porous media

attachModels(modelList)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.GroundwaterBiodegradation01Coefficients(omega=0.3, alpha_L=1.0, alpha_T=0.2, d_c=1.3e-09, d_e=1.3e-09, Kox_max=100.0, Kox_C=0.1, Kox_E=0.1, Kox_X=0.0035, Yield=0.05, k_d=0.0)[source]

Bases: proteus.TransportCoefficients.TC_base

groundwaterBiodegradation01EvaluateFC()[source]

Evaluate the coefficients of nonlinear advective-diffusion transport in porous media with toy biodegradation system

attachModels(modelList)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.GroundwaterBryantDawsonIonExCoefficients(omega=0.3, alpha_L=1.0, alpha_T=0.2, d_m=1.3e-09, d_h=1.3e-09, K_m=1.0, K_h=1.0, K_w=1.0, Z_tot=100.0)[source]

Bases: proteus.TransportCoefficients.TC_base

groundwaterBryantDawsonIonExEvaluateFC()[source]

Evaluate the coefficients of nonlinear advective-diffusion transport in porous media with model ion-exchange system

attachModels(modelList)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.ConservativeHeadRichardsMualemVanGenuchtenBlockHetV2withUpwind(nd, Ks_block, vgm_n_block, vgm_alpha_block, thetaR_block, thetaSR_block, gravity, density, beta, upwindFlag=0, sd=False)[source]

Bases: proteus.TransportCoefficients.TC_base

version of Re where element material type id’s used in evals

conservativeHeadRichardsMualemVanGenuchtenHetEvaluateV2()[source]

evaluate the coefficients of Richards’ equation

conservativeHeadRichardsMualemVanGenuchtenHetEvaluateV2withUpwind()[source]

evaluate the coefficients of Richards’ equation

conservativeHeadRichardsMualemVanGenuchtenHetEvaluateV2withUpwindAndHarm()[source]

evaluate the coefficients of Richards’ equation with upwinding and harmonic average for Ks

conservativeHeadRichardsMualemVanGenuchtenHetEvaluateV2withUpwindAndHarm_sd()[source]

evaluate the coefficients of Richards’ equation with upwinding and harmonic average for Ks

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.DiffusiveWave_1D(alpha=1.6666666666666667, gamma=0.5, epsilon=1e-06, bathymetryFunc=None, reactionFunc=None, analyticalSoln=None)[source]

Bases: proteus.TransportCoefficients.TC_base

Construct a coefficients object given the parameters of the Manning/Chezy formula and the regularization parameter.

Optionally provide a function for bathymetry, right hand side (source), and an analytical solution. The

diffusiveWave1DCoefficientsEvaluate()[source]

Evaluate the coefficients of the 1D diffusive wave equation

initializeMesh(mesh)[source]

Set the y component of the 1D mesh using the bathymetry function.

initializeElementQuadrature(t, cq)[source]

Set the y component of the element quadrature points using the bathymetry function.

initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]

Set the y component of the element boundary quadrature points using the bathymetry function.

initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]

Set the y component of the exterior element boundary quadrature points using the bathymetry function.

initializeGeneralizedInterpolationPointQuadrature(t, cip)[source]

Set the y component of the generlatized interpolation points using the bathymetry function.

evaluate(t, c)[source]

Evaluated the coefficients of the 1D diffusive wave model.

class proteus.TransportCoefficients.DiffusiveWave_2D(nd=2, alpha=1.6666666666666667, gamma=0.5, epsilon=1e-06, bathymetryFunc=None, bathymetryGradientFunc=None)[source]

Bases: proteus.TransportCoefficients.TC_base

Construct a coefficients object given the parameters of the Manning/Chezy formula and the regularization parameter.

Optionally provide a function for bathymetry, right hand side (source), and an analytical solution. The

diffusiveWave2DCoefficientsEvaluate()[source]

Evaluate the coefficients of the 2D diffusive wave equation

initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
initializeGeneralizedInterpolationPointQuadrature(t, cip)[source]
evaluate(t, c)[source]

Evaluated the coefficients of the 2D diffusive wave model.

class proteus.TransportCoefficients.TwophaseNavierStokesWithWaveMaker(epsFact=1.5, sigma=72.8, rho_0=998.2, nu_0=1.004e-06, rho_1=1.205, nu_1=1.5e-05, g=[0.0, -9.8], nd=2, LS_model=None, KN_model=None, epsFact_density=None, stokes=False, sd=True, turbulenceClosureFlag=None, smagorinskyConstant_0=0.1, smagorinskyConstant_1=0.1, epsFact_smagorinsky=0.33, movingDomain=False, waveFlag=0, waveHeight=0.01, waveCelerity=1.0, waveFrequency=1.0, waveNumber=2.0, waterDepth=0.5, Omega_s=[[0.45, 0.55], [0.2, 0.4], [0.0, 1.0]], epsFact_source=1.0)[source]

Bases: proteus.TransportCoefficients.TwophaseReynoldsAveragedNavierStokes_AlgebraicClosure

initializeMesh(mesh)[source]
evaluate(t, c)[source]
class proteus.TransportCoefficients.SinglePhaseDarcyCoefficients(a_types, source_types, nc=1, nd=2, timeVaryingCoefficients=False)[source]

Bases: proteus.TransportCoefficients.TC_base

  • div(a grad p) = f

supposed to use harm average for a with interface coefficients

TODO
allow a, f to be time varying
initializeMesh(mesh)[source]
initializeElementQuadrature(t, cq)[source]
initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]
initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]
evaluate(t, c)[source]