Documente Academic
Documente Profesional
Documente Cultură
(844) 825-5971
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
(https://www.simutechgroup.com)
HOME
BLOG
Home (/)
(/)
SOFTWARE
CONSULTING
TESTING
(HTTP://BLOG.SIMUTECHGROUP.COM/)
Support
INDUSTRY
CONTACT US
SUPPORT
(/OFFICES/)
TRAINING
ABOUT US
FEA
1 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
A hollow open-top tank was created in DesignModeler. Void interior space was filled with a second body representing air. The tank was
assigned Structural Steel material, while the void interior was assigned the density and adiabatic bulk modulus of air, plus a zero
Poissons ratio. Including air in the model aids calculation of the tank displacement volume.
The hydrostatic pressure is applied in an APDL Commands Object inserted at the Environment level of the Workbench Mechanical
Outline. Vertex constraints prevent rigid body drifting in X and Z, and yaw rotation about Y. Vertical movement in this model is in the
global Y direction, with the liquid surface at Y=0.
When meshing, element faces on exterior surfaces should be to be small enough to trace small changes in the position of the liquid
surface. A coarser surface reduces final position accuracy.
More sophisticated modeling of complex floating objects could be considered by a rigid body approach within the CFD code CFX, or via
fluid-structure interaction modeling with CFX and ANSYS working together in the Workbench interface. The present example seeks an
equilibrium position using Workbench Mechanical alone, and does not consider liquid movements or the possibility of flooding interior
spaces in a complex body.
fini
/solu
ANTYPE,0
! static analysis
nlgeom,off
! small displacement
acel,0,0,0
! no inertial load
allsel
! select full model
sfedele,all,all,all
! load removals
sfdele,all,all
fdele,all,all
bfedele,all,all
bfdele,all,all
!
esel,u,ename,,169,178
! contact elements not wanted
#####
d,all,all
! constrain all dof
irlf,-1
! inertial relief ==> mass estimate
solve
! solve (quickly as possible?)
!
*get,my_mass,elem,,mtot,y
! get the mass active in Y
*get,cenx,elem,,mc,x
! centroid X
*get,ceny,elem,,mc,y
! centroid Y
*get,cenz,elem,,mc,z
! centroid Z
fini
!
! Discover volume of elements of this model
/post1
allsel
set,last
esel,u,ename,,169,178
! Important: Unselect contact elements #####
etable,evol,volu
! volume of (remaining) elements
ssum
/com, .
/com, ####### SSUM RESULT ######
/com, .
*get,vol_of_elements,ssum,,ITEM,evol ! volume of all elements
2 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
The above commands establish the mass of the structure, the centroid coordinates, and the displacement volume of the structure,
including the body assigned air material properties. If the total volume is fully submerged, the calculated displacement volume produces
a vertical force equal to the weight of displaced liquid. The purpose of the displacement volume is to calculate a reasonable mass
damping value for the transient analysis.
The air material is very soft, so it does not significantly stiffen the structure. There are alternatives:
1.
Convert air elements to MESH200 after assessment of displacement volume, with no need for contact pairs.
liquid_weight_density=1000*9.8
! Weight density of water for buoyancy <======
!
cube_root_vol=vol_of_elements**(1/3) ! characteristic linear dimension
!
! Characterstic stiffness of "bobbing" on the liquid surface
!
char_stiff=liquid_weight_density*vol_of_elements/cube_root_vol
!
! Characteristic time for one "bobbing" cycle if no damping
! period = 2*pi*sqrt(mass/stiffness)
!
time_period=2*3.14159*sqrt(my_mass/char_stiff)
! one "bobbing" cycle time
! Try 0.7*critical damping
! - Scale ALPHAD argument so that when multiplied by the mass matrix, we get a damping
! matrix that produces approximately 0.7*critical damping behavior.
!
my_alphad=0.7*(2*sqrt(my_mass*char_stiff))/my_mass ! Want C_matrix=alphad*M_matrix
!
ALPHAD,my_alphad
! want transient damping a bit below critical
!
TINTP,0.02
! numerical damping; try to suppress "ringing" in structure
nstep=60
! number of loadsteps (15 per undamped cycle in this test)
finaltime=time_period*4
! 4 "bobbing" cycles (if not damped), characteristic dimensions
!
deltime=finaltime/nstep
! delta T for the time steps below
!
Because square and cube roots are taken, modest errors in displacement volume and mass have little effect on the damping coefficient.
Taking 4 time periods of oscillation lets the bobbing movement damp out.
Hydrostatic Pressure Load Update and Time Integration
In ANSYS, a Table Array can be formed to apply pressure to nodes as a function of depth. In this example, vertical is taken as the
global Y value, with Y=0 taken as the position of the liquid surface:
*dim,mypress,table,3,1,,Y
3 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
mypress(1,0)=-100000,0,1
! Depth positions in Y
mypress(1,1)=liquid_weight_density*100000,0,0 ! Pressure in TABLE ARRAY
! Using liquid weight density entered earlier
In this example, the above table array spans depths of up to 100000 meters, with the liquid surface at Y=0.
A numerical array is needed to store the original Y locations of exterior surface nodes in the mesh. Column 1 of the array is filled with the
original Y locations. Column 2 will be filled with the UY values of the nodes at the end of each load step. Column 3 will be filled with the
sum of (Column 1) Y and (Column 2) UY at the end of each load step.
*get,maxnode,node,,num,max
*dim,mynode_y,array,maxnode,3 ! column 1 is original node Y
! column 2 will be node UY
! column 3 will be Y+UY for node
An array is needed to hold the pressure at each exterior surface node as a function of the depth values found in the above array:
*dim,mynode_press,array,maxnode
Vector operations are used to look up the pressures as a function of current node location, fill an array with these pressures, and apply
them to surface nodes. This is done at the end of each load step, and these pressures are used during the next time transient load step.
Note that the value of (Y+UY) is used to look up the hydrostatic pressure:
Time integration is performed by executing a series of SOLVE commands inside a loop. After each SOLVE, the hydrostatic pressures are
changed to reflect the new surface node positions, with zero values employed above Y=0.
Time steps have to be small enough to maintain accuracy. The pressure profile is out of date at the end of a time step, so for accuracy,
steps should not be too large. In the absence of any damping, the bobbing oscillations of the body will diverge when using this simplified
time integration approach. Since the objective here is only to find a static equilibrium position, time steps can be reasonably large if
adequate damping is included. This example uses 15 time steps per undamped bobbing oscillation.
The second body Void (Air) is the empty space inside the tank, which has been filled by a body using DesignModeler. Material for this
body has been set to Void Space, a material that was set to the bulk modulus and density of air, and a zero Poissons ratio. This
Poissons ratio results in a shear modulus that is non-physical, but the values are so small that they will have no effect on most
structuresif the stiffness was thought to be affecting the structure, a smaller bulk modulus could be entered, or Poissons Ratio could
approach 0.5, or alternative methods for capturing the displacement volume of the empty voids in the model could be considered. The
reason for including this Void (Air) body is to calculate the fluid Displacement Volume of the entire structure elements for calculation of a
damping coefficient for the ALPHAD command. The Void Space can be observed in this image:
4 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
The following image shows properties of the Void Space material for air under adiabatic compression.
NOTE: An alternative is to make Poissons Ratio approach 0.5, for example 0.47, reducing Youngs Modulus and Shear Modulus to small
values for the given Bulk Modulus. If Youngs Modulus and Shear Modulus become too small, gravity load can cause severe distortion, so
Poissons Ratio for the air should not be set too close to 0.5.
In this example there is one contact pair, connecting Void Space to the structure. It has been set to Bonded, Asymmetric, Pure Penalty,
a small Stiffness Factor, and a manual Pinball Radius. The Contact Body is air:
Users could consider a Multibody Part connecting the Void Space to the structure, and avoiding contact pairs, if the mesh consequences
5 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
are satisfactory.
Wetted Surface
A Named Selection is used to indicate the External Hull for the purpose of this buoyancy floating analysis. It is set to all of the exterior
faces of the model, including the external face of the Void Space material. If pressurized, the soft air material would severely distort,
causing the solver to fail, warning the user if the solution produced a configuration in which the interior space could flood. This is not a
guarantee that a real structure would not flood, but may catch some situations in which the structure could flood and potentially sink.
In the above image, note that all 8 external faces have been included in the Named Selection External_Hull including the exterior face of
the air material in the void region. When the Commands Object that updates hydrostatic pressure is running, this Named Selection is
assigned to a node component n_external:
cmsel,s,External_Hull
cm,n_external,node
This node component is selected when pressures are applied, so only user-chosen exterior surfaces are wetted. A mask is set to refer
to exterior surface nodes:
*del,mymask,,nopr
*dim,mymask,array,maxnode
cmsel,s,n_external
! Nodes on model exterior
*vget,mymask(1),NODE,1,NSEL
! Fill masking array
Current Y-coordinate positions are calculated for these exterior nodes at each load step:
*vmask,mymask(1)
*vget,mynode_y(1,2),NODE,1,U,Y ! UY values of nodes on exterior
*vmask,mymask(1)
! Fill column 3 with updated Y+UY locations of nodes
*VOPER,mynode_y(1,3),mynode_y(1,1),ADD,mynode_y(1,2)
allsel
As mentioned, pressures are calculated for the current node Y positions in the third column of the mynode_y array:
*vfill,mynode_press(1),ramp,0,0 ! Zero array content
*vmask,mymask(1)
! Mask for surface nodes only
*vitrp,mynode_press(1),mypress(1,1),mynode_y(1,3) ! pressure at current Y+UY
SFFUN,PRES,mynode_press(1)
! Pressures at nodes per Y value
sf,all,pres,1.0e-14
! Added to above pressure as fn of current Y values
The Transient Environment
The APDL Commands Object entered in this example first performs a static analysis with loads removed and degrees of freedom
constrained, in order to find the displacement volume and mass, in order to set a damping coefficient for the ALPHAD command. It then
executes a multiple load step transient analysis, in which the hydrostatic pressure load on the exterior nodes is updated at each load step
according the depth below the liquid surface in the Y direction.
Gravity load is indicated by the user in a Standard Earth Gravity object. Note the Y (negative) direction.
Enough displacement constraints are entered to prevent free translation in the X and Z directions, and free rotation (yaw) about the Y
axis. These are not a necessity, but can make results review easier if the structure does not drift freely. The constrained vertices should
be chosen so free rotation (pitch and roll) about X and Z can take place, free movement in the Y direction results, and the structure can
undergo unrestrained thermal expansion or other distortions. A total of 3 degree-of-freedom constraints will be sufficient. In this example,
there are two vertex displacements in the Z direction, and one in the X direction. Although a remote displacement scoped to a face,
edges, or a choice of vertices could accomplish this constraint, the use of a remote displacement creates extra elements, a pilot node,
and can greatly increase the wavefront of a model, causing a longer solution time. Working with 3 constraints on vertices will generally be
preferred. In some models, a remote point might be intentionally used to measure structure rotation at equilibrium.
If the liquid surface is to be located at global Y=0, then the geometry needs to be in an initial position in which the open air void faces
are not below the liquid surface. In addition, the structure should not be located in a starting location so far above the liquid surface that
the structure drops below the surface and floods the open air void faces. An ideal starting location is near the equilibrium position. With
complex geometries, the structure may undergo substantial pitch and roll while approaching equilibrium. Yaw may be zero if rotation about
the vertical Y axis is prevented by displacement constraints, but pitch and roll should not be prevented by constraints.
6 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
The APDL Commands Object used in this example is listed in the Appendix
at the end of this document.
Analysis Settings for the Transient Environment
The details for Analysis
Settings are relatively
simple. Real control of the
solution of the model will
be exercised by the APDL
commands in the APDL
Commands Object that is
inserted in the Transient
Environment.
The Number of Steps
can be left as is, since the
Commands Object will
control time stepping. Note
that Time Integration is
On.
Weak springs should Off
in case there are large
movements.
Large Deflection is On
since the model moves a
significant distance in
comparison to its
dimensions, and may
rotate significantly.
Nonlinear Controls might
be left as-is, or be
tweaked by a user.
Output Controls should
be considered, since the
structural transient can
generate a substantial
amount of results data
over a large number of
substeps. (GBytes of data
can easily result.)
Solver Units can be set
to the units employed in
the APDL Commands
Object for the setting of
the parameter
liquid_weight_density. Users may find that this is most easily done in SI units, because of the peculiarities that result in other systems of
units, such as Newtons per cubic millimetre. Note that Weight Density is Mass Density multiplied by acceleration due to gravity.
Users should ensure that the solution is performed in the units assumed in the APDL Commands Object. Solver Units can help to ensure
that this is done.
The Mesh
Mesh density must satisfy a number of criteria. It needs to be fine enough to give an accurate structural solution. A coarser mesh may
return adequate structure displacement values, but high accuracy stresses will require a finer mesh, particularly in regions of interest.
Mesh density on the exterior will affect the accuracy of the final position when floating in a liquid. Interested users could perform a
sensitivity analysis on the effect of modified external face mesh density.
In the image below, the Void Space material is colored orange. A viewing setting like this helps to identify the regions in the model that
model empty space, but are considered to be interior spaces that affect displacement volume. The empty interior of the hull of a ship
would be typical of this Void Space.
7 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
Users should be careful to set the soft Void Space material as the Contact in a bonded contact pair, and to set it to asymmetric
contact. The Void Space can be meshed with low-order elements and a relatively coarse mesh, to reduce model size and solution time.
Results
Vertical movement by the structure can be observed in a plot of Y-displacement Max and Min values versus time:
Note that the bobbing motion of the floating object has settled down by the end of the transient.
A postprocessing APDL Commands Object can be used to plot the final pressure profile on the model, for example:
8 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
eplo
! Plot of elements
!
/view,1,1,1,1
! Isometric view
/psf,pres,norm,3 ! Show Normal Pressure Contours
nplo
! Plot of nodes
eplo
! Plot of elements
/view,1,0,0,1
! End View
nplo
! Plot of nodes
eplo
! Plot of elements
This is a plot of the pressure profile for the final near-equilibrium position of the mesh. Note that black and white colors have been
reversedthis color reversal can be done by additional APDL commands. The pressure at the top of the object can be observed to be
virtually zero. Note that the value is not exactly zero because the node pressures assigned by the SFFUN command must be followed by
an SF command with a very small non-zero value.
Summary
Using ANSYS Workbench Mechanical to simulate buoyancy loads on a floating body has been illustrated. In the approach presented, a
hydrostatic pressure load is applied to a Named Selection of exterior nodes that are located below a liquid surface. A transient structural
simulation is run by looping through many load step solves, with the surface pressure load recalculated for each load step. The load steps
must be short with respect to the bobbing frequency of the floating object at the liquid surface. Artificial damping is employed via the
ALPHAD command of ANSYS, using a damping coefficient that is about 70% of critical damping for the body bobbing on the liquid
surface. User inputs are limited to the liquid weight density, and placing the initial position of the body. The simulation damps body
movements, determining an equilibrium position and orientation for the floating body.
9 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
Convergence on the nonlinear deformations of a flexible structure will automatically be considered by the large displacement setting
employed in the analysis, however the changing displacement volume is not considered in the damping calculation, so damping may
diverge from near-critical in extreme cases. Accuracy may require a larger number of substeps. Full load is instantaneously applied with
the KBC,1 command, not ramped up, so smaller time steps may be desired with nonlinear body buckling deformations. The analysis could
be considered quasi-static, and enough structural damping should be used to prevent ringing vibrations of the body during the
simulation. In the present example, the TINTP command is used to try to reduce vibration of the structure during the transient.
The present example considers the vertical bobbing up and down of a floating model. Such an object could also pitch, yaw and roll on the
liquid surface. The length of the transient simulation when rotation of the structure is significant may need to be considered. The ALPHAD
damping value was chosen to suppress vertical bobbing of the floating body. A transient will need to run long enough to damp out any
rotational motions, too. Lower settings of the damping value with a longer transient might be considered if a rolling motion is expected to
re-orient the body.
The position and orientation solution for a complex floating body may be path dependent, and may depend on initial conditions of location,
orientation and velocity. The approach presented here uses a large damping value in an attempt to find an equilibrium position. Neutral
stability, and the degree of stability in the final orientation are not consideredthe applied damping simply stops motions. Users may want
to do further simulations after the initial stable floating position is established, and see whether small perturbations will cause body rolling
when ALPHAD damping is reduced to much smaller values. The UPCOORD command might make the at rest floating position become the
initial condition for a separate analysis of stability.
Appendix Input File for Hydrostatic Pressure and Simulation Control
Here is the APDL Commands Object that applies a pressure profile, sets a liquid weight density value, finds mass plus a value for the
floating stiffness of the bobbing motion of the floating body, sets an ALPHAD damping coefficient, and approximates how long to run
the simulation to approach an equilibrium position. It then performs the transient simulation through a series of short time steps, updating
the pressure profile at each time step according to depth of the surface nodes during time steps of the analysis.
Note that a user must update the liquid weight density setting in the code below according to the liquid, and may want to adjust other
settings according the particular model that is being considered. Correct use of units must be observed in setting liquid weight density.
In addition, mass density of materials must exist in all material properties of the model to be analyzed. Gravity loading comes from the
Workbench Mechanical model.
! Commands inserted into this file will be executed just prior to the Ansys SOLVE command.
! These commands may supersede command settings set by Workbench.
! Active UNIT system in Workbench when this object was created: Metric (m, kg, N, s, V, A)
! ##################################################
! Hydrostatic Pressure on a Floating Structure in a Liquid
!
! This example uses Void bodies (density and bulk modulus of air) to include interior spaces.
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
NOTE: It is assumed that "ringing" frequencies of the structure are much higher than the
frequency of "bobbing" of the floating structure on the liquid surface.
If this is not the case, then much longer transients may need to be studied, with
much lower damping settings used in the ALPHAD and TINTP commands below.
Warning: This demonstration input file has had only limited testing.
Use at your own risk.
10 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
!
fini
save,temporary_db_here__,db,,model
*del,all
! delete parameters
*del,all,_PRM
*del,,PRM_
!
!
!
USER MUST DEFINE LIQUID WEIGHT DENSITY HERE <<<<<<<<<<<<<<<<<<<<<<<
!
USER MUST DEFINE LIQUID WEIGHT DENSITY HERE <<<<<<<<<<<<<<<<<<<<<<<
!
liquid_weight_density=1000*9.8 ! Weight density of water for buoyancy <========
! Newtons per Cubic Meter
<========
! Use correct units!
<========
!
!
!
!
! Discover the mass of the model and a characteristic "bobbing" stiffness
!
fini
/solu
ANTYPE,0
! static analysis
nlgeom,off
! small displacement
acel,0,0,0
! no inertial load
allsel
! select full model
sfedele,all,all,all
! load removals
sfdele,all,all
fdele,all,all
bfedele,all,all
bfdele,all,all
!
esel,u,ename,,169,178
! contact elements not wanted #####
d,all,all
! constrain all dof
irlf,-1
! inertial relief ==> mass estimate
solve
! solve (quickly as possible?)
!
*get,my_mass,elem,,mtot,y
! get the mass active in Y
*get,cenx,elem,,mc,x
! centroid X
*get,ceny,elem,,mc,y
! centroid Y
*get,cenz,elem,,mc,z
! centroid Z
fini
!
! Discover volume of elements of this model
!
/post1
allsel
set,last
esel,u,ename,,169,178
! Important: Unselect contact elements #####
etable,evol,volu
! volume of (remaining) elements
! pretab,evol
ssum
/com, .
/com, ####### SSUM RESULT ######
/com, .
*get,vol_of_elements,ssum,,ITEM,evol ! volume of all elements
/com, .
cube_root_vol=vol_of_elements**(1/3) ! characteristic linear dimension
!
! Characterstic stiffness of "bobbing" on the liquid surface
!
char_stiff=liquid_weight_density*vol_of_elements/cube_root_vol
!
! Characteristic time for one "bobbing" cycle if no damping
! period = 2*pi*sqrt(mass/stiffness)
!
time_period=2*3.14159*sqrt(my_mass/char_stiff) ! one "bobbing" cycle time
!
fini
!
parsav,scalar,my_temporary_parameters,txt
resume,temporary_db_here__,db
parres,change,my_temporary_parameters,txt
!
/delete,my_temporary_parameters,txt
! clean up
/delete,temporary_db_here__,db
/delete,my_temporary_parameters,txt
!
11 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
allsel
! select full model
cmsel,s,External_Hull
! select external hull nodes
cm,n_external,node
! remember external nodes as component "n_external"
allsel
!
!
!
*del,mypress,,nopr
*dim,mypress,table,3,1,,Y
! Table Array, pressure as fn of Y
!
*get,maxnode,node,,num,max
*del,mynode_press,,nopr
! array to hold pressure at each surface node
*del,mynode_y,,nopr
! array to hold current node Y value
*dim,mynode_press,array,maxnode
*dim,mynode_y,array,maxnode,3 ! column 1 is original node Y
! column 2 will be node UY
! column 3 will be Y+UY for node
*del,mymask,,nopr
*dim,mymask,array,maxnode
cmsel,s,n_external
! Nodes on model exterior
*vget,mymask(1),NODE,1,NSEL
! Fill masking array
*vget,mynode_y(1,1),node,1,loc,Y ! Fill column 1 with node Y location
*vget,mynode_y(1,3),node,1,loc,Y ! Fill column 3 with node Y location
!
allsel
!
mypress(1,0)=-10000,0,1
! Depth positions in Y
mypress(1,1)=liquid_weight_density*10000,0,0 ! Pressure in TABLE ARRAY
! Using liquid density
!
! Loop through time steps (load steps) in transient analysis:
!
fini
!
/SOLU
!
ANTYPE,4
! time transient analysis
TRNOPT,FULL
LUMPM,ON
! Lumped mass matrix for... speed?
!
NLGEOM,1
NSUBST,1,0,0
! 1 substeps in each load step
AUTOTS,0
!
!
Gravity from Workbench Mechanical Environment <<<<<<<<<<<<<<<<<<<<<
!
kbc,1
! Do NOT ramp up loading, rely on damping below.
! Ramping exaggerates oscillation divergence.
! Ramp loading only if significant structure deformation.
! Want damping, ideally related to mass, displacement
! volume, and liquid density.
! Want ~ 0.7* critical damping for "bobbing" movement.
! Recall 1 DOF System critical damping = 2*sqrt(m*k).
! Using ALPHAD setting for mass damping.
!
! Try 0.7*critical damping
! - Scale ALPHAD argument so that when multiplied by the mass matrix, we get a damping
! matrix that produces approximately 0.7*critical damping behavior.
!
my_alphad=0.7*(2*sqrt(my_mass*char_stiff))/my_mass ! Want C_matrix=alphad*M_matrix
!
ALPHAD,my_alphad
! want transient damping a bit below critical
!
TINTP,0.02
! numerical damping; try to suppress "ringing" in structure
nstep=60
! number of loadsteps (15 per undamped cycle in this test)
finaltime=time_period*4
! 4 "bobbing" cycles (if not damped), characteristic dimensions
!
deltime=finaltime/nstep
! delta T for the time steps below
!
allsel
!
!
!
!
! Transient solves inside the following loop
!
*do,ii,1,nstep
TIME,ii*deltime
12 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
!
cmsel,s,n_external
! Nodes on model exterior
!
*vfill,mynode_press(1),ramp,0,0 ! Zero array content
*vmask,mymask(1)
! Mask for surface nodes only
*vitrp,mynode_press(1),mypress(1,1),mynode_y(1,3) ! pressure at current Y+UY
SFFUN,PRES,mynode_press(1)
! Pressures at nodes per Y value
sf,all,pres,1.0e-14
! Added to above pressure as fn of current Y values
allsel
!
*if,ii,lt,nstep,then
!
SOLVE
! take one load step in time
!
! Update mynode_y second column values (UY values)
*vmask,mymask(1)
*vget,mynode_y(1,2),NODE,1,U,Y ! UY values of nodes on exterior
*vmask,mymask(1)
! Fill column 3 with updated Y+UY locations of nodes
*VOPER,mynode_y(1,3),mynode_y(1,1),ADD,mynode_y(1,2)
allsel
*endif
*enddo
! Return control for final SOLVE in ANSYS, which follows this line
The body should be observed to be at rest by the end of the simulation, otherwise a longer transient should be simulated by increasing the
value of the parameter finaltime in the above code.
13 din 14
4/26/2016 1:11 PM
https://www.simutechgroup.com/FEA/fea-tips-tricks-macros-buoyance-flo...
14 din 14
4/26/2016 1:11 PM