Quantcast
Channel: PLAXIS - Knowledge Base - Tips and Tricks
Viewing all 25 articles
Browse latest View live

How to select more than 10 nodes to be used for a curve

$
0
0
Application:

In order to generate curves to show e.g. displacements in time, we should select a node for which we want to show this displacement data, or stress points to show stress related data. The Plaxis applications currently allow you to select up to 10 nodes and 10 stress points prior to calculation for which the data for all intermediate steps is stored.
For nodes and stress points selected after the calculation (post-calc), the data will be retrieved from the stored result files. By default, a phase will have the Max number of steps stored set to 1, so only the last step for this phase is remembered, hence only the result for this step will be shown for the selected post-calc node. For more detailed curves, it is needed to increase this Max number of steps stored to have more intermediate data points in a phase for the curve. If the Max number of steps stored is equal to the Max steps value then all steps will be available to be used for a curve.
For more details, see the related article on Selecting points for curves.

Note, having a lot of results steps saved will also increase the disk space needed.

For some applications, like dynamic earthquake analyses, the number of steps is usually huge, and so a lot of data will need to be stored if you want to define graphs with more than 10 nodes. However, with the use of a special file, it is possible to tell PLAXIS 2D it needs to store the nodal history for more than 10 nodes. Note: this is not available for stress points.

History file: data.hi2.rsa

This special file for these (additional) pre-calc selected nodes is an ASCII file (text file) named data.hi2.rsa and it needs to be present in the Plaxis data folder.

The structure of this file is as follows:

  • The first line contains the desired number of nodes (followed by at least one space)
  • Then on each next line, the first number must refer to the node NUMBER from the mesh, followed by at least one space. Note: any character after this space can be added as a comment and will be ignored by the calculation.
  • Using this trick, the Plaxis calculation can store the history of up to 100 nodes.

Example content to store data for 4 nodes (nodes 1492, 1829, 2045 and 2229)

4 #number of nodes
1492
1829
2045
2229

An easy way to create this file:

  • Select the nodes you want to follow as pre-calc nodes in the normal way
  • Now save the Plaxis 2D project file
  • In the *.p2dxdat folder, locate the file data.his
  • Make a copy of this file, and rename the copy to: data.hi2.rsa
  • Open this file with a text editor (e.g. Notepad) and add a line at the start, and write 10 in this line (this is the number of nodes), since Plaxis always writes 10 nodes in this data.his-file. This value should be changed when changing the number of nodes.
  • Save it
  • Now open the Plaxis project file in PLAXIS 2D, and run the calculation.

This data.hi2.rsa file can be altered to include a different amount of nodes:

  • make sure to change the number of selected nodes on the first line
  • then every next line should contain a node number. This node number can be retrieved in the Output program e.g. from the table when viewing the mesh.

After the calculation, you will find per phase a file called data.hx2.rr# (with # the number of the phase) in which the displacement history of the stored nodes from the data.hi2.rsa-file is saved.

Content of results file

Structure

The file data.hx2.rr# (with # the number of the phase) contains per phase the history of the nodal data for each calculation step.

In this file, the data will be written for each calculation step once a calculation step is finished.
It will write

  • two lines with general values for the current step (lines 1 and 2, see below)
  • then for each selected node from the data.hi2.rsa file one line of data with displacement values in this step: ux, uy, excess pore pressure value and optional for a dynamic calculation vx, vy, ax and ay. E.g. line 3 shows the displacement values for the first selected node number from the data.hi2.rsa file, line 4 of the second selected node, etc.
  • and finally one line with results from this step

The specific data per step also contains some legacy data (e.g. multiplier data from 2D Classic and earlier) which is not used since the PLAXIS 2D AE version, and defaults to a value.

The content structure looks like this:

1
2
3
4
.
6
7
[legacy]   [legacy]   [legacy]   time   Pmax   current_phase_step
ΣMweight    t_dyn    ΣMarea     ΣMsf   [legacy]   previous_phase_step
ux     uy     Pexcess     vx     vy     ax     ay
ux     uy     Pexcess     vx     vy     ax     ay
...
ux     uy     Pexcess     vx     vy     ax     ay
Fx     Fy     ΣMstage   [legacy]   [legacy]   CSP

Notes:

  • [legacy] defaults to either 0.0 or 1.0
  • the velocity and acceleration values (vx vy ax ay) are only added in dynamic phases
  • t_dyn is the dynamic time
  • Pmax is the phase’s maximum excess pore pressure
  • ΣMstage is not updated correctly in 2D AE and 2D 2015.00
  • current_phase_step and previous_phase_step refer to the internal step number of the phase. This internal numbering always starts at step 0 for each phase.

So if we take the input example as shown above and run the calculation, the image below could be part of the data.hx2.rr# - result of a dynamic calculation, opened in e.g. Notepad:

Figure 1. Example of part of data.hx2.rr# file containing steps 1 to 3

In this calculation we selected 4 nodes. This means that per step, we have 7 lines per step: 2 data lines, then 4 lines with node data, followed by 1 result line:

Figure 2. Example of part of data.hx2.rr# file highlighting data blocks for steps 1 to 3

For each step block in this example, lines 3-6 contain the results per node:
ux    uy    excess_pore_pressure    vx    vy    ax    ay

Figure 3. data.hx2.rr# file showing the data lines per step containing the node specific results

And these are the most important parameters in the general data lines (lines 1, 2, and the final line per step):

Figure 4. Parameters in the general data lines 1, 2, and the final line for step 2 of the phase

Results in Output program

Note that the data of this data.hx2.rr#-file does not follow a valid data format for the PLAXIS Output program. So it is not possible to use the history of these nodes in the PLAXIS Output program to visualize this in a curve. For this a third party application, like a spreadsheet program (e.g. Microsoft Excel), is needed.

Conclusion

With the mentioned trick, it is now possible to follow and store the complete displacement history of more than 10 nodes without the need to save all calculation results.


Create centerline for Structural Forces in Volumes

$
0
0
Application:

In order to view the Structural forces in volumes in Output, a centerline is required. A centerline can be created manually by selecting points in the model, by adding a centerline from the tunnel designer or by importing *.otnl, *.tnl or *.json files.

Create centerline manually in Output

In a pop-up window the points to define the centerline can be selected directly in the model. This can be done by using the cursor for the selection and/or manually add the exact coordinates of the points for the centerline. After the last point is added, OK can be clicked to view the forces.
Please note that with this method only straight lines can be created in order to define the centerline.

From tunnel designer

To be able to use the option From tunnel designer a thick lining, first, needs to be defined for the tunnel. This option can be found in the tunnel designer in Input, in the Subsections tab. By adding a thick lining a data.otnl file is directly generated by the Plaxis Input program. This *.otnl file is located in the folder of the current project and contains all information about the centerline.

Afterwards, in Output you can add the centerline following the steps below:

  1. Select Structural forces in volumes from Tools menu
  2. Click on the downward arrow in Add button
  3. Select the option From tunnel designer
  4. Click OK to view the Forces

In the case that more that one thick lining is defined, the data.otnl file is overwritten in the project folder when saving. In order to keep both files, you need to manually rename the existing data.otnl file before saving the project.
See below how to import the renamed data.otnl file in Output.

Import *.otnl or *.tnl file

A centerline can also be imported using existing *.otnl files from the current or other projects. The *.otnl files are usually located in the project folder of an existing model or stored in a local folder specified by the user.
To do so:

  1. Select Structural forces in volumes from the Tools menu
  2. Click on the downward arrow in the Add button
  3. Select Import…
  4. Open the *.otnl or *.tnl file from the location in a windows folder
  5. The centerline will be shown as a red line on your model
  6. Click OK to view the Forces

Note that a *.tnl file refers to a centerline that was created with PLAXIS 2D AE.00 version, which is currently still supported in PLAXIS 2D.

Import *.json file

JSON (JavaScript Object Notation) is a text format that can be used to generate the points of a centerline.

To create a new *.json file, a simple text file can be created. All relevant information should be added in JSON format and finally the file should be saved using the *.json file extension.

