| src | ||
| Cargo.lock | ||
| Cargo.toml | ||
| example_input.json | ||
| README.md | ||
Add soil resistivity report
Soil resistivity reports
Soil resistivity is a critical parameter in the design of CP systems because:
- It affects current distribution from the anode to the pipe.
- Low resistivity soils (e.g., wet clays) are more conductive and easier to protect pipelines in.
- High resistivity soils (e.g., dry sand, rock) require more power or more anodes to achieve protection.
Testing soil resistivity (typically via the Wenner 4-pin method) helps determine:
- CP system design and layout
- Anode type, spacing, and depth
- Expected current requirement and life of anodes
Input
Arguments
org_id: as string which should be a validuuidfor the organizationproject_id: the id of the data project where the pipeline data is foundpipeline_id: anarrayofstringswhich should be valid UUIDs for pipelinesinspection_date: astringformatted as an ISO date representing the date of the soil resistivity reportstarting_point: afloatrepresenting the log distance of the starting point of the soil typeending_point: afloatrepresenting the log distance of the end point of the soil typesoil_type: astringthe soil type for the current section of the pipeline possible valuesclaysandsilt
resistivity: afloatrepresenting the recorded value of the soil's electrical resistivity at this point and timesoil_temperature: afloatrepresenting the recorded value of the soil temperature at this point and timecp_practice: astringthe cathode protection for this section of the pipeline.no_cp: No cathode protectionno_cp_adjacent_risk: No cathode protection with risk of stray current from adjacent structurecp_outside: Cathode protection outside of NACE regulationcp_on: Cathode protection inline with NACE instance on regulationcp_off: Cathode protection inline with NACE instance off regulation
coating_repair_schedule: astringcoating repair schedulerepaired_or_regularly_replaced: Coating regularly repaired or replacednever_or_rarely_replaced: Coating never or rarely replaced
inspector: astringrepresenting the identifier of the inspectorremarks: astringfor any additional remarks about the inspection
Creating the function on the platform
To create this function on the platform using the cli set up the port forwarding as shown in README.
Then run the following command to create the function.
cargo run functions create \
-f functions/soil_resistivity \
-d "Add a soil resistivity report" \
-i org_id=string \
-i project_id=string \
-i pipeline_id=array \
-i inspection_date=string \
-i starting_point=float \
-i ending_point=float \
-i soil_type=string \
-i resistivity=float \
-i soil_temperature=float \
-i cp_practice=string \
-i coating_repair_schedule=string \
-i inspector=string \
-i remarks=string
Testing the function locally
You can run and test the function locally by running
cargo run
Then you can check it work with curl as follows
jq '. | tojson' functions/soil_resistivity/example_input.json | curl -d '@-' localhost:8080