mreten

package
v0.0.0-...-54c0f88 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2015 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

package mreten implements models for liquid retention curves

References:
 [1] Pedroso DM, Sheng D and Zhao, J (2009) The concept of reference curves for constitutive
     modelling in soil mechanics, Computers and Geotechnics, 36(1-2), 149-165,
     http://dx.doi.org/10.1016/j.compgeo.2008.01.009
 [2] Pedroso DM and Williams DJ (2010) A novel approach for modelling soil-water
     characteristic curves with hysteresis, Computers and Geotechnics, 37(3), 374-380,
     http://dx.doi.org/10.1016/j.compgeo.2009.12.004
 [3] Pedroso DM and Williams DJ (2011) Automatic Calibration of soil-water characteristic
     curves using genetic algorithms. Computers and Geotechnics, 38(3), 330-340,
     http://dx.doi.org/10.1016/j.compgeo.2010.12.004

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(tst *testing.T, mdl Model, pc0, sl0, pcf float64, npts int, tolCc, tolD1a, tolD1b, tolD2a, tolD2b float64, verbose bool, pcSkip []float64, tolSkip float64, doplot bool)

Check checks derivatives

func LogModels

func LogModels()

LogModels prints to log information on existent and allocated Models

func Plot

func Plot(mdl Model, pc0, sl0, pcf float64, npts int, args1, args2, label string) (err error)

Plot plots retention model

args1 -- arguments for model computed by solving differential equation; e.g. "'b*-'"
         if args1 == "", plot is skiped
args2 -- arguments for model computed by directly calling sl(pc), if available
         if args2 == "", plot is skiped

func PlotEnd

func PlotEnd(show bool)

PlotEnd ends plot and show figure, if show==true

func Update

func Update(mdl Model, pc0, sl0, Δpc float64) (slNew float64, err error)

Update updates pc and sl for given Δpc. An implicit ODE solver is used.

Types

type BrooksCorey

type BrooksCorey struct {
	// contains filtered or unexported fields
}

BrooksCorey implements Books and Corey' model

func (BrooksCorey) Cc

func (o BrooksCorey) Cc(pc, sl float64, wet bool) (float64, error)

Cc computes Cc(pc) := dsl/dpc

func (BrooksCorey) Derivs

func (o BrooksCorey) Derivs(pc, sl float64, wet bool) (L, Lx, J, Jx, Jy float64, err error)

Derivs computes all derivatives

func (BrooksCorey) GetPrms

func (o BrooksCorey) GetPrms(example bool) fun.Prms

GetPrms gets (an example) of parameters

func (*BrooksCorey) Init

func (o *BrooksCorey) Init(prms fun.Prms) (err error)

Init initialises model

func (BrooksCorey) J

func (o BrooksCorey) J(pc, sl float64, wet bool) (float64, error)

J computes J = ∂Cc/∂sl

func (BrooksCorey) L

func (o BrooksCorey) L(pc, sl float64, wet bool) (float64, error)

L computes L = ∂Cc/∂pc

func (BrooksCorey) Sl

func (o BrooksCorey) Sl(pc float64) float64

Sl computes sl directly from pc

func (BrooksCorey) SlMin

func (o BrooksCorey) SlMin() float64

SlMin returns sl_min

type Lin

type Lin struct {
	// contains filtered or unexported fields
}

Lin implements a linear retetion model: sl(pc) := 1 - λ*pc

func (Lin) Cc

func (o Lin) Cc(pc, sl float64, wet bool) (float64, error)

Cc computes Cc(pc) := dsl/dpc

func (Lin) Derivs

func (o Lin) Derivs(pc, sl float64, wet bool) (L, Lx, J, Jx, Jy float64, err error)

Derivs compute ∂Cc/∂pc and ∂²Cc/∂pc²

func (Lin) GetPrms

func (o Lin) GetPrms(example bool) fun.Prms

GetPrms gets (an example) of parameters

func (*Lin) Init

func (o *Lin) Init(prms fun.Prms) (err error)

Init initialises model

func (Lin) J

func (o Lin) J(pc, sl float64, wet bool) (float64, error)

J computes J = ∂Cc/∂sl

func (Lin) L

func (o Lin) L(pc, sl float64, wet bool) (float64, error)

L computes L = ∂Cc/∂pc

func (Lin) Sl

func (o Lin) Sl(pc float64) float64

Sl computes sl directly from pc

func (Lin) SlMin

func (o Lin) SlMin() float64

SlMin returns sl_min

type Model

