mporous

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: 9 Imported by: 0

Documentation

Overview

package mporous implements models for porous media based on the Theory of Porous Media

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
 [2] Pedroso DM (2015) A solution to transient seepage in unsaturated porous media.
     Computer Methods in Applied Mechanics and Engineering, 285 791-816
     http://dx.doi.org/10.1016/j.cma.2014.12.009

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPathCycle

func GetPathCycle(pc0 float64, P []float64, np int) (Pc []float64)

GetPathCycle sets a path with cycles of drying-wetting

pc0   -- initial capillary pressure
P     -- example: {10, 5, 20, 0}
np    -- number of points in each branch

func LogModels

func LogModels()

LogModels prints to log information on existent and allocated Models

Types

type Driver

type Driver struct {

	// input
	Mdl *Model // porous model

	// settings
	Silent  bool    // do not show error messages
	CheckD  bool    // do check consistent matrix
	UseDfwd bool    // use DerivFwd (forward differences) instead of DerivCen (central differences) when checking D
	TolCcb  float64 // tolerance to check Ccb
	TolCcd  float64 // tolerance to check Ccd
	VerD    bool    // verbose check of D

	// results
	Res []*State // results
}

Driver run simulations with models for porous media

func (*Driver) Init

func (o *Driver) Init(mdl *Model) (err error)

Init initialises driver

func (*Driver) Run

func (o *Driver) Run(Pc []float64) (err error)

Run runs simulation

type LsVars

type LsVars struct {
	A_ρl, A_ρ, A_p, Cpl, Cvs                float64
	Dρdpl, Dpdpl, DCpldpl, DCvsdpl, Dklrdpl float64
	DρldusM, DρdusM, DCpldusM               float64
}

LsVars hold data for liquid-solid computations

type Model

type Model struct {

	// constants
	NmaxIt  int     // max number iterations in Update
	Itol    float64 // iterations tolerance in Update
	PcZero  float64 // minimum value allowed for pc
	MEtrial bool    // perform Modified-Euler trial to start update process
	ShowR   bool    // show residual values in Update
	AllBE   bool    // use BE for all models, including those that directly implements sl=f(pc)
	Ncns    bool    // use non-consistent method for all derivatives (see [1])
	Ncns2   bool    // use non-consistent method only for second order derivatives (see [1])

	// parameters
	Nf0   float64 // nf0: initial volume fraction of all fluids ~ porosity
	RhoL0 float64 // ρL0: initial liquid real density
	RhoG0 float64 // ρG0: initial gas real density
	RhoS0 float64 // real (intrinsic) density of solids
	BulkL float64 // liquid bulk moduli at temperature θini
	RTg   float64 // R*Θ*g: initial gas constant
	Gref  float64 // reference gravity, at time of measuring ksat, kgas
	Pkl   float64 // isotrpic liquid saturated conductivity
	Pkg   float64 // isotrpic gas saturated conductivity

	// derived
	Cl    float64     // liquid compresssibility
	Cg    float64     // gas compressibility
	Klsat [][]float64 // klsat ÷ Gref
	Kgsat [][]float64 // kgsat ÷ Gref

	// conductivity and retention models
	Cnd mconduct.Model // liquid-gas conductivity models
	Lrm mreten.Model   // retention model
	// contains filtered or unexported fields
}

Model holds material parameters for porous media

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
 [2] Pedroso DM (2015) A solution to transient seepage in unsaturated porous media.
     Computer Methods in Applied Mechanics and Engineering, 285 791-816
     http://dx.doi.org/10.1016/j.cma.2014.12.009

func GetModel

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

GetModel returns (existent or new) model for porous media

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

func (Model) CalcLs

func (o Model) CalcLs(res *LsVars, sta *State, pl, divus float64, derivs bool) (err error)

CalcLs calculates variables for liquid-solid simulations

func (Model) Ccb

func (o Model) Ccb(s *State, pc float64) (dsldpc float64, err error)

Ccb (Cc-bar) returns dsl/dpc consistent with the update method

See Eq. (54) on page 618 of [1]

func (Model) Ccd

func (o Model) Ccd(s *State, pc float64) (dCcdpc float64, err error)

Ccd (Cc-dash) returns dCc/dpc consistent with the update method

See Eqs. (55) and (56) on page 618 of [1]

func (Model) GetPrms

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

GetPrms gets (an example) of parameters

func (*Model) Init

func (o *Model) Init(prms fun.Prms, cnd mconduct.Model, lrm mreten.Model) (err error)

Init initialises this structure

func (Model) NewState

func (o Model) NewState(ρL, ρG, pl, pg float64) (s *State, err error)

NewState creates and initialises a new state structure

Note: returns nil on errors

func (Model) Update

func (o Model) Update(s *State, Δpl, Δpg, pl, pg float64) (err error)

Update updates state

pl and pg are updated (new) values

type State

type State struct {
	A_ns0 float64 // 1 initial partial fraction of solids
	A_sl  float64 // 2 liquid saturation
	A_ρL  float64 // 3 real (intrinsic) density of liquid
	A_ρG  float64 // 4 real (intrinsic) density of gas
	A_Δpc float64 // 5 step increment of capillary pressure
	A_wet bool    // 6 wetting flag
}

State holds state variables for porous media with liquid and gas

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
 [2] Pedroso DM (2015) A solution to transient seepage in unsaturated porous media.
     Computer Methods in Applied Mechanics and Engineering, 285 791-816
     http://dx.doi.org/10.1016/j.cma.2014.12.009

func (State) GetCopy

func (o State) GetCopy() *State

GetCopy returns a copy of State

func (*State) Set

func (o *State) Set(s *State)

Set sets this State with another State

Jump to

Keyboard shortcuts

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