Package esys :: Package escript :: Module flows :: Class DarcyFlow
[hide private]
[frames] | no frames]

Class DarcyFlow

object --+
         |
        DarcyFlow

solves the problem

u_i+k_{ij}*p_{,j} = g_i u_{i,i} = f

where p represents the pressure and u the Darcy flux. k represents the permeability,

Instance Methods [hide private]
 
__init__(self, domain, useReduced=False, solver='POST', verbose=False, w=1.0)
initializes the Darcy flux problem :param domain: domain of the problem :type domain: Domain :param useReduced: uses reduced oreder on flux and pressure :type useReduced: bool :param solver: solver method :type solver: in [DarcyFlow.EVAL, DarcyFlow.POST', `DarcyFlow.SMOOTH' ] :param verbose: if ``True` some information on the iteration progress are printed.
escript.Data
getFlux(self, p, u0=None)
returns the flux for a given pressure p where the flux is equal to u0 on locations where location_of_fixed_flux is positive (see setValue).
 
getSolverOptionsFlux(self)
Returns the solver options used to solve the flux problems :return: SolverOptions
 
getSolverOptionsPressure(self)
Returns the solver options used to solve the pressure problems :return: SolverOptions
 
setSolverOptionsFlux(self, options=None)
Sets the solver options used to solve the flux problems If options is not present, the options are reset to default :param options: SolverOptions
 
setSolverOptionsPressure(self, options=None)
Sets the solver options used to solve the pressure problems If options is not present, the options are reset to default
 
setValue(self, f=None, g=None, location_of_fixed_pressure=None, location_of_fixed_flux=None, permeability=None)
assigns values to model parameters
tuple of escript.Data.
solve(self, u0, p0)
solves the problem.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  EVAL = 'EVAL'
direct pressure gradient evaluation for flux
  POST = 'POST'
global postprocessing of flux by solving the PDE K_{ij} u_j + (w * K * l u_{k,k})_{,i}= - p_{,j} + K_{ij} g_j where l is the length scale, K is the inverse of the permeability tensor, and w is a positive weighting factor.
  SIMPLE = 'EVAL'
  SMOOTH = 'SMOOTH'
global smoothing by solving the PDE K_{ij} u_j= - p_{,j} + K_{ij} g_j
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, domain, useReduced=False, solver='POST', verbose=False, w=1.0)
(Constructor)

 
initializes the Darcy flux problem :param domain: domain of the problem :type domain: Domain :param useReduced: uses reduced oreder on flux and pressure :type useReduced: bool :param solver: solver method :type solver: in [DarcyFlow.EVAL, DarcyFlow.POST', `DarcyFlow.SMOOTH' ] :param verbose: if ``True` some information on the iteration progress are printed. :type verbose: bool :param w: weighting factor for DarcyFlow.POST solver :type w: float
Overrides: object.__init__

getFlux(self, p, u0=None)

 
returns the flux for a given pressure p where the flux is equal to u0 on locations where location_of_fixed_flux is positive (see setValue). Notice that g is used, see setValue.
Parameters:
  • p (scalar value on the domain (e.g. escript.Data).) - pressure.
  • u0 (vector values on the domain (e.g. escript.Data) or None) - flux on the locations of the domain marked be location_of_fixed_flux.
Returns: escript.Data
flux

setSolverOptionsPressure(self, options=None)

 
Sets the solver options used to solve the pressure problems If options is not present, the options are reset to default
Parameters:

Note: if the adaption of subtolerance is choosen, the tolerance set by options will be overwritten before the solver is called.

setValue(self, f=None, g=None, location_of_fixed_pressure=None, location_of_fixed_flux=None, permeability=None)

 
assigns values to model parameters
Parameters:
  • f (scalar value on the domain (e.g. escript.Data)) - volumetic sources/sinks
  • g (vector values on the domain (e.g. escript.Data)) - flux sources/sinks
  • location_of_fixed_pressure (scalar value on the domain (e.g. escript.Data)) - mask for locations where pressure is fixed
  • location_of_fixed_flux (vector values on the domain (e.g. escript.Data)) - mask for locations where flux is fixed.
  • permeability (scalar or symmetric tensor values on the domain (e.g. escript.Data)) - permeability tensor. If scalar s is given the tensor with s on the main diagonal is used.
Notes:
  • the values of parameters which are not set by calling setValue are not altered.
  • at any point on the boundary of the domain the pressure (location_of_fixed_pressure >0) or the normal component of the flux (location_of_fixed_flux[i]>0) if direction of the normal is along the x_i axis.

solve(self, u0, p0)

 
solves the problem.
Parameters:
  • u0 (vector value on the domain (e.g. escript.Data).) - initial guess for the flux. At locations in the domain marked by location_of_fixed_flux the value of u0 is kept unchanged.
  • p0 (scalar value on the domain (e.g. escript.Data).) - initial guess for the pressure. At locations in the domain marked by location_of_fixed_pressure the value of p0 is kept unchanged.
Returns: tuple of escript.Data.
flux and pressure