In order to define the points of a centerline, depending on the geometry drawn, a polyline can be used for straight lines and arcs for generating part of an ellipse to form the shape.

Example: polyline

A polyline requires the exact coordinates of each point to be defined.

 

[{
    "type" : "polyline",
    "points" : [
        [20.25, 11],
        [15, 16.25],
        [9.75, 11],
        [15, 5.75],
        [20.25, 11]
    ]
}]

 

 

 

Example: arc

The arc requires the following parameters to be defined:

  • type: arc
  • origin: center of the ellipse
  • radius0: radius of the ellipse in the x-axis
  • radius1: radius of the ellipse in the y-axis (currently radius1 = radius0)
  • startangle: counter-clockwise start of the ellipse (from horizontal direction)
  • stopangle: counter-clockwise end of the ellipse (from horizontal direction)
  • segments: number of generated segments of the arc (more segments will show smoother results)
[{
    "type" : "arc",
    "origin" : [15.0, 11],
    "radius0" : 5.25,
    "radius1" : 5.25,
    "startangle" : 90,
    "stopangle" : 180,
    "segments" : 10
}]

 

 

Example: NATM tunnel

[{
    "type" : "polyline",
    "points" : [
        [11, 24],
        [11, 22],
        [14, 22],
        [17, 22],
        [17, 24]
    ]},
 {
    "type": "arc",
    "origin": [14, 24],
    "radius0": 3,
    "radius1": 3,
    "startangle": 0,
    "stopangle": 180,
    "segments": 36
}]

Please keep in mind that the *.json files should be encoded with ANSI or UTF8-without BOM to be valid for PLAXIS Output.

More information about the JSON format can also be found here:

Using PLAXIS Remote scripting with the Python wrapper

$
0
0
Application:

The PLAXIS software provides a HTTP based API (REST HTTP API), for which a special Python wrapper was developed to for an easy to use scripting API. Both PLAXIS Input and PLAXIS Output support this usage of a Remote Scripting server.

Prerequisites

In order to use this

  • a PLAXIS VIP licence is required
  • a recent version of Python. This can be downloaded from http://python.org/download/ . The Python installer comes with a code editor called IDLE. Many alternatives are available, however in Plaxis documentation we will assume IDLE as the editor of choice.
  • At least a very rudimentary knowledge of the Python language is recommended. The Plaxis documentation makes no attempt to teach it. Good resources for this purpose are e.g.:
  • The firewall should not block the PLAXIS application from accessing the internet, nor must it block other applications (in particular the python.exe executable) from communicating with the remote scripting server inside the PLAXIS application.

Activate scripting server

In order to start using this Remote Scripting/REST HTTP API, the remote scripting server inside PLAXIS needs to be activated. This can be done by opening the menu item Expert > Configure remote scripting server. The corresponding window will pop up, see Figure 1:

Figure 1. Configure remote scripting server window

In order for the Remote Scripting server to run, you would need:

  1. A valid PLAXIS VIP licence;
  2. A working HTTP connection to the Plaxis Remote scripting Authorization site (i.e. a working internet connection);
  3. The local connection port needs to be configured and the server activated.


Figure 2. Run the remote scripting server requirements:
1) valid licence, 2) connection with the Remote Plaxis service website
and 3) a local connection port

Boilerplate code

In order to start your first Python script, you must make sure that your Python script can communicate with the PLAXIS application. For this, the Plaxis scripting library wrapper needs to be imported as a module and the correct port needs to be set. For a locally running PLAXIS application this can easily be achieved using the following boilerplate Python code to start your Python script with (assuming the scripting server port was set to 10000, see above):

localhostport = 10000
plaxis_path =r'C:\Program Files (x86)\Plaxis\PLAXIS 2D'#no trailing backslash!import imp
found_module = imp.find_module('plxscripting', [plaxis_path])
plxscripting = imp.load_module('plxscripting', *found_module)
from plxscripting.easy import*
s, g = new_server('localhost', localhostport)

In this, we need to set the correct localhost port using the same number as set in the Configure remote scripting server window. Next we need the location where the PLAXIS application is installed: plaxis_path. From this location we will import the plxscripting module to allow for the communication with the Plaxis application.

Now we have two new variables:

  • s: this is bound to an object representing the PLAXIS Application (the Remote scripting server).
  • g: this variable is bound to the global object of the current open Plaxis model. This should be used when you want to make changes to the model (e.g. adding a borehole or a point, generating the mesh and start the calculation).

PLAXIS Input and PLAXIS Output

Note, if you want to use both PLAXIS Input and PLAXIS Output in your Python script, you will need to setup the connection with Input and Output separately by binding the server and the global object for Input and Output separately using each their own port number:

#[...]
localhostport_input = 10000
localhostport_output = 10001
s_input, g_input = new_server('localhost', localhostport_input )
s_output, g_output = new_server('localhost', localhostport_output )

Trouble shooting

If your script gives an error, please check the following:

  • Is the PLAXIS application running?
  • Is the Remote Scripting server inside PLAXIS activated with the same port number as used in the Python script?
  • Is the firewall blocking communications with the PLAXIS application?

For more details on this Python wrapper and some code examples, please see the appendix on the Python HTTP REST API wrapper in the PLAXIS Reference manual and the related links.

 

Receive instant notifications for finished calculations on your phone

$
0
0
Application:

When running long calculations using PLAXIS, it would be great if you can receive instant notifications when this calculation is finished: either via e-mail or a (push) notification on your smartphone (e.g. iPhone or Android device). This could be very useful for calculations that run unattended for example during a meeting, during lunch break or after office hours.
With the implementation of the PLAXIS Remote Scripting / Http REST API, this is now possible: once a calculation is finished you can be notified instantly!

First step: Message composition

Any method that we will use below will first need to calculate the PLAXIS project and gather the results for a short overview of the calculation result.

First we need to have the model loaded into PLAXIS and PLAXIS needs to be run as a Remote Scripting server. The PLAXIS Remote Scripting server within PLAXIS 2D or PLAXIS 3D can be activated via the menu item Expert > Remote Scripting server. See also the related page on Using PLAXIS Remote scripting with the Python wrapper, see the link at the bottom of the page.

Next step is to use the Python wrapper/scripting to start the calculation, after which we can collect the results:

  • check for each phase if the calculation was successful or not
  • Optional, when desired we can get main characteristics for a calculation type, like the reached SumMsf value for a Safety calculation (i.e. the Factor of Safety)
  • And determine a summary for the notification

Here we can write a function that gathers the basic phase information: was it calculated, and was it calculated successful or did it fail:

defgather_phase_overview():
    results = []
    allpassed =Truefor phase in g.Phases[:]:
        msg ="not calculated"ifnot phase.ShouldCalculate:
            if phase.CalculationResult == phase.CalculationResult.ok:
                msg ="OK"#may be extended for more detailselse:
                msg ="Failed: error {0}".format(phase.LogInfo)
                allpassed =False
        results.append( "{0}: {1}".format( phase.Name, msg) )

    return allpassed, results

This can be used to create message data with a subject/summary and a detailed message (the body):

defget_message_info():
    message = { "Subject": "",
                "Body": ""}
    allpassed, results = gather_phase_overview()
    if allpassed ==True:
        message["Subject"] ="Calculation OK"else:
        message["Subject"] ="Calculation failed"
    body = [ "Summary for PLAXIS calculation" ]
    body.append( "Title: {0}".format(g.Project.Title)  )
    body.append( "File: {0}".format(g.Project.Filename) )
    body.append('')
    body.append('Phase results:')
    for result in results:
        body.append('- {0}'.format(result) )
    message["Body"] ="\n".join(body)
    return message

E-mail notification

With Python it is possible to send e-mail messages, e.g. by using the SMTP protocol via the smtplib module, but of course more methods are available. For a detailed example, please refer to:

Push notifications on smart devices

Using third party services/apps it is possible to get push messages/notifications on smart devices like iPhones or Android devices. Two of such services are for example:

Such services have apps available for e.g. iOS and Android. Using the service's API it is possible to send a self made notification to these apps on your smart phone.

