Approach for updating nodal force values with explicit analysis

Forum for OpenSees users to post questions, comments, etc. on the use of the OpenSees interpreter, OpenSees.exe

Moderators: silvia, selimgunay, Moderators

Post Reply
DynamicModeler
Posts: 2
Joined: Thu Jul 08, 2021 10:51 am

Approach for updating nodal force values with explicit analysis

Post by DynamicModeler » Thu Jul 08, 2021 10:57 am

Hello,

I am trying to implement an approach where a nodal force is updated at each time step based on a nodal velocity from the previous time step.
I would prefer to use an explicit analysis (using “integrator CentralDifferenceNoDamping” command), but my results for the explicit analysis method do not match my results from an implicit analysis (and I don’t believe that it is an explicit time step size issue).

I investigated this further with a simplified single degree of freedom spring model. In summary, for my simplified model, I am prescribing a stepwise loading curve to a node at the free end of a zero-length spring. To investigate my approach, I developed 4 separate models where:

(1) the stepwise force-time curve is defined before conducting an implicit analysis

(2) the stepwise force-time curve is defined before conducting an explicit analysis

(3) a portion of the stepwise force-time curve (used in cases 1 and 2) is defined before the analysis and the remaining force is applied with each timestep in an implicit analysis. This additional (remaining) force is applied by analyzing a single timestep and then determining the current time. Based on the current time, the additional force is computed such that the total net force (combination of the first predefined portion + the additional force) is equal to the force applied in cases (1) and (2). For this model, since it is implicit, I get the same output as cases (1) and (2). For this approach, I am using the remove loadPattern command to remove the load from the previous time step and then apply a new load for the current time step. The results from this case match those from (1) and (2).

(4) for this case, I use the same approach as described in case (3), however, the analysis is an explicit analysis. The results from this model do not match those produced in cases (1) through (3).

I’d be happy to provide my simplified models for some additional guidance, as it’s possible my approach is flawed and there is a better (more elegant) method to achieve what I am describing.

Any help or guidance on trying to troubleshoot this issue would be greatly appreciated.

DynamicModeler
Posts: 2
Joined: Thu Jul 08, 2021 10:51 am

Re: Approach for updating nodal force values with explicit analysis

Post by DynamicModeler » Thu Jul 08, 2021 11:05 am

Here is the simplified input file (model case 4) that does not match the other 3 cases


# ------------------------------------------
# GENERAL INFORMATION
# ------------------------------------------
# MODEL UNITS
# Force: lbf
# Distance: in.
# Time: sec

# ------------------------------------------
# SETTING UP BASIC MODEL PROPERTIES
# ------------------------------------------
# Wipe existing data
wipe;

# Set start time
set time_0 [clock seconds];

# Create ModelBuilder (with three-dimensions and 6 DOF/node)
model basic -ndm 3 -ndf 6;

# ------------------------------------------
# CREATE NODES AND SPC BOUNDARY CONDITIONS
# ------------------------------------------
set free_spring_node 1;
set fixed_spring_node 2;

# Create nodes X Y Z
node $free_spring_node 0.0 0.0 0.0; #create node (for zero length spring)
node $fixed_spring_node 0.0 0.0 0.0; #create node (for zero length spring)

# Fix one end of spring and prevent any spring rotations
# tag DX DY DZ RX RY RZ
fix $fixed_spring_node 1 1 1 1 1 1;
fix $free_spring_node 0 1 1 1 1 1;

puts "Nodes and SPCs Created";

# ------------------------------------------
# DEFINE SPRING MATERIALS
# ------------------------------------------
set spring_mat_tag 1;
set spring_E 10000;

# tag E
uniaxialMaterial Elastic $spring_mat_tag $spring_E;


puts "Materials Defined";


# ------------------------------------------
# DEFINE SPRING ELEMENT
# ------------------------------------------
# Create spring element
# $eleTag $iNode $jNode -mat $matTag1 -dir $dir1
element zeroLength 1 $free_spring_node $fixed_spring_node -mat $spring_mat_tag -dir 1;

puts "Elements Created";


# Add nodal mass to free DOF
# node ID DX mass DY mass DZ mass RX mass RY mass RZ mass
mass $free_spring_node 1.0 0.0 0.0 0.0 0.0 0.0;

puts "Nodal Masses Defined";



# ---------------------------------------------
# DEFINE LOAD
# ---------------------------------------------

# Set an arbitrary force-time curve that has a stepwise rectangular shape for this example
set F_node 10000.0; #lateral x-force value

set load_patt_tag 1; #load pattern tag
set time_tag 1; #time series tag

# Create time series
set F_mag_values [list 1.0000 1.0000 1.0000 1.0000 0.0000 0.0000]; #list that holds force values for time series
set t_values [list 0.0000 0.0100 0.0101 0.0200 0.0201 0.0600]; #list that holds time values for time series

timeSeries Path $time_tag -time $t_values -values $F_mag_values;

# Create a Plain load pattern with defined time series
pattern Plain $load_patt_tag $time_tag {
#Create nodal load
# node FX FY FZ MX MY MZ
load $free_spring_node $F_node 0.0 0.0 0.0 0.0 0.0;
}

puts "Loads Defined";



# ------------------------------------------
# GENERATE TRANSIENT ANALYSIS PARAMETERS
# ------------------------------------------

# NOTE: Explicit analysis

# Create the system of equations, a banded symmetric positive definite matrix
system FullGeneral;

