pydfnWorks
python wrapper for dfnWorks
|
Functions | |
def | get_laplacian_sparse_mat (G, nodelist=None, weight=None, dtype=None, format='lil') |
def | prepare_graph_with_attributes (inflow, outflow, G=None) |
def | solve_flow_on_graph (Gtilde, Pin, Pout, fluid_viscosity=8.9e-4) |
def | run_graph_flow (self, inflow, outflow, Pin, Pout, fluid_viscosity=8.9e-4, G=None) |
def pydfnworks.dfnGraph.graph_flow.get_laplacian_sparse_mat | ( | G, | |
nodelist = None , |
|||
weight = None , |
|||
dtype = None , |
|||
format = 'lil' |
|||
) |
Get the matrices D, A that make up the Laplacian sparse matrix in desired sparsity format. Used to enforce boundary conditions by modifying rows of L = D - A Parameters ---------- G : object NetworkX graph equipped with weight attribute nodelist : list list of nodes of G for which laplacian is desired. Default is None in which case, all the nodes weight : string For weighted Laplacian, else all weights assumed unity dtype : default is None, cooresponds to float format: string sparse matrix format, csr, csc, coo, lil_matrix with default being lil Returns ------- D : sparse 2d float array Diagonal part of Laplacian A : sparse 2d float array Adjacency matrix of graph
Definition at line 10 of file graph_flow.py.
Referenced by pydfnworks.dfnGraph.graph_flow.solve_flow_on_graph().
def pydfnworks.dfnGraph.graph_flow.prepare_graph_with_attributes | ( | inflow, | |
outflow, | |||
G = None |
|||
) |
Create a NetworkX graph, prepare it for flow solve by equipping edges with attributes, renumber vertices, and tag vertices which are on inlet or outlet Parameters ---------- inflow : string name of file containing list of DFN fractures on inflow boundary outflow: string name of file containing list of DFN fractures on outflow boundary Returns ------- Gtilde : NetworkX graph
Definition at line 54 of file graph_flow.py.
Referenced by pydfnworks.dfnGraph.graph_flow.run_graph_flow().
def pydfnworks.dfnGraph.graph_flow.run_graph_flow | ( | self, | |
inflow, | |||
outflow, | |||
Pin, | |||
Pout, | |||
fluid_viscosity = 8.9e-4 , |
|||
G = None |
|||
) |
Run the graph flow portion of the workflow Parameters ---------- self : object DFN Class inflow : string name of file containing list of DFN fractures on inflow boundary outflow: string name of file containing list of DFN fractures on outflow boundary Pin : double Value of pressure (in Pa) at inlet Pout : double Value of pressure (in Pa) at outlet fluid_viscosity : double optional, in Pa-s, default is for water Returns ------- Gtilde : NetworkX graph Grtilde is updated with vertex pressures, edge fluxes and travel times Notes ----- Information on individual functions in found therein
Definition at line 172 of file graph_flow.py.
References pydfnworks.dfnGraph.graph_flow.prepare_graph_with_attributes(), and pydfnworks.dfnGraph.graph_flow.solve_flow_on_graph().
def pydfnworks.dfnGraph.graph_flow.solve_flow_on_graph | ( | Gtilde, | |
Pin, | |||
Pout, | |||
fluid_viscosity = 8.9e-4 |
|||
) |
Given a NetworkX graph prepared for flow solve, solve for vertex pressures, and equip edges with attributes (Darcy) flux and time of travel Parameters ---------- Gtilde : NetworkX graph Pin : double Value of pressure (in Pa) at inlet Pout : double Value of pressure (in Pa) at outlet fluid_viscosity : double optional, in Pa-s, default is for water Returns ------- Gtilde : NetworkX graph Gtilde is updated with vertex pressures, edge fluxes and travel times
Definition at line 104 of file graph_flow.py.
References pydfnworks.dfnGraph.graph_flow.get_laplacian_sparse_mat().
Referenced by pydfnworks.dfnGraph.graph_flow.run_graph_flow().