Example: Notifications for iPhone using BoxCar

Below we have a sample code to send a message using BoxCar. Documentation on how to send a notification to BoxCar:

Note: to be able to use the Boxcar end-user API, you need your "Access Token". The access token is available from the general "Settings" screen of Boxcar or from the Boxcar Web Inbox setting page.
Also, we will use the requests module, which is not a standard Python module: it is available via https://pypi.python.org/pypi/requests (requires install) and it is also available as part of the Plaxis scripting environment.

import requests #available at https://pypi.python.org/pypi/requestsimport json
import time

classBoxCar:
    BASE_URL ="https://new.boxcar.io/api/"
    RETRY_ATTEMPTS = 3
    RETRY_SLEEP = 2
    SOUND ='done'
    ICON ='http://www.plaxis.nl/files/images/img_cms/img_000240_cms.jpg'def__init__(self, access_token):
        self.access_token = access_token
        self.success =False
        self.encoded_data =None
        self.sound=self.SOUND

    defnotify(self, title, message):
        attempts = 0
        while attempts < self.RETRY_ATTEMPTS:
            attempts += 1
            result = self._send_notification(title, message)
            if result.status_code == 201:
                print( "* Message: %s"% title )
                print( "* Message delivered @ %s"% result.headers['date'] )
                self.success =Truebreakelse:
                if attempts == self.RETRY_ATTEMPTS:
                    print( "! Message delivery FAILED: %s"% ( result ) )
                    print( "!   %s"% result.status_code )
                self.success =Falsereturn self.success
 
    def_send_notification(self, title, long_message ):
        '''
        Documentation on how to send a notification to BoxCar:
        https://boxcar.uservoice.com/knowledgebase/articles/306788
        '''print('Sending a notification via BoxCar...')
        long_message = long_message.replace( "\n", '<br />' )
        data = { 'user_credentials': self.access_token,
                 'notification': {
                     'title': "PLAXIS: {0}".format(title),
                     'long_message': long_message,
                     'sound': self.sound,
                     'icon_url': self.ICON,
                     'source_name' : 'PLAXIS'
                     } 
               }
        notifications_url = self.BASE_URL +"notifications"
        headers = {'Content-type': 'application/json',
                                   'Accept': 'application/json'}
        self.encoded_data = json.dumps(data, ensure_ascii=False).encode('utf8')
        _request = requests.post(notifications_url,
                                 data=self.encoded_data,
                                 headers=headers  )
        return _request

Now we can combine it to send a message. For this you will need your BoxCar token. The access token is available from the general "Settings" screen of Boxcar or from  Boxcar Web Inbox setting page.

g.calculate()

defsendmessage():
    message = get_message_info()
    boxcartoken =''# YOUR BOXCAR TOKEN HERE!
    push = BoxCar(boxcartoken)
    push.notify(message[ "Subject" ], message[ "Body" ])

sendmessage()

Now the push message on e.g. an iPhone will look like this:

Figure 1. Notifications using BoxCar 2: left lock screen push message and on the right the detailed message

Conclusion

Using the power of Plaxis Remote Scripting it is possible to get instant notifications about your PLAXIS calculations on your mobile devices!

Output scripting example: get anchor force

$
0
0
Application:

In this example, we will use Tutorial Lesson 3 (Tied back excavation) [link] for the Plaxis file. In this case, we want to determine the force in the top anchor that is connected on the left retaining wall. This anchor is activated in Phase_3, and is connected with the wall at X = 40 m and Y = 27 m .

In order to retrieve this anchor force, we will use Output’s Remote Scripting environment with the Python wrapper:

  • we will need to launch the Output scripting server, available via the Expert menu
  • and we should make sure the Plaxis results are opened in the Output program
  • then we will obtain the anchor force for each phase in which the anchor is active. Since the ground anchor is activated in Phase_3, we can use all phases starting from this phase ( g_out.Phases[3:] )
  • for each phase we will obtain the anchor results: coordinates X and Y, and the anchor force N.
  • from which we will filter out node that belongs to the top anchor of the left retaining wall (at X= 40.0, Y = 27 m). We can identify an anchor by one of its endpoints. Because the order of the nodes is the same in each of these getresults-lists, we can use the X and Y coordinates to filter out the correct anchor force.
localhostport_output = 10001
plaxis_path =r'C:\Program Files (x86)\Plaxis\PLAXIS 2D'#no trailing backslash!import imp
found_module = imp.find_module('plxscripting', [plaxis_path])
plxscripting = imp.load_module('plxscripting', *found_module)
from plxscripting.easy import*

s_out, g_out = new_server('localhost', localhostport_output)


#geometric data for correct anchor:
Xanchor = 40.0
Yanchor = 27.0

#start from Phase_3 since the anchors are not active before this phasefor phase in g_out.Phases[3:]:
    anchorForce = g_out.getresults(phase,
                                   g_out.NodeToNodeAnchor.AnchorForce2D,
                                   'node')
    anchorX = g_out.getresults(phase, 
                               g_out.NodeToNodeAnchor.X,
                               'node')
    anchorY = g_out.getresults(phase,
                               g_out.NodeToNodeAnchor.Y,
                               'node')

    for x,y,N inzip(anchorX,anchorY,anchorForce):
        if x == Xanchor and y == Yanchor:
            print("Anchor force N in {}: {:.2f} kN/m".format(phase.Name,N))

The result from Python would look similar to this:

  Response from Python in IDLE >>>Anchor force N in Phase_3: 500.00 kN/m
Anchor force N in Phase_4: 544.09 kN/m
Anchor force N in Phase_5: 468.03 kN/m
Anchor force N in Phase_6: 460.27 kN/m>>>

Output scripting example: get heave of excavation bottom

$
0
0
Application:

In this example, we will use Tutorial Lesson 3 (Tied back excavation) [link] as an example. In this case, we want to determine the maximum heave of the excavation bottom. In the final phase, Phase_6, the bottom of the excavation is located at Y = 20.0 m, with the left retaining wall at X = 40 m and the right retaining wall at X = 60 m.

In order to retrieve the maximum heave for this excavation bottom, we will use Output’s Remote Scripting environment with the Python wrapper:

  • we will need to launch the Output scripting server, available via the Expert menu
  • and we should make sure the Plaxis results are opened in the Output program
  • next is that we will obtain all soil displacements
  • from which we will filter out the nodes that are at the excavation bottom. Because the order of the nodes is the same in each of these getresults-lists , we can use the x and y coordinates to filter out the vertical displacements at the excavation bottom: so we will only use the data from the nodes between X= 40.0 m and X = 60.0 m, with Y = 20.0 m
  • and from this we will obtain the maximum value for the vertical displacement uy.

Below is an example code how to achieve this.

localhostport_output = 10001
plaxis_path =r'C:\Program Files (x86)\Plaxis\PLAXIS 2D'#no trailing backslash!import imp
found_module = imp.find_module('plxscripting', [plaxis_path])
plxscripting = imp.load_module('plxscripting', *found_module)
from plxscripting.easy import*

s_out, g_out = new_server('localhost', localhostport_output)

#geometric limits for the bottom of the excavation:
x_left = 40.0
x_right = 60.0
y_bottom = 20.0

#initialize defaults
maxUy = 0.0
xAtMaxUy = 0.0
yAtMaxUy = 0.0

#obtain result tables from Output:
soilX = g_out.getresults(g_out.Phase_6, g_out.Soil.X, 'node')
soilY = g_out.getresults(g_out.Phase_6, g_out.Soil.Y, 'node')
soilUy = g_out.getresults(g_out.Phase_6, g_out.Soil.Uy, 'node')

#determine maximum heavefor x, y, uy inzip(soilX, soilY, soilUy):
    if x_left < x < x_right:
        if y == y_bottom:
            if uy > maxUy:
                maxUy = uy
                xAtMaxUy = x
                yAtMaxUy = y

print("Maximum heave of excavation bottom: uy={:.3f} m ""at (X,Y)=({:.2f},{:.2f})".format(maxUy, xAtMaxUy, yAtMaxUy))

