Two soil layers with different meshes.

A forum dedicated to users with questions regarding soil materials and elements.

forum currently locked

Moderator: Moderators

Carlota Gama
Posts: 22
Joined: Mon Oct 12, 2009 9:23 am
Location: Universidade Nova de Lisboa

Two soil layers with different meshes.

Post by Carlota Gama »

Hi,

I want to do 2 layers of different soils and generate at each layer a diferent mesh. I'm trying to do this with the block2D command, because is much easier and simple, but it gives me an error on the common nodes. How can I get around this?

This is what I was trying to do:

set Quad quad
set eleArgs "1 PlaneStrain 1 $press 0.0 $unitWeightX $unitWeightY"

set nx1 2
set ny1 2
set e1 1

block2D $nx1 $ny1 1 $e1 $Quad $eleArgs {
1 0 0
2 1 0
3 1 1
4 0 1
}

set nx2 2
set ny2 2
set e2 [expr $nx1*$ny1+1]

block2D $nx2 $ny2 2 $e2 $Quad $eleArgs {
2 1 0
5 2 0
6 2 1
3 1 1
}
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

in the current release you cannot use the same node tags .. it is something i should have considered and will make the change in the next version .. in the meantime you will have to use the equalDOF command to tie both blocks.
Carlota Gama
Posts: 22
Joined: Mon Oct 12, 2009 9:23 am
Location: Universidade Nova de Lisboa

Post by Carlota Gama »

I've tried all possible combinations, especially different nodes tags, and still can not make the meshes. I think I'll make the meshes with GID, which may be the easiest way.

Thanks,
Best regards.
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Post by fmk »

for 2 blocks on top of each other: nodes 4 and 3 (and 7) of block 1 have to be the same as 1 and 2 (and 5) of block number 2. also the blocks have to have same numX divisions. the starting node and element no.s for block 2 have to ensre no duplicate element or node numbers.

here:

[code]
model Basic -ndm 2 -ndf 2
set Quad quad
nDMaterial ElasticIsotropic 1 3000 0.25
set eleArgs "1 PlaneStrain 1"

set nx1 3
set ny1 5
set e1 1

block2D $nx1 $ny1 1 $e1 $Quad $eleArgs {
1 0 0
2 1 0
3 1 1
4 0 1
}

set nx2 $nx1
set ny2 2
set e2 [expr $nx1*$ny1+1]
set nn [expr ($nx1+1)*($ny1+1) +1]

block2D $nx2 $ny2 $nn $e2 $Quad $eleArgs {
1 0 1
2 1 1
3 1 2
4 0 2
}

set nB1 [expr ($nx1+1)*($ny1) +1]
for {set i 0} {$i <= $nx1} {incr i 1} {
equalDOF [expr $nn+$i] [expr $nB1+$i] 1 2
}
print

[/code]
Carlota Gama
Posts: 22
Joined: Mon Oct 12, 2009 9:23 am
Location: Universidade Nova de Lisboa

Post by Carlota Gama »

I was making a mistake on numbering the nodes.

However I have another question for the same example (Example 10 of the Geotechnical Simulation Capabilities). Why by making a simple change of the example by creating a mesh with nx=2 ny=2 the convergence of the problem is not verified and increasing the number of iterations does not resolve the problem?
jinlu
Posts: 47
Joined: Fri Jul 14, 2006 5:50 pm
Location: UC San Diego

Post by jinlu »

Make sure you use the latest version of OpenSees. At one time, the mass density was removed from the parameter list for quad element. Post your tcl file if you still have problems after using the latest version.

-Jinchi
Carlota Gama
Posts: 22
Joined: Mon Oct 12, 2009 9:23 am
Location: Universidade Nova de Lisboa

Post by Carlota Gama »

I install the version 2.2.2 and try to run the scrip but still gives me the same error. Thus sending the scrip which is equal to the example 10 of the manual OpenSees Geotechnical Simulation Capabilities with the difference of having created a mesh of 2*2.


