-
-
December 19, 2019 at 12:54 pm
HollyFart
SubscriberHello,
I'm trying to implement a moving pressure load with a circle shaped area, which is moving along the Y direction via do loop.
The pressure value is uniform and located within a circle shaped area.
The moving direction is the Y axis. It should start at the global CS (0,0,0) and heads towards the positive Y axis.
The load isn't moving, I don't have a clue why.
The script is posted below due to size restrictions in the post.
Best regards,
HF
-
December 19, 2019 at 1:40 pm
peteroznewman
SubscriberANSYS staff are not permitted to open attachments.
Â
total_time = 10 ! Total simulation time in seconds
time_steps = 100 ! Total amount of steps
time_inc = total_time/time_steps ! Time increment in seconds
V_p = 0.01 ! m/s Load velocity
Radius = 0.005 ! m Radius of the load area
PV = 1E07 ! Pa Load value
nsub,time_steps
*do,I,1,time_steps,1
time=I*time_inc
Y_Local=V_p*time
wpcs,-1,0 ! WP @ GLOBAL ORIGIN
wpof,,Y_Local ! OFFSET WP ALONG ITS Y AXIS (i.e. provide current position of center of circle along Y axis)
cswp,11,1 ! DEFINE Cylindrical COORDINATE SYSTEM @ WP ORIGIN
esel,s,ename,,154 ! Select SURF154 elements
sfed,all,,pres ! Delete old pressures if any
nsle ! Select nodes attached to selected SURF elements
nsel,r,loc,x,Radius ! Select nodes within radius of circle, 0.005m
csys,0 ! Set CSYS back to global
esln,r ! Select SURF elements attached to the nodes within the circle
sfe,all,,pres,,PV ! Apply pressure based on your calculation at the said time.
allsel,all
outres,all,all
*if,I,EQ,1,THEN
/prep7 ! Enter into /prep7 as ET and ESURF are valid only in /PREP7
et,100,154 ! Create a new element type for SURF154
cmsel,s,surface1 ! Select nodes on a face via Face named selection
type,100 ! Set the element type as 100
esurf ! Create surface effect elements on the selected nodes
allsel,all ! Select everything back
/solu
time=I*time_inc
Y_Local=V_p*time
wpcs,-1,0 ! WP @ GLOBAL ORIGIN
wpof,,Y_Local ! OFFSET WP ALONG ITS Y AXIS (i.e. provide current position of center of circle along Y axis)
cswp,11,1 ! DEFINE Cylindrical COORDINATE SYSTEM @ WP ORIGIN
esel,s,ename,,154 ! Select SURF154 elements
sfed,all,,pres ! Delete old pressures if any
nsle ! Select nodes attached to selected SURF elements
nsel,r,loc,x,Radius ! Select nodes within radius of circle, 0.005m
csys,0 ! Set CSYS back to global
esln,r ! Select SURF elements attached to the nodes within the circle
sfe,all,,pres,,PV ! Apply pressure based on your calculation at the said time.
allsel,all
outres,all,all
*else
time=I*time_inc
Y_Local=V_p*time
wpcs,-1,0 ! WP @ GLOBAL ORIGIN
wpof,,Y_Local ! OFFSET WP ALONG ITS Y AXIS (i.e. provide current position of center of circle along Y axis)
cswp,11,1 ! DEFINE Cylindrical COORDINATE SYSTEM @ WP ORIGIN
esel,s,ename,,154 ! Select SURF154 elements
sfed,all,,pres ! Delete old pressures if any
nsle ! Select nodes attached to selected SURF elements
nsel,r,loc,x,Radius ! Select nodes within radius of circle, 0.005m
csys,0 ! Set CSYS back to global
esln,r ! Select SURF elements attached to the nodes within the circle
sfe,all,,pres,,PV ! Apply pressure based on your calculation at the said time.
allsel,all
outres,all,all
*endif
*enddo -
December 19, 2019 at 1:42 pm
-
December 28, 2019 at 5:04 pm
-
December 28, 2019 at 5:08 pm
HollyFart
SubscriberAnd the used script:
total_time = 10 ! Total simulation time in seconds
time_steps = 100 ! Total amount of steps
time_inc = total_time/time_steps ! Time increment in seconds
V_p = 0.01 ! m/s Load velocity
Radius = 0.005 ! m Radius of the load area
PV = 1E07 ! Pa Load value
nsub,time_steps
*do,I,1,time_steps,1
time=I*time_inc
Y_Local=V_p*time
wpcs,-1,0 ! WP @ GLOBAL ORIGIN
wpof,,Y_Local ! OFFSET WP ALONG ITS Y AXIS (i.e. provide current position of center of circle along Y axis)
cswp,11,1 ! DEFINE Cylindrical COORDINATE SYSTEM @ WP ORIGIN
esel,s,ename,,154 ! Select SURF154 elements
sfed,all,,pres ! Delete old pressures if any
nsle ! Select nodes attached to selected SURF elements
nsel,r,loc,x,Radius ! Select nodes within radius of circle, 0.005m
csys,0 ! Set CSYS back to global
esln,r ! Select SURF elements attached to the nodes within the circle
sfe,all,,pres,,PV ! Apply pressure based on your calculation at the said time.
allsel,all
outres,all,all
*if,I,EQ,1,THEN
/prep7 ! Enter into /prep7 as ET and ESURF are valid only in /PREP7
et,100,154 ! Create a new element type for SURF154
cmsel,s,surface1 ! Select nodes on a face via Face named selection
type,100 ! Set the element type as 100
esurf ! Create surface effect elements on the selected nodes
allsel,all ! Select everything back
/solu
time=I*time_inc
Y_Local=V_p*time
wpcs,-1,0 ! WP @ GLOBAL ORIGIN
wpof,,Y_Local ! OFFSET WP ALONG ITS Y AXIS (i.e. provide current position of center of circle along Y axis)
cswp,11,1 ! DEFINE Cylindrical COORDINATE SYSTEM @ WP ORIGIN
esel,s,ename,,154 ! Select SURF154 elements
sfed,all,,pres ! Delete old pressures if any
nsle ! Select nodes attached to selected SURF elements
nsel,r,loc,x,Radius ! Select nodes within radius of circle, 0.005m
csys,0 ! Set CSYS back to global
esln,r ! Select SURF elements attached to the nodes within the circle
sfe,all,,pres,,PV ! Apply pressure based on your calculation at the said time.
allsel,all
outres,all,all
*else
time=I*time_inc
Y_Local=V_p*time
wpcs,-1,0 ! WP @ GLOBAL ORIGIN
wpof,,Y_Local ! OFFSET WP ALONG ITS Y AXIS (i.e. provide current position of center of circle along Y axis)
cswp,11,1 ! DEFINE Cylindrical COORDINATE SYSTEM @ WP ORIGIN
esel,s,ename,,154 ! Select SURF154 elements
sfed,all,,pres ! Delete old pressures if any
nsle ! Select nodes attached to selected SURF elements
nsel,r,loc,x,Radius ! Select nodes within radius of circle, 0.005m
csys,0 ! Set CSYS back to global
esln,r ! Select SURF elements attached to the nodes within the circle
sfe,all,,pres,,PV ! Apply pressure based on your calculation at the said time.
allsel,all
outres,all,all
*endif
*enddo
-
Viewing 4 reply threads
- The topic ‘Do loop for moving pressure load’ is closed to new replies.
Innovation Space
Trending discussions
- The legend values are not changing.
- LPBF Simulation of dissimilar materials in ANSYS mechanical (Thermal Transient)
- Convergence error in modal analysis
- APDL, memory, solid
- How to model a bimodular material in Mechanical
- Meaning of the error
- Simulate a fan on the end of shaft
- Real Life Example of a non-symmetric eigenvalue problem
- Nonlinear load cases combinations
- How can the results of Pressures and Motions for all elements be obtained?
Top Contributors
-
4107
-
1487
-
1318
-
1156
-
1021
Top Rated Tags
© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.