The result from Python would look like this:

  Response from Python in IDLE >>>Maximum heave of excavation bottom: uy=0.050 m at (X,Y)=(50.00,20.00)>>>

Output scripting example: get maximum bending moment

$
0
0
Application:

In this example, we will use Tutorial Lesson 3 (Tied back excavation) [link] for the Plaxis file. In this case, we want to determine the maximum bending moment for the left retaining wall for each phase in which the plate is active. This left retaining wall is activated in Phase_1, and is located at X = 40 m.

In order to retrieve the maximum and minimum bending moment for the left retaining wall, we will use Output’s Remote Scripting environment with the Python wrapper:

  1. we will need to launch the Output scripting server, available via the Expert menu
  2. and we should make sure the Plaxis results are opened in the Output program
  3. then we will obtain the bending moment values for each phase in which the plate is active. Since the plate is activated in Phase_1, we can use all phases, except the InitialPhase ( g_out.Phases[1:] )
  4. for each phase we will obtain all plate results: coordinates X and Y, and the bending moment M.
  5. from which we will filter out the nodes that are part of the left retaining wall (at X= 40.0). Because the order of the nodes is the same in each of the getresults-lists, we can use the X - coordinate to filter out the correct bending moment.
  6. and from this we will obtain the maximum value for the bending moment for the left retaining wall.
localhostport_output = 10001
plaxis_path =r'C:\Program Files (x86)\Plaxis\PLAXIS 2D'#no trailing backslash!import imp
found_module = imp.find_module('plxscripting', [plaxis_path])
plxscripting = imp.load_module('plxscripting', *found_module)
from plxscripting.easy import*

s_out, g_out = new_server('localhost', localhostport_output)

#geometric limits for the left retaining wall:                    
x_left = 40.0

#for all phases, starting from the second phase (Phase_1)for phase in g_out.Phases[1:]:
    #initialize defaults:
    maxM = 0.0
    xAtMaxM = 0.0
    yAtMaxM = 0.0
    minM = 0.0
    xAtMinM = 0.0
    yAtMinM = 0.0

    #obtain result tables
    plateX = g_out.getresults(phase, g_out.Plate.X, 'node')
    plateY = g_out.getresults(phase, g_out.Plate.Y, 'node')
    plateM = g_out.getresults(phase, g_out.Plate.M2D, 'node')

    #determine minimum and maximum bending moment:for x, y, M inzip(plateX, plateY, plateM):
        if x == x_left:
            if M > maxM:
                maxM = M
                xAtMaxM = x
                yAtMaxM = y
            if M < minM:
                minM = M
                xAtMinM = x
                yAtMinM = y

    print( "{}: ".format( phase.Name ) +"Mmax = {:.2f} kNm/m at Y={:.2f} m; ".format(maxM, yAtMaxM) +"Mmin = {:.2f} kNm/m at Y={:.2f} m".format(minM, yAtMinM) )

The result from Python would look like this:

  Response from Python in IDLE >>>Phase_1: Mmax = 3.02 kNm/m at Y=26.33 m; Mmin = -0.00 kNm/m at Y=30.00 m
Phase_2: Mmax = 4.91 kNm/m at Y=20.00 m; Mmin = -40.26 kNm/m at Y=25.67 m
Phase_3: Mmax = 21.12 kNm/m at Y=22.62 m; Mmin = -95.82 kNm/m at Y=27.00 m
Phase_4: Mmax = 67.74 kNm/m at Y=23.67 m; Mmin = -91.31 kNm/m at Y=27.00 m
Phase_5: Mmax = 26.12 kNm/m at Y=19.57 m; Mmin = -142.64 kNm/m at Y=23.00 m
Phase_6: Mmax = 123.35 kNm/m at Y=20.00 m; Mmin = -140.43 kNm/m at Y=23.00 m>>>

Output scripting example: create curve data

$
0
0
Application:

Since PLAXIS 2D 2015 and PLAXIS 3D AE, the Output program can also be accessed via REST Http / Remote Scripting in order to retrieve calculation result data via a scripting interface.

Retrieving curve data is one of the possible options for the data retrieval. In this example, we will retrieve the results and store these in a text file.

First, we will need to make sure that the current open PLAXIS Output program is accessible as Remote Scripting server. This can be achieved by activating the Remote scripting server via the Expert menu in the Output program.

Next, we will need to tell the Python script where it can access this Remote scripting server.
This can be done with e.g. this script code:

import imp

plaxis_path =r'C:\PLAXIS'#your PLAXIS installation path
found_module = imp.find_module('plxscripting', [plaxis_path])
plxscripting = imp.load_module('plxscripting', *found_module)
from plxscripting.easy import*

outputport = 10001
s_output,g_output=new_server('localhost', outputport)

Now we can retrieve the data. For this we will use the command getcurveresults(). Since this command will only return one result value, the script will need to access each step id of the desired phases.

In the example below, the Python script stores a table in a file, and it will store the following columns, using the phase order as specified in the parameter phaseorder:

  • phase name
  • step number
  • time
  • u_y for Node A ( g_output.Nodes[0] )
  • u_y for Node B ( g_output.Nodes[1] )

Note: You will need to store all steps during your calculation, otherwise it will not be possible to retrieve the time value for any of the unsaved steps.

defgettable_time_vs_uy(filename=None, phaseorder=None):
    #init data for lists
    stepids = [ ]
    uyAs = []
    uyBs = []
    times = []
    phasenames= []

    #look into all phases, all steps:for phase in phaseorder:
        for step in phase.Steps.value:
            phasenames.append( phase.Name.value )
            stepids.append( int(step.Name.value.replace("Step_","")) )
            uyAs.append( g_output.getcurveresults( g_output.Nodes[0],
                                                   step,
                                                   g_output.Soil.Uy)
                         )
            uyBs.append( g_output.getcurveresults( g_output.Nodes[1],
                                                   step,
                                                   g_output.Soil.Uy)
                         )
            #make sure step info on time is available, then add it:ifhasattr(g_output.Phases[-1].Steps.value[-1].Info,
                       'EstimatedEndTime'):
                times.append( step.Info.EstimatedEndTime.value )
            else:
                times.append( None )
            
    if filename:
        withopen(fname,"w") asfile:
            file.writelines( [ "{}\t{}\t{}\t{}\t{}\n".format( ph,nr,t,uyA,uyB )
                               for ph,nr,t,uyA,uyB inzip( phasenames,
                                                           stepids,
                                                           times,
                                                           uyAs,
                                                           uyBs )
                           ]
                         )

Now we can make a call to this function in order to save a text file with this data for phases Phase_1 and Phase_2:

gettable_time_vs_uy( filename=r'c:\data\project_curvedata.txt',
                     phaseorder = [ g_output.Phase_1, g_output.Phase_2 ] )

This data can then easily be used in spreadsheet programs to easily create charts or do other sorts of post processing.

Notes

  • To retrieve ΣMstage, use step.Info.SumMStage.value
  • To retrieve Force Fx, Fy or Fz (for 3D), use step.Info.ReachedForceX.value, step.Info.ReachedForceY.value or step.Info.ReachedForceZ.value respectively
  • Time value parameters are currently named as following:
    • In order to retrieve the end time for a phase or step, use phase.Info.EstimatedEndTime.value or step.Info.EstimatedEndTime.value respectively
    • When retrieving the total Dynamic time (in seconds), use phase.Info.ReachedTime.value or step.Info.ReachedTime.value

To get this data per step, use step. To get the phase final value, use phase.


Macros using the commands runner

$
0
0
Application:

When using certain command templates multiple times, it would be helpful if you can re-play these commands with just a single click. With a Macro you can do this: you can easily play a set of predefined commands.

Creating a macro

To create a macro:

  • Go to the Macro library menu item (available under the Expert menu)
  • Here choose to manage the library
  • And add a new Macro
  • Give it a descriptive title
  • And add the commands you would like to perform when executing this macro

Figure 1. The Macros library window

Using a macro

In order to make use of a macro, open the menu item Expert > Macro library > and here you will see the available macros. Now click on a macro to execute it.

Figure 2. Macros in the Expert menu

Keyboard shortcuts

Next to using the menu item to run a macro, PLAXIS also offers to execute a command via a keyboard shortcut. The first macro will be accessible via the key combination Shift + Ctrl + Alt + 1. This keyboard shortcut is also shown in the menu Expert > Macro library, see in the image above.

Examples

Tip: to make any command more flexible and useful in any Plaxis model, use the Group Filtered and Apply commands [link] in combination with the possibility to refer to any object using their index [link]. See also the examples below.

Calculation settings

Let’s say you have a large project with many phases and want to switch all of them except the initial one to use

  • a max. of 2 CPUs (cores)
  • and you want to store 10 steps for each phase.

You can write this macro for it:

groupfiltered Phases "PreviousPhase!="# all except the initial phaseapply Groups[-1]"setproperties""MaxCores"2apply Groups[-1]"setproperties""MaxStepsStored"10ungroup Groups[-1]# get rid of temporary group to leave model clean

This will work regardless of how many phases and/or groups you already have. It will only fail if you just have the initial phase, as that would try to create an empty group at the beginning.

Or, if you want to only change this for all the phases that are set to be calculated, we can add a new filter (groupfiltered command) to only use phases that are set to be calculated (ShouldCalculate == True), and then directly calculate it:

gotostagesgroupfiltered Phases"ShouldCalculate=True"groupfilteredGroups[-1]"PreviousPhase<>"applyGroups[-1]"sps""MaxCores"2#insert here the number of CPUsapplyGroups[-1]"sps""MaxStepsStored"10#max steps to save per phaseungroupGroups[-1]ungroupGroups[-1]calculate

Switch to Updated Mesh

To change all phases to use Updated Mesh, you can use this macro:

gotostagesgroupfiltered Phases"ShouldCalculate=True"groupfilteredGroups[-1]"PreviousPhase<>"applyGroups[-1]"sps""Deform.UseUpdatedMesh"TrueapplyGroups[-1]"sps""Deform.UseUpdatedWaterPressures"True#2D ONLYungroupGroups[-1]ungroupGroups[-1]

Note that UpdatedWaterPressures is currently (2015) only available in PLAXIS 2D.

Geometry checks for meshing in PLAXIS 3D

The tabulate command can also be used to detect if small surfaces or volumes are present in the intersected 3D geometry in the mesh mode. This could indicate problem areas for the 3D mesh generation.
To check for small volumes ( < 1 m3), small surfaces (e.g. a surface area < 0.1 m2) and small lines, you can use this macro:

tabulate SoilVolumes"Volume""Volume<1"tabulate Volumes"Volume""Volume<1"tabulate Surfaces"Area""Area<0.1"tabulate Lines"Length""Length<0.1"

Show a table of safety factors

To show a table of the SumMsf values, you can use this single command as a macro to quickly get this table in the Input program:

tabulatephases"PreviousPhaseReached.ReachedMsf""DeformCalcType=Safety"

CodeMeter network error during calculation (IPv4/v6 conflict)

$
0
0

With the release for PLAXIS 2D 2015 and PLAXIS 3D AE some small changes in the communication with the licence dongle (CodeMeter) have been implemented. Together with the new CodeMeter drivers, running a CodeMeter network server can sometimes give issues. due to an IPv4/IPv6 conflict. In these cases the program may respond with this error during the calculation:

One of the following licenses is required: CodeMeter 100444:2000000.
Failure reason: CodeMeter License Server not found, Error 101.

Fortunately, there are two solutions for this: on the server machine you will need

  1. to set the bind address for the server (prefered method, but only works for static IP addresses for the CodeMeter server),
  2. or to change the IPv4/IPv6 setting from automatic setting to IPv4 only.

Both methods need changes on the server. For Windows based machines, this require changes in the Windows Registry.

1. Set Bind address

  • on the server, open the Windows Registry
  • go to the key HKEY_LOCAL_MACHINE\SOFTWARE\WIBU-SYSTEMS\CodeMeter\Server\CurrentVersion
  • find the parameter BindAddress 
  • change the value of the key “BindAddress” from “0.0.0.0” to the IP-address the server should use for communicating with the client computers.
  • Afterwards the CodeMeter service needs to be restarted so that the change takes effect (see below).
  • Please be aware that it only makes sense in case that the server has a static IP address

2. Change communication mode to IPv4 only

  • on the server, open the Windows Registry
  • go to the key HKEY_LOCAL_MACHINE\SOFTWARE\WIBU-SYSTEMS\CodeMeter\Server\CurrentVersion
  • find the parameter ApiCommunicationMode
  • change its value to 6 to allow for IPv4 and local use only (no IPv6):  
  • Then restart the CodeMeter service on the server (see below)

Finally: Restart CodeMeter

For both methods, after making the changes, the CodeMeter services on the server need to be restarted: open the CodeMeter Control Center, and restart the CodeMeter service by first stop it and then start it:

For other trouble shooting for network licence setups, please see the general CodeMeter Network installation page.

Re-use materials from other projects

$
0
0
Application:

Soil materials, as well as plate materials are sometimes used in more than one Plaxis project file, for instance, when analysing alternatives or for models located close to each other. In Plaxis software the global material database can be used as a repository of material data sets. Then, these material data sets can be used for new projects.

The procedure described below covers the following topics:

  • changing the global material database of a project
  • creating a new global material database
  • add existing material data sets to the global material database

Note that the global material database can be created and used to add material data sets, such as for soils and interfaces, plates, embedded beam rows (or embedded beams in 3D), geogrids, beams (only in 3D) and anchors.

Change global material database

The steps to change the global material database are explained in detail below:

  1. Start a new project in Plaxis (or load an existing project);
  2. Open the material sets window and expand the global materials (the current location of the global material database can be seen below);
  3. Click on Select… to change the current global material database;
  4. Browse to the location of the global material database that is intended to be used;
  5. Select the global material file (*.matdb), e.g. Sands_only.matdb and click on Open.

Create a new global material database

Sometimes there is no existing global material database or a new one is required. The steps to create a new global material database are explained in detail below:

  1. Start a new project in Plaxis;
  2. Open the material sets window and expand the global materials;
  3. Click on Select… to open the window of global material database location;
  4. Browse to the location in which the new global material database will be placed (this can also be a network location);
  5. Create a new folder and name it accordingly, e.g. Global;
  6. Specify a filename, e.g. sands_only.matdb;
  7. Now the global material database for e.g. Soil and interfaces is changed and the list of the global materials should be empty.

Adding existing material data sets to the global material database

The steps to add existing materials to this global material database are:

  1. Open a project, which includes the material data set(s);
  2. Make sure that you have selected the new global material database (checks step of the previous procedure);
  3. Use one of these methods to copy all or individual datasets from the local project material database to the global material database:
    • button to copy only the selected material data set from the project material database to the global database;
    • button to copy all material data sets from the project material database to the global material database;
    • use drag-and-drop to copy individual material data sets from the project material database to the global one;
  4. Perform steps 1-3 for different projects from which you need the material data sets.


For a new project, you can now select the new global database and copy any of the global material data sets in the project material database.

An example of a Global material database can be seen below:


Note that using any material database, which is included in a project folder (data.plxmat) as a global material database should be avoided: unexpected behaviour might be noticed (e.g. material assignments might be lost in the original project).
Instead, the materials used in this specific project can be copied to a global material database (*.matdb-file), following the steps mentioned above.

How to check undrained shear strength using Undrained A?

$
0
0
Application:

For Undrained A materials, where effective stress parameters are used, the undrained shear strength is not an input parameter but a result of the analysis. In order to check that the shear stress values do not violate the undrained shear strength, the shear stress (σ_1-σ_3)/2 should be checked against the undrained shear strength s_u (or c_u) in the Output program.

In Figure 1 the shear stress in Point A is below the given undrained shear strength s_u (c_u) (from soil test or laboratory tests) , and so the undrained shear strength is not violated for this stress state. However, for the second (larger) Mohr Circle, the shear stress in point B is larger than the undrained shear strength, and so the strength criterion is violated.

Figure 1. Mohr Circles for evaluating shear strength

The undrained shear stress in the Output program can be seen via the menu item by selecting:
     Stresses» Principal total stresses» (σ_1 - σ_3) / 2
Then you can select to view the desired results:

  • by drawing a Cross section
  • or by using the Hint box  and move your mouse over the area of interest.

 

Python commands reference

$
0
0
Application:

Commands reference

There is extensive documentation available for when using the Python wrapper for the Remote Scripting functionality: inside the Plaxis programs that support this Remote Scripting you can access the full Commands and Objects reference via the help menu. This will open an HTML based documentation.
See also Command line reference

The basics for starting the Remote Scripting and start using the Python wrapper to interact with Plaxis, can be found in the PLAXIS Reference manual's Appendices and here Using PLAXIS Remote scripting with the Python wrapper

Plaxis Commands in Python

This Commands and Object reference describes how to directly use the Commands in the Plaxis Command line. With this it is easy to construct the command to be used inside the Python wrapper:

  • To call a command, prefix the command with the global object reference (in the boilerplate referred to as g) and add the parameters in brackets
  • To refer to a Plaxis object, prefix the Plaxis object name also with this global ojbject reference.

In the examples below, we used the boilerplate code example from this page: Using PLAXIS Remote scripting with the Python wrapper, i.e. we can refer to g as the global object of the current open Plaxis model.

Add a borehole in PLAXIS 2D

Plaxis commandborehole5
Python equivalent
g.borehole( 5 )

Add a point in PLAXIS 2D

Plaxis commandpoint12
Python equivalent
g.point( 1, 2 )

Change the x-coordinate for a point

Setting a single value to a so-called intrinsic property can be achieved using different Python syntax:

Plaxis commandsetPoint_1.x9.3
Python equivalent
g.set( g.Point_1, 9.3 )
 
g.Point_1.set(9.3)
 
g.Point_1 = 9.3

Info and Echo

Practically, sometimes it is useful to use the info and echo command in the PLAXIS Input program to get more details about an object. For instance when using it for the Colours object or for a point object Point_1 to obtain more info about the available parameters and their spelling, and to see which commands and attributes are available:

0010> echoColoursColours named "Colours"0011> infoColoursColours    Commands: echo, commands, rename, set, info, setproperties    Attributes: Apple, Aqua, BabyBlue, Black, BlackBerry, Blue, Brown, ...  0012> echoPoint_1Point named "Point_1"  x: 5    y: 5  0013> infoPoint_1Point_1    Commands: echo, commands, rename, set, info, setproperties, movedisconnected     Attributes: Name, Comments, UserFeatures, x, y, z 

Practical tip to obtain Python command

A practical tip if you are trying to figure out what command to use in Python, is to do the action you want to perform by using the mouse and keyboard in the Graphical User Interface (GUI), and read the generated command in the Command Session pane. Then, this command should be easily transferable into a Python command.
Example: change the top of a borehole
In order to do this via the GUI, we need to open the Modify soil layers window and change the top of the first soil layer. e.g. we change it to y = 2 m:

This will generate the following command to apply the change from which we can create the Python equivalent:

Plaxis command_setsoillayerlevelBorehole_102
Python equivalent
g.setsoillayerlevel( g.Borehole_1, 0, 2 )

For more documentation on the specific parameters for the used setsoillayerlevel command, or any other command, please refer to the Commands reference.

Python wrapper script examples

For more details on this Python wrapper and some code examples, please see the appendix on the Python HTTP REST API wrapper in the PLAXIS Reference manuals. In the Plaxis Knowledge Base you can also find some scripting examples which can be used as a basis of your own Python script. Please see the related pages below.

Consolidation: Minimum Pore Pressures and Degree of Consolidation analysis may give spurious displacements of boundary nodes

$
0
0
Application:

When performing a consolidation analysis three possibilities exist:

  • Staged Construction (SC);
  • Minimum Pore Pressure(MPP);
  • and Degree of Consolidation(DoC).

For a SC calculation a time interval must be specified for the duration of the consolidation process whereas for the other two options the duration of the consolidation process is in fact a result of the calculation by specifying the end of consolidation. This end of consolidation is specified either as the maximum allowed excess pore pressure anywhere in the model or the degree of consolidation that must be at least reached anywhere in the model.

However, this is not the only difference in the two calculation types. More important is that a SC calculation can deal with changes in the geometry (construction, excavation, changes of water level and/or loads) during the consolidation process. These changes lead to a so-called unbalance between the externally applied loads and the internal stresses in the model and this unbalance will be solved. On the other hand, the MPP and DoC analysis assume a fixed geometry: they are pure consolidation analyses that do not take into account the possibility of an unbalance.
This may have consequences when performing a consolidation analysis directly after an undrained analysis (Plastic or Dynamic). Such an undrained analysis will generate excess pore pressures even on the nodes on the contour of the model, for instance the soil surface. A consolidation analysis, however, would consider the soil surface an open boundary where the excess pore pressures are by definition zero. Hence, at the start of the consolidation analysis the excess pore pressures on the soil surface and any other boundary that is not explicitly set as a closed flow boundary are set to zero. By doing so, the total stresses at those boundary nodes are changed and so an unbalance is created. If the consolidation analysis is a SC calculation, this unbalance will be solved as part of the consolidation analysis whereas for a MPP and DoC analysis this unbalance will remain throughout the calculation. For the MPP and DoC analyses this may lead to spurious displacements of boundary nodes, especially if the soil is cohesionless and does not allow for tensile stresses.

It is therefore in general not recommended to use an MPP or DoC type of consolidation analysis directly after an undrained Plastic or Dynamic analysis but rather use a SC type of consolidation analysis first. This SC type of consolidation phase can then be followed by an MPP or DoC consolidation phase. The SC consolidation analysis will set the excess pore pressures on the boundaries to zero and solve the unbalance so that for the MPP or DoC analysis there will be no unbalance left to influence the results.

Install latest 2D version and 2D AE for converting older files

$
0
0

How to have the latest PLAXIS 2D version and PLAXIS 2D AE simultaneously installed in your computer for converting older files


The procedure of converting projects created with PLAXIS 2D Classic, PLAXS 2D 2012 or an earlier version (with extension .P2D) can only be done with PLAXIS 2D AE. Since it is inconvenient to constantly switch between installed versions, you may use this tip to have both versions (2D AE and latest 2D 2015) are available in your system:

  1. open PLAXIS Connect to see which version is installed
  2. if PLAXIS 2D AE.02 is not yet installed: click to see the Available versions (see the figure below)
  3. select PLAXIS 2D AE.02 and click to Install
  4. go to the installation folder of PLAXIS 2D; by default this is in:
       C:\Program Files (x86)\Plaxis\PLAXIS 2D
  5. copy the folder to a different location (this folder should now contain the full 2D AE.02 version) and rename the copied folder properly, e.g. to PLAXIS 2DAE
  6. open PLAXIS Connect again to update to the latest version
  7. PLAXIS 2D AE and the latest PLAXIS 2D version should now be available in two separate locations with default being the latest version.
  8. In order to use the 2D AE version, PLAXIS Input should be launched from the separate folder, created in previous steps by starting PLAXIS2DXInput.exe

Notes

  • In order to use a PLAXIS 2D version, you must have access to the appropriate licence;
  • Any shortcuts, or file extension association (e.g. when double clicking a file) will always refer to the latest fully installed location.
  • For converting even older files with the extension *.plx, you can use the 2D Classic version,which can be found in the subfolder called classic, located inside the 2D AE program folder. See here for more details.

How to downgrade your PLAXIS 2D version

By using PLAXIS Connect it is easy to change versions:


Create rock bolts accurately in PLAXIS 3D AE

$
0
0

Introduction

In the PLAXIS 3D AE version it is not directly possible to intersect lines with surfaces. This is because of the parametric definition of the PLAXIS 3D AE surface objects, which is not compatible yet for line objects.