set accMul 7 ;# acceleration multiplier
set massDen 2. ;# mass density
set massProportionalDamping 0.0 ;
set stiffnessProportionalDamping 0.001 ;
set fangle 31.40 ;#friction angle
set ptangle 26.50 ;#phase transformation angle
set E 90000.0 ;#Young's modulus
set poisson 0.40 ;
set G [expr $E/(2*(1+$poisson))] ;
set B [expr $E/(3*(1-2*$poisson))] ;
set press 0.0 ;# isotropic consolidation pressure on quad element(s)
set deltaT 0.010 ;# time step for analysis
set numSteps 2000 ;# Number of analysis steps
set gamma 0.600 ;# Newmark integration parameter
set period 1 ;# Period of applied sinusoidal load
set pi 3.1415926535 ;
set inclination 0 ;
set unitWeightX [expr $massDen*9.81*sin($inclination/180.0*$pi)] ;# unit weight in X direction
set unitWeightY [expr -$massDen*9.81*cos($inclination/180.0*$pi)] ;# unit weight in Y direction
##################################################


#create the ModelBuilder
model basic -ndm 2 -ndf 2

# define material and properties
nDMaterial PressureDependMultiYield 2 2 $massDen $G $B $fangle .1 80 0.5 \
$ptangle 0.17 0.4 10 00 0.015 1.0

set Quad quad
set eleArgs "1 PlaneStrain 2 $press 0.0 $unitWeightX $unitWeightY"
set nx1 2
set ny1 2
set nn1 1
set e1 1

block2D $nx1 $ny1 $nn1 $e1 $Quad $eleArgs {
1 0 0
2 1 0
3 1 1
4 0 1
}

updateMaterialStage -material 2 -stage 0

# fix the base
for {set i 0} {$i <= $nx1} {incr i 1} {
fix [expr $nn1+$i] 1 1
}


set nB1 [expr ($nx1+1)*($ny1)+1]
for {set i 0} {$i <= ($nx1-1)} {incr i 1} {
equalDOF [expr $nB1+$i] [expr $nB1+$i+1] 1 2
}


#############################################################
# GRAVITY APPLICATION (elastic behavior)
# create the SOE, ConstraintHandler, Integrator, Algorithm and Numberer
system ProfileSPD
test NormDispIncr 1.e-12 50 0
constraints Transformation
integrator LoadControl 1 1 1 1
algorithm Newton
numberer RCM

# create the Analysis
analysis Static

#analyze
analyze 2

# switch the material to plastic
updateMaterialStage -material 2 -stage 1
updateMaterials -material 2 bulkModulus [expr $G*2/3.];

#analyze
analyze 1

############################################################
# NOW APPLY LOADING SEQUENCE AND ANALYZE (plastic)

# rezero time
setTime 0.0
#loadConst -time 0.00
wipeAnalysis

pattern UniformExcitation 1 1 -accel "Sine 0 1000 $period -factor $accMul"
# create the Analysis
constraints Transformation;
test NormDispIncr 1.e-12 50 0
algorithm Newton
numberer RCM
system ProfileSPD
rayleigh $massProportionalDamping 0.0 $stiffnessProportionalDamping 0.
integrator Newmark $gamma [expr pow($gamma+0.5, 2)/4]
analysis VariableTransient

recorder Node -file disp10_4.txt -time -node $nn1 [expr ($nx1+1)*($ny1+1)] -dof 1 -dT 0.01 disp
recorder Node -file acce10_4.txt -time -node $nn1 [expr ($nx1+1)*($ny1+1)] -dof 1 -dT 0.01 accel

recorder Element -ele $e1 -time -file stress10_1.txt -dT 0.01 material 1 stress
recorder Element -ele $e1 -time -file strain10_1.txt -dT 0.01 material 1 strain

