Sei sulla pagina 1di 133

Faculty of Science and Technology

MASTERS THESIS

Study program/ Specialization:


Spring semester, 2011
Offshore Technology/ Subsea Technology

Restricted access

Writer: Sivert Duvsete



(Writers signature)
Faculty supervisor: Ove Tobias Gudmestad, University of Stavanger

External supervisor(s): Pl Foss, IKM Ocean Design AS

Title of thesis:

Development of Screening Software Tool for Evaluation of Pipeline Lateral Buckling

Credits (ECTS): 30

Key words:
Pages: 132
Buckling, Lateral Buckling, Python,
Smoothing + enclosure: CD w/ LBSS.py, Survey.txt
and Design.txt (the software
and two text files)

Stavanger, 14.06.11

DevelopmentofScreeningSoftwareToolfor
EvaluationofPipelineLateralBuckling


Pipelineexposedtolateralbuckling20


MasterthesisattheUniversityofStavanger
Spring2011
BySivertDuvsete

Summary

During its lifetime a pipeline is subjected to an increase in internal pressure and


temperaturefromitsasinstalledcondition.Theseloadscausethepipelinetoexpandatits
freeend,andinducestressesandforcesinthepipewall.Ifthepipelineisnotallowedto
expand, this will result in buckling if the magnitude of the loads is large enough, to
overcomeexternalrestrainingforces.

The scope of this thesis is to develop a Screening Software Tool for Evaluation of Pipeline
LateralBuckling;atoolforevaluationofpipelineintegritybasedonsurveyresults.Themain
purpose of the software is the identification and evaluation of locations that have
undergone lateral buckling. This is done by first of all creating a software tool that can
import text files; files such as the design route, aslaid data and survey data. With this
informationthesoftwareisabletoprintallthreepipelineroutes,andavisualcomparison
betweendesign/aslaidandthesurveyroutecanbeperformed.Further,thelateraloffset
betweendesign/aslaidandthesurveyrouteisplottedinordertogetabetteroverviewon
locationsthatmayhaveundergonegloballateralbuckling.Fromthisplottheusercanselect
asectionforfurtherinvestigation.Thesurveydataisthedatasettobeanalyzed,itisnot
fullyaccurate;noiseoftenoccursandneedstobereduced/eliminated.Noisereductionis
donebysmoothingthedataset.Afterthissmoothingiscarriedoutandtheuserfeelsthe
smoothedcurveisrealistic;thispartoftheworkisfinalized.

With this smoothed curve the screening tool can now calculate the curvature, and
multiplyingitwiththebendingstiffnessofthepipe;theresultisthebendingmoment.This
isnotafullyaccurateresult,butitgivesagoodindicationonwherethepipelinemightbe
operating under a high degree of utilization, and that a better and more thorough FE
analysisshouldberun.

TheverificationworkonthisscreeningtoolhasbeenappliedintheprogramSIMLA,where
selfestablishedrouteshavebeentestedwiththeLateralBucklingScreeningSoftware.

TheLateralBucklingScreeningSoftware(LBSS)hasshowntobeagoodtoolforthe
evaluationofpipelinelateralbuckling.Ithasdevelopedintoaneasyandeffectivetoolfor
importofdatafiles.Anditcontainsagreatsmoothingfunctionthatmakestheresults
realisticandsufficienttoobtainagoodestimateforfurthercurvaturecalculations.

TheLBSShasitslimitationswhencalculatingthebendingmoment;itonlytakesthe
horizontalpositionintoconsideration.Soanyeffectfromanunevenseabedorupheaval
bucklingisnotincluded,thisiswhytheLBSSwillalwaysgivelowerstressresultsthanaFE
analysissoftware.

Preface

This Master thesis has been written in the spring of 2011 as the final examination before
achievingmyMasterdegreeinOffshoreTechnologySubseaTechnologyattheUniversity
of Stavanger. The thesis has been defined in cooperation with IKM Ocean Design AS,
Trondheim. IKM Ocean Design AS provided office space at their location in Trondheim,
where the writing, programming and analytical work of the thesis was performed. It has
beenanexcitingandchallengingphaseofmylife.

Through this period many people have given me useful advice and guidance to help me
completemythesis.Iwouldliketoexpressmygratitudetothefollowingpeople;

Professor Ove Tobias Gudmestad, my supervisor from the University of Stavanger.


Hehasgivenmemuchvaluableguidancethroughthiswholeprocess.

EngineeringManagerBjrnLundeforgivenmetheopportunitytowritemythesisin
cooperationwithIKMOceanDesignAS.

DisciplineManager(pipelines)PlFoss,mysupervisorinIKMOceanDesign.Hehas
been my gotoguy when problems have occurred, and he has been defining the
problemsformeandexplainedthemwell.

Knut Nordanger, engineer, for helping me to understand the program Python, and
hehashelpedmethroughthewholeprogrammingpartofthethesis.

PerTommyRoten,engineer,forhelpingmegettingtheprogramSIMLArunning.

AudunKristoffersen,engineer,myproblemsolver.Hehasbeenaveryusefulasset
duringthisperiod,withFEanalysisinSIMLAandprogramminginPython.

John Bjarne Svinvik, engineer, my office partner and oil and gasdictionary. He has
usedalotoftimeexplainingwordsandexpressionsIhaveneededhelpwith.

SivertDuvsete,Stavanger,14.06.2011

II

TableofContents

Summary..................................................................................................................................................I
Preface....................................................................................................................................................II
Abbreviations..........................................................................................................................................V
Symbols..................................................................................................................................................VI
ListofFigures........................................................................................................................................VII
ListofTables.........................................................................................................................................VII
1Introduction......................................................................................................................................1
2Objectives..........................................................................................................................................2
3Theory...............................................................................................................................................3
3.1Buckling.........................................................................................................................................3
3.1.1General...................................................................................................................................3
3.1.2UpheavalBuckling..................................................................................................................4
3.1.3LateralBuckling......................................................................................................................5
3.1.4RelationbetweenLateralandUpheavalBuckling.................................................................6
3.2Restrainedpipeline...................................................................................................................6
3.3EffectsofHP/HTreservoirs...........................................................................................................7
3.4Trawling.........................................................................................................................................8
3.5PipelineDesignAnalysis..............................................................................................................10
3.5.1Generalstresscheck............................................................................................................10
3.5.2PipelineDesignaccordingtoDNVcodes.................................................................................13
3.6Curvature....................................................................................................................................19
3.7Smoothing...................................................................................................................................20
3.8ROVPipetracker..........................................................................................................................21
3.9FiniteElementMethodAnalysis(FEMA).................................................................................22
4Softwaredevelopment....................................................................................................................23
5Calibrationanalyses........................................................................................................................25
6Discussionon:..................................................................................................................................27
7Conclusions.....................................................................................................................................29
8References.......................................................................................................................................30
AppendixA5ptand7ptfilesandDesignroutefiles........................................................................31
7ptfilesand5ptfiles........................................................................................................................32
DesignRoutefile...............................................................................................................................33

III

AppendixBPythonprogramming......................................................................................................34
Pythonprogramming........................................................................................................................35
Ingeneral......................................................................................................................................35
Thelanguage[4]............................................................................................................................36
AppendixCSIMLA...............................................................................................................................40
SIMLA[6]...........................................................................................................................................41
Programbasis................................................................................................................................41
Basicconcepts...............................................................................................................................41
AppendixDUsermanual...................................................................................................................43
Introduction......................................................................................................................................45
INSTALLATION...................................................................................................................................46
Setup.............................................................................................................................................46
HOWTOUSETHESOFTWARE(LBSS)................................................................................................47
Overview.......................................................................................................................................47
Convertinggeographicalcoordinatestoeastingandnorthingcoordinates................................49
TheStartup....................................................................................................................................49
AppendixEVerificationtestsofprogram..........................................................................................50
Verificationtestsofprogram............................................................................................................51
AppendixFScriptofPythonprogram................................................................................................66

IV

Abbreviations

HP/HTHighpressure/hightemperature
VIVVortexinducedvibrations
FEMFiniteelementmethod
DNVDetNorskeVeritas
FEFiniteElement
FEAFiniteelementanalysis
ULSUltimateLimitState
SLSServiceabilityLimitState
FLSFatigueLimitState
ALSAccidentalLimitState
KPKilometerPoint(alongpipeline)
ROVRemotelyOperatedVehicle
GPSGlobalPositioningSystem
EPDEnthoughtPythonDistribution
IDInternalpipediameter
THPipewallthickness
EModulusofelasticity(Youngsmodulus)
LBSSLateralBucklingScreeningSoftware
BMBendingmoment

Symbols

m Meter m
DegreesofCelsius C
Externalhydrostaticpressure N/m2
WD Waterdepth m
Density Kg/m3
g Gravity m/s2
Hoopstress N/m2
Longitudinalstress N/m2
pi Internalpressure(operatingpressure) N/m2
Di Internaldiameter m
Do Outerdiameter m
t Wallthickness m
Linearthermalexpansioncoefficient 1/C
T Temperaturedifference C
Differentialpressureacrosspipewall N/m2
Poissonsratio
Fa Axialforce N
A Crosssectionareaofpipe m2
Mb Bendingmoment Nm
I Momentofinertia m4
y Distancefromthepipebottomtothecentreofthepipe;Do/2 m
l Longitudinalstrain
K Curvature m1
R Radius m
y' Secondderivativeofy
y' Firstderivativeofy

VI

ListofFigures

Figure1Pipelinewithoverbend...........................................................................................................4
Figure2Pipelineexposedtoupheavalbuckling...................................................................................4
Figure3Pipelineexposedtolateralbuckling13....................................................................................5
Figure4Weightcoatlossatdamagedlocation11(Kvitebjrngaspipe)...............................................8
Figure5Bottomtrawlingactivity15.......................................................................................................9
Figure6Hoopstressandlongitudinalstressinacylindricalshapedpart..........................................10
Figure7Measurementerrors.............................................................................................................20
Figure8Anexampleofsmoothing.....................................................................................................21
Figure9Asimulatedpipelineonmeshedseabed..............................................................................25

ListofTables

Table1Materialresistancefactor......................................................................................................14
Table2Materialstrength...................................................................................................................15
Table3Loadeffectfactorsandloadcombinations............................................................................17

VII

1Introduction

Intheoffshoreindustryfluidshavetobemovedinhugequantitiesandoverlongdistances;
water, oil, natural gas, and carbon dioxide are examples. One option to move fluids is
transportingthemthroughpipelines.Apipelineisafixedassetwithlargecapitalcosts.Once
the pipeline is in place, the operation and maintenance costs are relatively small1, which
makesthepipelinesagoodoptionfortransportofoilandgasfrommanyfields.

Duetotheriskofimpactbyfishinggear,shipanchors,etc,pipelinesshouldbeburiedunder
theseabed,butthisisnotalwaysthecase,nordoesitalwayssolvetheproblem.

When production starts and the produced fluid runs through the pipeline the internal
temperatureandpressurewillincrease,duetothereservoirconditions.Whentheinternal
pressure increases the hydrostatic pressure outside the pipe remains the same, which
causesgreatercircumferentialstress,alsocalledhoopstress,inthepipe.Thetemperature
increasewillleadtothermalexpansionofthesteel,andresultinaxialcompressiveforcesin
the pipe. Combined they result in a longitudinal stress of the pipe. As a response to the
longitudinal compressive force, when the pipeline is restrained (see chapter 3.2), global
buckling may occur at a position determined by the curvature of the pipeline and the
supportconditions.

Apipelinewillbuckleinthedirectionwhereitmeetstheleastresistance.Inafreespanit
usuallybucklesdownwards,ontheseabeditcanmovesideways(lateralbuckling),andfor
buriedpipelinestheeasiestwaytomoveusuallyisupwards.Thelastoneiswellknownas
upheaval buckling, which is a phenomenon that is unfavorable considering the risk of
impactbyfishinggearmentionedearlier.

Forcontrolofthepipelineanditsmovementafterbeingsetinoperation,anROVisused,
equipped with several cameras and a pipetracker. This method of determining the new
positionofthepipelinewillnotgivetheexactposition;itwillhaveitserrors.Theseerrors
are called noise (see smoothing section) in the data set (positional coordinates). The
standardformatsofthesedatasetsare5ptfilesor7ptfiles(appendixA).Tousethisdata,
forexample,tofindthecurvatureofthepipeline,smoothingofthedatasetisnecessary.
Thisthesisisnarrowedintothelateralmovementofthepipeline.

2Objectives

The scope of this thesis is to develop a Screening Software Tool for Evaluation of Pipeline
Lateral Buckling, a tool for evaluation of pipeline integrity based on survey results. The
surveyresultstobeevaluatedwillbeintheformof5ptor7ptfiles(explainedinappendix
A).Themainpurposeofthesoftwareisevaluationoflocationsthathaveundergonelateral
buckling. The software tool will be based on Python (appendix B). Python is the chosen
programmingtoolbecauseofitseffectiveness;quicklinereading,andgreatmemory(thisis
arequirementbecauseofthesizeofthesurveydatafile).

Inordertodevelopabucklingscreeningtoolforevaluationofresultsfrompipelinesurveys,
thefollowingworkshouldbeincluded:

Calibrationanalyses
FE analyses (using the program SIMLA) for selected pipeline dimensions and
pipesoilparameterswillbeperformedinordertocheckbucklingscenarios.
Existing IKM Ocean Design inhouse data will also be used as an input to the
resultdatabase.
AcomparisonofthePythonandSIMLAresultswillgiveagoodapproximationas
towhichofthesmoothingmethodsshouldbeused.

Softwaredevelopment
Identification of locations that have undergone lateral buckling will be made,
andcomparisonbetweendifferentsurveyswillbecarriedout.
Automatedroutinesforimportofdesign/aslaidandoperationaldata.
Presentationofdevelopmentinlateralbucklingbehavior.
Evaluation of identified locations, smoothing of survey data, estimation of
utilizationfactor.

Usermanualdevelopment
Theusermanualshallgiveadescriptionoftheappliedmethodology.
Descriptionofrequiredinputandoperationsinordertousethesoftware.

3Theory

3.1Buckling

3.1.1General

Global buckling is a mode of buckling which involves a substantial length of the pipeline;
usually several pipe joints without gross deformations of the cross section; upheaval
bucklingisanexamplethereof.Ontheotherhand,localbucklingisamodeofbucklingthat
is confined to a short length of the pipeline causing gross changes in the cross section;
collapse,localizedwallwrinklingandkinkingareexamplesofthereof9.Globalbucklingofa
pipelinecanbecomparedtoabarincompression;thepipelinewillbuckleinthedirection
where it meets the least resistance. In a free span it usually buckles downwards, on the
seabeditcanmovesideways(lateralbuckling),andforburiedpipelinestheeasiestwayto
move usually is upwards. The last one is well known as upheaval buckling, which is a
phenomenonthatisunfavorableconsideringtheriskofimpactbyfishinggearandanchors.

Thedrivingforceforbucklingofthepipelineistheeffectiveaxialforce(seechapter3.5.1).It
isinducedbyatemperatureor/andpressureincrease.Beforeproductionstartstheinternal
temperature of the pipeline is about the same as its surrounding seawater. When the
pipelineisputintoservicethetemperatureandpressurewillincrease.Asaresultofthisthe
pipewillexpand.Aconstrainedpipelinewillnotallowexpansiontooccurwhichwillresultin
axial compressive forces in the pipe wall. The pipeline will try to relieve the stresses by
buckling3,itwilltrytofindanewequilibriumbymovingperpendiculartothepipeaxialaxis.
Thelevelofaxialforcetoinitiatethisglobalbucklingdependson10:

Pipecrosssectionproperties
Lateralresistance
Outofstraightnessinthepipeline
Lateraltriggingforce(forexampletrawling)

This phenomenon is most likely to happen in HP/HT reservoirs. Even pipelines with
adequate wall thickness may be exposed to buckling at moderate temperatures and
pressures3.

Thereareseveralfailuremodesforapipeexposedtoglobalbuckling.Globalbucklingisa
loadresponseandnotafailuremodealone,butglobalbucklingmayleadtofailuressuchas
fracture, fatigue, local buckling, bending moments, and large plastic deformations. For
pipelines lying exposed on the seabed, global buckling may be allowed as long as its
displacementispredetermined3(controlled).

Ifthecurvatureofthebuckle(upheaval)leavesagapbetweenthepipeandseabed,afree
spanisformed.ThepipelinemaythenbevulnerabletofatigueduetoVIV,vortexinduced
vibrations,atthisregion3ortofishinggearhookingontothepipeline.

3.1.2UpheavalBuckling

Aburiedpipelinecansometimesarchupwardsoutoftheseabed,formingaraisedloopthat
may project several meters1. This phenomenon (upheaval buckling) is induced by a
longitudinalcompressiveforceduetotemperatureandpressureincrease,whengoinginto
operatingmode.Upheavalbucklingiscausedbytheinteractionbetweenthatlongitudinal
compressive force and the local curvature of the pipeline axis1. In other words, axial
compressive forces tend to make the pipe push upwards. Upheaval may occur if the
combination of weight and the uplift resistance of any cover are not large enough to
restrainthepipe5.

Figure1Pipelinewithoverbend Figure2Pipelineexposedtoupheavalbuckling

If the pipeline is buried, then there is less resistance to upwards movement compared to
sideways/ lateral buckling. The pipeline therefore buckles upwards, almost invariably at
overbends where the profile is convex upwards. Figures 1 and 2 illustrate the sequence
schematically1.Thepipecanalsobuckledownintotheground,iftheseabedstiffnessislow
enough;forexamplesoftmud.Thepipewillalwaysbuckleinthedirectionwhereitmeets
theleastresistance.

3.1.3LateralBuckling

Lateral buckling is induced in the same way as upheaval buckling by a temperature or


pressureincrease.Thedifferencebetweenlateralandupheavalbucklingisjustthedirection
ofthebendingmovement.

If a pipeline is not buried it is usually easier for it to buckle sideways. The resistance to
sideways movement is the friction force (soil friction), which is the submerged weight of
pipemultipliedbythefrictioncoefficient.Thereisalsoaresistancewhenmovingthrough
seawater,butitisnegligible1.Infigure3,apipelineinservicehasbeenexposedtolateral
buckling.Thetrackoftheaslaidpipelineisnotable.

Many pipelines buckle laterally to some extent, but lateral movements frequently go
undetected.Lateralmovementsareoftenharmless,becausethelateralmovementoccurs
overasubstantialdistance,thebendingstressesaresmall,andthebuckledoesnotlocalize
intoasharpkink.However,lateralmovementscanbelarger,andifoneisunlucky,allthe
movementisconcentratedinonebuckle.Ifthismovementistoolargethenakinkmightbe
formed, and if the strain is large enough this can result in rupture of the pipe wall.


Figure3Pipelineexposedtolateralbuckling13

A lateral buckling incident in Brazil in 2000 has generated further concern. A hot pipeline
buriedinsoftmudinashoreapproachbuckledsidewaysandkinked.Thethinwallfolded,
andthepiperuptured,leadingtoadamagingoilspill1.Inotherwords,lateralbucklingcan
beaproblemanditneedstobecontrolledandmonitored.

3.1.4RelationbetweenLateralandUpheavalBuckling

Whenapipelineisexposedtoupheavalbucklingitsnormalresponsewillbetoliedownon
theside,ontheseabed.Thisisduetothecurvatureofthepipelinelayandcurrentsonthe
seabottom.Forillustration,onecanthinkofaperfectlystraightelasticstickonaflattable.
Compressive axial force is applied from both sides of the stick; this will result in the stick
bending up in a smooth curve, as long as it is not bent upwards in an angle (transverse
angle).Pipelinesareusuallynotlaidinaperfectlystraightlinegiventheunevenseabed,so
gravityandcurrentswillbetheforceslayingthepipelinedown.

Ifapipelinebucklingleadsthepipelineintoexposureontheseabed,thesimplestsolution
would be to stabilize the pipeline at its new position. This can be done by covering the
exposedpipe,forexamplebyrockdumping,concretemats,etc.However,iftheintegrityof
thepipelineisreducedandthepipewallisoverstressed,thismayleadtorupture.Thenthe
damaged part will have to be replaced before stabilizing the pipeline again3.

3.2Restrainedpipeline

So far it has been have written that the temperature increase is proportional to the
expansion. This statement is only correct as long as the pipeline is unrestrained. If it is
restrained or partially restrained, then the result might be global buckling (note: the pipe
can also buckle without being restrained). The stresses acting depend on whether the
pipelineisunrestrained,restrainedorpartiallyrestrained.

Friction (soil friction) acts as a restraining force. A fixed object that is connected to the
pipelinewillhavethesameeffect,forexample;aplatform.

3.3EffectsofHP/HTreservoirs

A high pressure, high temperature reservoir is formally defined by having an undisturbed


bottom hole temperature of greater than 149oC and a reservoir pressure higher than
690bar.6
Hightemperaturesfromthecontentofthepipelinecausesexpansionofthepipe.

Materialpropertiessuchasyieldstress,tensilestrengthandYoungsmoduluschangewith
materialtemperature,andifnecessarymaybeaccountedfor.

Externalhydrostaticpressure(po)isanimportantfactorregardingthestrengthcapacityof
deepwater pipelines. The external pressure is a function of the water depth (WD), water
density( =1025kg/m3forseawater)andgravity(g=9,81m/s2).

So, for example a reservoir has its wellhead on the seabed, at 3000m water depth. The
contentrunningthroughthepipelinehasapressureof700bar.Thehydrostaticpressurein
thiscasewouldbearound300bar,whichmeansthatthedifferentialpressure(pipo)is400
bar.

For a reservoir with pressures around 200 400bar, at the same water depth, the pipe
wouldnotbeexposedtothesameamountofaxialforces.

This just shows that for HP/HT reservoirs buckling will always be an issue, because of the
greataxialforcesinduced.

3.4Trawling

Trawlingisamethodoffishingthatinvolvespullingfishingnetsthroughthewaterbehind
oneormoreboats.Thenetthatisusedfortrawlingiscalledatrawl2.Onemethodisbottom
trawling,seefigure5,thetrawlisdraggedontheseabedanditcanapplyapulloverloadon
the pipeline. Trawling may affect the pipeline in several ways; trawl impact, pullover and
hooking. Trawl impact is when the fishing gear hits the pipe, while dragged on the sea
bottom, and causes deformation/damage on the pipe. Buckling has a weakness for
deformedpipessincethedeformationweakensthepipesbendingstiffness,and makesit
moreexposedtoaxialcompressiveforces.Whileapulloverloadiswhenthetrawlsweeps
across the pipeline and exposes the pipe for a great load for a short period of time. If a
pipeline curve is experiencing great tension but still not enough to cause buckling of the
pipe, then the pullover load might be all that is needed triggering lateral buckling of the
pipeline.Atlastthereishooking;itcaninflictsomeseriousdamagetothepipeline.Hooking
iscausedbyashipsanchor,orothersimilartypesofgear,hookingontothepipelineand
draggingitalong.

With upheaval buckling the risk of trawl impact increases, this is one of the reasons why
upheavalbucklingisaveryunfavorablescenario.Anexampleofsuchanincidentoccurred
at the gas field Kvitebjrn in the North Sea, with HP/HT conditions. The cause of the
accidentwasananchor;ithadhookedontothepipelineandinflictedseriousdamage,see
figure 4. The pipe was dragged 53m along the seabed, which resulted in a kink of the
pipeline.A26mlongpipesectionneededtobereplaced11,12.


Figure4Weightcoatlossatdamagedlocation11(Kvitebjrngaspipe)

When the pipeline is installed it is placed on the seabed in tension, which makes it less
vulnerable to trawl pullover loads, compared to a pipeline in service exposed to axial
compressive forces. In the last case a pullover load might be the triggering factor for the
pipetocollapseorbeexposedtolocalbuckling.Solateralbucklingmightalsobeaproblem
ifnotcontrolled.


Figure5Bottomtrawlingactivity15

3.5PipelineDesignAnalysis
3.5.1Generalstresscheck

Thiswriteupontheoryusedforthestresscheckisinspiredby(1),(3)and(4).

A pipeline has to be designed to withstand all the loads that it will be subjected to, both
during installation and operation. During installation it will be bent, pulled and twisted.
When production starts and it goes into operation mode it will be loaded by; internal
pressurefromthefluiditcarries,byexternalpressurefromthesea(hydrostaticpressure),
andbystressesinducedbytemperaturechanges.Externalimpactsfromanchorsandfishing
gear(trawling)canalsooccur.


Figure6Hoopstressandlongitudinalstressinacylindricalshapedpart

In figure 6, hoop stress (SH) and longitudinal stress (SL) are shown. Hoop stress is
circumferentialstress;itisgeneratedbyinternalpressure(beingtheoperatingpressure).If
thehoopstressistoolargethepipelinecanyieldcircumferentially,andcontinuedyielding
willleadtothinningofthepipewallandultimatelytoarupture.

Hoopstress,

Where, isinternalpressure(operatingpressure)
isexternalpressure(hydrostaticpressureofsea)
isinsidediameterofpipe
isoutsidediameterofpipe
tiswallthicknessofpipe

A pipeline in operation is exposed to longitudinal stresses as well as hoop stress.


Longitudinal stresses arise primarily from two effects: Poisson and Temperature. The first
onecanbeexplainedbyimaginingasteelbarloadedintension,itwillextendinthetension
direction and contract in transverse direction. If transverse contraction is prevented, a
transversetensilestressissetup.Asforonlycircumferentialstress(nolongitudinalstress),
the pipe will extend radially and contract in longitudinal direction. If friction against the
seabed(soilfriction)orattachmentstofixedobjectssuchasplatformspreventslongitudinal
contraction, a longitudinal tensile stress occurs. This is the Poisson effect.
The second effect that induces longitudinal stress is temperature. When the temperature

10

insidethepipeincreasesthepipeexpandsinalldirections,ifthepipeisfreetoexpandinall
directions,bothaxiallyandcircumferentially(radially).Circumferentialexpansionisusually
completely unconstrained, but longitudinal expansion is constrained by the seabed (soil
friction)andotherobjectsthatconstrainthepipe.Asforthefirsteffect,ifaxialexpansionis
prevented,alongitudinalcompressivestresswilloccur.

Bending moments due to, for example, free span or bending under installation can also
occurandwillbeincludedinlongitudinalstress.Ifthepipeisappliedwithanexternalaxial
force,thisaxialforcewillalsobeincludedinlongitudinalstress.

Longitudinalstress,

Poissoneffect:

Thermaleffect: ,(thermalstress)

Where,Eisyoungsmodulus
islinearthermalexpansioncoefficient
istemperaturedifference
isinternalpressure(operatingpressure)
isexternalpressure(hydrostaticpressureofsea)
isinsidediameterofpipe
isoutsidediameterofpipe
tiswallthicknessofpipe
isdifferentialpressureacrosspipewall
isPoissonsratio
Faisaxialforce
Aiscrosssectionareaofpipe
Mbisbendingmoment
Iismomentofinertia
yisdistancefromthepipebottomtocentreofpipe; /2

Longitudinalstrain,

11

Theresultingaxialforceincurvature:

Poisson contraction effect is seen acting in the opposite direction to the end cap force.
Theendcapforceiscausedbytheinternalpressureofthecontentinthepipelineactingon
aneffectivelyclosedendofapipeline,suchasabend14.

Endcapforce:

Expansion is due to combined effects of temperature, pressure and Poissons effect. In


operational pipelines, the three factors will usually occur in combination, which gives this
expansionaxialforce:


2 4
ThermalforcePoissonforceEndcapforce

12

3.5.2PipelineDesignaccordingtoDNVcodes

Theinformationinthischapterisfoundin(9)and(10).

The DNVOSF101 standard is used to provide an internationally acceptable standard of


safetyforsubmarinepipelinesystems.Itservesasaguidelinefordesigners,purchaserand
contractors.

Two load conditions are used, load controlled condition and displacement controlled
condition. Different design checks apply for these two conditions. An example of a
displacementcontrolledconditionisapipelinebeinginstalled;itisbentintotheshapeof
another curved structure, such as a reel. In this case, the curvature of the pipe is
predetermined.Butthecircumferentialbendingthatleadstoovalisationisdeterminedby
the interaction between the curvature and the internal forces induced by the curvature.
Anothercaseisanexpansionspoolontheseabed.Pipelineexpansionduetoatemperature
or pressure increase imposes a displacement at the end of the spool. The structural
responseisprimarilydisplacementcontrolled.However,thelateralresistancetosideways
movementofthespoolontheseabedalsoplaysasignificantpartandinducesadegreeof
loadcontrol.

These examples show that to choose which condition to use is not so easy, there is no
distinct difference between the two conditions in several cases, so the choice should be
based on a skilled judgment on which components of the combined conditions are more
important.

IKMOceanDesigntakesboththeLoadcontrolledconditionandthedisplacementcontrolled
conditionintoconsiderationduringpipelinedesign.


LoadcontrolledconditionMomentcriteria

DisplacementcontrolledconditionStraincriteria

Global buckling is a combination of these two criteria. To combine the load controlled
conditionwiththedisplacementcontrolledconditionaconditionloadeffectfactor, ,needs
tobecalibrated.

13

UsingtheLoadcontrolledcondition,pipememberssubjectedtobendingmoment,effective
axialforceandinternaloverpressureshallbedesignedtosatisfythefollowingconditionat
allcrosssection:


1 1

Where,

Md isDesignbendingmoment
Sd isDesigneffectiveaxialforce
pd isDesigndifferentialoverpressure
sc isSafetyclassresistancefactor
m isMaterialresistancefactor
Mp isPlasticmomentresistance

Table1Materialresistancefactor

Limitstatecategory SLS/ULS/ALS FLS


m 1.15 1.00

SpisCharacteristicplasticaxialforceresistancegivenby:

DisNominaloutsidediameter
isYieldstresstobeusedindesign
isTensilestrengthtobeusedindesign

14

Table2Materialstrength

Characteristicmaterialstrength,fy,fu
Property Value
Characteristicyieldstress fy=(SMTSfy,temp)*

Characteristictensilestrength fu=(SMTSfu,temp)* *

where,

, and , isthereductionvalueduetothetemperatureoftheyieldstressandthe
tensilestrength.

U isthematerialstrengthfactor,
normally0.96ifnotincreasedconfidenceinyieldstress,then1.00isused.

A istheAnisotropyfactor,
0.95foraxialdirectionduetorelaxedtestingrequirementsinlinepipespecification,
1.00forothercases.

t2 isPipewallthickness*

* and are found in DNVOSF101, section 5C 300, Characteristic wall thickness. is


pipewallthicknessusedforcalculationsofpressurecontainmentresistance,inotherwords
insituationslikesystempressuretesting.Herethefabricationthicknesstolerance, ,is
taken into consideration. This is because the pipe will crack at the spot where the wall
thicknessisthethinnest.Whendesigningforthebendingmomentthisisnotneeded,inthis
casethenominalwallthicknessisused(theoverallwallthickness).Thenextstepistoknow
if the pipe is being designed for an operational condition, or for the construction phase
(installation mode). For a pipe in operational condition tcorr is included, which is the
corrosionallowance.tisthenominalwallthicknessofthepipe(uncorroded);

Thisisduetothecorrosionfromtheseawater,CO2andHydrogenSulfidefromthereservoir
fluid.

pb(t2)istheBurstpressure

pb(x)=Min(pb,s(x);pb,u(x)),whichisthepressurecontainmentresistance.

pb,s(x)= ,whichisyieldinglimitstate.

15


pb,u(x)= ,whichisBurstinglimitstate.
,

Note!Inthetwoformulasabovexshallbereplacedbyt1ort2asappropriate.

isFlowstressparameteraccountingforstrainhardeninggivenby:

Butmaximum1,20.

0,4 forD/t2<15
0,4 60 /45 for15 D/t2 60
0 forD/t2>60

2 for >
3
0 for

isnottobetakenlargerthan1,20

Where,

pe isExternalpressure
pld isLocaldesignpressure

, aregivenintable1.While istobefoundseparately.

isFunctionalbendingmoment
isEnvironmentalbendingmoment
isAccidentalbendingmoment

16

Table3Loadeffectfactorsandloadcombinations

Functional Environmental Accidental Pressure


LimitState/ Loads1) load loads loads
Loadcombination
SLS& a 1,2 0,7 1,05
ULS b 1,1 1,3 1,05
FLS 1,0 1,0 1,0
ALS 1,0 1,0 1,0 1,0
1)
Ifthefunctionalloadeffectreducesthecombinedloadeffects, shallbetakenas1/1,1.

To find , DNVRPF110 section 9 must be used, Condition Load Effect For Exposed
Pipelines.

This chapter includes calculation procedures to calculate the load condition factor, for
pipelinesthatbuckles.Theprocedureappliestoscenariosofevenseabed,unevenseabed,
withandwithouttrawl.Dependingonthescenariooneormoreoftheparametersmaybe
zero.
The condition factor, is based on the prevailing uncertainty in the response bending
momentgivenby:

, , 0,80; 0,72 1 2 , ,

Where;

pischaracteristicpressure
Tistemperature
FTistrawlload

A lessthanunitycalculatedinthissectionshallnotbeappliedtotheeffectiveaxialload
accordingthisRecommendedPractice.

17

, , is the Coefficient of Variation of the resulting bending moment in the


buckle. The uncertainty in the bending moment response from the global FEanalyses is
assumedtoarisefrom:

uncertaintyintheaxialsoilresistance,XA
uncertaintyinthelateralsoilresistance,XL
uncertaintyintheappliedstressstraincurve,XB
uncertaintyintheappliedtrawlload,XC

Thisuncertaintymaybeestimatedfrom:

, , , , , , , , , ,

The CoV(X) terms in the equation above reflects the uncertainty in the impact on the
bending moment response, this from the uncertainty in the soil parameters, choice of
stressstraincurve,anduncertaintyintheappliedtrawlpulloverload.Theconditionfactor,
, will then also represent the degree of displacement control that the pipeline
experiences.

18

3.6Curvature

Thedefinitionofcurvatureistheamountbywhichageometricobjectdeviatesfrombeing
flat,orstraightinthecasefromaline,butcurvatureisdefinedindifferentwaysdepending
onthecontext16.


Where;

Kiscurvature.
Risradius.

The formula above shows that in a straight line the curvature is equal to zero, and the
curvatureofabendisrelatedtoitsradius.Thebiggertheradiusisthesmallerthecurvature
iswhichmeansthatforasmallradiusthecurvatureislarge.

Bendingmomentisequaltocurvaturemultipliedwithitsbendingstiffness(EI).Thebending
stiffnessofthepipelineisfoundby:

BendingStiffness=materialstiffness*momentofinertia

EistheYoungsmodulus;itisameasureofthestiffnessofthematerial.Iisthemomentof
inertia.Themomentofinertiadependsontheobjectscrosssection;inthecaseofpipelines
athinwalledcylinderapproximationisgood,whichis:

Where,

Doisouterdiameter
Diisinnerdiameter

Thelocationofaninstalledpipelineisdefinedbycoordinateseasting(x)andnorthing(y).To
findthecurvatureoftheplottedcurve/routethisformulaisused:

y'andyarederivativesofthecurveofthepipelineroute.

19

3.7Smoothing

ThesurveydataisacquiredwithROVsupport.Thedataisnotfullyaccurate;everysurvey
reporthasitsowntoleranceregardingsurveyaccuracy.Whenplottingthedatapointsand
interpolating between them a very curvy graph occurs, a curve which in reality is not
possible with the transport pipeline dimensions used in the offshore industry. So to get a
realistic pipe lay picture as output, this graph needs to be smoothed. Smoothing is to
smoothadatasettocreateanapproximatingfunctionthatattemptstocaptureimportant
patternsinthedata,whileleavingoutnoise18.(Incommonusethewordnoisemeansany
unwanted sound, but in this case it is unwanted data without meaning)19. In this case, as
seeninfigure7,therearemultiplestagesthattakeplacetogetthissurveydata.Firstthere
istheconnectionbetweenthesatelliteandtheshipthatgivestheshipslocationwiththe
useofGPS.Second,byusingechotheshipknowswheretheROVislocatedateverytime,
andatlast,theROVisequippedwithapipetracker(seesectionROVPipetracker)tolocate
the pipeline. At each of the three stages of locating the pipelines position there are
measurementerrors,allerrorstogethercausesthenoise.


Figure7Measurementerrors

With this new approximating function the curvature can be calculated, and the curvature
shouldtellwherethepipelinecouldhavebuckled.Thedifferentsmoothingconditionsand
whatorderofpolynomialapproximationisusedmaketheresultvary.Thisiswhychoosing
therightsmoothingconditionisveryimportant.

20


Figure8Anexampleofsmoothing

Figure 8 is an example of plotted survey data set (green points) and the (blue) smoothed
line (spline). For the untrained eye it looks like three possible areas have undergone local
buckling. But if considering a 20 inch pipeline then this kind of movement is not possible,
theresultingbendingmomentwouldbetoolarge(unrealistic)becauseoftheunusualhigh
curvature.
Thisisthekindofnoisethatneedstobereduced.Butthenagainwheredoesthelinego
between noise and useable measurements? This is really up to the user; trust inthe data
given by the survey contractor, but also use common sense. If the data given is not very
realisticthenaquickcheckofanareacanbeallthatisneeded,andthenifnothingiswrong
withthepipethisdatacanbelabeledasnoise,andcanbereducedbysmoothingasdonein
thefigureabove.Butagain,theareasshouldbecheckedifthesurveycontractorsaysthe
data is good, since the contractors usually performs their own calibration, etc of survey
data.

3.8ROVPipetracker

AROVPipetrackerprovidesthecapabilityoftrackingsubseapipelines.Totrackthepipeline
magnetometerbased sensors can be used. But it is easily affected by other forms of
magnetism, which can cause measurement errors (noise). The pipetracker can also use
pulse induction technology that gives the ability to locate any conductive material on or
belowtheseasurface.Theunitgenerateshighlyaccuratesurveydatathatcanenablethe
locationofanytypeofsubseapipelinetoberecordedwithexceptionalaccuracy21.Ithasthe
abilitytofunctionaroundsubseastructures.

21

3.9FiniteElementMethodAnalysis(FEMA)

Thefiniteelementanalysisisawaytosimulatethebehaviorsofaninstalledpipelineina
realistic threedimensional environment obtained by measurements of the seabed
topography. This allows engineers to exploit any opportunities that the pipeline behavior
mayoffertodevelopbothsafeandcosteffectivesolutions7.Thefiniteelementmodelmay
beatoolforanalyzingtheinplacebehaviorofapipeline.

In this thesis the verification work is performed in SIMLA; a FEanalyze software (see
AppendixC).

22

4Softwaredevelopment

The design criterion is the allowable bending moment, so to find the actual bending
moment of a pipeline in the operational mode is very important. If the actual bending
momentexceedstheallowablebendingmomenttheaxialcompressivestresswillbehigher
thanexpected,andthiscancausebucklingofthepipe.Thisiswhyfindingthecurvatureof
thepipelinecanbesohelpful.

In most cases a map of the pipeline route has the coordinates easting(x) and northing(y),
but at the same time engineers want the different positions of the pipeline given in KP
(Kilometric Point along the pipeline). The KP follows the pipeline route from KP 0 (zero)
whichisthestartingpoint,totheend.Thewayitiswrittenvaries,sometimesKP6isthe
pointonthepipelineafter6meters,butinothercasesthispointwillbewrittenasKP0.006,
whereKP6isthepointafter6kilometers.Thelastalternativeisthecorrectone,sinceitis
calledkilometerpointnotmeterpoint,howeverbothareused.

Tofindthe curvature,surveydataneedstobecollectedsothepositionofthepipelinein
operational mode can be determined. The survey data set is a data set of positional
measurements,howmanymeasurementsthataretakenvaries,butnormallyitisatevery
meter following the KP. But as said these measurements differ from each other, distance
wise and in accuracy. Noise in data set reduces the accuracy. This noise needs to be
eliminated/ reduced, and this is done by smoothing the data set through some kind of
interpolating that takes this into consideration by not interpolating through every point,
instead it gives us a better approximation of the pipeline position. It is this smoothing
operationthatisimportantinthissoftware.

FortheLateralBucklingScreeningSoftware(LBSS)thePythonprogrammingwillbeusedto
obtainautomatedroutines.

Thereare2mainstepsinthedevelopmentofthesoftwaretool:

Step1willaimtopresentanoverviewoftheresults,basedonanevaluationofthesurvey
data:

Lateraloffsetfromdesign/aslaiddata.

Importofsurveydatashallbeperformedautomatically.

23

Step2,basedonreportedlateraloffset,selectedlocationswillbeevaluatedindividually.In
order to get an accurate estimate of pipeline curvature and bending moments, different
smoothing alternativeswillbeevaluatedforuseinthesoftware.Smoothingofthesurvey
datawillreduce/eliminatenoiseinthedataset.

ThreedifferentsmoothingfunctionsinthesoftwarePythonwasapplied:

polyfit()
interpolation.UnivariateSpline()
interpolate.splrep()withinterpolate.splev()

The polyfit() function gives a polynomial approximation of the data set, but this is for the
whole graph, not just for parts of it, so for long graphs (data sets) this is not a good
alternative.Theothertwofunctionsusesamethodofsmoothing,fittingasmoothcurveto
a set of noisy observations17, using a spline function, which is piecewise polynomials with
continuous derivatives to chosen degree. This allows an interpolation with a smoothing
factorthatdetermineshowmanyofthepointsthatshouldbeused(interpolatedthrough).
This allows the user to reduce the noise in the data set, and it will most likely give a
smoother/betterpictureofthepipelineposition.

The interpolation.UnivariateSpline() function reduces the noise very well, however the
coefficientsforthepiecewisepolynomialisneededtocalculatethederivativeofthecurve.
Accordingtoasourceontheinternett22thesecoefficientsbelongtotheBzierformula(for
Bziercurves),whichgottoocomplicatedcomparedtothenextalternative,sothisresulted
in abondonment of the function. The choice ended on the function combination:
interpolate.splrep() and interpolate.splev(). The combination is user friendly and executes
excellent interpolations, and it has the .splev() function to calculate the derivatives of the
graph/curve.

The resulting curvature and bending moment (according to the curvature) for the chosen
alternativeispresentedasoutputintheLateralBucklingScreeningSoftware.

Calculation of the curvature of the smoothed curve multiplied with the pipes bending
stiffnessgivesthebendingmomentalongthepipeline.

Theallowablebendingmomentsforthepipelinewillbeplottedtogetherwiththecalculated
bending moments for the smoothed line. (Existing and verified inhouse spreadsheets for
calculation of allowable bending moments will be applied for calculation of allowable
moments.)

24

5Calibrationanalyses

Theselectionofbestpossiblesmoothingmethodwhenevaluatingsurveydataiscritical.In
order to increase the confidence in selection of smoothing method, a set of calibration
analysesusinga3DFEinplaceanalysistool,namedtheSIMLAisused.

Figure9Asimulatedpipelineonmeshedseabed

SIMLA reads the seabed data from survey data to generate the threedimensional terrain
mesh.Asthepipelineislaidontotheseabedmesh,thepipelineelementsarefreetomove
in all degrees of freedom, at both ends. The pipeline is therefore not restricted to
movements in the vertical direction only, but may slide sideways if the slope is large
perpendiculartothepipeaxis.

25

In order to get a good estimate of pipeline utilization (bending moment) at the time of
surveythefollowinganalysisisapplied:

1. Createapipelinerouteonapremadeseabed(inSIMVIS).

2. Addpipelinedimensionsandsoilfriction(inSIMLA).

3. Laythepipelinedownontheseabed(inSIMLA).

4. Addpressureandtemperature,gradually(inSIMLA).

5. RunSIMPOSTfortheresults:KPvalue,newxandycoordinatesforthepipelineand
thebendingmoment.

6. Createatextfilewiththreecolumns;onewiththeKPvalue,thetwoothercolumns
containxandycoordinatesseparately.

7. ImportthenewtextfileinthedevelopedLateralBucklingScreeningSoftware.

8. Evaluatetheresult,andcompareittotheresultsgiveninSIMLA.

26

6Discussionon:

SelectingtheprogramPython:

Because of its effectiveness, fast line readingand greatmemory, the programPython is a


verygoodfitfortheoperationsrequiredintheLateralBucklingScreeningSoftware.Python
letstheuserquicklywritethecodeneededandthankstoahighlyoptimizedbytecompiler
andsupportlibraries,Pythonrunsmorethanfastenoughformostapplications.Thismakes
itverycompatiblewiththeuseoflargedatafiles,suchassurveydata.

ThethreesmoothingfunctionstestedintheprogramPython:

The polyfit() function gives a polynomial approximation of the data set, but this is for the
whole graph, not just for parts of it, so for long graphs (data sets) this is not a good
alternative.Itmightworkforsimplecurves(shortdistances),butforlongerdistanceswith
severalcurvesthisfunctionwillbetooroughwhensmoothingthesurveydata.

The interpolation.UnivariateSpline() function reduces the noise very well, however the
coefficientsforthepiecewisepolynomialareneededinordertocalculatethederivativeof
the curve. According to a source on the internet22 these coefficients belong to the Bzier
formula (for Bzier curves), and after testing the next function interpolate.splrep() with
interpolate.splev() the choice was made. The combination is user friendly and executes
excellentinterpolations,andithasafunctionnamed.splev()tocalculatethederivativesof
thegraph/curve.Alltheuserneedstodoistochooseasmoothingfactor(seeappendixD)
thatfits;inotherwords,afactorthatreducesthenoiseandgivesarealisticpictureofthe
pipelines position on the seabottom. The smoothing factor is a great attribute of the
functionsinceeverysurveydatasetisdifferentwithrespecttosizeandthefrequencyofthe
data.

Problemsarisingthroughworkonthethesis:

Importing easting and northing coordinates and KP values from different data set was
challenging,becausesomesurveydatahasthedataseparatedwithacoupleoflineswith
field information. This field information is not required and is easy to not import, but the
informationcancontainnumberswhichcauseproblems,forexampledates.Thesenumbers
mustbeexcludedfromtheimportthroughaseparatemethod.

The program SIMLA would never accept the flat seabed profiles created. This was never
achieved during the thesis work. The solution to the problem was to use actual seabed
profilesgeneratedintheprogramSIMVISfromearlierIKMOceanDesignprojects(nofield
namesgiven).Duetothissolution anotherproblemarose,theverificationworkgotmore
challenging.TheLBSStooldoesnottakeintoconsiderationthestresseffectsfromupheaval

27

bucklingandanunevenseabed.Thisisanimportantfactortoconsiderwhenevaluatingthe
LBSSresults,whencomparingthemtotheresultsinSIMLA.

This was not the only problem when using the program SIMLA; when the material
parameters were imported, SIMLA would not finalize the FEanalysis when using a linear
material type (which is used in the Lateral Buckling Screening Software). So, in every FE
analysisrunperformedinSIMLAanelastoplaticmaterialtypehasbeenused.

BoththeseproblemshavehadtheireffectontheresultsgiveninSIMLA,whichhavemade
the verification work complicated. This, as said, is because the Lateral Buckling Screening
Softwareanalysesarerunwithalinearmaterialtype,andonaflatseabedprofile.

ThefinalizedLateralBucklingScreeningSoftwaredeveloped:

Seechapter7Conclusions.

Furtherworkandimprovements:

The effects on the stresses from an uneven seabed can be the next big step for further
developmentofthesoftware.Thismightbethesolutiontoachievemoreaccurateresults.

The method used for importing easting and northing coordinates and KP values from
differentdatasetshouldbeimproved.Thecurrentmethodreadsalineinthedatasetand
importstheelementsinthatlinethatcontainanumericalvalue.Thereasonforthisisthat
somesurveydatahasthedataseparatedwithacoupleoflineswithfieldinformation.This
fieldinformationisnotwantedandiseasytonotimport,buttheinformationcancontain
numberswhichcauseaproblem,forexampledates.Thesenumbersmustbeexcludedfrom
theimportthroughaseparatemethod.

Moretestingofthesoftwareshouldbeperformed.Testingonatotallyflatseabedwouldbe
very useful, the result will show the effects from a flat seabed compared to an uneven
seabed. More testing with different pipe parameters should be performed to see how
essentialthepipedimensionsarefortheresults.

28

7Conclusions

The Lateral Buckling Screening Software (LBSS) has shown to be a good tool for the
evaluation of pipeline lateral buckling. By using the program Python as programming
software it has developed into an easy and effective tool for import of data (for example
surveydata);withquicklinereadingandgreatmemory.LBSScontainsasmartsmoothing
function.Whyisitsmart?Everysurveydatafilecontainsdifferentamountofdata;length
andfrequencywise.Soapermanentformulaorsmoothingfactorwillnotwork.LBSSgives
the user the opportunity to choose a smoothing factor as many times as the user feels is
necessaryfortheoutcome/resulttoberealisticandsufficienttoobtainagoodestimatefor
furthercurvaturecalculations.

CurrentlytheLBSShasitslimitations.Calculationscanonlybedonewithalinearmaterial
type, and when calculating the bending moment it only takes the horizontal position into
consideration. So any effect from an uneven seabed or upheaval buckling is not included,
this is why the LBSS will always give lower stress results than a FEanalysis software. To
improvethetool,thisisthedifferencemaker.

Note!TheLBSSsmoothingfunctioncanalsobeusedforsmoothingofothertypesofdata.

29

8References

(1) PalmerA.C.,andKingR.A.,SubseaPipelineEngineering.PennWellCorporation,
Tulsa,USA(2006)
(2) http://en.wikipedia.org/wiki/trawl
(3) Ommundsen,M.L.,UpheavalBucklingofBuriedPipelines,MasterthesisatUniversityof
Stavanger(2009)
(4) Karunakaran,D.,StructuralDesignofPipelines[Lecturenotes],UniversityofStavanger
(2010)
(5) Karunakaran,D.,UpheavalandLateralBuckling[Lecturenotes],UniversityofStavanger
(2010)
(6) http://www.glossary.oilfield.slb.com,onHP/HT.
(7) Bai,Y.,SubseaPipelinesandRisers.ElsevierLtd,Oxford,UK(2005)
(8) ANSYSTrainingmanual,SASIPInc.(2006)
(9) DNVOSF101,SubmarinePipelineSystems.DetNorskeVeritas,Offshore
Standard.DNV,Hvik,Norway(2007)
(10) DNVRPF110,GlobalBucklingofSubmarinePipelinesStructuralDesigndueto
HighTemperature/HighPressure.DetNorskeVeritas,RecommendedPractice.
DNV,Hvik,Norway(2007)
(11) Solheim,R.,Presentasjonsikkerhetsforumalvorligehendelser.
Petroleumstilsynet.Stavanger,Norway(2007)
(12) http://www.aftenbladet.no/energi/1253149/Anker_kan_truga_lys_og_varme.ht
ml
(13) OIL&GASJOURNAL,www.ogj.com,picturesearchonwww.google.com
(14) JPKennyGroup,Pipelineexpansionanalysis,Designguidelines(1994)
(15) http://news.mongabay.com/2006/1124trawling.html
(16) http://en.wikipedia.org/wiki/Curvature
(17) http://en.wikipedia.org/wiki/Smoothing_spline
(18) http://en.wikipedia.org/wiki/Smoothing
(19) http://en.wikipedia.org/wiki/Noise
(20) http://www.epmag.com/archives/features/64.htm
(21) http://findarticles.com/p/articles/mi_qa5367/is_199808/ai_n21426438/
(22) http://comments.gmane.org/gmane.comp.python.scientific.user/24701

30

AppendixA
5ptand7ptfiles
and
DesignRoutefiles

31

7ptfilesand5ptfiles

Thefilesstartwithgeneralinformationaboutthefield,andarecompletedwithalongseries
of numbers. Each separated part of the line contains certain information; this pattern is
followed through the whole document. For the Lateral Buckling Screening Software, only
three of these line elements are needed; KP, Easting and Northing. These three tell the
horizontal position of the pipeline (a 2D horizontal coordinate system) and the given KP
valuealongthepipeline.

Theproblemhere(fortheLateralBucklingScreeningSoftware)isthatthesoftwareneedsto
knowwhichlinenottoread,andthateverylineneedstobesplitforexportofwanteddata
(thetreementionedabove).


FigureAAtrenchedpipelinewiththesevenpointsgivenina7ptfile

Under this text there is a section from a 7ptfile, it contains; the KP value, Easting
coordinate,Northingcoordinate,andthenthe7pointsshowninfigureAfollows.Thelast
pointsafterthattelltheoffsetfromthesurveycentreline.Thedifferencebetween7ptfiles
and 5ptfiles is that the 5ptfiles contain two less points then the 7ptfiles. The two
outermostpointsisnottobefoundinthe5ptfiles.

KP;Easting;Northing;FarPortMSBL;NearPortMSBL;PortMSBL;StbdMSBL;NearStbdMSBL;FarStbdMSBL;TOP;FarM
SBLdist;NearMSBLdist;MSBLdist(#Thisoriginallyonlyoneline)

000.0101;473081.77;6772032.49;189.91;189.94;189.53;189.45;189.62;189.31;188.70;17.88;6.06;1.82
000.0091;473082.65;6772031.91;190.11;189.82;189.55;189.55;189.57;189.34;188.72;18.12;5.70;1.50

000.0081;473083.56;6772031.56;190.16;189.62;189.68;189.66;189.46;189.45;188.75;18.12;5.65;1.47

000.0071;473084.53;6772031.21;190.05;189.56;189.59;189.59;189.56;189.60;188.79;18.76;6.03;1.55

000.0062;473085.43;6772030.89;190.10;189.71;189.71;189.71;189.64;189.71;188.86;18.41;5.73;1.55

000.0052;473086.41;6772030.58;190.23;189.66;189.80;189.82;189.59;189.42;188.89;18.31;6.36;1.53

000.0041;473087.38;6772030.28;190.19;189.93;189.71;189.71;189.66;189.28;188.93;17.51;5.80;1.82

32

DesignRoutefile

Asthe7ptandthe5ptfile,theDesignRoutefile(seeexampleunderthistext)startswith
general field information (not included in example), and this is followed by a bunch of
numbers.InthiscasethestationcolumnistheKPvalue.

WhenusingDesignRoutefilesinthescreeningtool,itiscolumn1,3and4whichisneeded
toperformthecorrectplotting.

StationPointEasting(X)Northing(Y)Elevation(Z)

0.0POB473090.86106772027.91300.0000

1.0POT473091.76716772027.49000.0000

2.0POT473092.67336772027.06700.0000

3.0POT473093.57946772026.64410.0000

4.0POT473094.48566772026.22110.0000

5.0POT473095.39176772025.79810.0000

6.0POT473096.29786772025.37510.0000

7.0POT473097.20406772024.95220.0000

8.0POT473098.11016772024.52920.0000

9.0POT473099.01636772024.10620.0000

10.0POT473099.92246772023.68320.0000

33



AppendixB
PythonProgramming

34

Pythonprogramming
Ingeneral

Python is an Enthought developed software. It provides scientists and engineers a


comprehensive set of tools to perform rigorous data analysis and visualization 1 . Python,
well known for its flexibility and easeofuse, is becoming a more and more popular
programminglanguageforusersworldwide.EPD,EnthoughtPythonDistribution,backsthis
statementupbyitsimpressiveandpowerfulcollectionofPythonlibraries,includingSciPy,
NumPyandmatplotlib.

ThechoiceofselectingEPDasaprogrammingtoolisreasonedbyitseffectiveness;fastline
reading, with a great memory. Python lets the user write the code needed, quickly. And,
thankstoahighlyoptimizedbytecompilerandsupportlibraries,Pythonrunsmorethanfast
enoughformostapplications2.Thismakesitverycompatiblewiththeuseoflargedatafiles,
comparedtocomputationaldemandingsoftware,likeVisualBasic.And,itisfreetouse.

Someofitskeydistinguishingfeaturesinclude 2 :

Veryclearandreadablelanguage
Intuitiveobjectorientation
Naturalexpressionofproceduralcode
Fullmodularity(theuseofindividuallydistinctfunctionalunits 3 )
Exceptionbasederrorhandling
Veryhighleveldynamicdatatypes
Extensivestandardlibrariesandthirdpartymodulesforvirtuallyeverytask

1
http://www.enthought.com/products/epd.php
2
http://www.python.org/about/
3
http://dictionary.reference.com/browse/modularity

35

Thelanguage[4]

Python was intended to be a highly readable language. It is designed to have a clear and
organized visual layout, frequently using English keywords where other languages use
punctuation.Thelanguageusescertainstatementsandexpressions.


FigureBThefigureshowsaPython2.xcodeandthelanguagethatisused 4

Amongothers,thesearethemainstatementsthathavebeenuseddevelopingthe
screeningtool(#marksacomment):

Theifstatement,whichconditionallyexecutesablockofcode,alongwithelseand
elif(acontractionofelseif).

Asimpleunrelatedexample:
#Avariablexisfound,thisisachecktoseeifthevariablefoundhasavaluehigherthan10.
ifx>10:
print"Thevariableistoohigh!"
else:
print"Thevariablehasavalueof10orless,accepted!"

4
http://en.wikipedia.org/wiki/Python_(programming_language)

36

Theforstatement,whichiteratesoveraniterableobject,capturingeachelementto
alocalvariableforusebytheattachedblock.

Asimpleunrelatedexample:
#Duplicatetest
#Alistnamedx1isimported,andthisisaduplicatecheckofthelistx1
foriinrange(len(x1)):#Afunctionthatiteratesasmanytimesasthelengthoflistx1
ifx1.count(x1[i])>1:#Afunctionthatcountsthenumberofsimilarvaluesasx1[0],x[1],etc
printx1[i],x1.count(x1[i])#Allduplicatesarebeingprintedoutasoutputonthescreen
else:
pass#ifelementhasnoduplicates,nothinghappens,itjustgoesontothenextelement
#inthelist

Thewhilestatement,whichexecutesablockofcodesaslongasitsconditionistrue.

Asimplerelatedexample:

#Alistnamedxx1containsintegersandisimported
#Asimpletesttofindtheclosestvalueinthelistxx1;withrespecttowhatsbeingaskedfor
test=1
start1=input('Whatisthestarteastingcoordinateofyourcheck?')
whiletest==1:#thisfunctionrunsaslongasthevariabletestisequalto1.
ifstart1inxx1:
test=2#ifthecoordinateaskedforisinthelist,thewhileloopisquit
print'\n'
printstr(start1)+"isthestartofyourinterval"
print'\n'
else:
start1=start1+1#ifnot,itadds1andsearchesagain

37

Thetrystatement,whichallowsexceptionsraisedinitsattachedcodeblocktobe
caughtandhandledbyexceptclauses.

Asimplerelatedexample:

#Thisisamethodthat,afteratextfilehasbeenimported,dismissesunwantedwordsandcertainnumbers
x1=[]#anemptylistiscreated
try:
iffloat(a1[g11])>30:#30isjustasetvalue,butthisalsoindicatesthatthewantedvalue>30
x1.append(float(a1[g11]))#Afunctionthatentersthewantednumbersintothelistx1
else:
pass#ifthelistelement,a1[g11],isnotgreaterthan30;nothinghappens,itjustpasseson
exceptValueError:#thisfunctionallowsexceptionsinthelist,soifitreadsastring(aword),
pass#thestringisnotappendedinthelistx1

Thedefstatement,whichdefinesafunctionormethod.Thedefstatementdoesnot
execute its block immediately, unlike most other statements. It executes when
wantedinthemain()function,asshownunder:

Arelatedexample:

#Afunctionisdefinedoutsidethemain()function,whereitsreturnvalueisexecutedinthemain()function.
#4alternativesaregiven
defask_alt(prompt='Whichofthefouralternativesabovedoyouwanttolookat?Inotherwords,
whatfilesdoyouhave?',complaint='1to4,please!'):#thefunctionisnamedask_alt
whileTrue:#awhileloopisexecuted,itonlyquitswhenoneoftheelementsinthelistgoodisgiven
good=['1','2','3','4']
alt=raw_input(prompt)#thevariablealtwillcontaintheanswergiven
ifaltingood:#ifstatementthatasksiftheanswergivencanbefoundinthelistgood
print"Okey,alternative"+alt+"itis."
returnalt#thissaysthataltisthereturnvaluewhenthefunctionisexecuted
else:
printcomplaint

defmain():#thisisthemain()function
alt=ask_alt()#itisatthispositiontheask_alt()functionisbeingexecuted

if__name__=='__main__':
main()#thisistheendofthemain()function

38

Expressions:

InPython,==comparesbyvalue.
Pythonusesthewordsand,or,notforitsBooleanoperators.
Pythonmakesadistinctionbetweenlistsandtuples(atupleissimilartoalistbut
with parentheses instead). Lists are written [1,2,3,4,5], and changes can be made.
Whiletuplesarewritten(1,2,3,4,5),andcannotbechanged.
Pythonhassliceexpressionsonlists,denotedas:[left:right:stride]
Ex.Ifthevariablexisassignedthelist[1,2,3,4,5],thenthefollowingexpressionswill
betrue:
x[0:2]==[1,2],ps:x[0]isthefirstelementinthelist.
x[1:4]==[2,3,4],i.e.theslicegoesupto,butnotincluding,therightindex.
x[:]makesacopyofthelist.
Asdecimalseparatorpunctuationisused,notcomma.Commaisusedforseparation
ofdifferentelementsinalist.
Touseafunctionthatbelongstoacertainlibrary,thatlibraryneedstobeimported.
Ex.Importscipy

Methods:

Methodsonobjectsarefunctionsattachedtoobject,example,x1.append(1).Wherex1is
theobjectandappendisthefunction.Thenumber1isbeingappendedinthelistx1.

Librariesused(amongothers):

Matplotlibisthepython2Dplottinglibrary
NumPyisthefundamentalpackageneededforscientificcomputingwithPython.It
providesconvenientandfastNdimensionalarraymanipulation.
Pylabisanotherlibraryusedforplotting.
SciPyisopensourcesoftwareformathematics,scienceandengineering.Itdepends
on NumPy, it is built to work with NumPy arrays, and provides userfriendly and
efficient numerical routines such as routines for numerical integration and
derivation 5 .Italsohavegoodinterpolationroutines.

5
http://www.scipy.org/

39

AppendixC
SIMLA

40

SIMLA[6]
Programbasis
SIMLAisacomputerprogramforsimulationofumbilicalstructures.Itwasdeveloped(Sept.,
2000)afterasimulationrequestrelatedtotheinstallationoftheOrmenLangePipelines 6 .

Basicconcepts
AnalysisinSIMLAcanbedividedupinseveralphases;theyareorganizedinfigureC.


FigureCThefigureillustratestheSIMLAsystemarchitecture6

The Input File is where the user enters his pipeline and field data. It is text string
based;everyinputlinestartswithastring,alsocalledacardinSIMLA.Everycardhas
itsownfunction,someisusedtoenterthepipedimensions,othercardscanbeused
to: decide the different loads and load histories (temperature and pressure, etc),
entermaterialproperties,seabedproperties(frictionwise),decidethesequenceof
analysis(itdefinesasetoftimeintervalswheredifferentpropertiesmayapplywith
respecttosteplength,timeintervalforresultstorageandtypeofanalysisstaticor
dynamic),andamongothersatextfilecontainingtheseabedprofile.
WhentheinputfileiscompletethenextphaseistoruntheanalysisinSIMLA.Ifthe
analysis is successful the user can use XPOST for visualization of pipeline and the
bucklingeffectsonitforeachtimestep.
To get the results such as new pipeline position after a buckle has been triggered,
bendingmoment,etc,SIMPOSTisthetooltouse.Thesetworesultshavebeenused

6
Svik,S.,kland,O.D.,Baarholm,G.S.,andGjsteen,J.K..,SIMLAUserManual,MARINTEK,(2010)

41

inthisthesisverifyingthescreeningtooldeveloped.Thisisdonebycalculatingthe
curvatureofthenewpipelinepositioninthescreeningtoolandmatchingtheresult
withtheresultgiveninSIMPOST.
OtherfilesusedaretheLOGfile,whichtellstheuserwhensomethingiswrongand
where the problem is. It also logs every step of the analysis when being run.
SIMVISisanotherprogramused,thisiswherea3Dseabedisvisualizedandtheuser
cancreateaselfmadepipelineroute,toanalyzefurtherinSIMLA.

Formoreinformation,seeSIMLAUserManual.





42



AppendixD
Usermanual

43

USERMANUAL
for
LBSS


AScreeningSoftwareToolforEvaluationofLateralBuckling

44

Introduction

The software is developed to reveal potential lateral buckling/snakings, and to check the
degreeofutilizationwithrespecttotheallowablebendingmoment(actualBM/allowable
BM).

Themainfunctionofthesoftwareistoreducenoisefromthesurveydata.Thisisdoneby
smoothing the data set with a special function in python programming, and making the
surveydatamorerealisticanduseableforcalculationsofthepipelinecurvature.

45

INSTALLATION
Setup

To use this software (LBSS) the program Python is required. Python is an Enthought
developed software; it provides a comprehensive set of tools to perform rigorous data
analysisandvisualization 7 .

PythonrunsonWindows,Linux/UnixandMacOSX.

TodownloadPython(includingitsverymuchneededlibraries),followthesesteps:

Enterthiswebpage:http://www.enthought.com/products/trialdownload.php

1) Choosethecorrectoperatingsystem,andenterpersonalinformation.
2) Followthesetupinstructions.

Note!AttachedtothethesisisaCD,itcontainsprogramLBSS.py,themasterthesisandtwo
surveydatafilesfortestingoftheLateralBucklingScreeningSoftware(LBSS).

7
http://www.enthought.com/products/epd.php

46

HOWTOUSETHESOFTWARE(LBSS)

Overview

To get a brief overview of the software; it is divided in three phases. First is the import
phasewherethreesortsofdatacanbeimported;thedesignroute,aslaiddataandsurvey
data. The wanted combination is of the users own choice. Second phase is an overview
(illustration)ofselecteddata.Fromthisamoredetailedsearchcanbedonetofindpossible
lateralbuckling,andawantedsectionofpipelineistobechosen.Thelastphaseistofind
the curvature, and the related bending moment of the selected pipeline section. This is
donebyfindingthebestsuitedsmoothingfactor*throughsomesortofiteration.Whenthe
user feels satisfied with the chosen smoothing factor, meaning it gives the most realistic
pictureofthepipelinelay,theusershouldbeabletofindpossiblelateralbucklings.Allthis
isdescribedindetailinthesectionunder.

Phaseone:Thepurposeofthesoftwareistosmoothadataset,inotherwordsalistof
data (survey) must be imported. The software will then need to know where on your
computerthefileislocated,forexample,C:\Programfiles\project2011\(filename).txt.The
software needs a certain format on the imported file. It needs to be a text file (.txt), and
everycolumnneedstobeseparatedbyspace,notsemicolonoranyothersign.Iforiginal
datasetisseparatedbysuchsignsthisneedtobechanged.Thiscaneasilybeperformedin
Excel, by using the replace function. When this is in accordance, the next step is to get
acquaintedwithwhereyourwanteddataispositioned,inwhichcolumn.Thesoftwarewill
ask from which column it should import the KP values from, likewise with the x and y
coordinates.
Asmentionedabove,themaingoalistofindthecurvatureofthepipeline.Thecurvature
formulacontainsthesecondderivativeofthepolynomialapproximationofthecurve,this
causesasmallproblem;therecanbenoduplicatesinthexcolumn(thisisaprobleminthe
lastphase,butitisbesttoperformtheduplicatecheckbeforerunningtheprogram).Thisis
onlyrelevantforthesectionchosentobechecked.

StationPointEasting(X)Northing(Y)Elevation(Z)

0.0POB473090.86106772027.91300.0000

1.0POT473091.76716772027.49000.0000

2.0POT473092.67336772027.06700.0000

3.0POT473093.57946772026.64410.0000

Thelistaboveisanexampleofoneofmanyformatsthatareacceptableforimport.

PS:Decimalseparatorsmustbepunctuation,notcomma.

47

Typicalerrors:

Enteringthewrongfileaddress
Fileisnotinorder,commainsteadofpunctuation,columnsarenotseparatedwith
space

Phase two: After importing the necessary files the output will be a figure with graphs
corresponding to the pipeline position according to, for example, the survey data. In this
figure the user can zoom and explore the unsmoothed curve(s) and decide which section
needs a better look, a section that might have undergone more lateral buckling than
wanted. This section is from one easting (x) coordinate to another easting (x) coordinate.
The length of it should not exceed 10 km, this number is relative to the number of
measurementsinthedataset.Ifthedatasetisfromeverymeterofpipe,10kmisagood
limitation.Iflessmeasurements,themaximumlengthoftheintervalexpands.

PS:iftheuserenters18001asstartenendcoordinate,thesoftwaresearchesforthenext
integerthatisclosestto18001.Whatthemethoddoesisthatitjustremovesthecurrent
decimals,andtheremainingisthenewnumberintheintegerlist.

Typicalerrors:

Enteringtoobigofaneasting(x)interval.

Phase three: This is the last phase; this is where through manual iteration a reasonable
resultappearsasoutput.Beforetheresult,curvatureandcorrespondingbendingmoment,
appearsasoutputtheuserisaskedtoenterasmoothingfactor*.Itisaparameterinthe
smoothingfunctionscipy.interpolate.splrep()inpython.Theresultfromthisfunctionislater
enteredinthederivativefunctionscipy.interpolate.splev().Thesearethemainfunctionsin
calculatingthecurvature.

AfterthesmoothingfactorisenteredandthecurvatureandBM(bendingmoment)diagram
hasappearedtheusercanevaluatetheresult,thesmoothingofcurve.Ifitisrealisticornot,
thereisnotextbookanswerhere,thisiswhentheabilitytouselogicenters.Thesurveycan
be good but at some pieces of the data set the ROV Pipetracker can collect wrong data,
thinking something beside the pipe is the real pipe, and as usual there are always small
measuringerrors.Thisiswhysmoothingissoimportant.

iftheuserfeelsthatthesmoothingfactorusedisnotsatisfying,theuserenternowhen
asked, and phase three starts over again, a new smoothing factor is entered. This is the
iterationpart;itshouldendupgivingasatisfyingresult.

PS:Agoodstartingpointforthesmoothingfactorcanbebetween10and50.Thenworkit
fromthere.

Typicalerrors:

48

Duplicatesinthexcoordinatecolumn
Toosmallsmoothingfactor

* A smoothing condition. s = smoothing factor. The amount of smoothness is determined by satisfying the
conditions:sum((w*(yg))**2,axis=0)<=swhereg(x)isthesmoothedinterpolationof(x,y).Theusercanuse
s to control the tradeoff between closeness and smoothness of fit. Larger s means more smoothing while
smallervaluesofsindicatelesssmoothing.Recommendedvaluesofsdependontheweights,w.Iftheweights
represent the inverse of the standarddeviation of y, then a good s value should be found in the range (m
sqrt(2*m),m+sqrt(2*m)) where m is the number of data points in x, y, and w. default : s=msqrt(2*m) if
weightsaresupplied.s=0.0(interpolating)ifnoweightsaresupplied 8 .

Converting geographical coordinates to easting and northing


coordinates
Geographicalcoordinatesystemisacoordinatesystemthatenableseverylocationonthe
Earth to be specified by a set of numbers. A common choice of coordinates is latitude,
longitude and elevation 9 . Compared to easting and northing coordinates with the unit
meter, these coordinates do not, which is a problem when calculating the curvature.
However,theycanbeconverted,havingthenewunitbeingmeter.

Usuallythe5ptfilesand7ptfilesaregivenineastingandnorthingcoordinates,butwhen
theyoccasionallycomeingeographicalcoordinatestheyhavetobeconverted.Thiscanbe
performedwithsoftware,calledGeotrans.

TheStartup
Tostartthesoftware(LBSS)theusermustopenPythonidle,andopenthefile;(LBSS.py).To
runthesoftwarewhenfileisopened,justpressF5orrunmoduleinthemenubarabovethe
script.

Problems:

ContactSivertDuvsete
Email:Sivert.Duvsete@IKM.no

8
http://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.splrep.html
9
http://en.wikipedia.org/wiki/Geographic_coordinate_system

49



AppendixE
Verificationtestsofsoftware

50

Verificationtestsofprogram

Test1.1.SMR1300lasttimestep(timestep503)

SMR1300isaselfmaderouteconstructedinSIMVIS(seeAppendixC)onapredeveloped
uneven seabed. It is laid with 1300m in radius. After the pipeline is installed the
temperatureandinternalpressureisincreasedtotriggerbucklingofthepipeline.Thesetest
results are from the last time step in the load history. When visualized in XPOST (see
AppendixC), two sections of the pipelineare exposed to significant buckling; both can be
seeninthetworesultfiguresDandE.

SIMLAinput: LBSSinput:

ID:0.254m ID:0.254m
TH:0.0175m TH:0.0175m
Materialtype:X60,elastoplastic Materialtype:x60,linear
E:8.26e10N/m2 E:8.26e10N/m2

Comments/results:Internalpipetestparameters;93.5Celsiusand100bar.Thistestdisplaystwo
possibleareasforlateralbuckling.

TableAResultsfromtest1.1

Results SIMLA[kNm] SST[kNm] Differential(SST/SIMLA)[%]


KP500600 175 88 50
KP10001100 197 144 73

51


FigureDTheresultfromLBSS,test1.1

52


FigureETheresultfromSIMLA,test1.1

53

Test1.2.SMR1300timestep307

SMR1300isaselfmaderouteconstructedinSIMVISonapredevelopedunevenseabed.It
is laid with 1300m in radius. After the pipeline is installed the temperature and internal
pressure is increased to trigger buckling of the pipeline. These test results are from time
step307(of503)intheloadhistory.Thepurposeofthistestistocomparetheresultsgiven
fromanearliertimestepwiththeresultsfromtest1.1(sameinputdata,theonlydifference
is the magnitude of the temperature and pressure, which mean less curvature). When
visualized in XPOST, two sections of the pipeline are exposed to moderate buckling; both
canbeseeninthetworesultfiguresFandG.

SIMLAinput: LBSSinput:

ID:0.254m ID:0.254m
TH:0.0175m TH:0.0175m
Materialtype:X60,elastoplastic Materialtype:x60,linear
E:8.26e10N/m2 E:8.26e10N/m2

Comments/results:Internalpipetestparametersatlasttimestep;93.5Celsiusand100bar.But
thisisthe307thtimestepoutof503timesteps.Sotheinternalpipetestparametersarearound60
70%ofthefinaltestparameters(ownassumption).Thistestdisplaystwopossibleareasforlateral
buckling.

TableBResultsfromtest1.2

Results SIMLA[kNm] SST[kNm] Differential(SST/SIMLA)[%]


KP500600 101 56 55
KP10001100 115 93 81

54


FigureFTheresultfromLBSS,test1.2

55


FigureGTheresultfromSIMLA,test1.2

56

Test2.1.SMR1lasttimestep(timestep503)

SMR1 is a selfmade route constructed in SIMVIS (see Appendix C) on a predeveloped


uneven seabed. After the pipeline is installed the temperature and internal pressure is
increasedtotriggerbucklingofthepipeline.Thesetestresultsarefromthelasttimestepin
theloadhistory.WhenvisualizedinXPOST(seeAppendixC),onesectionofthepipelineis
exposedtosignificantbuckling;itcanbeseenintheresultfiguresHandI.

SIMLAinput: LBSSinput:

ID:0.254m ID:0.254m
TH:0.0175m TH:0.0175m
Materialtype:X60,elastoplastic Materialtype:x60,linear
E:8.26e10N/m2 E:8.26e10N/m2

Comments/results:Internalpipetestparameters;93.5Celsiusand100bar.Thistestdisplaysone
possibleareaforlateralbuckling.

TableCResultsfromtest2.1

Results SIMLA[kNm] SST[kNm] Differential(SST/SIMLA)[%]


KP12001300 233 173 74

57


FigureHTheresultfromLBSS,test2.1

58


FigureITheresultfromSIMLA,test2.1

59

Test2.2.SMR1timestep258

SMR1isaselfmaderouteconstructedinSIMVISonapredevelopedunevenseabed.After
the pipeline is installed the temperature and internal pressure is increased to trigger
buckling of the pipeline. These test results are from time step 258 ( of 503) in the load
history. The purpose of this test isto compare the results given from an earlier time step
withtheresultsfromtest2.1(sameinputdata,theonlydifferenceisthemagnitudeofthe
temperature and pressure, which mean less curvature). When visualized in XPOST, one
section of the pipeline is exposed to moderate buckling; it can be seen in the two result
figuresJandK.

SIMLAinput: LBSSinput:

ID:0.254m ID:0.254m
TH:0.0175m TH:0.0175m
Materialtype:X60,elastoplastic Materialtype:x60,linear
E:8.26e10N/m2 E:8.26e10N/m2

Comments/ results: Internal pipe test parameters at last time step; 93.5 Celsius and 100 bar. But
thisisthe258thtimestepoutof503timesteps.Sotheinternalpipetestparametersarearound50
60%ofthefinaltestparameters (ownassumption).This testdisplaysonepossibleareaforlateral
buckling.

TableDResultsfromtest2.2

Results SIMLA[kNm] SST[kNm] Differential(SST/SIMLA)[%]


KP12001300 97 60 62

60


FigureJTheresultfromLBSS,test2.2

61


FigureKTheresultfromSIMLA,test2.2

62

Test3.1.SMR2lasttimestep(timestep356)

SMR2isthesameselfmaderoutefromtest2.1,butwithnewpipedimensions.Asmaller
pipe with a thinner wall thickness is experimented with. After the pipeline is installed the
temperatureandinternalpressureisincreasedtotriggerbucklingofthepipeline.Thesetest
results are from the last time step in the load history. When visualized in XPOST (see
AppendixC),twosectionsofthepipelineisexposedtosignificantbuckling;itcanbeseenin
theresultfiguresLandM.

SIMLAinput: LBSSinput:

ID:0.212m ID:0.212m
TH:0.014m TH:0.014m
Materialtype:X60,elastoplastic Materialtype:x60,linear
E:8.26e10N/m2 E:8.26e10N/m2

Comments/ results: Internalpipetestparameters;93.5Celsius and60bar. Thistestdisplaystwo


possibleareasforlateralbucklingcomparedtotheonedisplayedintest2.1withthesamepipeline
route.Smallerpipedimensionstogetherwithlessinternalpressurehavecausedlateralbucklingin
twoareasinsteadofonearea,andabetterSSTresultcomparedtotheSIMLAresult.

TableEResultsfromtest3.1

Results SIMLA[kNm] SST[kNm] Differential(SST/SIMLA)[%]


KP600700 97 82 85
KP13001400 110 92 84

Note!Inthistestthelasttimestepis356insteadof503.ThisisbecauseSIMLAneedslesstimeto
increasethepressureto60barinsteadof100bar.

63


FigureLTheresultfromLBSS,test3.1

64


FigureMTheresultfromSIMLA,test3.1

65



AppendixF
Scriptofpythonprogram

66

importstring

importpylab

importnumpyasnp

importmatplotlib.pyplotasplt

frompylabimportlinspace

fromscipyimportinterpolate

fromcopyimportdeepcopy

importmath

x1=[]

y1=[]

x2=[]

y2=[]

x3=[]

y3=[]

SurveyKp=[]

allowable_BM=input('Whatistheallowablebendingmoment?')

#Whatfilestobeimported

print'1Surveydata'

print'2Designrouteandsurveydata'

print'3Aslaiddataandsurveydata'

print'4Designroute,aslaiddataandsurveydata'

print'\n'

#Whileloop,sothenumbers14havetobechosen

67

defask_alt(prompt='Whichofthefouralternativesabovedoyouwanttolookat?Inotherwords,
whatfilesdoyouhave?',complaint='1to4,please!'):

whileTrue:

good=['1','2','3','4']

alt=raw_input(prompt)

ifaltingood:

print"Okey,alternative"+alt+"itis."

returnalt

else:

printcomplaint

deftest(prompt='isthisatest?',complaint='yforyes,please!'):#Atestfunction

whileTrue:

good=['y']

testrun=raw_input(prompt)

iftestruningood:

print"Okey,testitis."

returntestrun

else:

return"no"

defmain():

alt=ask_alt()

ifalt=='1':#Surveydata
##################################################################################

68

print'\n'

testrun=test()

iftestrun=='y':

filelocation1='c:\\Sivert\\ola.txt'

g1=2

h1=3

surveyKp=1

f1=open(str(filelocation1))

else:

print'\n'

print"Toopenyourtextfile(s)thelocationofthefile(s)isneeded.Thefile(s)needstobein
txtformat.\n"

filelocation1=raw_input('Whereisthe"survey"datafilelocated?Example:C:\Program
Files\example.txt')

print'\n'

g1=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

print'\n'

h1=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

surveyKp=input("WhichcolumnfromtheleftcontainstheKPnumber?")

print'\n'

f1=open(str(filelocation1))

tmp1=f1.readlines()

foriinrange(len(tmp1)):

try:

a1=[]

69

line=tmp1[i]

a1=string.split(line)

try:

iffloat(a1[g11])>1:#Thisnumber(1),mightneedtobechanged

x1.append(float(a1[g11]))

else:

pass

iffloat(a1[h11])>2100:#Thisnumber(2100),mightneedtobechanged

y1.append(float(a1[h11]))

else:

pass

iffloat(a1[surveyKp1])<12000:#Thisnumber(12000),mightneedtobechanged

SurveyKp.append(float(a1[surveyKp1]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f1.close()

#try:

#foriinrange(len(x1)):

#ifx1.count(x1[i])>1:

70

#printx1[i],x1.count(x1[i])#Duplicatecheck,ifneeded

#else:

#pass

#exceptIndexError:

#pass

print"Findtheintervalyouwanttocheckthroughyoureastingcoordinates."

pylab.plot(x1,y1,'r')

pylab.ylabel('Northing(y)')

pylab.xlabel('Easting(x)')

pylab.grid(True)

pylab.title('Plottedpipelineposition')#finntittel

pylab.legend(('Survey'),loc='upperright')

#pylab.savefig('save')#finnnavnforfil

pylab.show()

print'\n'

xx1=[]

foriinrange(len(x1)):

xx1.append(float(int(x1[i])))

figo=1

start1=input('Whatisthestarteastingcoordinateofyourcheck?')

71

whilefigo==1:

ifstart1inxx1:

figo=2

print'\n'

printstr(start1)+"isthestartofyourinterval"

print'\n'

else:

start1=start1+1

lara=1

end1=input('Whatisthelasteastingcoordinateofyourcheck?')

whilelara==1:

ifend1inxx1:

lara=2

print'\n'

printstr(end1)+"istheendofyourinterval"

else:

end1=end1+1

slp1=xx1.index(start1)

slp2=xx1.index(end1)

ifslp1<slp2:

XnewStart=start1

XnewEnd=end1

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp1])+'KP'+str(SurveyKp[slp2])

72

print'\n'

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

KpStart=SurveyKp[slp1]

KpEnd=SurveyKp[slp2]

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x1[slp1:slp2],y1[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,abs(1000*(slp2slp1)+1))

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs((y2der)/((1+yder**2)**(3/2)))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x1[slp1:slp2],y1[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

73

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y1[slp2],y1[slp1])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

74

pylab.show()

q=raw_input("Areyousatisfied?(yesorno)")

kiko=1

whilekiko==1:

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x1[slp1:slp2],y1[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,abs(1000*(slp2slp1)+1))

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs((y2der)/((1+yder**2)**(3/2)))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x1[slp1:slp2],y1[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

75

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y1[slp2],y1[slp1])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

76

else:

x1.reverse()

y1.reverse()

SurveyKp.reverse()

xx1.reverse()

slp1=xx1.index(start1)

slp2=xx1.index(end1)

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp2])+'KP'+str(SurveyKp[slp1])

print'\n'

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

KpStart=SurveyKp[slp2]

KpEnd=SurveyKp[slp1]

XnewStart=start1#x1[slp1]

XnewEnd=end1#x1[slp2]

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x1[slp1:slp2],y1[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

77

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs((y2der)/((1+yder**2)**(3/2)))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x1[slp1:slp2],y1[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

pylab.grid(True)

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y1[slp1],y1[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

78

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

kiko=1

whilekiko==1:

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x1[slp1:slp2],y1[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

79

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs((y2der)/((1+yder**2)**(3/2)))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x1[slp1:slp2],y1[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

pylab.grid(True)

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y1[slp1],y1[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

80

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#finntittel

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

elifalt=='2':#Designrouteandsurveydata
###########################################################################

print'\n'

testrun=test()

iftestrun=='y':

filelocation1='c:\Sivert\DesignR.txt'

g1=3

h1=4

f1=open(str(filelocation1))

filelocation3='c:\\Sivert\\new7pt.txt'

81

g3=2

h3=3

surveyKp=1

f3=open(str(filelocation3))

else:

print'\n'

print"Toopenyourtextfile(s)thelocationofthefile(s)isneeded.Thefile(s)needstobein
txtformat.\n"

filelocation1=raw_input('Whereisthe"asdesigned"datafilelocated?Example:C:\Program
Files\example.txt')

print'\n'

g1=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

print'\n'

h1=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

f1=open(str(filelocation1))

filelocation3=raw_input('Whereisthe"surveydata"filelocated?Example:C:\Program
Files\example.txt')

print'\n'

g3=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

print'\n'

h3=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

surveyKp=input("WhichcolumnfromtheleftcontainstheKp?")

print'\n'

f3=open(str(filelocation3))

82

#Forloop,addingelementstotheasdesignedarray

tmp1=f1.readlines()

foriinrange(len(tmp1)):

try:

a1=[]

line=tmp1[i]

a1=string.split(line)

try:

iffloat(a1[g11])>3000:#Thisnumber(3000),mightneedtobechanged

x1.append(float(a1[g11]))

else:

pass

iffloat(a1[h11])>3000:

y1.append(float(a1[h11]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f1.close()

#Forloop,addingelementstothesurveydataarray

tmp3=f3.readlines()

83

foriinrange(len(tmp3)):

try:

a3=[]

line=tmp3[i]

a3=string.split(line)

try:

iffloat(a3[g31])>3000:#Thisnumber(3000),mightneedtobechanged

x3.append(float(a3[g31]))

else:

pass

iffloat(a3[h31])>3000:

y3.append(float(a3[h31]))

else:

pass

iffloat(a3[surveyKp1])<49:#Thisnumber(49),mightneedtobechanged

SurveyKp.append(float(a3[surveyKp1]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f3.close()

84

print"Findtheintervalyouwanttocheckthroughyoureastingcoordinates."

pylab.plot(x1,y1,'r',x3,y3,'b')

pylab.ylabel('Northing(y)')

pylab.xlabel('Easting(x)')

pylab.grid(True)

pylab.title('Plottedpipelineposition')

pylab.legend(('Asdesigned','Survey'),loc='upperright')

#pylab.savefig('save')

pylab.show()

print'\n'

xx3=[]

foriinrange(len(x3)):

xx3.append(float(int(x3[i])))

figo=1

start1=input('Whatisthestarteastingcoordinateofyourcheck?')

whilefigo==1:

ifstart1inxx3:

figo=2

print'\n'

85

printstr(start1)+"isthestartofyourinterval"

print'\n'

else:

start1=start1+1#thisformulashouldbechanged,adding.01insteadof1.(Butnoluckso
far)

lara=1

end1=input('Whatisthelasteastingcoordinateofyourcheck?')

whilelara==1:

ifend1inxx3:

lara=2

print'\n'

printstr(end1)+"istheendofyourinterval"

else:

end1=end1+1

slp1=xx3.index(start1)

slp2=xx3.index(end1)

ifslp1<slp2:

XnewStart=start1

XnewEnd=end1

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp1])+'KP'+str(SurveyKp[slp2])

print'\n'

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

86

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

KpStart=SurveyKp[slp1]

KpEnd=SurveyKp[slp2]

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

87

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp2],y3[slp1])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

kiko=1

q=raw_input("Areyousatisfied?(yesorno)")

whilekiko==1:

88

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp2],y3[slp1])

89

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#finntittel

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

else:

x3.reverse()

y3.reverse()

90

SurveyKp.reverse()

slp1=x3.index(start1)

slp2=x3.index(end1)

XnewStart=start1

XnewEnd=end1

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp2])+'KP'+str(SurveyKp[slp1])

print'\n'

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

91

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp1],y3[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

92

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#finntittel

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

kiko=1

q=raw_input("Areyousatisfied?")

whilekiko==1:

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

93

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp1],y3[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#finntittel

pylab.legend(('Actual','Allowable'),loc='upperright')

94

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

elifalt=='3':#aslaiddataandsurveydata
##############################################################################

print'\n'

testrun=test()

iftestrun=='y':

filelocation2='c:\Sivert\R.txt'

g2=1

h2=2

f2=open(str(filelocation2))

filelocation3='c:\\Sivert\\new7pt.txt'

g3=2

h3=3

surveyKp=1

f3=open(str(filelocation3))

else:

print'\n'

print"Toopenyourtextfile(s)thelocationofthefile(s)isneeded.Thefile(s)needstobein
txtformat.\n"

95

filelocation2=raw_input('Whereisthe"aslaid"datafilelocated?Example:C:\Program
Files\example.txt')

print'\n'

g2=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

print'\n'

h2=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

f2=open(str(filelocation2))

filelocation3=raw_input('Whereisthe"surveydata"filelocated?Example:C:\Program
Files\example.txt')

print'\n'

g3=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

print'\n'

h3=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

surveyKp=input("WhichcolumnfromtheleftcontainstheKp?")

print'\n'

f3=open(str(filelocation3))

#Forloop,forfylleaslaidvektorene

tmp2=f2.readlines()

foriinrange(len(tmp2)):

try:

a2=[]

line=tmp2[i]

96

a2=string.split(line)

try:

iffloat(a2[g21])>3000:#Thisnumber(3000),mightneedtobechanged

x2.append(float(a2[g21]))

else:

pass

iffloat(a2[h21])>3000:#Thisnumber(3000),mightneedtobechanged

y2.append(float(a2[h21]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f2.close()

tmp3=f3.readlines()

foriinrange(len(tmp3)):

try:

a3=[]

line=tmp3[i]

a3=string.split(line)

try:

iffloat(a3[g31])>3000:#Thisnumber(3000),mightneedtobechanged

97

x3.append(float(a3[g31]))

else:

pass

iffloat(a3[h31])>3000:#Thisnumber(3000),mightneedtobechanged

y3.append(float(a3[h31]))

else:

pass

iffloat(a3[surveyKp1])<49:#Thisnumber(49),mightneedtobechanged

SurveyKp.append(float(a3[surveyKp1]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f3.close()

print"Findtheintervalyouwanttocheckthroughyoureastingcoordinates."

pylab.plot(x2,y2,'g',x3,y3,'b')

pylab.ylabel('Northing(y)')

pylab.xlabel('Easting(x)')

pylab.grid(True)

98

pylab.title('Plottedpipelineposition')

pylab.legend(('Aslaid','Survey'),loc='upperright')

#pylab.savefig('save')

pylab.show()

print'\n'

xx3=[]

foriinrange(len(x3)):

xx3.append(float(int(x3[i])))

figo=1

start1=input('Whatisthestarteastingcoordinateofyourcheck?')

whilefigo==1:

ifstart1inxx3:

figo=2

print'\n'

printstr(start1)+"isthestartofyourinterval"

print'\n'

else:

start1=start1+1

lara=1

end1=input('Whatisthelasteastingcoordinateofyourcheck?')

whilelara==1:

ifend1inxx3:

99

lara=2

print'\n'

printstr(end1)+"istheendofyourinterval"

else:

end1=end1+1

slp1=xx3.index(start1)

slp2=xx3.index(end1)

ifslp1<slp2:

XnewStart=start1

XnewEnd=end1

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp1])+'KP'+str(SurveyKp[slp2])

print'\n'

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

KpStart=SurveyKp[slp1]

KpEnd=SurveyKp[slp2]

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

100

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp2],y3[slp1])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

101

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#finntittel

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

kiko=1

q=raw_input("Areyousatisfied?(yesorno)")

whilekiko==1:

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

102

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp2],y3[slp1])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

103

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

else:

x3.reverse()

y3.reverse()

SurveyKp.reverse()

slp1=x3.index(start1)

slp2=x3.index(end1)

XnewStart=start1

XnewEnd=end1

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp2])+'KP'+str(SurveyKp[slp1])

print'\n'

104

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

105

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp1],y3[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#finntittel

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')#finnnavnforfil

pylab.show()

106

kiko=1

q=raw_input("Areyousatisfied?")

whilekiko==1:

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

107

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp1],y3[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')#finnnavnforfil

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

108

elifalt=='4':#Designroute,aslaiddataandsurveydata
######################################################################

print'\n'

testrun=test()#detteerkunforgjredetletteretesteprogrammet

iftestrun=='y':

filelocation1='c:\Sivert\DesignR.txt'

g1=3

h1=4

f1=open(str(filelocation1))

filelocation2='c:\Sivert\R.txt'

g2=1

h2=2

f2=open(str(filelocation2))

filelocation3='c:\\Sivert\\new7pt.txt'

g3=2

h3=3

surveyKp=1

f3=open(str(filelocation3))

else:

print'\n'

print"Toopenyourtextfile(s)thelocationofthefile(s)isneeded.Thefile(s)needstobein
txtformat.\n"

filelocation1=raw_input('Whereisthe"asdesigned"datafilelocated?Example:C:\Program
Files\example.txt')

print'\n'

g1=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

109

print'\n'

h1=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

f1=open(str(filelocation1))

filelocation2=raw_input('Whereisthe"aslaid"datafilelocated?Example:C:\Program
Files\example.txt')

print'\n'

g2=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

print'\n'

h2=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

f2=open(str(filelocation2))

filelocation3=raw_input('Whereisthe"surveydata"filelocated?Example:C:\Program
Files\example.txt')

print'\n'

g3=input("WhichcolumnfromtheleftcontainstheEasting(x)coordinates?")

print'\n'

h3=input("WhichcolumnfromtheleftcontainstheNorthing(y)coordinates?")

print'\n'

surveyKp=input("WhichcolumnfromtheleftcontainstheKp?")

print'\n'

f3=open(str(filelocation3))

tmp1=f1.readlines()

foriinrange(len(tmp1)):

110

try:

a1=[]

line=tmp1[i]

a1=string.split(line)

try:

iffloat(a1[g11])>3000:#Thisnumber(3000),mightneedtobechanged

x1.append(float(a1[g11]))

else:

pass

iffloat(a1[h11])>3000:#Thisnumber(3000),mightneedtobechanged

y1.append(float(a1[h11]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f1.close()

tmp2=f2.readlines()

foriinrange(len(tmp2)):

try:

a2=[]

line=tmp2[i]

111

a2=string.split(line)

try:

iffloat(a2[g21])>3000:#Thisnumber(3000),mightneedtobechanged

x2.append(float(a2[g21]))

else:

pass

iffloat(a2[h21])>3000:#Thisnumber(3000),mightneedtobechanged

y2.append(float(a2[h21]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f2.close()

tmp3=f3.readlines()

foriinrange(len(tmp3)):

try:

a3=[]

line=tmp3[i]

a3=string.split(line)

try:

iffloat(a3[g31])>3000:#Thisnumber(3000),mightneedtobechanged

112

x3.append(float(a3[g31]))

else:

pass

iffloat(a3[h31])>3000:#Thisnumber(3000),mightneedtobechanged

y3.append(float(a3[h31]))

else:

pass

iffloat(a3[surveyKp1])<49:#Thisnumber(49),mightneedtobechanged

SurveyKp.append(float(a3[surveyKp1]))

else:

pass

exceptValueError:

pass

exceptIndexError:

pass

f3.close()

print"Findtheintervalyouwanttocheckthroughyoureastingcoordinates."

pylab.plot(x1,y1,'r',x2,y2,'g',x3,y3,'b')

pylab.ylabel('Northing(y)')

pylab.xlabel('Easting(x)')

pylab.grid(True)

113

pylab.title('Plottedpipelineposition')#finntittel

pylab.legend(('Asdesigned','Aslaid','Survey'),loc='upperright')

#pylab.savefig('save')

pylab.show()

print'\n'

xx3=[]

foriinrange(len(x3)):

xx3.append(float(int(x3[i])))

figo=1

start1=input('Whatisthestarteastingcoordinateofyourcheck?')

whilefigo==1:

ifstart1inxx3:

figo=2

print'\n'

printstr(start1)+"isthestartofyourinterval"

print'\n'

else:

start1=start1+1

lara=1

end1=input('Whatisthelasteastingcoordinateofyourcheck?')

whilelara==1:

ifend1inxx3:

114

lara=2

print'\n'

printstr(end1)+"istheendofyourinterval"

else:

end1=end1+1

slp1=xx3.index(start1)

slp2=xx3.index(end1)

ifslp1<slp2:

XnewStart=start1

XnewEnd=end1

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp1])+'KP'+str(SurveyKp[slp2])

print'\n'

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

KpStart=SurveyKp[slp1]

KpEnd=SurveyKp[slp2]

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

115

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp2],y3[slp1])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

116

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')#finntittel

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

kiko=1

q=raw_input("Areyousatisfied?(yesorno)")

whilekiko==1:

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

117

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp2],y3[slp1])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

118

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(min(SurveyKp[slp1:slp2]),max(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

else:

x3.reverse()

y3.reverse()

SurveyKp.reverse()

slp1=x3.index(start1)

slp2=x3.index(end1)

XnewStart=start1

XnewEnd=end1

print'\n'

print'Theintervalbeingchecked:KP'+str(SurveyKp[slp2])+'KP'+str(SurveyKp[slp1])

print'\n'

119

#EI,Bendingstiffnesscalculationforgivenpipeinterval

E=input("EntertheYoung'smodulus(N/m^2):")

Do=input("Entertheouterdiameterofthepipeline(m):")

ts=input("Enterthewallthicknessofthepipeline(m):")

I=((math.pi)/64)*(Do**4(Do2*ts)**4)

EI=E*I#(Nm^2)

print"Pipelinebendingstiffness:"+str(EI)+"Nm^2"

print'\n'

smoothingfactor=input("Enterasmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

120

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp1],y3[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

121

kiko=1

q=raw_input("Areyousatisfied?")

whilekiko==1:

ifq=="yes":

kiko=kiko+1

else:

smoothingfactor=input("Enteranewsmoothingfactor:")

tck=interpolate.splrep(x3[slp1:slp2],y3[slp1:slp2],k=5,s=smoothingfactor)

xnew=linspace(XnewStart,XnewEnd,1000*(slp2slp1)+1)

ynew=interpolate.splev(xnew,tck,der=0)

yder=interpolate.splev(xnew[::1000],tck,der=1)

y2der=interpolate.splev(xnew[::1000],tck,der=2)

curvature=(y2der)/((1+yder**2)**(3/2))

abs_curvature=abs(y2der)/((1+yder**2)**(3/2))

BM=[x*EIforxincurvature]#EI*curvature=BM

fig=plt.figure()

ax1=fig.add_subplot(211)

ax1.plot(x3[slp1:slp2],y3[slp1:slp2],'go',xnew,ynew,'b')

pylab.legend(('surveydata','Splines'),loc='upperright')

ax1.set_xlabel('Easting(x)')

ax1.set_ylabel('Northing(y)',color='b')

fortlinax1.get_yticklabels():

tl.set_color('b')

ax2=ax1.twinx()

ax2.plot(xnew[::1000],curvature,'r')

122

ax2.set_ylabel('curvature,5thordersplines',color='r')

fortlinax2.get_yticklabels():

tl.set_color('r')

ax1.set_ylim(y3[slp1],y3[slp2])

ax2.set_ylim(min(curvature),max(curvature))

pylab.grid(True)

pylab.title('Smoothedplottedpipelineposition')

pylab.legend(('curvature'),loc='lowerright')

#pylab.savefig('save')

aBM=[allowable_BM]

a_BM=aBM*len(SurveyKp[slp1:slp2])

ax3=fig.add_subplot(212)

ax3.plot(SurveyKp[slp1:slp2],BM[:slp2slp1],'b',SurveyKp[slp1:slp2],a_BM,'r')

ax3.set_ylabel('Bendingmoment(Nm)')

ax3.set_xlabel('Kp')

pylab.xlim(max(SurveyKp[slp1:slp2]),min(SurveyKp[slp1:slp2]))

pylab.grid(True)

pylab.title('5thorderspline')

pylab.legend(('Actual','Allowable'),loc='upperright')

#pylab.savefig('save')

pylab.show()

q=raw_input("Areyousatisfied?")

else:

123

print"ERROR"

if__name__=='__main__':

main()

124

Potrebbero piacerti anche