This makes the process of designing rock bolts for a tunnel project cumbersome, since the created lines might not be accurately snapped on the lining (surface) of the tunnel. Manual snapping of the end point to the tunnel lining can be done, however this might change the angle of the rockbolt slightly, which may be undesired. A manual intersection of the line and surface could solve the problem. However, this is not currently possible.

Alternative rock bolt definition

Depending on the desired geometry, different approaches are suggested. In this article the following cases are explained, related to the reference point that is given for designing the rock bolts:

  • reference point is inside the tunnel geometry
  • ending point of rock bolt

Reference point inside the tunnel geometry

In this case, the reference point is located inside the tunnel geometry. This point and a given angle assists in providing the direction of the rock bolt.
The following steps describe how to create a rock bolt accurately snapped on the surface of the tunnel lining:

  1. create the reference point
  2. find the name of the surface from which the rock bolt will be created
  3. use the lineangles command to create a line starting from the reference point towards this surface
  4. the newly created point is the starting point of the rock bolt
  5. (optional) delete the created line as not needed
  6. use the lineangles command to create the rock bolt by specifying the length (instead of a target surface)

For this example the following assumptions are taken:

  • reference point is: (25 1 -20)
  • angle of the rock bolt with respect to the xz-plane is: 60º for x-axis

Commands used:

point(251-20) # reference point lineanglesPoint_1060Surface_2deleteLines[-1]  # optional lineanglesPoints[-1]  0604 # same command with length embeddedbeamLines[-1] "Behaviour""Rockbolt""ConnectionPoint""First"

Ending point of rock bolt

In this case, the suggested alternatives are given below using two available commands: lineangles and the line command using "vector" parameters.

lineangles command

The following steps describe how to create a rock bolt accurately snapped on the surface of the tunnel lining:
create the reference point

  • find the name of the surface towards which the rock bolt will be created
  • use the command lineangles to create a line starting from the reference point towards this surface (remember to adjust the angle to find the correct value for the command)

For this example the following assumptions are taken:

  • reference point is: (32 1 -7.5)
  • angle of the rock bolt with respect to the xz-plane is: 60º for x-axis (240º for x-axis at the opposite direction)

Commands used

point(321-7.5) # reference point lineanglesPoint_10240Surface_2 # adjust angle 

line command with "vector" parameters

The line command can be used in different ways. One way to create a line is using a vector to define the direction of the line towards a surface. The structure of this command is the following:

line|referencepoint(x,y,z)|"vector"|direction(a,b,c)|targetobject

Example:

line250.2"vector"0-10Surface_1

Creates a line from a new point with coordinates (2, 5, 0.2) with a direction of (0, -1, 0) onto Surface_1.

For this example the following assumptions are taken:

  • reference point is: (32 1 -7.5)
  • angle of the rock bolt with respect to the xz-plane is: 60º for x-axis (30º for z-axis)

The following steps describe how to create a rock bolt accurately snapped on the surface of the tunnel wall:

  1. find the name of the surface towards which the rock bolt will be created
  2. use the line command to create a line starting from the reference point towards this surface (the vector in this case is calculated accordingly based on the angle given)

Commands used:

line321-7.5"vector"-0.50-0.866Surface_2embeddedbeamLines[-1] "Behaviour""Rockbolt""ConnectionPoint""Second"

( vector is calculated based on the following: [-0.5, 0, -0.866] = [cos60 , cos0 , cos30] )

These commands can also be written in a single line so it can easily be used when the rock bolt generation is prepared in for instance a spreadsheet program (see example here[]link]). The command would look like this:

embeddedbeam(321-7.5)"vector"-0.50-0.866Surface_2"Behaviour""Rockbolt""ConnectionPoint""Second""Material"”RockboltBeamMaterial

For more information on the structure of the commands used, please check the Command reference, under Help menu in Input.

How does Reset displacements to zero work?

$
0
0
Application:

When we apply the option Reset displacements to zero, we reset the displacements at the BEGINNING of the phase. This means that any displacement in the model due to changes, e.g., load changes, structural elements being activated, soil activated/deactivated, can still occur in this phase: the phase just starts with zero displacements.

This option should be selected when irrelevant displacements of previous calculation steps are to be disregarded at the beginning of the current calculation phase, so that the new calculation starts from a zero displacement field. For example, deformations due to gravity loading are physically meaningless. Hence, this option may be chosen after Gravity loading to remove these displacements. If the option is not selected, the incremental displacements occurring in the current calculation phase will be added to those of the previous phase. The selection of the Reset displacements to zero option does not influence the stress field.

The use of the Reset displacements to zero option may not be used in a sequence of calculations where the Updated mesh option is used. However, if an Updated mesh analysis starts from a calculation where the Updated mesh option is not used, then the Reset displacements to zero option MUST be used in this Updated mesh analysis.

Reset small strain

This option should be selected when an existing state of the small-strain tensor in the HS small model, as reached at the end of the previous phase, is to be disregarded. As a result, the soil will behave as a 'virgin soil' without strain history. Other state parameters are not affected by this option. If it is the user's intention to reset all state parameters, then the option Reset State Variables should be used.

Note: this option to Reset small strain is automatically checked when you select the Reset displacements to zero option.

Reset state variables

This option should be selected when the values of the state parameters in advanced soil models, as reached at the end of the previous phase, are to be disregarded. As a result, the soil will behave as 'virgin' soil. The reset parameters for the Plaxis models are given in the table below.

Material modelParameter
Soft soil, Soft soil creep, Modified Cam-Clay,
Hardening soil, Hardening soil small-strain
pp reset to current effective stress state
Hardening soil small-strainStrain history tensor reset to zero
Hardening soil, Hardening soil small-strainMobilised shear reset to current
effective stress state

 

How to get a Load - Displacement curve using Scripting interface

$
0
0
Application:

Currently it is not possible to directly plot the active load qactive in a curve to generate load-displacement curves for a load-controlled analysis. See the related article How to get a load - displacement curve using SumMstage

In this article, we will show how to use the HTTP REST API / Remote Scripting feature in order to retrieve the necessary values and save them in a text file, so that this data can be used in any spreadsheet software to generate a load-displacement curve..

First, we will need to make sure that the current running PLAXIS Input and PLAXIS Output program are accessible as Remote Scripting server. This can be achieved by activating the Remote scripting server via the Expert menu in both Input and Output programs.
See also: Using PLAXIS Remote scripting with the Python wrapper in order to correctly setup the reference to Plaxis Input (s_i,g_i) and Output (s_o,g_o) using the boilerplate code.

In order to construct the actual load-displacement curve the following quantities are needed for each step:

  • qactive , equation to determine qactive:
       qactive = qphase_start + ΣMstage * ( qphase_end - qphase_start)
  • displacements (specified node)

The steps to achieve in generating a load-displacement curve can be summarize in the following points:

  1. create a function that will retrieve the load value
  2. create a function that will retrieve the results required for the equation to determine qactive and for the load-displacement curve and add them in tables
  3. create a file that will store these information by means of a text file
  4. make a quick plot (using matplotlib package)
  5. call the function that will execute all above operations

Note in this code example we will use Tutorial Lesson 1 Case B: Flexible footing's case to illustrate the behaviour.

Retrieve load value

To begin with, we will need to retrieve the values for qphase_start and qphase_end for a specified phase, for which the load is active and applied. For this the command that retrieves the load value for a specific phase can be used. For instance:

g_i.LineLoad_1_1.qy_start[g_i.Phase_1]

In order to make the defined script reusable in other conditions, we will write a function that takes the line load name and the phase name as an input, and returns the load object for that phase:

# creating the function that will retrieve# the values later in the scriptdefgetphasevalue (plxobject, phase):
    return plxobject[phase]

Required results for equation and curve

In order to calculate the value of qactive we will need the ΣMstage values from the Output results. Next to that, the displacements of a pre-selected node (A) should be retrieved, too. In the following example, we will create a table with these columns:

  • step number
  • phase name
  • ΣMstage value
  • displacement of node A (total): |u|
  • qactive-value