recorder Element -ele [expr $nx1*$ny1] -time -file stress10_3.txt -dT 0.01 material 3 stress
recorder Element -ele [expr $nx1*$ny1] -time -file strain10_3.txt -dT 0.01 material 3 strain

#analyze
set startT [clock seconds]
analyze $numSteps $deltaT [expr $deltaT/100] $deltaT 10
set endT [clock seconds]
puts "Execution time: [expr $endT-$startT] seconds."

wipe #flush ouput stream
jinlu
Posts: 47
Joined: Fri Jul 14, 2006 5:50 pm
Location: UC San Diego

Post by jinlu »

For a typical nonlinear soil analysis, the tolerance can be as large as 1.0E-04 (e.g., test NormDispIncr 1.e-04 50 0). However for the gravity application phase, you may want to use a smaller tolerance (e.g., 1e-8 or less).
Carlota Gama
Posts: 22
Joined: Mon Oct 12, 2009 9:23 am
Location: Universidade Nova de Lisboa

Post by Carlota Gama »

What I can not understand is why whenever I change the mesh I have to change these two parameters. For example, changing the tcl file for a mesh 4*4, opensees only runs with values of tolerance of 1e-2, either to gravitational analisis or dynamic analysis. Is this normal? I think it's a little strange.
jinlu
Posts: 47
Joined: Fri Jul 14, 2006 5:50 pm
Location: UC San Diego

Post by jinlu »

Your boundary condition is not correct. It should be like this:
for {set i 1} {$i <= $ny1} {incr i 1} {
equalDOF [expr ($nx1+1)*$i+1] [expr ($nx1+1)*($i+1)] 1 2
}
Carlota Gama
Posts: 22
Joined: Mon Oct 12, 2009 9:23 am
Location: Universidade Nova de Lisboa

Post by Carlota Gama »

Fixing the boundary conditions I can get fairly consistent results.
My goal is to reach a much more complex structure but for this I have to go through all the intermediate stages. Making two blocks side by side occur exactly the same, OpenSees only runs with tolerances of 1e-4 which, as you said, is a very high tolerance. I double check the problem and it seems right. With these values can I get good solutions?


set accMul 1 ;# acceleration multiplier
set massDen 2 ;# solid mass density
set massProportionalDamping 0.0 ;
set stiffnessProportionalDamping 0.001 ;
set fangle 31.40 ;#friction angle
set ptangle 26.50 ;#phase transformation angle
set E 90000.0 ;#shear modulus
set poisson 0.40 ;
set G [expr $E/(2*(1+$poisson))] ;
set B [expr $E/(3*(1-2*$poisson))] ;
set press 0.0 ;# isotropic consolidation pressure on quad element(s)
set deltaT 0.010 ;# time step for analysis
set numSteps 3600 ;# Number of analysis steps
set gamma 0.600 ;# Newmark integration parameter
set pi 3.1415926535 ;
set inclination 0 ;
set unitWeightX [expr $massDen*9.81*sin($inclination/180.0*$pi)] ;# unit weight in X direction
set unitWeightY [expr -$massDen*9.81*cos($inclination/180.0*$pi)] ;# unit weight in Y direction
#########################

#create the ModelBuilder
model basic -ndm 2 -ndf 2

# define material and properties
nDMaterial PressureDependMultiYield 1 2 $massDen $G $B $fangle .1 80 0.5 \
$ptangle 0.17 0.4 10 10 0.015 1.0

set Quad quad
set eleArgs "1 PlaneStrain 1 $press 0.0 $unitWeightX $unitWeightY"
set nx1 2
set ny1 2
set e1 1
set nn1 1
block2D $nx1 $ny1 $nn1 $e1 $Quad $eleArgs {
1 0 0
2 1 0
3 1 1
4 0 1
}
set nx2 2
set ny2 $ny1
set e2 [expr $nx1*$ny1+1]
set nn2 [expr ($nx1+1)*($ny1+1)+1]
block2D $nx2 $ny2 $nn2 $e2 $Quad $eleArgs {
1 1 0
2 2 0
3 2 1
4 1 1
}

