Jump to content
wangs8811

How to link variables with abaqus slover?

Recommended Posts

Hi, I'm using abaqus as a slover. There are two models which should be optimize synchronously, so some variables were linked. 
--------------------------------
Acitive       Label         Varname                 Expression
1                 com1_1    m_1_varname_1    
1                 com2_1    m_2_varname_1    m_1_varname_1
--------------------------------
But when the "evaluate" was conducted, there are errors occured:
--------------------------------
13 Error : Scalar value expected for ( com2_1 (m_2_varname_1) )
14 Warning: Could not set the value of variable ( com2_1 (m_2_varname_1) ) in model ( Model 2 (m_2) )
--------------------------------

I'm wondering whether the slover script didn't support the two models link variables?

--------------------------------
#!/usr/bin/env python
""" Example script to run abaqus
"""
# import statements
import os
import platform
import subprocess
import sys
# user edits-------------------------------------------------------------------
# set abaqus path use forward slashes (/)
abaqus_exe = 'C:/SIMULIA/Abaqus/Commands/abq6121.bat'
# set abaqus arguments
abaqus_arguments = 'job=' + sys.argv[1] + ' ' + 'memory=20000Mb cpus=36 interactive'
# set log file name
logFile = 'logFile.txt'
# -----------------------------------------------------------------------------
# open log file
f = open('logFile.txt', 'w')
# get environment information
plat = platform.system()
hst_altair_home = ''
strEnvVal = os.getenv('HST_ALTAIR_HOME')
if strEnvVal:
    hst_altair_home = strEnvVal
else:
    f.write('%EXA_xx-e-env, Environment variable not defined ( HST_ALTAIR_HOME )')
abaqus_exe = os.path.normpath(abaqus_exe)
lstCommands = [abaqus_exe, abaqus_arguments]
# echo log information
f.write('platform: ' + plat + '\n')
f.write('hst_altair_home: ' + hst_altair_home + '\n')
f.write('abaqus command: ' + abaqus_exe + '\n')

#execute the command
f.write('Running the command:\n' + ' '.join(lstCommands) + '\n')
p1 = subprocess.Popen(' '.join(lstCommands), stdout=subprocess.PIPE , stderr=subprocess.PIPE)
# log the standard out and error
f.write('\nStandard out' + '\n' + p1.communicate()[0] + '\n')
f.write('\nStandard error' + '\n' + p1.communicate()[1] + '\n')
# close log file
f.close()
# End of file:

Share this post


Link to post
Share on other sites
1 hour ago, Rahul R said:

Are you able to execute nominal run for any other single model(without linking)?Please share which version of HyperStudy & Abaqus you are using at your end?

@Rahul R

 

Thanks for your replying. The nominal run worked well and two models can get their results, but the second model's variable can change in accordance with the first model.

 

The hyperworks is 14.0 with the abaqus is 6.12. Is that matter?

 

 

Share this post


Link to post
Share on other sites

HyperStudy doesn’t support linking two string variables today.  We have enhancement request for this feature.

As a workaround, We would recommend using output stream redirection as shown the attached example.  The example shows how a single tpl file can be used to write multiple other files using only a single.  This allows the user to get the same string variable value written into more than one file without using a link in HyperStudy.  From the point of view of the HST framework there is only one variable.

This process will result in both files written into the same directory.  In 14.0 the user may need to use some custom solver scripts to run both of these files.  In 2017.2, you could use a combination of model resources and an operator model to avoid a custom script.
 

file3.tpl

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...