Search found 108 matches

by EricsonEncinaZ
Mon Apr 08, 2019 1:09 am
Forum: OpenSees.exe Users
Topic: ZeroLengthSection Element for cantilever
Replies: 3
Views: 3768

Re: ZeroLengthSection Element for cantilever

The code you posted looks well to me, everything is consistent: node definition, fix conditions, GT, section definitions and orientations.

Probably not causing your problem but, within a fibre {...} block you have "set" commands, May this make OpenSees confused?

Different topic: Given the base units are in mm, if you want to reach 1% drift in the model posted above and considering that all the rotation happens in the ZLS element then the curvature of the ZLS element should be 10000rad/km, which is disproportionally massive.
Interesting 1 tonne = 1 N·s²/mm :-D (didn't know that, cool!)

I'm sorry I can not give a better answer for your problem.
by EricsonEncinaZ
Mon Apr 08, 2019 12:39 am
Forum: OpenSees.exe Users
Topic: Why are additional nodes resulting in failure + convergence
Replies: 8
Views: 6849

Re: Why are additional nodes resulting in failure + converge

You may be having localisation issues: Coleman&Spacone 2001 "Localization Issues in Force-Based Frames Elements".

Despite you use FBE you have to ensure you have enough IPs to actually capture an objective response of the element non-linearity. Remember that this is a distributed plasticity element, so the number of IPs have an impact on the response. You can see this by doing an analysis with 2IP and then run the same analysis but with 6 or 9 IPs, for example.

You must ensure that the number of IPs are enough to capture the NL behaviour of the element, and if you need more IPs (max is 10 according to the source code) then you need to use more than 1 element to add more IPs.

I have tried DBEs as well and, as it is known, you need way more elements to get an objective response, but they do have less convergence problems... at least as I can say based on the models I have run. Be aware that you can also have localisation issues in DBEs, but instead of localise the response in 1 IP the localisation will occur over an entire element.
by EricsonEncinaZ
Wed Apr 03, 2019 3:11 am
Forum: OpenSees.exe Users
Topic: ZeroLengthSection Element for cantilever
Replies: 3
Views: 3768

Re: ZeroLengthSection Element for cantilever

It would be good to have more details about the elastic element and the fibre sections you are using for your ZLS elements, like materials, section discretisation, orientation vector of the ZLS element, etc.

With the information you provided I may dare to say that the displacement or the load imposed is not making the elements go beyond their linear elastic response; or the ZLS element is way stronger than the elastic section.

Also be aware that zero length elements have unitary length. So given a specific couple N*, M* you will have a unique curvature regardless of the model units, but when transforming that curvature into rotation the result will be affected by the model units. For instance, lets say curv = 20 rad/m = 0.508 rad/in, then if the model is in meters rot = curv · 1m = 20 rad, but if the model is in inches then rot = curv · 1in = 0.508 rad. Here you can see that your ZLS element will rotate either 20rad or 0.508rad depending on the units you are working on.
by EricsonEncinaZ
Fri Mar 29, 2019 12:07 am
Forum: OpenSees.exe Users
Topic: Convergence issue on Linux version of OpenSEES
Replies: 1
Views: 2262

Re: Convergence issue on Linux version of OpenSEES

I have had similar issues with different version of OpenSEES running in both Windows and Linux machines and HPC facilities. So, I may doubt whether it is completely because of the OS or it is because of the different versions and revisions of OpenSEES. For example, the current version for Windows is v2.5.0 rev6536, a while ago it was v2.5.0 rev6477. I have noticed that the same model sometimes fails to converge in one and actually gets to the end in the other. The good news is that after tweaking the models (No of elements, No of IPs, Mesh, integration schemes) when they converge in both versions they do give the same results :-D.
by EricsonEncinaZ
Thu Mar 28, 2019 11:54 pm
Forum: OpenSees.exe Users
Topic: Timoshenko beam
Replies: 5
Views: 5023

Re: Timoshenko beam

If elastic, you can calculate the properties by hand and assigned them to the elastic element, as you are currently doing.
You can also try a fibre-based section, and then assign that section to a beam-column element.
by EricsonEncinaZ
Thu Mar 28, 2019 11:52 pm
Forum: OpenSees.exe Users
Topic: Eigen analysis problem
Replies: 4
Views: 4514

Re: Eigen analysis problem

Mass in OpenSees should be given in units of force·time²/distance, like kN·s²/m. For example, if the base units of your model is kN and m and you want to define 1000kg then in order to be consistent with your base units you should define that mass as 1 kN·s²/m.

You can also create your own set of units, for example:

# Base units are kN and m
set kN 1.
set m 1.
set sec 1.

# Derived units
set N [expr $kN/1000.]
set mm [expr $m/1000.]
set MPa [expr $N/$mm**2]
set ton [expr $kN*$sec**2/$m]
set kg [expr $ton/1000.]

# Now you can define stuff using any of the defined units
set tw [expr 300*$mm]
set fc [expr 40*$MPa]
set M [expr 1000*$kg]

This way you can type your code using units. In the script examples on the OpenSees webpage there is a file called libUnits.tcl (or something like that) that has more units.
by EricsonEncinaZ
Thu Mar 28, 2019 2:30 am
Forum: OpenSees.exe Users
Topic: Timoshenko beam
Replies: 5
Views: 5023

Re: Timoshenko beam

I would say elements have their own local reference system, so you can define things like Iy and Iz. As a separate case, the domain has its own reference system. Now both RS do not know each other, so you have to let them know how to interact, this is done by the vector vecXZ and the geometric transformation type.
So the idea of creating everything in the global RS is not possible, that's not the way complex FEA softwares, like OpenSees, work. As an additional example, ETABS has a global RS where the model lives, then every section has its own RF, and then if you assign a pier, for example, then the pier has its own RS as well. The different RSs can match in orientation, but they are not always pointing to the same direction.
by EricsonEncinaZ
Thu Mar 28, 2019 2:21 am
Forum: OpenSees.exe Users
Topic: Eigen analysis problem
Replies: 4
Views: 4514

Re: Eigen analysis problem

Are you sure that the same vecXZ vector passed in the geometrical transformation fits all the directions of the elements you defined?
You are saying tha all the elements are defined with the local z axis pointing in the global Y axis.
Also check units, mass and stiffnes definitions.
by EricsonEncinaZ
Thu Mar 28, 2019 2:12 am
Forum: OpenSees.exe Users
Topic: BARSLIP Material
Replies: 1
Views: 2403

Re: BARSLIP Material

In OpenSees you have to be consistent with the basic units you are working on. If your basic units are: force in N, length in m and time in seconds, for example, then all the stresses should be given in N/m² = Pa, moments in N·m, kg in N·s²/m, ... etc.

It is important to note that some materials are unit-dependent and therefore they need the whole model to be defined in a specific set of units. As an example Bond_SP01 material require the use of kips and in as the units for forces and lengths, which means that if you use this material your whole model should be defined in those units.

So just be consistent with the set of units you selected, unless something in the model asks you to use a specific set of units.
by EricsonEncinaZ
Thu Mar 28, 2019 2:03 am
Forum: OpenSees.exe Users
Topic: Timoshenko beam
Replies: 5
Views: 5023

Re: Timoshenko beam

According to the commands you are using you have a 3D domain, so the vector passed in the geometrical transformation tells the domain how your element is oriented, i.e. the relationship between the element's local reference system and the global reference system. If you do not provide the vector in a 3D domain then OpenSees can not know how you want your element to be oriented.
If your model lived a 2D domain then the vector is not needed.
by EricsonEncinaZ
Thu Mar 07, 2019 10:37 pm
Forum: OpenSees.exe Users
Topic: Conversion moment-rotation to moment-curvature.
Replies: 2
Views: 2685

Re: Conversion moment-rotation to moment-curvature.

Curvature = Rotation / Lp, where Lp is the length over which the rotation occurs. This assumes the rotation is constant over Lp.
You can read any of the many publications in the equivalent plastic hinge length for columns, walls and beams to have a better idea :-D
by EricsonEncinaZ
Wed Feb 27, 2019 11:59 pm
Forum: OpenSees.exe Users
Topic: [eleResponse $ele integrationPoints]
Replies: 2
Views: 2864

Re: [eleResponse $ele integrationPoints]

Hehehe better to get them from the source code and put them into a procedure.
Below the proc in case it is useful

proc infoIntegracion {inte NoIPs WorP} {

# Check info is correct
if {$inte!="Lobatto" && $inte!="Legendre" && $inte!="Radau" && $inte!="NewtonCotes"} {
return "infoIntegracion: The integration is not recognized"
}
if {$NoIPs < 1 || 10 < $NoIPs} {
return "infoIntegracion: Number of IPs is out of the valid range(1-10)"
}
if {$WorP != "W" && $WorP != "P"} {
return "infoIntegracion: Weights or Points not defined. Options are W or P"
}

# Lobatto integration Scheme
set inteComp "Lobatto"
if {$inte == $inteComp && $WorP == "P"} {
switch $NoIPs {
1 {return [list -1.00]}
2 {return [list 0.000 1.000]}
3 {return [list 0.000 0.500 1.000]}
4 {return [list 0.000 0.276 0.724 1.000]}
5 {return [list 0.000 0.173 0.500 0.827 1.000]}
6 {return [list 0.000 0.117 0.357 0.643 0.883 1.000]}
7 {return [list 0.000 0.085 0.266 0.500 0.734 0.915 1.000]}
8 {return [list 0.000 0.064 0.204 0.395 0.605 0.796 0.936 1.000]}
9 {return [list 0.000 0.050 0.161 0.318 0.500 0.682 0.839 0.950 1.000]}
10 {return [list 0.000 0.040 0.131 0.261 0.417 0.583 0.739 0.869 0.960 1.000]}
}
} elseif {$inte == $inteComp && $WorP == "W"} {
switch $NoIPs {
1 {return [list -1.00]}
2 {return [list 0.500 0.500]}
3 {return [list 0.167 0.666 0.167]}
4 {return [list 0.083 0.417 0.417 0.083]}
5 {return [list 0.050 0.272 0.356 0.272 0.050]}
6 {return [list 0.034 0.189 0.277 0.277 0.189 0.034]}
7 {return [list 0.024 0.138 0.216 0.244 0.216 0.138 0.024]}
8 {return [list 0.018 0.105 0.171 0.206 0.206 0.171 0.105 0.018]}
9 {return [list 0.014 0.083 0.137 0.173 0.186 0.173 0.137 0.083 0.014]}
10 {return [list 0.011 0.067 0.112 0.146 0.164 0.164 0.146 0.112 0.067 0.011]}
}
}

# Legendre integration Scheme
set inteComp "Legendre"
if {$inte == $inteComp && $WorP == "P"} {
switch $NoIPs {
1 {return [list 0.500]}
2 {return [list 0.211 0.789]}
3 {return [list 0.113 0.500 0.887]}
4 {return [list 0.069 0.330 0.670 0.931]}
5 {return [list 0.047 0.231 0.500 0.769 0.953]}
6 {return [list 0.034 0.169 0.381 0.619 0.831 0.966]}
7 {return [list 0.025 0.129 0.297 0.500 0.703 0.871 0.975]}
8 {return [list 0.020 0.102 0.237 0.408 0.592 0.763 0.898 0.980]}
9 {return [list 0.016 0.082 0.193 0.338 0.500 0.662 0.807 0.918 0.984]}
10 {return [list 0.013 0.067 0.160 0.283 0.426 0.574 0.717 0.840 0.933 0.987]}
}
} elseif {$inte == $inteComp && $WorP == "W"} {
switch $NoIPs {
1 {return [list 1.000]}
2 {return [list 0.500 0.500]}
3 {return [list 0.278 0.444 0.278]}
4 {return [list 0.174 0.326 0.326 0.174]}
5 {return [list 0.119 0.239 0.284 0.239 0.119]}
6 {return [list 0.086 0.180 0.234 0.234 0.180 0.086]}
7 {return [list 0.065 0.140 0.191 0.208 0.191 0.140 0.065]}
8 {return [list 0.051 0.111 0.157 0.181 0.181 0.157 0.111 0.051]}
9 {return [list 0.041 0.090 0.130 0.156 0.166 0.156 0.130 0.090 0.041]}
10 {return [list 0.033 0.074 0.110 0.135 0.148 0.148 0.135 0.110 0.074 0.033]}
}
}

# Radau integration Scheme
set inteComp "Radau"
if {$inte == $inteComp && $WorP == "P"} {
switch $NoIPs {
1 {return [list 0.000]}
2 {return [list 0.000 0.667]}
3 {return [list 0.000 0.355 0.845]}
4 {return [list 0.000 0.212 0.591 0.911]}
5 {return [list 0.000 0.140 0.416 0.723 0.943]}
6 {return [list 0.000 0.099 0.305 0.562 0.802 0.960]}
7 {return [list 0.000 0.073 0.231 0.441 0.663 0.852 0.971]}
8 {return [list 0.000 0.056 0.180 0.353 0.547 0.734 0.885 0.978]}
9 {return [list 0.000 0.045 0.144 0.287 0.455 0.628 0.786 0.909 0.982]}
10 {return [list 0.000 0.036 0.118 0.237 0.382 0.538 0.690 0.824 0.926 0.986]}
}
} elseif {$inte == $inteComp && $WorP == "W"} {
switch $NoIPs {
1 {return [list 1.000]}
2 {return [list 0.250 0.750]}
3 {return [list 0.112 0.512 0.376]}
4 {return [list 0.063 0.329 0.388 0.220]}
5 {return [list 0.040 0.223 0.312 0.281 0.144]}
6 {return [list 0.028 0.160 0.243 0.260 0.208 0.101]}
7 {return [list 0.020 0.120 0.190 0.225 0.212 0.159 0.074]}
8 {return [list 0.016 0.093 0.152 0.187 0.196 0.174 0.125 0.057]}
9 {return [list 0.012 0.074 0.124 0.158 0.175 0.169 0.143 0.100 0.045]}
10 {return [list 0.010 0.060 0.102 0.134 0.153 0.157 0.145 0.120 0.082 0.037]}
}
}

# NewtonCotes integration Scheme
set inteComp "NewtonCotes"
if {$inte == $inteComp && $WorP == "P"} {
switch $NoIPs {
1 {return [list -1.00]}
2 {return [list 0.000 1.000]}
3 {return [list 0.000 0.500 1.000]}
4 {return [list 0.000 0.333 0.667 1.000]}
5 {return [list 0.000 0.250 0.500 0.750 1.000]}
6 {return [list 0.000 0.200 0.400 0.600 0.800 1.000]}
7 {return [list 0.000 0.167 0.333 0.500 0.667 0.833 1.000]}
8 {return [list 0.000 0.143 0.286 0.429 0.571 0.714 0.857 1.000]}
9 {return [list 0.000 0.125 0.250 0.375 0.500 0.625 0.750 0.875 1.000]}
10 {return [list 0.000 0.111 0.222 0.333 0.444 0.556 0.667 0.778 0.889 1.000]}
}
} elseif {$inte == $inteComp && $WorP == "W"} {
switch $NoIPs {
1 {return [list -1.00]}
2 {return [list 0.500 0.500]}
3 {return [list 0.167 0.667 0.167]}
4 {return [list 0.125 0.375 0.375 0.125]}
5 {return [list 0.078 0.356 0.133 0.356 0.078]}
6 {return [list 0.066 0.260 0.174 0.174 0.260 0.066]}
7 {return [list 0.049 0.257 0.032 0.324 0.032 0.257 0.049 ]}
8 {return [list 0.043 0.207 0.077 0.173 0.173 0.077 0.207 0.043]}
9 {return [list 0.035 0.208 -0.033 0.370 -0.160 0.370 -0.033 0.208 0.035]}
10 {return [list 0.032 0.176 0.012 0.216 0.064 0.064 0.216 0.012 0.176 0.032]}
}
}
}
by EricsonEncinaZ
Mon Feb 25, 2019 3:02 am
Forum: OpenSees.exe Users
Topic: moment curvature
Replies: 3
Views: 3727

Re: moment curvature

Hi,

You can track the moment and curvature directly into the integration point that you are interested in.
- recorder element -xml secDsp.out -time -ele $ele -section $sec displacements
- recorder element -xml secFrc.out -time -ele $ele -section $sec forces
If you are recording a zeroLengthSection element, then omit the "-section $sec" part

If you still want to measure it in the node (I would say you will measure rotation, not curvature)
- recorder Node -xml nodeDsp.out -time -node $nod -dof 3 disp
- recorder Node -xml nodeFrc.out -time -node $nod -dof 3 reaction

I'm using the flag -xml instead -file, so the headers in the file tells you what the results are :-D
by EricsonEncinaZ
Sat Feb 23, 2019 1:45 am
Forum: OpenSees.exe Users
Topic: [eleResponse $ele integrationPoints]
Replies: 2
Views: 2864

Re: [eleResponse $ele integrationPoints]

A workaround is to define a 2D domain, 2 nodes, 1 elastic section, 1 FBE/DBE element with the require IPs, save the position and weights of the IPs in variables, wipe the 2D model and then start the 3D model as normal, all in the same script execution. The "wipe" command will delete the 2D model, but not the variables that were defined.
Is this the only way to do it or there is a special flag for the 3D case?
by EricsonEncinaZ
Thu Feb 21, 2019 2:26 am
Forum: OpenSees.exe Users
Topic: connectivity of bond slip in a cantilever
Replies: 5
Views: 4923

Re: connectivity of bond slip in a cantilever

Working now, it gives 0.249 seconds :-D, I do not know if it is ok, I just made it run.

What I did to your code was:
1. changed the builder to "model BasicBuilder -ndm 2 -ndf 3"
2. Based on the node coordinates I assumed [3] -- zero length -- [1] -- FBE -- [2], so I changed your code accordingly
3. The steel02 definition lacked R0 R1 and R2, which are not optional, so I uncommented them and add them to the definition
4. At "section fiberSec $ColSecTag" you had not only fibre commands but "set" commands inside the { } as well. I took them out of the {}
5. The definition of the "layer circ" had at the end this "$theta 360", I think that $theta was wrong. I deleted it as I assumed the reinforcement was evenly distributed around the section
6. When you define the BS section the concrete material should have an Elastic Perfectly Plastic behaviour or define it in a way that do not loose strength under large strains. This means that the Concrete04 that you are using for the fibre section of the pier cannot be used in the definition of the Bond_SP section. I used Concrete01 (because it was simpler) to define 2 new materials with EPP behaviour. They are based on the material properties used for the pier fibre section.
7. The shear behaviour of the zeroLengthSection should be stiff, you had assigned G·A, so I changed it to 1e8 to make it stiff. You can include G·A in the FBE element (with an aggregator) to include the shear deformations happening in the pier. Note: If using DBEs aggregator will not work, so the shear defs should be included with an aggregator to the zeroLengthSection element, using G·A/H. The use of the constants assumes linear elastic shear response.
8. As mentioned in 2. I re-defined the FBE from node 1 to 2.
9. For the ZeroLengthSection from 3 to 1, I changed the vector you had, I used "-orient 0 1 0 1 0 0", so local x points in Global Y and local y points in Global X. This way it matches with the FBE as well. Please note that in 2D the the local Y should be kept in the XY plane, yours was pointing in global Z (0 0 -1).

The error you had pointed out a singular matrix, so some of the elements in your model had to be defined in such a way that does not make sense to OpenSees. This, I think, it was the Vy of the BS section pointing in global Z, which is a dimension that does not exist in a 2D domain.

The revised code below:

# Performance Modeling Strategies for Modern Reinforced Concrete Bridge Columns
# date: 16/12/2018
# Units in kip/in
# column.tcl
# This model is a 2D model

# SET UP ----------------------------------------------------------------------------
model BasicBuilder -ndm 2 -ndf 3; # 2 spacial dimensions, 3 DOF's per nodey

set dataDir DataBS; # set up name for data directory
file mkdir $dataDir/; # create data directory
set GMdir "../GMfiles"; # ground-motion file directory
# -----------------------------------------------------
# define section geometry
set Dcol 24.0; # Column Diameter (in)
set LCol 96.0; # column length (in) # Specimen Lehman et al. N°415. L/D=4.0
set P 147.0 ; # weight (kips)
set Weight [expr $P]
set g 386.22; #[inch/s2]
# calculated parameters
set Mass [expr $P/$g]; # nodal mass

# nodal coordinates:
node 3 0. 0.;
node 1 0. 0.; # node#, X, Y
node 2 0. $LCol

# Single point constraints -- Boundary Conditions
fix 3 1 1 1;
#fix 3 1 0 0;

#equalDOF $rNodeTag $cNodeTag $dof1 $dof2
#equalDOF 1 3 1;

# nodal masses:
mass 2 $Mass 1e-9 0.;

# we need to set up parameters that are particular to the model.
set IDctrlNode 2; # node where displacement is read for displacement control
set IDctrlDOF 1; # degree of freedom of displacement read for displacement control
set iSupportNode "3"; # define support node, if needed.

# Define Column geometry
#-------------------------------------------------------------------
set coverSec 0.874; # Column cover to reinforcing steel (in)
set numBarsSec 22; # number of longitudinal-reinforcement bars in the column section
set dlSec 0.626; # [in] Steel diameter T15.9
set PI 3.14;
set barAreaSec [expr $PI*pow($dlSec,2)/4]; #area of longitudinal-reinforcement bars # (in^2)


# MATERIAL parameters
#-------------------------------------------------------------------
set IDconcC 1; # material ID tag -- confined core concrete
set IDconcU 2; # material ID tag -- unconfined cover concrete
set IDreinf 3; # material ID tag -- reinforcement

# Define uniaxial materials
#-------------------------------------------------------------------
# Mander concrete model for confined and unconfined concrete
# characteristics of materials test of Lehman et al. (PEER 98-01)

# confined concrete (core)
#-------------------------
set fc 4.496; # [Ksi] CONCRETE Compressive Strength
set ec 0.002294; # concrete strain at maximum strength ??????
set ecu 0.008101; # [Ksi] concrete strain at crushing strength ????
set Ec 3822.0; # [Ksi]Concrete Elastic Modulus
set fct 0.5046; #[Ksi] maximum tensile strength of concrete
set et 0.000132; # ultimate tensile strain of concrete
#set beta 0.1; #value defining the exponential curve parameter to define the residual stress

#uniaxialMaterial Concrete04 $matTag $fc $ec $ecu $Ec <$fct $et> <$beta>;
#uniaxialMaterial Concrete04 $IDconcC $fc $ec $ecu $Ec $fct $et;
#uniaxialMaterial Concrete04 $IDconcC [expr -$fc] [expr -$ec] [expr -$ecu] $Ec $fct $et;
uniaxialMaterial Concrete04 $IDconcC -$fc -$ec -$ecu $Ec $fct $et;

set IDconcC2 10
uniaxialMaterial Concrete01 $IDconcC2 -$fc -$ec [expr -$fc*0.99] -$ecu

# unconfined concrete (cover)
#----------------------------
set fcU 4.496; # [Ksi] CONCRETE Compressive Strength
set ecU 0.002; # concrete strain at maximum strength (#I did not find the experimentation values)
set ecuU 0.0035; # [Ksi] concrete strain at crushing strength (#I did not find the experimentation values)
set EcU 3822.0; # [Ksi]Concrete Elastic Modulus
set fctU 0.5046; #[Ksi] maximum tensile strength of concrete
set etU 0.000132; # ultimate tensile strain of concrete
#set betaU 0.1; #value defining the exponential curve parameter to define the residual stress

# uniaxialMaterial Concrete04 $matTag $fc $ec $ecu $Ec <$fct $et> <$beta>;
# niaxialMaterial Concrete04 $IDconcU [expr -$fcU] [expr -$ecU] [expr -$ecuU] $EcU $fctU $etU;
uniaxialMaterial Concrete04 $IDconcU -$fcU -$ecU -$ecuU $EcU $fctU $etU;

set IDconcU2 11
uniaxialMaterial Concrete01 $IDconcU2 -$fcU -$ecU [expr -$fcU*0.99] -$ecuU

# ----------- Reinforcing Steel --------
set Es 29000.0 ; # modulus of steel (Ksi)??????
set Fy 67.0; # [Ksi] yield stress Lehman et al.2000 (specimen 415.)
set Fu 91.37; #[Ksi] ultimate stress Lehman et al.2000
set B 0.01; # strain-hardening ratio (Lehman et al. 2000)
set R0 18.5; # control the transition from elastic to plastic branches
set cR1 0.925; # control the transition from elastic to plastic branches
set cR2 0.15; # control the transition from elastic to plastic branches
#set a1 0.04;
#set a2 1.0;
#set a3 0.04;
#set a4 1.0;

#uniaxialMaterial Steel02 $IDreinf $Fy $Es $B $R0 $cR1 $cR2 $a1 $a2 $a3 $a4;
uniaxialMaterial Steel02 $IDreinf $Fy $Es $B $R0 $cR1 $cR2;

puts "materials defined"
#===============================================================Bond-Slip=================================================================
set alphaBS 0.4 ; #alphaBS is a parameter used in the local bond-slip relation and can be taken as 0.4
set Pow [expr (1.0/$alphaBS)]

#Eq for a model with units (ksi, kips, inches)
#set Sy [expr (((((($dlSec*$Fy*1000.0)/(4000.0*(sqrt($fc*-1000.0))))*((2.0*$alphaBS)+1.0))*pow($Pow,1))*0.1)+0.013)]
set Sy 0.08337;
set Su [expr $Sy*35.0]
set b 0.5
set R 0.7
set bondslipMat 5

#uniaxialMaterial Bond_SP01 $matTag $Fy $Sy $Fu $Su $b $R
uniaxialMaterial Bond_SP01 $bondslipMat $Fy $Sy $Fu $Su $b $R

puts "materials defined "

#----------------------------------------------------------------
# Generate a circular reinforced concrete section
# with one layer of steel evenly distributed around the perimeter and a confined core.
# confined core.
# by: Michael H. Scott, 2003
# Notes
# The center of the reinforcing bars are placed at the inner radius
# The core concrete ends at the inner radius (same as reinforcing bars)
# The reinforcing bars are all the same size
# The center of the section is at (0,0) in the local axis system
# Zero degrees is along section y-axis
#Following recommendations using uniformly distibutions ratdial disretization shema

set ri 0.0; # inner radius of the section, only for hollow sections
set ro [expr $Dcol/2]; # overall (outer) radius of the section
set nfCoreR 10; # number of radial divisions in the core (number of "rings")
set nfCoreT 20; # number of theta divisions in the core (number of "wedges")
set nfCoverR 1; # number of radial divisions in the cover
set nfCoverT 20; # number of theta divisions in the cover

# Define ELEMENTS & SECTIONS
#----------------------------
set ColSecTag 1; # assign a tag number to the column section

# Define the fiber section
#-------------------------
set rc [expr $ro-$coverSec]; # Core radius
set bcent 6.39 ; # expr[$coversec+$Dsec/2]
set rb [expr $ro-$bcent];
set theta [expr 360.0/$numBarsSec]; # Determine angle increment between bars
section fiberSec $ColSecTag {

#patch circ $matTag $numSubdivCirc $numSubdivRad $yCenter $zCenter $intRad $extRad <$startAng $endAng>
patch circ $IDconcC $nfCoreT $nfCoreR 0 0 $ri $rc 0 360; # Define the core patch
patch circ $IDconcU $nfCoverT $nfCoverR 0 0 $rc $ro 0 360; # Define the cover patch

#layer circ $matTag $numFiber $areaFiber $yCenter $zCenter $radius <$startAng $endAng>
layer circ $IDreinf $numBarsSec $barAreaSec 0 0 $rc; # Define the reinforcing layer
}
puts "section geometry defined of Column"

# Define the fiber section of Bond Slip
#---------------------------------------
set SecTagBS 3;
section fiberSec $SecTagBS {; # Define the fiber section
patch circ $IDconcC2 $nfCoreT $nfCoreR 0 0 $ri $rc 0 360; # Define the core patch
patch circ $IDconcU2 $nfCoverT $nfCoverR 0 0 $rc $ro 0 360; # Define the cover patch
layer circ $bondslipMat $numBarsSec $barAreaSec 0 0 $rc ; # Define the reinforcing layer
}
puts "section geometry defined of Bond Slip"

#Aggregator
#------------------------
set shearsec 4;
set TagsecAgg 6;
set AreaSec [expr $PI*pow($Dcol,2)/4]; #gross cross-sectional area (in^2)
set G [expr ($Ec)/(2.4)];
puts "G=$G"
set GA [expr ($G*$AreaSec)];
puts "GA=$GA"

#Assign shear to the model of flexure
#------------------------------------

uniaxialMaterial Elastic $shearsec 1e8
puts "shear defined"

#section Aggregator $TagsecAgg $shearsec Vy -section $ColSecTag
section Aggregator $TagsecAgg $shearsec Vy -section $SecTagBS

puts "section aggregator defined"


# define geometric transformation
#--------------------------------
#performs a linear geometric transformation of beam stiffness and resisting force
#from the basic system to the global-coordinate system

set ColTransfTag 1; # associate a tag to column transformation
set ColTransfType Linear ; # options, Linear PDelta Corotational
geomTransf $ColTransfType $ColTransfTag ;

# element connectivity:
set numIntgrPts 5; # number of integration points for force-based element
#element nonlinearBeamColumn $eleTag $iNode $jNode $numIntgrPts $secTag $transfTag
#element nonlinearBeamColumn 1 2 3 $numIntgrPts $TagsecAgg $ColTransfTag

element nonlinearBeamColumn 1 1 2 $numIntgrPts $ColSecTag $ColTransfTag


puts "element nonlinear defined"

######ZeroElement of Bond-Slip
#element zeroLengthSection $EleTag $ibNode $jbNode $SecTagBS
element zeroLengthSection 2 3 1 $TagsecAgg -orient 0 1 0 1 0 0
puts "zeroLength element defined"

puts "model etablished"


#-------------------------------------------------------------------------------

# Column- Pile element connectivity:

# Create recorder
recorder Node -file $dataDir/DFree.out -time -node 2 -dof 1 2 3 disp; # displacements of free nodes
recorder Node -file $dataDir/RBase.out -time -node 3 -dof 1 2 3 reaction; # support reaction ????? reaction node3


#recorder Element <-file $fileName> <-time> <-ele ($ele1 $ele2 ...)> <-eleRange $startEle $endEle> <-region $regTag> <-ele all> ($arg1 $arg2 ...)
#$secNum refers to the integration point whose data is to be output (In this case we want 3 Output= section 3)
recorder Element -file $dataDir/secstrSTELneg.out -time -ele 1 section 3 fiber -$ro 0. $IDreinf stressStrain #??? A revoir data ro
recorder Element -file $dataDir/secstrSTEELpos.out -time -ele 1 section 3 fiber $ro 0. $IDreinf stressStrain
recorder Element -file $dataDir/secstrCONC.out -time -ele 1 section 3 fiber $rc 0. $IDconcC stressStrain

#recorder plot $dataDir/topdispac.out Node2_Ydisp 10 10 300 300 -columns 2 1


# Static analysis
#-------------------------------------------------------------
#define GRAVITY
pattern Plain 1 Linear {
load 2 0 -$P 0
}

# Gravity-analysis parameters -- load-controlled static analysis
set Tol 1.0e-5; # convergence tolerance for test

constraints Plain; # how it handles boundary conditions
numberer Plain; # renumber dof's to minimize band-width (optimization), if you want to
system BandGeneral; # how to store and solve the system of equations in the analysis
test NormDispIncr $Tol 100 ; # determine if convergence has been achieved at the end of an iteration step
algorithm Newton; # use Newton's solution algorithm: updates tangent stiffness at every iteration

set NstepGravity 1; # apply gravity in 10 steps
set DGravity [expr 1./$NstepGravity]; # first load increment;

integrator LoadControl $DGravity; # determine the next time step for an analysis

analysis Static; # define type of analysis static or transient
analyze $NstepGravity; # apply gravity

#-----maintain constant gravity loads and reset time to zero------
loadConst -time 0.0
print -node 2
puts "Model Built"

#EIGEN MODE
#-----------------------------

set omega2 [eigen 1];
set omega1 [expr pow($omega2 ,0.5)];
set period1 [expr 2*3.1415/$omega1];
puts " OpenSees Calculated Period of First mode= $period1"