#Unir bloco 1 ao Bloco 2
set nb12 [expr $nx1+1]
for {set i 0} {$i <= $ny1} {incr i 1} {
equalDOF [expr $nn2+($nx2+1)*$i] [expr $nb12+($nx1+1)*$i] 1 2
}

updateMaterialStage -material 1 -stage 0

# fix the base
for {set i 0} {$i <= $nx1} {incr i 1} {
fix [expr $nn1+$i] 1 1
}
for {set i 0} {$i <= $nx2} {incr i 1} {
fix [expr $nn2+$i] 1 1
}

#tie nodes
for {set i 0} {$i <=$ny1} {incr i 1} {
equalDOF [expr ($nx1+1)*$i+1] [expr ($nx1+1)*($i+1)] 1 2
}
for {set i 0} {$i <=$ny2} {incr i 1} {
equalDOF [expr ($nx2+1)*$i+$nn2] [expr ($nx2+1)*($i+1)+$nn2-1] 1 2
}

puts "Modelo construído"

#########################
# GRAVITY APPLICATION (elastic behavior)
# create the SOE, ConstraintHandler, Integrator, Algorithm and Numberer

system ProfileSPD
test NormDispIncr 1.e-4 50 0
constraints Transformation
integrator LoadControl 1 1 1 1
algorithm Newton
numberer RCM

# create the Analysis
analysis Static

#analyze
analyze 2

# switch the material to plastic
updateMaterialStage -material 1 -stage 1
updateMaterials -material 1 bulkModulus [expr $G*2/3.];

#analyze
analyze 1

#########################
# NOW APPLY LOADING SEQUENCE AND ANALYZE (plastic)

# rezero time
setTime 0.0

wipeAnalysis

set GM "Series -dt 0.02 -filePath acelerograma.txt -factor $accMul"
pattern UniformExcitation 1 1 -accel $GM

# create the Analysis
constraints Transformation;
test NormDispIncr 1.0e-4 25 0
algorithm Newton
numberer RCM
system ProfileSPD
rayleigh $massProportionalDamping 0.0 $stiffnessProportionalDamping 0.
integrator Newmark $gamma [expr pow($gamma+0.5, 2)/4]
analysis VariableTransient
herbalbesng
Posts: 1
Joined: Mon Apr 25, 2011 8:11 pm

Re: Two soil layers with different meshes.

Post by herbalbesng »

I accept with information: set nx1 2
set ny1 2
set e1 1

block2D $nx1 $ny1 1 $e1 $Quad $eleArgs {
1 0 0
2 1 0
3 1 1
4 0 1
}

set nx2 2
set ny2 2
set e2 [expr $nx1*$ny1+1]

block2D $nx2 $ny2 2 $e2 $Quad $eleArgs {
2 1 0
5 2 0
fmk
Site Admin
Posts: 5884
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Two soil layers with different meshes.

Post by fmk »

te block command will create nodes and add them to the domain .. if these are duplicates you will have a problem . you can use 2 block commands with different nodes to tie them together with the equaDOF command .. or else create the nodes and elements in Tcl loops.
mahi0862
Posts: 1
Joined: Thu Aug 11, 2011 2:38 am

Re: Two soil layers with different meshes.

Post by mahi0862 »

I have another question for the same example (Example 10 of the Geotechnical Simulation Capabilities). Why by making a simple change of the example by creating a mesh with nx=2 ny=2 the convergence of the problem is not verified and increasing the number of iterations does not resolve the problem?
hour0862
Posts: 2
Joined: Sun Aug 14, 2011 1:25 am

Re: Two soil layers with different meshes.

Post by hour0862 »

I have to go through all the intermediate stages. Making two blocks side by side occur exactly the same, OpenSees only runs with tolerances of 1e-4 which, as you said, is a very high tolerance. I double check the problem and it seems right.
Locked