Skip to content

Commit

Permalink
Add and break out functions that automatically map OWENS boundary con…
Browse files Browse the repository at this point in the history
…ditions and applied forces to GX and automate the campbell diagram generation process
  • Loading branch information
kevmoor committed Sep 12, 2024
1 parent 6c60ca1 commit 9dfdbdf
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 219 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ new*
*.out
*.h5
*.mat
*.csv
*.csv
*.png
*.gif
*.mp4
*turbsimfiles/
14 changes: 9 additions & 5 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ OWENS is an ontology, or way of coupling modular aerodynamic, structural, hydrod

Here are several examples of OWENS use cases, current and past, including the Sandia 34m research turbine.

![SNL34m.](./assets/SNL34m.png){}
![SNL34m.](./assets/SNL34m.png){#fig:34m
width="50%"}

Then here is an example of a helical design. Note that arbitrary numbers of struts can be specified in the automatic meshing functions. You can also write your own generalized mesh using the internal building blocks, but it is not thouroughly documented.

![helical.](./assets/helical.png){}
![helical.](./assets/helical.png){#fig:34m
width="50%"}

The generalized meshing was modified to include HAWT concepts, like this bi-wing concept. OWENS is capable of axial flow turbines/HAWTs, but it is not a mature feature, and no where near as developed as OpenFAST (i.e. for regular HAWTs it is recommended to use that software).

![biwing.](./assets/biwing.png){}
![biwing.](./assets/biwing.png){#fig:34m
width="50%"}

Then, floating turbines are a possibility, though this feature adds another dimension to the nonlinear time stepping convergance and in turn a fair amount of time. Future work is to make this general interface and functionality an easy to use feature (right now it needs a high level of experience to use).

![arcus.](./assets/arcus.png){}
![arcus.](./assets/arcus.png){#fig:34m
width="50%"}


# OWENS under the hood
Expand All @@ -44,7 +48,7 @@ Turbulent inflow is provided by OWENSOpenFASTWrappers.jl and the inflowwind and

Rainflow counting was provided by Rainflow.jl, however, this package became orphained and was pulled into the OWENS code base.

![arcus.](./assets/OWENS_Processes.png){}
<img src="./assets/OWENS_Processes.png" alt="drawing" width="400"/>

## Installation
Please follow the instructions on the setup page
Expand Down
3 changes: 1 addition & 2 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ Additionally, if you find that your ssh is erroring when you try to install pack
PubkeyAcceptedAlgorithms +ssh-ed25519

# Install Optional OpenFAST Dependices
Note that this is optional as it is automatically done by julia in the OWENSOpenFASTWrappers.jl deps/build.jl. For Windows, please follow the OpenFAST Windows instructions on the openfast site for the branch referenced here.

If your system is already set up such that it is capable of compiling OpenFAST, and you are on mac or linux, then you may skip this and rely on the automatically compiled version that are created when the OWENSOpenFAST libraries are installed by Julia.
mkdir coderepos
cd coderepos
# Install openfast coupled libraries !NOTE!: if you change the location of the compiled libraries, you may need to update the rpath variable, or recompile.
Expand Down
4 changes: 2 additions & 2 deletions examples/SNL34m/SNL34m_Inputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ controlParameters:
AeroParameters:
Nslices: 35 # number of OWENSAero discritizations #TODO: AD parameters
ntheta: 30 # number of OWENSAero azimuthal discretizations
AModel: AD # AD, DMS, AC
AModel: DMS # AD, DMS, AC
adi_lib: nothing
adi_rootname: "/SNL34m"

structuralParameters:
structuralModel: ROM #GX, TNB, ROM
structuralModel: GX #GX, TNB, ROM
nonlinear: false #TODO: propogate
ntelem: 20 #tower elements in each
nbelem: 60 #blade elements in each
Expand Down
2 changes: 1 addition & 1 deletion examples/literate/A_simplyRunningOWENS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import OWENS

runpath = path = "/home/runner/work/OWENS.jl/OWENS.jl/examples/literate" # to run locally, change to splitdir(@__FILE__)[1]
##runpath = path = "/Users/kevmoor/Documents/coderepos/OWENS_Toolkit/OWENS.jl/examples/literate"#splitdir(@__FILE__)[1]
## runpath = path = splitdir(@__FILE__)[1]

Inp = OWENS.MasterInput("$runpath/sampleOWENS.yml")

Expand Down
8 changes: 4 additions & 4 deletions examples/literate/B_detailedInputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ if ifw_libfile == "nothing"
end
Blade_Height = Inp.Blade_Height
Blade_Radius = Inp.Blade_Radius
numTS = Inp.numTS
delta_t = Inp.delta_t
numTS = 1000#Inp.numTS
delta_t = 0.05#Inp.delta_t
NuMad_geom_xlscsv_file_twr = "$(path)$(Inp.NuMad_geom_xlscsv_file_twr)"
NuMad_mat_xlscsv_file_twr = "$(path)$(Inp.NuMad_mat_xlscsv_file_twr)"
NuMad_geom_xlscsv_file_bld = "$(path)$(Inp.NuMad_geom_xlscsv_file_bld)"
Expand Down Expand Up @@ -110,8 +110,8 @@ mass_breakout_blds,mass_breakout_twr,system,assembly,sections,AD15bldNdIdxRng, A
NuMad_geom_xlscsv_file_strut,
NuMad_mat_xlscsv_file_strut,
Htwr_base=towerHeight,
strut_twr_mountpoint = [0.25,0.75],
strut_bld_mountpoint = [0.25,0.75],
strut_twr_mountpoint = [0.2,0.8],
strut_bld_mountpoint = [0.2,0.8],
ntelem,
nbelem,
ncelem,
Expand Down
1 change: 1 addition & 0 deletions src/OWENS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ using WriteVTK
const module_path = splitdir(@__FILE__)[1] # Path to this module

Modal = OWENSFEA.modal
AutoCampbellDiagram = OWENSFEA.autoCampbellDiagram
FEAModel = OWENSFEA.FEAModel
Mesh = OWENSFEA.Mesh
El = OWENSFEA.El
Expand Down
8 changes: 5 additions & 3 deletions src/SetupTurbine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function setupOWENS(OWENSAero,path;
meshtype = "Darrieus",
custommesh = nothing) #Darrieus, H-VAWT, ARCUS

custom_mesh_outputs = []

