Two soil layers with different meshes.
Moderator: Moderators
-
- Posts: 22
- Joined: Mon Oct 12, 2009 9:23 am
- Location: Universidade Nova de Lisboa
Two soil layers with different meshes.
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
}
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
}
-
- Posts: 22
- Joined: Mon Oct 12, 2009 9:23 am
- Location: Universidade Nova de Lisboa
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]
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
}
[/code]
-
- Posts: 22
- Joined: Mon Oct 12, 2009 9:23 am
- Location: Universidade Nova de Lisboa
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?
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?
-
- Posts: 22
- Joined: Mon Oct 12, 2009 9:23 am
- Location: Universidade Nova de Lisboa
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
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
-
- Posts: 22
- Joined: Mon Oct 12, 2009 9:23 am
- Location: Universidade Nova de Lisboa
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.
-
- Posts: 22
- Joined: Mon Oct 12, 2009 9:23 am
- Location: Universidade Nova de Lisboa
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
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
-
- Posts: 1
- Joined: Mon Apr 25, 2011 8:11 pm
Re: Two soil layers with different meshes.
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
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
Re: Two soil layers with different meshes.
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.
Re: Two soil layers with different meshes.
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?
Re: Two soil layers with different meshes.
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.