# qphase_start is start load value in phase, equal to# the final load value in the preceding phase: the PreviousPhase# qphase_end is the defined final load value for this phaseimport math

defcreate_phases_name_map(phases):
    result = {}
    for phase in phases[:]:
        result[phase.Name.value] = phase
    return result

defget_table_qactive_vs_displacement(filename, phases_i):
    # initial data for eventual table columns
    col_step = ["Step"]
    col_sum_mstage = ["SumMStage"]
    col_phases = ["Phase"]
    col_utot = ["Utot"]
    col_qactive = ["qactive [kN/m2]"]
    col_load = ["Load [kN]"] # load for axisymmetric models
    radius = 1
    area = math.pi * radius**2

    phasesmap_o = create_phases_name_map(g_o.Phases)
    # look into all phases, all steps:
    loadfeature_i = g_i.LineLoad_1_1
    for phase_i in phases_i:
        qphase_end = getphasevalue(loadfeature_i.qy_start, phase_i)
        # check if previous phase has a Line Load# that is deactivated (then load=0)if loadfeature_i.Active[phase_i.PreviousPhase]:
            qphase_start = loadfeature_i.qy_start[phase_i.PreviousPhase]
        else:
            qphase_start = 0
       
        phase_o = phasesmap_o[phase_i.Name.value]
        for step in phase_o.Steps:
            sumMstage = step.Info.SumMStage.value           
            col_phases.append(phase_o.Name.value)
            col_step.append(int(step.Name.value.replace("Step_", "")))
            col_utot.append(g_o.getcurveresults(g_o.Nodes[0], 
                                                step,
                                                g_o.ResultTypes.Soil.Utot))
            col_sum_mstage.append(sumMstage)
            col_qactive.append(-qphase_start + sumMstage * (-qphase_end + qphase_start))
            col_load.append(col_qactive[-1] * area)

---------------------------------------------------------------------------------

Text file with required information

After retrieving the tables of the results, a filename will be created that will be saved as a normal text file (*.txt). The specified path should be given below:

if filename isnotNone:
        withopen(filename,"w") asfile:
            for results inzip(col_phases, col_step, col_utot, col_qactive, col_load):
                print('\t'.join(["{}".format(i) for i in results]), file=file)

Run the function

Now we can make a call to this function in order to save a table with these results for Phase_1 to the text file.

get_table_qactive_vs_displacement(filename =r'C:\data\load_displ_data.txt',
                                  phases_i = [ g_i.Phase_1 ] )

Note that in order to use mathematical functions and constants (e.g. math.pi) a specific module needs to be imported. To import the math module, the following line is included at the beginning of the script:

import math

The assumptions made in the script are that the project should have the following:

  • all steps are stored during calculation to retrieve the results for each step
  • a pre-selected node to check the displacements is selected
  • a single vertical line load is applied

Example

When executing this Python code on  Tutorial Lesson 1 (Settlement of a circular footing on a sand - Case B: Flexible footing [link]) the described script will result in the following data table:

Figure 1. Text file generated for Lesson 1B

By opening the text file in spreadsheet program (e.g. Microsoft Excel) we can further process the data to generate the following curve:

Figure 2. Load - displacement curve from spreadsheet data

 

Quick plot for Load-Displacement curve [matplotlib]

At the end of this example, the option to create a quick plot is provided using the matplotlib plotting library, which allows for a quick check of the Load-Displacement curve. This will appear in a separate window. Note that the following code should be used within the previous script, before the command which runs the function.

# Make a quick plot of the Load-Displacement curveimport matplotlib.pyplot as plt
    plt.plot(col_utot[1:], col_load[1:] )
    plt.xlabel('Displacements (m)')
    plt.ylabel('Load (kN)')
    plt.title('Load-Displacement curve')
    plt.grid(True)
    #plt.savefig("load_displ_curve.png")if filename:
        plt.savefig(filename.replace(".txt", ".png"))      
    plt.show()

Figure 3. Example of a load - displacement curve generated by matplotlib's plt.show()

Force envelope results explained

$
0
0
Application:

My force envelope distribution value is larger  than any of the phases' results: How can this be?

In PLAXIS 2D, sometimes, the maximum or minimum values displayed on the force distribution envelope can be larger  than any of the phases’ results.  This can be explained by the fact that these maximum and/or minimum values for the axial force N, the shear force Q or the bending moment M were recorded at an (unknown) intermediate calculation step.

Due to the non-linear behaviour of the soil, each calculation phase is generally divided into a number of calculation steps. In order words, the external loading (Out-of-Balance) is applied and solved in (small) increments.

Each calculation steps is, during the calculation, temporarily saved in the Windows TEMP folder, in a file named data.### (### corresponds to the calculation step number). During a calculation step, the actual forces are compared with the ones from subsequent calculation steps and the maximum and minimum variables are updated if the actual force is bigger or lower than the maximum or minimum values recorded in previous calculation steps, respectively.

The force envelope distribution is the visual representation of the maximum and minimum force values recorded during calculation and it doesn’t necessarily mean that these occurred in the last calculation step of any phase. In other words, whenever a force envelope distribution value is larger than in any of the phases' final results, this is an indication that the maximum and minimum force values occurred in an intermediate calculation step.

However, by default, a calculation phase has the Max number of steps stored (in the numerical control parameters settings in the Phases window) set to 1, so only the phase’s last calculation step file will be stored and saved in the project folder. As a consequence, if the maximum and minimum force’s values occurred in an (unknown) intermediate calculation step, the user won’t be able to visualise the calculation results for that specific intermediate calculation step.

Find the calculation step when a force envelope value has been reached and visualize its results

In order to find out in which (intermediate) calculation step the maximum/minimum value occurred, you need to:

  1. Store all intermediate calculation steps, during the calculation ( Max number of steps stored = Max steps value on each Phase's numerical control parameters tab)
  2. Run your model and save it at the end of the calculation
  3. Select to view the results for the plate in Output and then click the Select points for curves button to choose the plate’s post-calc node you wish to retrieve the results for.
  4. Create a Step vs post-calc node force's curve, in the Curve manager window. In the generated curve, you can now see the force evolution during calculation and identify in which calculation step the maximum/minimum value occurred.
  5. Knowing the calculation step number, you can change the plot of the force distribution to the step in which the maximum or the minimum value was recorded. For that, just make sure that the button in front of the drop-down menu is set to show all saved calculations steps results, as shown in the image below.  From there, you can visualize any calculation steps results.

End bearing of plates

$
0
0
Application:

In the material data base of Plates in PLAXIS 2D and 3D there is the option to select ‘End bearing’. Selecting this option may be appropriate to provide some sort of vertical end bearing (tip resistance) in the case the plate is used as a wall.

In reality, vertical loads on walls, for example as a result of vertical components of anchor forces or point loads on the wall, are sustained by the shaft friction and the tip resistance. A certain amount of resistance is offered by the soil under the tip, depending on the thickness or the cross section area of the tip. Slender walls are often modelled as plates. Due to the zero thickness of the plate elements, vertical plates (walls) have no end bearing. The effects of end bearing can still be considered in the calculation when the corresponding option is selected in the material data set. In order to consider end bearing at the bottom (tip) of plates, a zone in the soil volume elements surrounding the tip of the plate is identified where any kind of soil plasticity is excluded (elastic zone). The size of this elastic zone is determined as Deq = √(12 EI / EA).

Notes

  • In contrast to embedded beam elements, it is NOT the idea that this end bearing represents the true end bearing capacity of the wall. It just prevents unrealistic vertical movement or penetration of the wall into deeper layers. The value of end bearing cannot be prescribed by the user, and it is neither theoretically determined by PLAXIS.
  • Note that sheet pile walls have very little end bearing, considering that the thickness of the steel is much less than Deq, when modelling them as plates. Hence, the end bearing option shall NOT be used for sheet pile walls.

For more background on the End bearing option, please refer to the PLAXIS 2D and 3D Reference Manual and Material Models manuals.

Viewing all 25 articles
Browse latest View live




Latest Images