Skip to content

Conversation

@kmruehl
Copy link
Collaborator

@kmruehl kmruehl commented Mar 10, 2022

This PR is a continuation of #803. Refactoring WEC-Sim Classes and Properties based on project board card and discussions with the WEC-Sim team.

Objectives:

  • clear and intuitive variable naming using camelCase
  • consistent properties across classes, e.g. pto.loc versus mooring.ref
  • convert properties for a single feature to property structures, e.g. struct(body.morison)
  • move properties to the appropriate class, e.g. simu.yaw to body.yaw
  • updating WEC-Sim library accordingly

Wave Class

  • waves.etaImport to waves.waveImport to waves.elevationImport
  • waves.spectrumDataFile to waves.waveSpectrumFile to waves.spectrumFile
  • waves.etaDataFile to waves.waveElevationFileto waves.elevationFile
  • waves.plotEta to waves.plotElevation
  • waves.waveDir to waves.waveDirection to waves.direction
  • waves.waveSpread to waves.spread
  • beta to theta to match online documentation
  • waves.deepWaterWave to waves.deepWater
  • convert waves.current properties to structure, similar to morison element,
    • waves.currentOption to waves.current.option
    • waves.currentDepth to waves.current.depth
    • waves.currentDirection to waves.current.direction
    • waves.currentSpeed to waves.current.speed
  • convert properties related to BEM data to waves.bem structure
    • waves.numFreq to waves.freqNum to waves.bem.count
    • waves.freqDisc to waves.bem.option
    • waves.freqRange to wave.bem.range
  • add checks for waveClass structures
  • convert waves.marker properties to structure
    • waves.markerLoc to waves.marker.loc to waves.marker.location
    • waves.markerSize to waves.marker.size
    • waves.markerStyle to waves.marker.style
    • convert waves.marker properties to structure in Frames Library

Simulation Class

  • simu.writetxt to simu.writeText
  • waves.waveStatisticsDataLoad to simu.mcrExcelFile (formerly Wave Class)
  • simu.mcrCaseFile to simu.mcrMatFile
  • simu.dtME to simu.morisonDt
  • simu.CTTime to simu.cicTime
  • simu.dtCI to simu.cicDt
  • simu.CITime to simu.cicEndTime
  • simu.CIkt to simu.cicLength
  • simu.ssCalc to simu.stateSpace
  • simu.setupSimu to simu.simuSetup to simu.setup
  • convert simu.paraview properties to structure, similar to morison element, note: test that sub-properties are tested
    • simu.dtParaview to simu.paraviewDt to simu.paraview.dt
    • simu.StartTimeParaview to simu.paraviewStartTime to simu.paraview.startTime
    • simu.EndTimeParaview to simu.paraviewEndTime to simu.paraview.endTime
    • simu.pathParaviewVideo to simu.paraviewDirectory to simu.paraview.path
  • simu.numWecBodies to simu.body.numHydroBodies
  • simu.pressureDis to simu.pressure
  • simu.simulationDate to simu.date
  • add checks for simulationClass structures
  • simu.adjMassWeightFun to simu.adjMassFactor
  • simu.autoRateTranBlk to simu.rateTransition
  • simu.zeroCrossCont to simu.zeroCross
  • simu.numIntMidTimeSteps removed
  • parallelComputing_dir to pctDir NOTE this is not in the simulationClass, but maybe it should be

Body Class

  • body.dof_start to body.dofStart
  • body.dof_end to body.dofEnd
  • body.dof_gbm to body.dofGBM to body.gbmDOF
  • body.nlHydro to body.nonlinearHydro
  • body.lenJ to body.dofCoupled
  • body.meanDriftForce to body.meanDrift
  • body.bodyparaview to body.paraviewBody to body.paraview
  • body.flexHydroBody to body.flexBody to body.flex
  • body.nhBody to body.nonHydroBody to body.nonHydro
  • body.hydroDataBodyNum to body.hydroBodyTotal to body.hydroTotal NOTE Do we even use this?
  • body.viscDrag to body.viscousDrag to body.quadDrag
  • body.userDefinedExcIRF to body.excitationIRF
  • add checks for bodyClass structures
  • move simu.yaw and simu.yawThresh to bodyClass
    • simu.yaw to body.yaw.option
    • simu.yawThres to body.yaw.threshold
  • body.bodyNumber to body.number
  • body.bodyTotal to body.total
  • body.bodyGeometry to body.geometry

Cable Class

  • cable.c to cable.damping
  • cable.k to cable.stiffness
  • cable.viscDrag to cable.viscousDrag to cable.quadDrag
  • cable.cableNum to cable.number
  • cable.loc to cable.location

Constraint Class

  • constraint.loc to constraint.location
  • constraint.constraintNum to constraint.number

PTO Class

  • pto.loc to pto.location
  • pto.c to pto.damping
  • pto.k to pto.stiffness
  • pto.ptoNum to pto.number

Mooring Class

  • mooring.ref to mooring.loc to mooring.location
  • mooring.loc to mooring.orientation (internal)
  • mooring.mooringNum to mooring.number

Doc

  • add dev documentation for style guide, look into naming convention, e.g. pep 8

Notes

  • Are the property structure fields checked? No, properties are automatically checked, but not the structure fields. For example there's an error if waves.bems is specified in the input file, but not for waves.bem.options. This can be addressed by adding some additional checks to the checkinputs method of each class with a structure.
  • how does b2b impact migration of passive yaw to bodyClass?
  • resolve TestPassiveYawRegression test failure
  • resolve wecSimPCT issue
  • move pctDir to simulationClass?

@kmruehl
Copy link
Collaborator Author

kmruehl commented Mar 11, 2022

Thanks @akeeste for 3adb4a1

@nathanmtom
Copy link

nathanmtom commented Mar 12, 2022

Working review comments:

Body Class

  • quadDrag.Drag to quadDrag.drag
  • morisonElement.characteristicArea to morisonElement.area
  • quadDrag.characteristicArea to quadDrag.area
  • cg to centerGravity
  • cb to centerBuoyancy
  • dispVol to displacedVolume to volume
    (we agreed to have acronyms, i.e. IRF, but certain words are fully written out and not so this would be for perceived consistency.)
  • In the original comment of this PR there is body.dof_gbm to body.dofGBM but in the simulationClass it appears to be gbmDOF no issue with this labeling, but just confirming intent.)
    kmruehl: my mistake, it should be gbmDOF, I'll update this
  • body.initDisp.initLinDisp to body.initDisp.initLinearDisp

Wave Class

  • waves.T to waves.period (another case where if we are consistent with using full names than assumed variables we should change; however, I'd say this is pretty standard in our industry and do not think we have had any confusion here.)
  • waves.H to waves.height (another case where if we are consistent with using full names than assumed variables we should change; however, I'd say this is pretty standard in our industry and do not think we have had any confusion here.)

Simulation Class

  • waves.writeText seems to have been removed, just confirming intention here.
    kmruehl: do you mean responseClass.writeText?

Cable Class

  • cable.L0 to cable.unstretchedLength
  • Clarify that linearDamping and quadDamping in the cable class is related to the global motion of the cable, not associated with extension of the cable?
  • cable.cb1 to cable.centerBuoyancyBase
  • cable.cg1 to cable.centerGravityBase
  • cable.cb2 to cable.centerBuoyancyFollower
  • cable.cg2 to cable.centerGravityFollower
  • cable.dispVol to cable.displacedVolume to dispVol
  • cable.quadDrag.characteristicArea to quadDrag.area
  • cable.quadDrag.Drag to quadDrag.drag
  • cable.initDisp.initLinDisp to cable.initDisp.initLinearDisp
  • cable.rotloc1 to cable.rotationLocation1 (Dom, am I interpreting the variable correctly?)
  • cable.rotloc2 to cable.rotationLocation2 (Dom, am I interpreting the variable correctly?)

Constraint Class

  • constraint.initDisp.initLinDisp to constraint.initDisp.initLinearDisp

PTO Class

  • pto.initDisp.initLinDisp to pto.initDisp.initLinearDisp

Mooring Class

  • mooring.initDisp.initLinDisp to mooring.initDisp.initLinearDisp

Other Comments

  • Side comment here, but outside of it being difficult to maintain, it does seem like having a list of all variables in a table and every location they are used would be valuable to make similar changes in the future. Also, this allows to double check if a variable is actually used or not. I would appreciate some thoughts on if the team can think of a good method for this.

@kmruehl kmruehl mentioned this pull request Mar 14, 2022
73 tasks
@kmruehl
Copy link
Collaborator Author

kmruehl commented Mar 14, 2022

@nathanmtom thanks, I'll work on incorporating those revisions now

@nathanmtom
Copy link

nathanmtom commented Mar 14, 2022

@kmruehl Apologies for my slow review, going through the rest of the PR this afternoon. I'll update in the comment above with any other potential changes. Let me know if there is anything you want to discuss on any of my comments/suggestions.

@kmruehl Just wanted to give an update that I've completed my initial review and left additional comments in the working review comments above. Happy to discuss any of these with you and volunteer to help make any of these changes if we agree they should be made.

@kmruehl
Copy link
Collaborator Author

kmruehl commented Mar 14, 2022

@nathanmtom thanks! I'll work on the ones that we're 100% on, and wait for the team meeting to discuss the rest.

This was referenced Mar 15, 2022
@kmruehl
Copy link
Collaborator Author

kmruehl commented Mar 15, 2022

@WEC-Sim/wec-sim-lab-team I'm going to merge this PR into dev and re-open a new one to resolve the remaining issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Body Class Body Class (bodyClass.m) Cable Class Cable Class (cableClass.m) Constraint Class Constraint Class (constraintClass.m) Library updates to the WEC-Sim Library Mooring Class Mooring Class (mooringClass.m) Response Class Response Class (responseClass.m) SCM source code mangagement and warnings Simulation Class Simulation Class (simulationClass.m)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants