PKR Core

Documentation

PKR Core documentation

This page is a self-contained overview of the PKR Core workspace: how to bring in or generate a structure, run an analysis, organize results with Study and Report, and move data in and out of the tool. No GitHub account or repository access is required.

Getting started

Quick start

Open the tool from /app/ and either generate a structure from the Structure menu or import an existing one. From there, pick an analysis type such as Conductivity, Diffusion, Elasticity, Permeability, Liquid intrusion, or CO2 adsorption, configure the calculation conditions, and run it. Use the Study menu to sweep a parameter or build a DOE matrix across many structures, and use the Report tab to review charts and summary metrics once a run finishes. Save the current structure at any point as a .pkz project file, or export individual results as CSV, mesh, or image-stack files.

Structures

Structure generation and import

The Structure menu can generate voxel structures procedurally, including foam-like, layered, and woven-fiber generators, as well as particle, fiber, and platelet packing fillers. Existing structures can be imported instead: native .leS voxel files, .pkz project archives, .stl and .obj surface meshes (voxelized on import), ASCII VTK structured-points volumes (.vtk), image-stack sequences, and headerless 8-bit raw volumes (.raw / .bin). Large structures can be coarsened by combining blocks of voxels into a single cell, which speeds up downstream analysis at the cost of fine detail. The Materials panel assigns physical properties to the voxel labels present in the loaded structure before any analysis is run.

Analysis

Running an analysis

Each analysis type (Conductivity, Diffusion, Elasticity, Permeability, Liquid intrusion, CO2 adsorption) has its own conditions panel where you set the solve direction and, where more than one is offered, the solve method before running. Conductivity has the widest choice: a reduced-order graph network selected by default, a full 3D field solver that captures curved paths through the structure, and a near-instant straight-column estimate. Diffusion and Permeability pair the default graph network with one fast estimate each; Elasticity adds a 3D spring-network approximation but starts on the straight-column estimate; Liquid intrusion and CO2 adsorption run on the graph network only. Results appear alongside the current structure in the analysis workbench, and feed automatically into the Report tab and, when applicable, the Study run history.

Study and Report

Study and Report

The Study menu drives the Parametric Study workspace, where a base recipe is swept across a single parameter or expanded into a full DOE (design of experiments) matrix, then executed as a batch of cases with undo/redo over edits to the case list. Cases and their generated structures can be imported and exported as CSV and ZIP, and the whole study definition as JSON, for reuse outside the tool. The Report tab (labeled Report in the app menu bar) is a single streamlined view of the current structure and run history, leading with headline figures such as porosity and effective properties, followed by composition, pore size, connectivity, tortuosity, and percolation-path views, so a full parameter sweep can be reviewed without re-running each case individually.

Data formats

Import and export formats

.leS is the native voxel structure format, storing a grid header followed by per-voxel material labels. .pkz is the gzipped project archive written by Save project: it carries one structure's voxel grid, its material assignments, and its generation and edit history, so a saved structure reopens exactly as it was. Beyond these two native formats, PKR Core can import .stl and .obj surface meshes, ASCII VTK structured-points volumes (.vtk), image-stack sequences, and headerless 8-bit raw volumes (.raw / .bin, which have no header, so the grid dimensions and voxel size are entered in the tool before import). Exports cover CSV tables, surfaces (.stl, .obj), FEM volume meshes for Abaqus (.inp) and Fluent (.msh), the native .leS voxel structure, voxel fields as .vtk or headerless .raw, image stacks, analysis reports as Markdown or JSON, extracted pore networks and structural graphs as JSON (including an OpenPNM-ready form), and zipped bundles for parametric-study cases and report charts and tables.

Accuracy

About the reduced-order models

The graph-network method, selected by default for Conductivity, Diffusion, and related analyses, reduces the solid or pore skeleton to a network and solves that network instead of the full voxel field. This makes it fast on open or complex structures, but it is a fast approximation, not an exact field solution: it returns a scalar result without a field contour and can miss effects that only appear in a full 3D solve. When precision matters more than speed, switch the Conductivity Method selector to the 3D field solver, which solves the potential field across every voxel and captures curved paths through the structure, at a higher computational cost. Conductivity is the only property with a full-field solver; every analysis panel labels the selected method with its accuracy tier (instant, reduced-order, or high-fidelity) so the trade-off is visible before you run. Treat graph-network results as a quick screening estimate to guide which cases are worth a full solve.

API access

API and AI integration

Everything in the workspace is also reachable through a REST API, which is the supported entry point for external tools, scripts, and AI agents. The API base URL is https://api.pakericore.app, and business endpoints such as generate, analyze, and workflows/run require an issued token sent as Authorization: Bearer <token>.

Get a token from /app/ under the Settings & API Tokens tab: open the API Token Dashboard and use Issue API Token. The full token value is shown only once, right after issuing it, so copy it somewhere safe before leaving the page.

The complete API contract is published as an OpenAPI specification at https://api.pakericore.app/api/v1/openapi.yaml, served without authentication so it can be fetched directly by tooling. If you are pointing an AI agent at PKR Core, this single line is enough context for it to start calling the API on its own:

