<s> import OpenPNM <EOL> import scipy as sp <EOL> print ( '<STR_LIT>' + OpenPNM . __version__ ) <EOL> pn = OpenPNM . Network . Cubic ( shape = [ <NUM_LIT:10> , <NUM_LIT:10> , <NUM_LIT> ] , spacing = <NUM_LIT> ) <EOL> pn . add_boundaries ( ) <EOL> Ps = pn . pores ( '<STR_LIT>' , mode = '<STR_LIT>' ) <EOL> Ts = pn . find_neighbor_throats ( pores = Ps , mode = '<STR_LIT>' , flatten = True ) <EOL> geom = OpenPNM . Geometry . Toray090 ( network = pn , pores = Ps , throats = Ts ) <EOL> Ps = pn . pores ( '<STR_LIT>' ) <EOL> Ts = pn . find_neighbor_throats ( pores = Ps , mode = '<STR_LIT>' ) <EOL> boun = OpenPNM . Geometry . Boundary ( network = pn , pores = Ps , throats = Ts ) <EOL> air = OpenPNM . Phases . Air ( network = pn , name = '<STR_LIT>' ) <EOL> phys_air = OpenPNM . Physics . Standard ( network = pn , phase = air , pores = sp . r_ [ <NUM_LIT> : pn . Np ] , throats = pn . Ts ) <EOL> phys_air [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air . add_model ( model = OpenPNM . Physics . models . generic_source_term . power_law , <EOL> propname = '<STR_LIT>' , <EOL> A1 = '<STR_LIT>' , <EOL> A2 = '<STR_LIT>' , <EOL> A3 = '<STR_LIT>' , <EOL> x = '<STR_LIT>' , <EOL> regen_mode = '<STR_LIT>' ) <EOL> phys_air [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air [ '<STR_LIT>' ] = <NUM_LIT:0.5> <EOL> phys_air [ '<STR_LIT>' ] = <NUM_LIT:2> <EOL> phys_air [ '<STR_LIT>' ] = - <NUM_LIT> <EOL> phys_air [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air . add_model ( model = OpenPNM . Physics . models . generic_source_term . natural_exponential , <EOL> propname = '<STR_LIT>' , <EOL> A1 = '<STR_LIT>' , <EOL> A2 = '<STR_LIT>' , <EOL> A3 = '<STR_LIT>' , <EOL> A4 = '<STR_LIT>' , <EOL> A5 = '<STR_LIT>' , <EOL> x = '<STR_LIT>' , <EOL> regen_mode = '<STR_LIT>' ) <EOL> phys_air2 = OpenPNM . Physics . Standard ( network = pn , phase = air , pores = sp . r_ [ <NUM_LIT:0> : <NUM_LIT> ] ) <EOL> phys_air2 [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air2 [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air2 [ '<STR_LIT>' ] = <NUM_LIT> <EOL> phys_air2 . add_model ( model = OpenPNM . Physics . models . generic_source_term . power_law , <EOL> propname = '<STR_LIT>' , <EOL> A1 = '<STR_LIT>' , <EOL> A2 = '<STR_LIT>' , <EOL> A3 = '<STR_LIT>' , <EOL> x = '<STR_LIT>' , <EOL> regen_mode = '<STR_LIT>' ) <EOL> alg = OpenPNM . Algorithms . FickianDiffusion ( network = pn , phase = air ) <EOL> BC1_pores = pn . pores ( '<STR_LIT>' ) <EOL> alg . set_boundary_conditions ( bctype = '<STR_LIT>' , bcvalue = <NUM_LIT> , pores = BC1_pores ) <EOL> BC2_pores = pn . pores ( '<STR_LIT>' ) <EOL> alg . set_boundary_conditions ( bctype = '<STR_LIT>' , bcvalue = <NUM_LIT> * <NUM_LIT> , pores = BC2_pores ) <EOL> alg . set_source_term ( source_name = '<STR_LIT>' , pores = sp . r_ [ <NUM_LIT> : <NUM_LIT> ] ) <EOL> alg . set_source_term ( source_name = '<STR_LIT>' , pores = sp . r_ [ <NUM_LIT> : <NUM_LIT> ] ) <EOL> alg . setup ( ) <EOL> alg . solve ( ) <EOL> alg . return_results ( ) <EOL> phys_air . regenerate ( ) <EOL> phys_air2 . regenerate ( ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' , alg . _steps ) <EOL> print ( '<STR_LIT>' , alg . _tol_reached ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' , sp . sum ( <NUM_LIT> * air [ '<STR_LIT>' ] [ sp . r_ [ <NUM_LIT> : <NUM_LIT> ] ] ** <NUM_LIT> + <NUM_LIT> ) + sp . sum ( <NUM_LIT> * air [ '<STR_LIT>' ] [ sp . r_ [ <NUM_LIT> : <NUM_LIT> ] ] ** <NUM_LIT> + <NUM_LIT> ) ) <EOL> print ( '<STR_LIT>' , alg . rate ( sp . r_ [ <NUM_LIT> : <NUM_LIT> ] ) [ <NUM_LIT:0> ] ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' , sp . sum ( <NUM_LIT> * sp . exp ( <NUM_LIT:0.5> * air [ '<STR_LIT>' ] [ sp . r_ [ <NUM_LIT> : <NUM_LIT> ] ] ** <NUM_LIT:2> - <NUM_LIT> ) + <NUM_LIT> ) ) <EOL> print ( '<STR_LIT>' , alg . rate ( sp . r_ [ <NUM_LIT> : <NUM_LIT> ] ) [ <NUM_LIT:0> ] ) </s>
