From a3cb2efe5dc458d0f9425fbef43f70bf709f41b4 Mon Sep 17 00:00:00 2001 From: kevmoor Date: Wed, 6 Nov 2024 12:59:11 -0700 Subject: [PATCH 1/3] Update vtk variable name to be more consistent --- src/modal.jl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/modal.jl b/src/modal.jl index 9c0ddb9..6f08f7b 100644 --- a/src/modal.jl +++ b/src/modal.jl @@ -3,14 +3,14 @@ frequencies = autoCampbellDiagram(FEAinputs,mymesh,myel,system,assembly,sections minRPM = 0.0, maxRPM = 40.0, NRPM = 9, # int - vtksavename = nothing, + VTKsavename = nothing, saveModes = [1,3,5], #must be int saveRPM = [1,3,5], #must be int mode_scaling = 500.0, ) Automated Campbell Diagram Generator, this function runs the model with centrifugal stiffening for the specified RPM levels. -If FEAinputs.analysisType == "GX" and vtksavename are specified, it will output paraview mode shape files at the specified save name. +If FEAinputs.analysisType == "GX" and VTKsavename are specified, it will output paraview mode shape files at the specified save name. #Inputs * `FEAinputs::OWENSFEA.FEAModel`: The FEA modeling options @@ -22,7 +22,7 @@ If FEAinputs.analysisType == "GX" and vtksavename are specified, it will output * `minRPM::Float64`: minimum RPM to be run, e.x. 0.0 * `maxRPM::Float64`: maximum RPM to be run e.x. 40.0 * `NRPM::Int64`: number of linear discretizations of RPM e.x. 9 must be int -* `vtksavename::string`: filename (with path if desired) of the VTK outputs if GX. Set to "nothing" to not save. +* `VTKsavename::string`: filename (with path if desired) of the VTK outputs if GX. Set to "nothing" to not save. * `saveModes::Array{Int64}`: The modes to save in the VTK outputs e.x. [1,3,5] must be int * `saveRPM::Array{Int64}`: The RPMs to save in the VTK outputs e.x. [1,3,5] must be int * `mode_scaling::Float64`: The mode scaling in the VTK outputs e.x. 500.0 @@ -34,7 +34,7 @@ function autoCampbellDiagram(FEAinputs,mymesh,myel,system,assembly,sections; minRPM = 0.0, maxRPM = 40.0, NRPM = 9, # int - vtksavename = nothing, + VTKsavename = nothing, saveModes = [1,3,5], #must be int saveRPM = [1,3,5], #must be int mode_scaling = 500.0, @@ -137,21 +137,21 @@ function autoCampbellDiagram(FEAinputs,mymesh,myel,system,assembly,sections; eigenstates_save[irpm] = eigenstates end - if !isnothing(vtksavename) #TODO: map the OWENS state into the gx state for filesaving + if !isnothing(VTKsavename) #TODO: map the OWENS state into the gx state for filesaving state = GXBeam.AssemblyState(system, assembly; prescribed_conditions=prescribed_conditions) try #this should error if someone on windows uses backslash '\' - lastforwardslash = findlast(x->x=='/',vtksavename) - filepath = vtksavename[1:lastforwardslash-1] + lastforwardslash = findlast(x->x=='/',VTKsavename) + filepath = VTKsavename[1:lastforwardslash-1] if !isdir(filepath) mkdir(filepath) end catch - @info "Please manually create the directory to house $vtksavename" + @info "Please manually create the directory to house $VTKsavename" end for isaveRPM in saveRPM for isavemode in saveModes - GXBeam.write_vtk("$(vtksavename)_RPM$(rotSpdArrayRPM[isaveRPM])_Mode$(isavemode)", assembly, state, + GXBeam.write_vtk("$(VTKsavename)_RPM$(rotSpdArrayRPM[isaveRPM])_Mode$(isavemode)", assembly, state, λ_save[isaveRPM][isavemode], eigenstates_save[isaveRPM][isavemode]; sections,mode_scaling) end end From 9d17c2d49f7eda2c3c06268d7890d2d74dfcaf9b Mon Sep 17 00:00:00 2001 From: kevmoor Date: Wed, 6 Nov 2024 17:28:19 -0700 Subject: [PATCH 2/3] Unify output file naming --- src/modal.jl | 2 +- src/structs.jl | 10 +++++----- test/CantileverBeamDisplacement.jl | 2 +- test/CantileverBeamModal.jl | 2 +- test/CantileverBeamRotating.jl | 2 +- test/CantileverBeamRotatingModal.jl | 2 +- test/UnsteadyBeam.jl | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/modal.jl b/src/modal.jl index 6f08f7b..7629581 100644 --- a/src/modal.jl +++ b/src/modal.jl @@ -314,7 +314,7 @@ function linearAnalysisModal(feamodel,mesh,el,displ,Omega,elStorage;returnDynMa # #write output if feamodel.analysisType !="FA" - freq,damp,imagCompSign,U_x_0,U_y_0,U_z_0,theta_x_0,theta_y_0,theta_z_0,U_x_90,U_y_90,U_z_90,theta_x_90,theta_y_90,theta_z_90 = ModalOutput(freq,damp,phase1,phase2,imagCompSign,feamodel.outFilename) + freq,damp,imagCompSign,U_x_0,U_y_0,U_z_0,theta_x_0,theta_y_0,theta_z_0,U_x_90,U_y_90,U_z_90,theta_x_90,theta_y_90,theta_z_90 = ModalOutput(freq,damp,phase1,phase2,imagCompSign,feamodel.dataOutputFilename) end return freq,damp,imagCompSign,U_x_0,U_y_0,U_z_0,theta_x_0,theta_y_0,theta_z_0,U_x_90,U_y_90,U_z_90,theta_x_90,theta_y_90,theta_z_90,eigVal,eigVec diff --git a/src/structs.jl b/src/structs.jl index 05cda4d..b2d6b4d 100644 --- a/src/structs.jl +++ b/src/structs.jl @@ -7,7 +7,7 @@ mutable struct FEAModel gravityOn nlOn spinUpOn - outFilename + dataOutputFilename RayleighAlpha RayleighBeta elementOrder @@ -34,7 +34,7 @@ end gravityOn = true, nlOn = false, spinUpOn = false, - outFilename = "none", + dataOutputFilename = "none", RayleighAlpha = 0.0, RayleighBeta = 0.0, elementOrder = 1, @@ -69,7 +69,7 @@ Model inputs for FEA analysis, struct * `gravityOn::Bool orArray{<:float}`: vector of 3 or flag to include distributed gravity acceleration (9.81m/s) in the negative z-direction * `nlOn::Bool`: flag for solver to calculate deflection induced stiffness changes and associated convergance to the coupled solution * `spinUpOn::Bool`: flag to perform a static analysis (warm start) prior to performing modal analysis -* `outFilename::string`: /path/to/desired/output/filename if it doesn't exist already it is created, if exists, is overwritten +* `dataOutputFilename::string`: /path/to/desired/output/filename if it doesn't exist already it is created, if exists, is overwritten * `RayleighAlpha::float`: Rayleigh alpha damping used in timoshenko beam damping matrix * `RayleighBeta::float`: Rayleigh beta damping used in timoshenko beam damping matrix * `elementOrder::int`: order of element: 1 linear, 2 quadratic @@ -108,7 +108,7 @@ function FEAModel(;analysisType = "TNB", gravityOn = true, nlOn = false, spinUpOn = false, - outFilename = "none", + dataOutputFilename = "none", RayleighAlpha = 0.0, RayleighBeta = 0.0, elementOrder = 1, @@ -162,7 +162,7 @@ function FEAModel(;analysisType = "TNB", end return FEAModel(analysisType,initCond,aeroElasticOn,guessFreq,airDensity, - gravityOn,nlOn,spinUpOn,outFilename,RayleighAlpha,RayleighBeta,elementOrder,joint, + gravityOn,nlOn,spinUpOn,dataOutputFilename,RayleighAlpha,RayleighBeta,elementOrder,joint, platformTurbineConnectionNodeNumber,jointTransform,reducedDOFList,nlParams,BC,nodalTerms,numModes,AddedMass_Coeff_Ca) end diff --git a/test/CantileverBeamDisplacement.jl b/test/CantileverBeamDisplacement.jl index b35fbaf..663a0bd 100644 --- a/test/CantileverBeamDisplacement.jl +++ b/test/CantileverBeamDisplacement.jl @@ -213,7 +213,7 @@ for (iload,load) in enumerate(P) nodalTerms = OWENSFEA.applyConcentratedTerms(mesh.numNodes, 6;data = nodalinputdata) feamodel = OWENSFEA.FEAModel(;analysisType = "TNB", - outFilename = "none", + dataOutputFilename = "none", joint, pBC = pBC, nodalTerms = nodalTerms, diff --git a/test/CantileverBeamModal.jl b/test/CantileverBeamModal.jl index 077b869..bbf8a64 100644 --- a/test/CantileverBeamModal.jl +++ b/test/CantileverBeamModal.jl @@ -182,7 +182,7 @@ pBC = [1 1 0 1 6 0] feamodel = OWENSFEA.FEAModel(;analysisType = "M", -outFilename = "none", +dataOutputFilename = "none", joint = joint, gravityOn = false, platformTurbineConnectionNodeNumber = 1, diff --git a/test/CantileverBeamRotating.jl b/test/CantileverBeamRotating.jl index 135bf3e..25ac1ea 100644 --- a/test/CantileverBeamRotating.jl +++ b/test/CantileverBeamRotating.jl @@ -193,7 +193,7 @@ function runme(islinear) for (ii,rpm) in enumerate(RPM) feamodel = OWENSFEA.FEAModel(;analysisType = "TNB", - outFilename = "none", + dataOutputFilename = "none", joint, pBC = pBC, numNodes = mesh.numNodes, diff --git a/test/CantileverBeamRotatingModal.jl b/test/CantileverBeamRotatingModal.jl index e6d85af..91d6a2d 100644 --- a/test/CantileverBeamRotatingModal.jl +++ b/test/CantileverBeamRotatingModal.jl @@ -202,7 +202,7 @@ pBC = [1 1 0 # mesh.numNodes 6 0] feamodel = OWENSFEA.FEAModel(;analysisType = "M", -outFilename = "none", +dataOutputFilename = "none", joint = joint, gravityOn = false, platformTurbineConnectionNodeNumber = 1, diff --git a/test/UnsteadyBeam.jl b/test/UnsteadyBeam.jl index da90dba..5c47ded 100644 --- a/test/UnsteadyBeam.jl +++ b/test/UnsteadyBeam.jl @@ -133,7 +133,7 @@ function runOWENS() uHist = zeros(mesh.numNodes*numDOFPerNode,numTS+1) #put here so it keeps the last RPM solution in the scope feamodel = OWENSFEA.FEAModel(;analysisType = "TNB", - outFilename = "none", + dataOutputFilename = "none", joint, pBC = pBC, numNodes = mesh.numNodes, From c200868133014a8611a5f92cfaa1e4cbfebc30fe Mon Sep 17 00:00:00 2001 From: kevmoor Date: Thu, 7 Nov 2024 12:02:46 -0700 Subject: [PATCH 3/3] Use specified gravity in campbell diagram helper function --- src/modal.jl | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/modal.jl b/src/modal.jl index 7629581..3191778 100644 --- a/src/modal.jl +++ b/src/modal.jl @@ -78,7 +78,22 @@ function autoCampbellDiagram(FEAinputs,mymesh,myel,system,assembly,sections; # --- Perform Analysis --- # # gravity vector - gravity = [0, 0, -9.81] #TODO: from FEAinputs + if eltype(FEAinputs.gravityOn) == Bool && FEAinputs.gravityOn == true + a_x_n = 0.0 #accelerations in inertial frame + a_y_n = 0.0 + a_z_n = -9.81 # gravity + elseif eltype(FEAinputs.gravityOn) == Bool && FEAinputs.gravityOn == false + a_x_n = 0.0 #accelerations in inertial frame + a_y_n = 0.0 + a_z_n = 0.0 + end + + if eltype(FEAinputs.gravityOn) == Float64 + a_x_n = FEAinputs.gravityOn[1] #accelerations in inertial frame + a_y_n = FEAinputs.gravityOn[2] + a_z_n = FEAinputs.gravityOn[3] + end + gravity = [a_x_n, a_y_n, a_z_n] #TODO: from FEAinputs # number of modes nmode = FEAinputs.numModes @@ -151,7 +166,7 @@ function autoCampbellDiagram(FEAinputs,mymesh,myel,system,assembly,sections; end for isaveRPM in saveRPM for isavemode in saveModes - GXBeam.write_vtk("$(VTKsavename)_RPM$(rotSpdArrayRPM[isaveRPM])_Mode$(isavemode)", assembly, state, + GXBeam.write_vtk("$(VTKsavename)_RPM$(rotSpdArrayRPM[isaveRPM])_Mode$(isavemode)_eigenmode", assembly, state, λ_save[isaveRPM][isavemode], eigenstates_save[isaveRPM][isavemode]; sections,mode_scaling) end end