Use this OpenAPI specification to call PKR Core: https://api.pakericore.app/api/v1/openapi.yaml

A ready-made request body for the examples below can be pulled from GET /api/v1/examples, which returns a list of named example recipes. The three calls below cover the core workflow: generate a structure, analyze it, and run a multi-step workflow in one request.

curl -X POST https://api.pakericore.app/api/v1/generate \
  -H "Authorization: Bearer $PKR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipe": {"generatorType": "foamLike", "grid": {"nx": 64, "ny": 64, "nz": 64, "voxelSizeUm": 1}}}'
curl -X POST https://api.pakericore.app/api/v1/analyze \
  -H "Authorization: Bearer $PKR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"recipe": {"generatorType": "foamLike", "grid": {"nx": 64, "ny": 64, "nz": 64, "voxelSizeUm": 1}}, "backend": "auto"}'

For an AI agent that wants to request several steps in a single call instead of chaining multiple requests, workflows/run accepts a full workflow definition and returns all of its results together:

curl -X POST https://api.pakericore.app/api/v1/workflows/run \
  -H "Authorization: Bearer $PKR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workflow": {"recipe": {"generatorType": "foamLike", "grid": {"nx": 64, "ny": 64, "nz": 64, "voxelSizeUm": 1}}, "requestedOutputs": ["metrics"]}}'

Errors from any endpoint share the same body shape, so a single handler can parse all of them:

{"error": {"code": "invalid_request", "message": "recipe is required."}}

No GitHub account or repository access is needed to use the API: the base URL, the token flow above, and the OpenAPI specification are everything required to get started.

AI Chat

AI Chat editable parameters

The AI chat panel in /app/ can set the parameters listed below. Write a request in plain words, or use the label and example value from the tables to be exact. Paths are the structure and analysis setting keys that the chat applies.

Structure parameters

ParameterPathUnitDescriptionExample
Generator TypegeneratorType—Primary microstructure generator type.Generator Type = fiberPacking
NXnxvoxelsGrid size along the X axis.NX = 128
NYnyvoxelsGrid size along the Y axis.NY = 128
NZnzvoxelsGrid size along the Z axis.NZ = 128
Seedseed—Random seed for reproducible structure generation.Seed = 33801
Volume FractionvolumeFraction%Target primary phase volume fraction.Volume Fraction = 12
Overlap PercentoverlapPercent%Maximum allowed overlap percentage between features.Overlap Percent = 5
Voxel SizevoxelSizeµmPhysical size of each voxel edge.Voxel Size = 1.5
Binder Volume FractionbinderVolumeFraction%Target binder phase volume fraction.Binder Volume Fraction = 5
Binder Material IDbinderConfig.materialId—Material ID assigned to binder phase.Binder Material ID = 7
Binder PlacementbinderConfig.placement—Placement mode for binder material (surfaceShell or contactShell).Binder Placement = contactShell
Binder Shell ThicknessbinderConfig.shellThicknessVoxelsvoxelsThickness of binder shell layer in voxels.Binder Shell Thickness = 2
Binder Coverage PercentbinderConfig.coveragePercent%Percentage of eligible binder candidate voxels to cover (1-100).Binder Coverage Percent = 70
Foam Material IDfoamConfig.materialId—Material ID for foam matrix phase.Foam Material ID = 3
Foam Noise ScalefoamConfig.noiseScaleVoxelsvoxelsNoise spatial scale for foam pore structure.Foam Noise Scale = 8
Foam Smoothing PassesfoamConfig.smoothingPasses—Number of smoothing iterations for foam matrix.Foam Smoothing Passes = 2
Foam Threshold JitterfoamConfig.thresholdJitter—Random jitter amplitude for foam density threshold.Foam Threshold Jitter = 0.12
Layer AxislayerConfig.axis—Stacking direction axis (x, y, or z) for layered structure.Layer Axis = z
Layers ListlayerConfig.layers—List of layer definitions with material, thickness fraction, and roughness.Layers List = [{"materialId":1,"thicknessFraction":0.5,"roughness":0},{"materialId":2,"thicknessFraction":0.5,"roughness":0}]
Warp Material IDwovenFiberConfig.warpMaterialId—Material ID for warp yarns.Warp Material ID = 1
Weft Material IDwovenFiberConfig.weftMaterialId—Material ID for weft yarns.Weft Material ID = 2
Yarn RadiuswovenFiberConfig.yarnRadiusvoxelsYarn cross-section radius in voxels.Yarn Radius = 3
Warp SpacingwovenFiberConfig.warpSpacingvoxelsCenter-to-center spacing between warp yarns.Warp Spacing = 10
Weft SpacingwovenFiberConfig.weftSpacingvoxelsCenter-to-center spacing between weft yarns.Weft Spacing = 10
Layer CountwovenFiberConfig.layerCount—Number of stacked woven fabric layers.Layer Count = 2
Filler Configs ListfillerConfigs—List of particle or fiber filler specifications. Fiber entries also accept wavinessAmplitudeVoxels (0-16) and wavinessPeriodVoxels (4-256) for sinusoidal curved fibers.Filler Configs List = [{"type":"fiber","radius":2,"volumeFraction":10,"materialId":1,"wavinessAmplitudeVoxels":3,"wavinessPeriodVoxels":12}]