type Model interface {
	Init(prms fun.Prms) error                                              // initialises retention model
	GetPrms(example bool) fun.Prms                                         // gets (an example) of parameters
	SlMin() float64                                                        // returns sl_min
	Cc(pc, sl float64, wet bool) (float64, error)                          // computes Cc = f = ∂sl/∂pc
	L(pc, sl float64, wet bool) (float64, error)                           // computes L = ∂Cc/∂pc
	J(pc, sl float64, wet bool) (float64, error)                           // computes J = ∂Cc/∂sl
	Derivs(pc, sl float64, wet bool) (L, Lx, J, Jx, Jy float64, err error) // computes all derivatives
}

Model implements a liquid retention model (LRM)

Derivs computes (see [1] page 618):
  L  = ∂Cc/∂pc
  Lx = ∂²Cc/∂pc²
  J  = ∂Cc/∂sl
  Jx == ∂²Cc/(∂pc ∂sl)
  Jy == ∂²Cc/∂sl²
References:
 [1] Pedroso DM (2015) A consistent u-p formulation for porous media with hysteresis.
     Int Journal for Numerical Methods in Engineering, 101(8) 606-634
     http://dx.doi.org/10.1002/nme.4808

func GetModel

func GetModel(simfnk, matname, modelname string, getnew bool) Model

GetModel returns (existent or new) liquid retention model

simfnk    -- unique simulation filename key
matname   -- name of material
modelname -- model name
getnew    -- force a new allocation; i.e. do not use any model found in database
Note: returns nil on errors

type Nonrate

type Nonrate interface {
	Sl(pc float64) float64 // compute sl directly from pc
}

Nonrate is a subset of LRM that directly computes saturation from capillary pressure

type RefM1

type RefM1 struct {
	A float64 // Amplitude and pc_ref for non-default model

	// temporary variables (calculated by wetting or drying functions)
	Dw float64 // [temporary] wetting
	Dd float64 // [temporary] drying
	D  float64 // [temporary] wetting/drying
	// contains filtered or unexported fields
}

RefM1 implements a nonlinear liquid retention model based on the concept of references [1,2,3]

References:
 [1] Pedroso DM, Sheng D and Zhao, J (2009) The concept of reference curves for constitutive
     modelling in soil mechanics, Computers and Geotechnics, 36(1-2), 149-165,
     http://dx.doi.org/10.1016/j.compgeo.2008.01.009
 [2] Pedroso DM and Williams DJ (2010) A novel approach for modelling soil-water
     characteristic curves with hysteresis, Computers and Geotechnics, 37(3), 374-380,
     http://dx.doi.org/10.1016/j.compgeo.2009.12.004
 [3] Pedroso DM and Williams DJ (2011) Automatic Calibration of soil-water characteristic
     curves using genetic algorithms. Computers and Geotechnics, 38(3), 330-340,
     http://dx.doi.org/10.1016/j.compgeo.2010.12.004

func (*RefM1) Cc

func (o *RefM1) Cc(pc, sl float64, wet bool) (Ccval float64, err error)

compute Cc(pc,sl) := dsl/dpc

func (*RefM1) Derivs

func (o *RefM1) Derivs(pc, sl float64, wet bool) (L, Lx, J, Jx, Jy float64, err error)

derivatives

func (RefM1) GetPrms

func (o RefM1) GetPrms(example bool) fun.Prms

GetPrms gets (an example) of parameters

func (*RefM1) Init

func (o *RefM1) Init(prms fun.Prms) (err error)

Init initialises model

func (RefM1) J

func (o RefM1) J(pc, sl float64, wet bool) (float64, error)

J computes J = ∂Cc/∂sl

func (RefM1) L

func (o RefM1) L(pc, sl float64, wet bool) (float64, error)

L computes L = ∂Cc/∂pc

func (RefM1) SlMin

func (o RefM1) SlMin() float64

SlMin returns sl_min

type VanGen

type VanGen struct {
	// contains filtered or unexported fields
}

VanGen implements van Genuchten's model

func (VanGen) Cc

func (o VanGen) Cc(pc, sl float64, wet bool) (float64, error)

Cc computes Cc(pc) := dsl/dpc

func (VanGen) Derivs

func (o VanGen) Derivs(pc, sl float64, wet bool) (L, Lx, J, Jx, Jy float64, err error)

Derivs compute ∂Cc/∂pc and ∂²Cc/∂pc²

func (VanGen) GetPrms

func (o VanGen) GetPrms(example bool) fun.Prms

GetPrms gets (an example) of parameters

func (*VanGen) Init

func (o *VanGen) Init(prms fun.Prms) (err error)

Init initialises model

func (VanGen) J

func (o VanGen) J(pc, sl float64, wet bool) (float64, error)

J computes J = ∂Cc/∂sl

func (VanGen) L

func (o VanGen) L(pc, sl float64, wet bool) (float64, error)

L computes L = ∂Cc/∂pc

func (VanGen) Sl

func (o VanGen) Sl(pc float64) float64

Sl computes sl directly from pc

func (VanGen) SlMin

func (o VanGen) SlMin() float64

SlMin returns sl_min

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL