Geometry Helpers¶
The voids.geom sub-package provides functions for normalizing characteristic pore
and throat sizes and computing hydraulic conductances.
Characteristic Size¶
voids.geom.characteristic
¶
area_equivalent_diameter
¶
Return the circular-equivalent diameter associated with an area array.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
area
|
ndarray
|
Cross-sectional area array. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Diameter defined by |
Source code in src/voids/geom/characteristic.py
normalize_characteristic_size
¶
Normalize a size-like field to a characteristic diameter surrogate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
ndarray
|
Raw size-like field values. |
required |
field_name
|
str | None
|
Source field name, used to convert radii and areas to diameters. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Characteristic-size array interpreted as a diameter-like quantity. |
Source code in src/voids/geom/characteristic.py
characteristic_size
¶
Return a preferred characteristic size array from a pore/throat store.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
store
|
Mapping[str, object]
|
Mapping such as |
required |
expected_shape
|
tuple[int, ...] | None
|
Optional expected array shape. |
None
|
fields
|
tuple[str, ...]
|
Ordered field priority. The default is
|
_CHARACTERISTIC_SIZE_FIELDS
|
Returns:
| Type | Description |
|---|---|
tuple
|
Pair |
Raises:
| Type | Description |
|---|---|
KeyError
|
If none of the requested fields exists. |
ValueError
|
If a selected field does not match |
Source code in src/voids/geom/characteristic.py
Hydraulic Geometry¶
voids.geom.hydraulic
¶
generic_poiseuille_conductance
¶
Compute throat conductance using a circular Poiseuille approximation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Network containing throat geometry or precomputed hydraulic conductance. |
required |
viscosity
|
float | ndarray | None
|
Dynamic viscosity. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Conductance array for all throats. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If viscosity is non-positive or if precomputed conductance is negative. |
KeyError
|
If required geometry is missing. |
Notes
When no precomputed conductance is supplied, the model uses
g = pi * r**4 / (8 * mu * L)
with radius inferred from either throat.diameter_inscribed or
throat.area.
Source code in src/voids/geom/hydraulic.py
hagen_poiseuille_conductance
¶
Compute the Hagen-Poiseuille conduit conductance.
When pore-throat-pore conduit lengths and pore/throat areas are available,
the model computes the harmonic series conductance of the pore-1, throat,
and pore-2 segments, with each segment using
g = A**2 / (8 * pi * mu * L). If that conduit decomposition is
unavailable, it falls back to the single throat circular Poiseuille model,
which is the same segment law applied to one throat segment.
Source code in src/voids/geom/hydraulic.py
valvatne_blunt_throat_conductance
¶
Compute shape-aware throat conductance using throat geometry only.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Network containing throat length and cross-sectional geometry. |
required |
viscosity
|
float | ndarray | None
|
Dynamic viscosity. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Shape-aware throat conductance array. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If viscosity is not positive. |
KeyError
|
If required throat geometry is unavailable. |
Source code in src/voids/geom/hydraulic.py
valvatne_blunt_conductance
¶
Compute a shape-factor-aware single-phase conductance following Valvatne-Blunt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Network containing throat and, ideally, pore geometry. |
required |
viscosity
|
float | ndarray | None
|
Dynamic viscosity. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Throat conductance array. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If viscosity is not positive. |
Notes
This implements the single-phase geometric closure used in the Imperial College Valvatne-Blunt style network model:
- segment conductance is evaluated as
g = k * G * A**2 / (mu * L) k = 3/5for triangular ductsk = 0.5623for square ductsk = 1/2for circular ducts
The selection logic is:
- If
throat.hydraulic_conductanceis explicitly present, return it. - Else, if conduit lengths and pore/throat shape data are available, compute a harmonic pore1-core-pore2 conductance.
- Else, if throat-only shape data are available, use a throat-only model.
- Else, warn and fall back to circular Poiseuille conductance.
This is still a single-phase closure; corner films and multiphase occupancy are intentionally out of scope here.
Source code in src/voids/geom/hydraulic.py
981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 | |
valvatne_blunt_baseline_conductance
¶
valvatne_blunt_baseline_conductance(
net,
viscosity,
*,
pore_viscosity=None,
throat_viscosity=None,
)
Backward-compatible alias for :func:valvatne_blunt_conductance.
Source code in src/voids/geom/hydraulic.py
auto_conductance
¶
Compute conductance using the richest available built-in model.
The selection hierarchy is:
- precomputed
throat.hydraulic_conductance - OpenPNM-style
throat.hydraulic_size_factors - explicit shape-factor pore-throat-pore
valvatne_blunt - circular conduit
hagen_poiseuille - throat-only
valvatne_blunt_throat - fallback
generic_poiseuille
Source code in src/voids/geom/hydraulic.py
available_conductance_models
¶
Return the names of built-in hydraulic conductance models.
Returns:
| Type | Description |
|---|---|
tuple of str
|
Available model names. |
Source code in src/voids/geom/hydraulic.py
throat_conductance
¶
throat_conductance(
net,
viscosity,
model="generic_poiseuille",
*,
pore_viscosity=None,
throat_viscosity=None,
)
Dispatch to a throat hydraulic conductance model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
Network
|
Network containing the required geometry. |
required |
viscosity
|
float | ndarray | None
|
Dynamic viscosity. |
required |
model
|
str
|
Conductance model name. |
'generic_poiseuille'
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Throat conductance array. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/voids/geom/hydraulic.py
1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 | |
throat_conductance_with_sensitivities
¶
throat_conductance_with_sensitivities(
net,
viscosity,
model="generic_poiseuille",
*,
pore_viscosity=None,
throat_viscosity=None,
pore_dviscosity_dpressure=None,
throat_dviscosity_dpressure=None,
)
Return throat conductance and endpoint pressure sensitivities.
Notes
The returned arrays are (g, dg_dpi, dg_dpj) where i and j are
the pore indices in net.throat_conns[:, 0] and net.throat_conns[:, 1].
Source code in src/voids/geom/hydraulic.py
1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 | |