Analysis parameters

ParameterPathUnitDescriptionExample
Conductivity DirectionconductivityDirection—Transport axis for effective conductivity.Conductivity Direction = z
Conductivity MethodconductivityMethod—Computation method: 3d = full field, graph-network = graph proxy, simple = column average.Conductivity Method = 3d
Diffusion DirectiondiffusionDirection—Transport axis for effective diffusion.Diffusion Direction = z
Diffusion MethoddiffusionMethod—Computation method: effective-medium or others available in the dropdown.Diffusion Method = effective-medium
Diffusion Approximation MethoddiffusionApproximationMethod—Reduced-order model used when Diffusion Method is graph-network: skeleton-graph = skeleton graph, canonical-pore = PKR canonical pore network.Diffusion Approximation Method = canonical-pore
Permeability DirectionpermeabilityDirection—Transport axis for permeability.Permeability Direction = z
Permeability MethodpermeabilityMethod—Computation method: pore-network = connectivity estimate, graph-network = reduced-order graph solve.Permeability Method = graph-network
Permeability Max Pressure DroppermeabilityPressureMaxPaMaximum pressure drop used for the permeability pressure-flow curve sweep.Permeability Max Pressure Drop = 1000
Permeability Curve StepspermeabilityFlowStepCount—Number of pressure steps sampled for the permeability pressure-flow curve.Permeability Curve Steps = 5
Elasticity DirectionelasticityDirection—Load axis for effective Young's modulus.Elasticity Direction = z
Elasticity MethodelasticityMethod—Computation method: voxel-spring-network (column estimate), 3d-scalar-spring-network (3D spring network), or graph-network (reduced-order stiffness proxy).Elasticity Method = voxel-spring-network
Elasticity Loading ModeelasticityLoadingMode—Loading direction of the elasticity strain sweep (tension or compression).Elasticity Loading Mode = compression
Elasticity Min StrainelasticityStrainMin%Minimum strain magnitude (percent) for the elasticity strain sweep.Elasticity Min Strain = 0
Elasticity Max StrainelasticityStrainMax%Maximum strain magnitude (percent) for the elasticity strain sweep.Elasticity Max Strain = 5
Elasticity Sweep StepselasticityStepCount—Number of strain steps sampled for the elasticity strain sweep.Elasticity Sweep Steps = 10
Liquid Intrusion DirectioninvasionDirection—Intrusion axis for liquid intrusion (invasion percolation).Liquid Intrusion Direction = z
CO2 Adsorption Directionco2Direction—Flow direction for the CO2 adsorption breakthrough analysis.CO2 Adsorption Direction = z
Liquid Intrusion Surface TensioninvasionSurfaceTensionN/mSurface tension used by the liquid intrusion capillary pressure model.Liquid Intrusion Surface Tension = 0.072
Liquid Intrusion Contact AngleinvasionContactAngledegContact angle used by the liquid intrusion capillary pressure model.Liquid Intrusion Contact Angle = 140
CO2 Isotherm Modelco2IsothermModel—Adsorption isotherm model used for the CO2 adsorption breakthrough analysis.CO2 Isotherm Model = toth
CO2 Velocityco2Velocitym/sInterstitial flow velocity for the CO2 adsorption breakthrough analysis.CO2 Velocity = 0.02
CO2 Diffusivityco2Diffusivitym^2/sMolecular diffusivity for the CO2 adsorption breakthrough analysis.CO2 Diffusivity = 1.6e-5
CO2 Adsorbent Densityco2AdsorbentDensitykg/m³Bulk density of the adsorbent phase used for CO2 loading.CO2 Adsorbent Density = 1200
CO2 Maximum Loading qMaxco2QMaxmol/kgSaturation loading of the adsorption isotherm.CO2 Maximum Loading qMax = 5
CO2 Affinity Constant bco2BPerPa1/PaIsotherm affinity constant for the Langmuir/Toth model.CO2 Affinity Constant b = 2e-5
CO2 Toth Exponentco2TothExponent—Toth isotherm exponent; only used when the isotherm model is toth.CO2 Toth Exponent = 0.7
CO2 Simulation Timeco2SimulationTimesTotal simulated time for the CO2 adsorption breakthrough run.CO2 Simulation Time = 200
CO2 Time Stepco2TimeStepsTime increment used by the CO2 adsorption breakthrough integration.CO2 Time Step = 0.05
CO2 LDF Rate Constantco2KLdf1/sLinear driving force mass transfer rate constant for CO2 uptake.CO2 LDF Rate Constant = 0.5
Seed Merge FactorporeNetworkSeedMergeFactor—Seed merge factor used when extracting the pore network from the distance transform maxima.Seed Merge Factor = 1.5