if AModel=="AD"
AD15On = true
else
Expand Down Expand Up @@ -127,7 +129,7 @@ function setupOWENS(OWENSAero,path;
verbosity=0, # 0 nothing, 1 basic, 2 lots: amount of printed information
connectBldTips2Twr)
elseif custommesh != nothing
mymesh, myort, myjoint, AD15bldNdIdxRng, AD15bldElIdxRng = custommesh(;Htwr_base,
mymesh, myort, myjoint, AD15bldNdIdxRng, AD15bldElIdxRng, custom_mesh_outputs = custommesh(;Htwr_base,
Htwr_blds,
Hbld = H, #blade height
R, # m bade radius
Expand Down Expand Up @@ -637,13 +639,13 @@ function setupOWENS(OWENSAero,path;
stiff_twr, stiff_bld,bld_precompinput,
bld_precompoutput,plyprops_bld,numadIn_bld,lam_U_bld,lam_L_bld,
twr_precompinput,twr_precompoutput,plyprops_twr,numadIn_twr,lam_U_twr,lam_L_twr,aeroForcesAD,deformAeroAD,
mass_breakout_blds,mass_breakout_twr,system,assembly,sections,AD15bldNdIdxRng, AD15bldElIdxRng
mass_breakout_blds,mass_breakout_twr,system,assembly,sections,AD15bldNdIdxRng, AD15bldElIdxRng, custom_mesh_outputs
else
return mymesh,myel,myort,myjoint,sectionPropsArray,mass_twr, mass_bld,
stiff_twr, stiff_bld,bld_precompinput,
bld_precompoutput,plyprops_bld,numadIn_bld,lam_U_bld,lam_L_bld,
twr_precompinput,twr_precompoutput,plyprops_twr,numadIn_twr,lam_U_twr,lam_L_twr,aeroForcesACDMS,deformAeroACDMS,
mass_breakout_blds,mass_breakout_twr,system,assembly,sections,AD15bldNdIdxRng, AD15bldElIdxRng
mass_breakout_blds,mass_breakout_twr,system,assembly,sections,AD15bldNdIdxRng, AD15bldElIdxRng, custom_mesh_outputs
end
end

Expand Down
70 changes: 2 additions & 68 deletions src/Unsteady.jl
Original file line number Diff line number Diff line change
Expand Up @@ -764,72 +764,6 @@ end

function structuralDynamicsTransientGX(topModel,mesh,Fexternal,ForceDof,system,assembly,t,Omega_j,OmegaDot_j,delta_t,numIterations,i,strainGX,curvGX)

function setPrescribedConditions(mesh;pBC=zeros(2,2),Fexternal=[],ForceDof=[])
Fx = Fexternal[1:6:end]
Fy = Fexternal[2:6:end]
Fz = Fexternal[3:6:end]
Mx = Fexternal[4:6:end]
My = Fexternal[5:6:end]
Mz = Fexternal[6:6:end]
prescribed_conditions = Dict()
for inode = 1:mesh.numNodes
ux = nothing
uy = nothing
uz = nothing
theta_x = nothing
theta_y = nothing
theta_z = nothing
Fx_follower = nothing
Fy_follower = nothing
Fz_follower = nothing
Mx_follower = nothing
My_follower = nothing
Mz_follower = nothing
if inode in pBC[:,1]
for iBC = 1:length(pBC[:,1])
if pBC[iBC,1] == inode
if pBC[iBC,2] == 1
ux = pBC[iBC,3]
elseif pBC[iBC,2] == 2
uy = pBC[iBC,3]
elseif pBC[iBC,2] == 3
uz = pBC[iBC,3]
elseif pBC[iBC,2] == 4
theta_x = pBC[iBC,3]
elseif pBC[iBC,2] == 5
theta_y = pBC[iBC,3]
elseif pBC[iBC,2] == 6
theta_z = pBC[iBC,3]
end
end
end
end
if isnothing(ux) && !isempty(Fexternal) && Fx[inode]!=0.0
Fx_follower = Fx[inode]
end
if isnothing(uy) && !isempty(Fexternal) && Fy[inode]!=0.0
Fy_follower = Fy[inode]
end
if isnothing(uz) && !isempty(Fexternal) && Fz[inode]!=0.0
Fz_follower = Fz[inode]
end
if isnothing(theta_x) && !isempty(Fexternal) && Mx[inode]!=0.0
Mx_follower = Mx[inode]
end
if isnothing(theta_y) && !isempty(Fexternal) && My[inode]!=0.0
My_follower = My[inode]
end
if isnothing(theta_z) && !isempty(Fexternal) && Mz[inode]!=0.0
Mz_follower = Mz[inode]
end

prescribed_conditions[inode] = GXBeam.PrescribedConditions(;ux,uy,uz,theta_x,theta_y,theta_z,Fx_follower,Fy_follower,Fz_follower,Mx_follower,My_follower,Mz_follower)

end
return prescribed_conditions
end


linear_velocity = [0.0,0.0,0.0]
angular_velocity = [0.0,0.0,Omega_j*2*pi]
linear_acceleration = [0.0,0.0,0.0]
Expand All @@ -852,12 +786,12 @@ function structuralDynamicsTransientGX(topModel,mesh,Fexternal,ForceDof,system,a
initialize = false

if i == 1 && numIterations == 1 # Do initial solve without external loads
prescribed_conditions = setPrescribedConditions(mesh;pBC=topModel.BC.pBC)
prescribed_conditions = GyricFEA.setPrescribedConditions(mesh;pBC=topModel.BC.pBC)
system, state, converged = GXBeam.steady_state_analysis!(system,assembly; prescribed_conditions,
gravity,angular_velocity,linear=false,reset_state=true)
end

prescribed_conditions = setPrescribedConditions(mesh;pBC=topModel.BC.pBC,Fexternal,ForceDof)
prescribed_conditions = GyricFEA.setPrescribedConditions(mesh;pBC=topModel.BC.pBC,Fexternal,ForceDof)
initial_state = GXBeam.AssemblyState(system, assembly; prescribed_conditions)

systemout, history, converged = GXBeam.time_domain_analysis!(deepcopy(system),assembly, tvec;
Expand Down
2 changes: 1 addition & 1 deletion src/meshing_utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ function mesh_beam_centered(;L1 = 6.0, #first section of beam length
end

"""
return mymesh, myort, myjoint, AD15bldNdIdxRng, AD15bldElIdxRng = create_mesh_struts(;Htwr_base = 15.0,
mymesh, myort, myjoint, AD15bldNdIdxRng, AD15bldElIdxRng = create_mesh_struts(;Htwr_base = 15.0,
Htwr_blds = 147.148-15.0,
Hbld = 147.148-15.0, #blade height
R = 54.014, # m bade radius
Expand Down
Loading

0 comments on commit 9dfdbdf

Please sign in to comment.