# Create the constraint handler
constraints Plain;

# Create the DOF numberer, the reverse Cuthill-McKee algorithm
numberer RCM;

### Explicit
# Create the solution algorithm, a linear solution algorithm with no iterations
algorithm Linear;

# Create the integration scheme, a central difference scheme
integrator CentralDifferenceNoDamping;



# Create the analysis object
analysis Transient;

puts "Transient Analysis Parameters Defined";

# --------------------------------------------------
# SPECIFY RECORDERS FOR TRANSIENT ANALYSIS
# --------------------------------------------------
recorder Node -file Out1_Free_Node_Disp.out -time -closeOnWrite -node $free_spring_node -dof 1 2 3 4 5 6 disp;
recorder Node -file Out2_Fixed_Node_Disp.out -time -closeOnWrite -node $fixed_spring_node -dof 1 2 3 4 5 6 disp;
recorder Element -file Out3_Element_Force.out -time -closeOnWrite -ele 1 globalForces;
recorder Node -file Out4_Fixed_Node_Rxn.out -time -closeOnWrite -node $fixed_spring_node -dof 1 2 3 4 5 6 reaction;

puts "Recorders Defined for Transient Analysis";


# ------------------------------------------
# CONDUCT TRANSIENT ANALYSIS
# ------------------------------------------

# Set transient analysis parameters
set duration 0.10; #set analysis duration
set dt [expr $duration/500]; #calculate time step
set nsteps [expr int($duration/$dt)]; #calculate number of time steps required to conduct analysis



# Resample dynamic load based on time step
# This is used for applying an additional force (below)
set t_res {0.0}; #set initial time in resampled list
set F_res {1.0}; #set initial load in resampled list
for {set i 1} {$i<=$nsteps} {incr i} {
set t [expr $i*$dt];
set flag 0;
for {set j 0} {$j<[llength $t_values]} {incr j} {
set time_temp [lindex $t_values $j];
if {($time_temp > 0.0) && ($time_temp >= $t) && ($flag != 1)} {
set time_2 $time_temp;
set Force_2 [lindex $F_mag_values $j];
set time_1 [lindex $t_values [expr $j-1]];
set Force_1 [lindex $F_mag_values [expr $j-1]];
set slope [expr ($Force_2-$Force_1)/($time_2-$time_1)];
set resam_Force [expr $Force_2-$slope*($time_2-$t)];
lappend t_res $t;
lappend F_res $resam_Force;
set flag 1;
}
}
set time_curve_length [llength $t_values];
set max_curve_time [lindex $t_values [expr $time_curve_length-1]];
# add zeros to end of curve
if {$t>$max_curve_time} {
lappend t_res $t;
lappend F_res 0.0;
}
}


# For our more complex model, we are trying to implement a nodal force
# where the applied force is a function of the nodal velocity from the previous time step.
# As a result, we need to add a Plain load pattern with each time step.
# The approach we are using currently seems to only work with an implicit analysis
# and does not work explicitly (i.e., results are not the same when the load Pattern of zero
# is removed and added back in with each time step.


# Set up initial additional load curve (zero to be modified with remove loadPattern)
set additional_load_tag 2;

pattern Plain $additional_load_tag Constant {
# nd FX FY FZ MX MY MZ
load $free_spring_node 0.0 0.0 0.0 0.0 0.0 0.0;
}


# Write Dynamic Rxn force and Additional Forcee to files
set Additional_force_file [open "Out5_Additional_force.txt" w+]; #open file to write additional force
set Net_force_file [open "Out6_Net_force.txt" w+]; #open file to write dynamic reaction force


# Calculate a additional force with each time step to produce a net force that is equal to the force applied in models
# where the force is "predefined"
for {set i 1} {$i<=$nsteps} {incr i} {
puts "load step $i of $nsteps";

#analyze the first time step (no additional force applied)
analyze 1 $dt;

set t_current [getTime]; #get current time in analysis

#find the load applied at the current time step to determine what the additional force should be
set F_current_mag [lindex $F_res [expr $i]]; #getting applied dynamic load magnitude at current time (between 0 and 1)
set F_dyn_current [expr $F_current_mag*$F_node]; #multiply by the F_node value

#Initialize the additional magnitude
set additional_mag 0.0;

#If the time is between 0.01 and 0.02, set the additional force magnitude
if {($t_current >= 0.01) && ($t_current <= 0.02)} {
set additional_mag 0.4;
}

#compute the additional force magnitude for the current time step
set F_additional [expr ($additional_mag*$F_node)];

#remove zero load and apply additional force at current time step
remove loadPattern $additional_load_tag;

#apply the additional force in the opposite direction to produce a net value as defined in the "predefined" model
pattern Plain $additional_load_tag Constant {
# nd FX FY FZ MX MY MZ
load $free_spring_node [expr -1*$F_additional] 0.0 0.0 0.0 0.0 0.0; #define new additional
}


#check that the net force is equal to the "predefined" model
set F_net [expr ($F_dyn_current-$F_additional)];
puts $Additional_force_file "$t_current,$F_additional";
puts $Net_force_file "$t_current,$F_net";
}


#close $Dynamic_Rxn_file;
close $Additional_force_file;
close $Net_force_file;

puts "Analysis Completed";

# Print entire model to file
print -JSON -file Test_Model.json;

# Determine analysis duration
set time_end [clock seconds];
set sim_time [expr $time_end-$time_0];
puts "The analysis took $sim_time seconds.";

Post Reply