Re: [WB or APDL?] Apply time varying heat transfer

CA
Caba, Aaron (US)
Fri, Oct 28, 2022 1:28 PM

Thanks all for the ideas!

I ended up doing a little scripting, and using a cool copy-paste feature in Mechanical.  I have 120 load case files, so I didn't want to do this manually.

To create and setup the External Data system I recorded a Project script and ended up with something like Jeff's posted script. I recorded a project-level WBJN script of me manually creating an External Data and importing and setting-up a couple of files.  From there it was pretty easy to add a loop to import all 120 files.  I had the script written before I found the next solution, but it would work as well as my script.

For applying the loads in Mechanical, Harish from ANSYS sent me a pointer to the help docs that directly addresses this problem:  https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v222/en/wb2_help/wb2h_MechLoadapp.html%23wb2h_ext_data_multi_set_ex

A couple of cool copy-paste operations and I had applied 120 load cases in less than 30 seconds.

Aaron C. Caba, Ph.D.
Sr. Principal R&D Engineer II
BAE Systems, Inc. | Ordnance Systems, Inc.

E-mail: aaron.caba@baesystems.commailto:aaron.caba@baesystems.com | Mail:  4050 Peppers Ferry Road, Radford VA 24143-0100
www.baesystems.comhttp://www.baesystems.com/

-----Original Message-----
From: Jeff Bronson Jeff.Bronson@ansys.com
Sent: Thursday, October 27, 2022 4:25 PM
To: XANSYS Mailing List Home xansys-temp@list.xansys.org; Caba, Aaron (US) Aaron.Caba@baesystems.com
Subject: RE: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer

External Email Alert

This email has been sent from an account outside of the BAE Systems network.

Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros.  For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.commailto:phishing@baesystems.com.

Hi Aaron,

I don't have an exact example for your situation but I think you can achieve what you are trying to do with some scripting.  Irene is right that you have an additional "dimension" to your external data that makes it cumbersome to use the GUI manually for all the individual files.  I have an example script that we use for adding a large number of thickness maps for 2D plane stress with thickness regions.  You can run something like this on the Workbench project page to automate setting up the External Data system.  I would set it up so that you have one External Data Cell that has 120 different Data Sources and the Identifier column has your time variable.  These can all be scripted and you can even record your actions when you create or modify a the External Data cell through File -> Scripting -> Record Journal.  You can run a journal macro through this same menu, or open a console window and enter script lines one by one.  Here is an example of setting up External data to read a bunch of 2D thickness map files that start with a _ character from the project UserFiles directory:

setup External Data System for Thicknesses (Project Page) import os uFilesDir = GetUserFilesDirectory().ToString()

StaticStrSys = GetSystem(Name='SYS')

Create and setup External Data system

ExtDataTemplate = GetTemplate(TemplateName="External Data") thickSystem = ExtDataTemplate.CreateSystem(Position="Left",RelativeTo=StaticStrSys)

thickSystem.DisplayText="Thicknesses"

thickSetup = thickSystem.GetContainer(ComponentName="Setup")

thickFilesPP=[]

filesPP=os.listdir(uFilesDir)

for file in filesPP:

if file.StartsWith('_'):

    thickFilesPP.append(file)

for tFile in thickFilesPP:

tFilePath=os.path.join(uFilesDir,tFile)

tAddedDataFile = thickSetup.AddDataFile(FilePath=tFilePath)

tFileName=tFile[1:-4]

tDataProperty = tAddedDataFile.GetDataProperty()

tDataProperty.FileIdentifier=tFileName

tDataProperty.SetDimensionType(Dimensions="Dimension2D")



cx=tDataProperty.ColumnsData[0]

tDataProperty.SetColumnDataType(ColumnData=cx,DataType="X Coordinate")



cy=tDataProperty.ColumnsData[1]

tDataProperty.SetColumnDataType(ColumnData=cy,DataType="Y Coordinate")



ct=tDataProperty.ColumnsData[2]

tDataProperty.SetColumnDataType(ColumnData=ct,DataType="Thickness")

Connect External Data to Static Str System

setupComponent1 = StaticStrSys.GetComponent(Name="Model")

setupComponent2 = thickSystem.GetComponent(Name="Setup")

setupComponent2.TransferData(TargetComponent=setupComponent1)

After the external data is setup, within Mechanical you can use the External Data object and create multiple lines within an Imported Heat Transfer object.  This should also be able to be scripted.  I don't have an example of this but within the Mechanical Scripting window (Automation tab -> Scripting) you should be able to record yourself setting one or two of the files up manually to see how it works, then nest it in a for loop to create all 120 load steps.

I think this would be your most efficient option, the APDL route will be much slower due to the mapping algorithms being based on a less efficient method.

Jeff Bronson  /  Principal Application Engineer

900 Victor's Way, Suite 350  /  Ann Arbor, MI 48108 Mobile 734-272-5746  /  office 734-213-1278

jeff.bronson@ansys.commailto:jeff.bronson@ansys.com  /  www.ansys.comhttp://www.ansys.com

-----Original Message-----

From: Slater, Irene M <SlaterIM@corning.commailto:SlaterIM@corning.com>

Sent: Thursday, October 27, 2022 3:37 PM

To: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>; XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Subject: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer

[External Sender]

Aaron,

Sorry. Yes, that is what I was suggesting.  I agree, there should be a better way.

Perhaps we will be lucky enough to have an ANSYS employee chime in and let us know if we are missing something.

And if we aren't, maybe there will be an enhancement request that is created.

I would not be surprised if this enhancement request is already on their list of things to do.

Wouldn't it be great if some code (Iron python, ACT or whathaveyou) already exists to do this - and that someone wrote a blog about it?

Personally, I think that if you use APDL - you may have to go through a time do-loop and that will be slow depending on the size of your model.

Since you are saying lots of things happening/changing, I won't ask if you can remove any unnecessary ones after you have reviewed the data that you will be importing.

By the way, it would have been so easy to do this directly from Thermal Mechanical - that would transfer the time (space varying) data very easily.  And, I bet the same goes for ANSYS fluent solvers within the WB environment.

Irene Slater

Corning Incorporated

-----Original Message-----

From: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>

Sent: Thursday, October 27, 2022 12:06 PM

To: Slater, Irene M <SlaterIM@corning.commailto:SlaterIM@corning.com>; XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer

Irene,

The CFD was done in STAR-CCM+, so no easy linking there  :(

I've done the External Data thing with rotating the and mapping and it works great.

My issue is I have 120 CSV files from 120 different time points through the analysis (lots is happening and changing).  Per your instructions, would I need to import each CSV and apply it at the appropriate time in Mechanical?  And I'm pretty sure I will be running similar but different analyses in the near future and I don't want to manually map all 100+ files by hand.

Aaron C. Caba, Ph.D.

Sr. Principal R&D Engineer II

BAE Systems, Inc. | Ordnance Systems, Inc.

E-mail: aaron.caba@baesystems.commailto:aaron.caba@baesystems.com | Mail:  4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&reserved=0 -----Original Message-----

From: Slater, Irene M <SlaterIM@corning.commailto:SlaterIM@corning.com>

Sent: Thursday, October 27, 2022 11:58 AM

To: XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>

Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer

External Email Alert

This email has been sent from an account outside of the BAE Systems network.

Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros.  For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.commailto:phishing@baesystems.com.

Aaron,

Workbench External Data makes this simple.  Usually, I have files for different time (or temperature) points.

First off, if it is from a Fluent or a CFX analysis - perhaps you could import their project to Mechanical and directly import the data, but that is if all the stars align.

Meaning, if your geometry/mesh is different, as I suspect it is, sometimes you'll need to do an interim thermal analysis.

Anyway, back to Engineering data - since you have the CSV file.

Click on the three dots and search for the file you want to read in.

Setup all the details properly:  choose 2D or 3D; scale/translate/revolve the incoming data; choose the proper column names; skip first/second/etc row if needed.  Verify that the data is read into Engineering Data properly.

Hook that up to a Mechanical analysis - and import it. You may not have the same csys as the CFD, so fix that.

Go back and forth between Engineering data and Mechanical, to make certain that the CFD data points align with your model.

Again, I usually have multiple files that represent different times - which can be read into ONE Engineering Data.

Actually, Engineering Data, with all the bells & whistles (yes, you can even "rotate" 2D data to create a 3D field) is pretty excellent and user friendly.

The subsequent mapping controls is rather nice too.  No need for an exact mesh match.

Regards,

Irene

-----Original Message-----

From: Caba, Aaron (US) via Xansys <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Sent: Thursday, October 27, 2022 10:45 AM

To: XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>

Subject: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer

I have a .csv file with time varying heat transfer information from a CFD analysis that I want to apply to a transient thermal model.  Is there an easy way to do this in WB using e.g. an External Data system, or do I need to dust off my APDL notes and start hacking in MAPDL?

When imported into an External Data, I can assign units to the HTC, X, Y, & Temp. columns, but there is not drop-down to assign Time.

HTC Solid (W/m^2-K),X (m),Y (m),Time (s),Temperature (K)

175.882249770533,-19.035485714285702,0.0139192000010409,0.251,2606.72

153.435713098819,-19.035485714285702,0.0141732000031226,0.251,2606.72

70.5855265126402,-18.4320865106402,0.0169545,0.251,2606.72

59.2383104668609,-18.131714803191,0.0169545,0.251,2606.72

47.0177289686141,-17.8313430977083,0.0169545,0.251,2606.72

Aaron C. Caba, Ph.D.

Sr. Principal R&D Engineer

BAE Systems, Inc.

4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&reserved=0


Xansys mailing list -- xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org To unsubscribe send an email to xansys-temp-leave@list.xansys.orgmailto:xansys-temp-leave@list.xansys.org If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day.

Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.ukmailto:xansys-mod@tynecomp.co.uk and not to the list _______________________________________________

Xansys mailing list -- xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org To unsubscribe send an email to xansys-temp-leave@list.xansys.orgmailto:xansys-temp-leave@list.xansys.org If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day.

Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.ukmailto:xansys-mod@tynecomp.co.uk and not to the list

Thanks all for the ideas! I ended up doing a little scripting, and using a cool copy-paste feature in Mechanical. I have 120 load case files, so I didn't want to do this manually. To create and setup the External Data system I recorded a Project script and ended up with something like Jeff's posted script. I recorded a project-level WBJN script of me manually creating an External Data and importing and setting-up a couple of files. From there it was pretty easy to add a loop to import all 120 files. I had the script written before I found the next solution, but it would work as well as my script. For applying the loads in Mechanical, Harish from ANSYS sent me a pointer to the help docs that directly addresses this problem: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v222/en/wb2_help/wb2h_MechLoadapp.html%23wb2h_ext_data_multi_set_ex A couple of cool copy-paste operations and I had applied 120 load cases in less than 30 seconds. Aaron C. Caba, Ph.D. Sr. Principal R&D Engineer II BAE Systems, Inc. | Ordnance Systems, Inc. E-mail: aaron.caba@baesystems.com<mailto:aaron.caba@baesystems.com> | Mail: 4050 Peppers Ferry Road, Radford VA 24143-0100 www.baesystems.com<http://www.baesystems.com/> -----Original Message----- From: Jeff Bronson <Jeff.Bronson@ansys.com> Sent: Thursday, October 27, 2022 4:25 PM To: XANSYS Mailing List Home <xansys-temp@list.xansys.org>; Caba, Aaron (US) <Aaron.Caba@baesystems.com> Subject: RE: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer External Email Alert This email has been sent from an account outside of the BAE Systems network. Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros. For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.com<mailto:phishing@baesystems.com>. Hi Aaron, I don't have an exact example for your situation but I think you can achieve what you are trying to do with some scripting. Irene is right that you have an additional "dimension" to your external data that makes it cumbersome to use the GUI manually for all the individual files. I have an example script that we use for adding a large number of thickness maps for 2D plane stress with thickness regions. You can run something like this on the Workbench project page to automate setting up the External Data system. I would set it up so that you have one External Data Cell that has 120 different Data Sources and the Identifier column has your time variable. These can all be scripted and you can even record your actions when you create or modify a the External Data cell through File -> Scripting -> Record Journal. You can run a journal macro through this same menu, or open a console window and enter script lines one by one. Here is an example of setting up External data to read a bunch of 2D thickness map files that start with a _ character from the project UserFiles directory: # setup External Data System for Thicknesses (Project Page) import os uFilesDir = GetUserFilesDirectory().ToString() StaticStrSys = GetSystem(Name='SYS') # Create and setup External Data system ExtDataTemplate = GetTemplate(TemplateName="External Data") thickSystem = ExtDataTemplate.CreateSystem(Position="Left",RelativeTo=StaticStrSys) thickSystem.DisplayText="Thicknesses" thickSetup = thickSystem.GetContainer(ComponentName="Setup") thickFilesPP=[] filesPP=os.listdir(uFilesDir) for file in filesPP: if file.StartsWith('_'): thickFilesPP.append(file) for tFile in thickFilesPP: tFilePath=os.path.join(uFilesDir,tFile) tAddedDataFile = thickSetup.AddDataFile(FilePath=tFilePath) tFileName=tFile[1:-4] tDataProperty = tAddedDataFile.GetDataProperty() tDataProperty.FileIdentifier=tFileName tDataProperty.SetDimensionType(Dimensions="Dimension2D") cx=tDataProperty.ColumnsData[0] tDataProperty.SetColumnDataType(ColumnData=cx,DataType="X Coordinate") cy=tDataProperty.ColumnsData[1] tDataProperty.SetColumnDataType(ColumnData=cy,DataType="Y Coordinate") ct=tDataProperty.ColumnsData[2] tDataProperty.SetColumnDataType(ColumnData=ct,DataType="Thickness") # Connect External Data to Static Str System setupComponent1 = StaticStrSys.GetComponent(Name="Model") setupComponent2 = thickSystem.GetComponent(Name="Setup") setupComponent2.TransferData(TargetComponent=setupComponent1) After the external data is setup, within Mechanical you can use the External Data object and create multiple lines within an Imported Heat Transfer object. This should also be able to be scripted. I don't have an example of this but within the Mechanical Scripting window (Automation tab -> Scripting) you should be able to record yourself setting one or two of the files up manually to see how it works, then nest it in a for loop to create all 120 load steps. I think this would be your most efficient option, the APDL route will be much slower due to the mapping algorithms being based on a less efficient method. Jeff Bronson / Principal Application Engineer 900 Victor's Way, Suite 350 / Ann Arbor, MI 48108 Mobile 734-272-5746 / office 734-213-1278 jeff.bronson@ansys.com<mailto:jeff.bronson@ansys.com> / www.ansys.com<http://www.ansys.com> -----Original Message----- From: Slater, Irene M <SlaterIM@corning.com<mailto:SlaterIM@corning.com>> Sent: Thursday, October 27, 2022 3:37 PM To: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>>; XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Subject: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer [External Sender] Aaron, Sorry. Yes, that is what I was suggesting. I agree, there should be a better way. Perhaps we will be lucky enough to have an ANSYS employee chime in and let us know if we are missing something. And if we aren't, maybe there will be an enhancement request that is created. I would not be surprised if this enhancement request is already on their list of things to do. Wouldn't it be great if some code (Iron python, ACT or whathaveyou) already exists to do this - and that someone wrote a blog about it? Personally, I think that if you use APDL - you may have to go through a time do-loop and that will be slow depending on the size of your model. Since you are saying lots of things happening/changing, I won't ask if you can remove any unnecessary ones after you have reviewed the data that you will be importing. By the way, it would have been so easy to do this directly from Thermal Mechanical - that would transfer the time (space varying) data very easily. And, I bet the same goes for ANSYS fluent solvers within the WB environment. Irene Slater Corning Incorporated -----Original Message----- From: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>> Sent: Thursday, October 27, 2022 12:06 PM To: Slater, Irene M <SlaterIM@corning.com<mailto:SlaterIM@corning.com>>; XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer Irene, The CFD was done in STAR-CCM+, so no easy linking there :( I've done the External Data thing with rotating the and mapping and it works great. My issue is I have 120 CSV files from 120 different time points through the analysis (lots is happening and changing). Per your instructions, would I need to import each CSV and apply it at the appropriate time in Mechanical? And I'm pretty sure I will be running similar but different analyses in the near future and I don't want to manually map all 100+ files by hand. Aaron C. Caba, Ph.D. Sr. Principal R&D Engineer II BAE Systems, Inc. | Ordnance Systems, Inc. E-mail: aaron.caba@baesystems.com<mailto:aaron.caba@baesystems.com> | Mail: 4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&amp;data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&amp;reserved=0 -----Original Message----- From: Slater, Irene M <SlaterIM@corning.com<mailto:SlaterIM@corning.com>> Sent: Thursday, October 27, 2022 11:58 AM To: XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>> Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer External Email Alert This email has been sent from an account outside of the BAE Systems network. Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros. For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.com<mailto:phishing@baesystems.com>. Aaron, Workbench External Data makes this simple. Usually, I have files for different time (or temperature) points. First off, if it is from a Fluent or a CFX analysis - perhaps you could import their project to Mechanical and directly import the data, but that is if all the stars align. Meaning, if your geometry/mesh is different, as I suspect it is, sometimes you'll need to do an interim thermal analysis. Anyway, back to Engineering data - since you have the CSV file. Click on the three dots and search for the file you want to read in. Setup all the details properly: choose 2D or 3D; scale/translate/revolve the incoming data; choose the proper column names; skip first/second/etc row if needed. Verify that the data is read into Engineering Data properly. Hook that up to a Mechanical analysis - and import it. You may not have the same csys as the CFD, so fix that. Go back and forth between Engineering data and Mechanical, to make certain that the CFD data points align with your model. Again, I usually have multiple files that represent different times - which can be read into ONE Engineering Data. Actually, Engineering Data, with all the bells & whistles (yes, you can even "rotate" 2D data to create a 3D field) is pretty excellent and user friendly. The subsequent mapping controls is rather nice too. No need for an exact mesh match. Regards, Irene -----Original Message----- From: Caba, Aaron (US) via Xansys <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Sent: Thursday, October 27, 2022 10:45 AM To: XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>> Subject: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer I have a .csv file with time varying heat transfer information from a CFD analysis that I want to apply to a transient thermal model. Is there an easy way to do this in WB using e.g. an External Data system, or do I need to dust off my APDL notes and start hacking in MAPDL? When imported into an External Data, I can assign units to the HTC, X, Y, & Temp. columns, but there is not drop-down to assign Time. HTC Solid (W/m^2-K),X (m),Y (m),Time (s),Temperature (K) 175.882249770533,-19.035485714285702,0.0139192000010409,0.251,2606.72 153.435713098819,-19.035485714285702,0.0141732000031226,0.251,2606.72 70.5855265126402,-18.4320865106402,0.0169545,0.251,2606.72 59.2383104668609,-18.131714803191,0.0169545,0.251,2606.72 47.0177289686141,-17.8313430977083,0.0169545,0.251,2606.72 Aaron C. Caba, Ph.D. Sr. Principal R&D Engineer BAE Systems, Inc. 4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&amp;data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&amp;reserved=0 _______________________________________________ Xansys mailing list -- xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org> To unsubscribe send an email to xansys-temp-leave@list.xansys.org<mailto:xansys-temp-leave@list.xansys.org> If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day. Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.uk<mailto:xansys-mod@tynecomp.co.uk> and not to the list _______________________________________________ Xansys mailing list -- xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org> To unsubscribe send an email to xansys-temp-leave@list.xansys.org<mailto:xansys-temp-leave@list.xansys.org> If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day. Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.uk<mailto:xansys-mod@tynecomp.co.uk> and not to the list
CA
Caba, Aaron (US)
Fri, Oct 28, 2022 1:57 PM

P.S. - Here's my final WB script to create the External Data system:

encoding: utf-8

2021 R2

import glob

SetScriptVersion(Version="21.2.209")
template1 = GetTemplate(TemplateName="External Data")
system2 = template1.CreateSystem(Position="Below")
setup1 = system2.GetContainer(ComponentName="Setup")

def timeFromFileName(fileName):
return float(fileName.split("_")[-1][0:-4])

def addDataFile(fileName):
fileData = setup1.AddDataFile(
FilePath=GetAbsoluteUserPathName(fileName))

fileTime = timeFromFileName(fileName)

property1 = fileData.GetDataProperty()
property1.SetDimensionType(Dimensions="Dimension2D")
property1.ThetaXYUnit = "degree"
property1.ThetaXY = -90

col_x = property1.ColumnsData[0]
property1.SetColumnDataType(ColumnData=col_x, DataType="X Coordinate")

col_y = property1.ColumnsData[1]
property1.SetColumnDataType(ColumnData=col_y, DataType="Y Coordinate")

col_htc = property1.ColumnsData[2]
property1.SetColumnDataType(ColumnData=col_htc, DataType="Heat Transfer Coefficient")
col_htc.Identifier = "HTC " + str(fileTime)

col_temperture = property1.ColumnsData[3]
property1.SetColumnDataType(ColumnData=col_temperture, DataType="Temperature")
col_temperture.Unit = "K"

fileData.SetStartImportAtLine(FileDataProperty=property1, LineNumber=2)

rootFolder = "C:/ ... /Project/Results/"
filePrefix = "htc_"
filelist = glob.glob(rootFolder + filePrefix + '*.csv')

Sort the list of files by time so they are imported

into the External Data in the desired order

file name format is:  htc_2.510000e-01.csv

file_time = []
for fileName in filelist:
fileTime = timeFromFileName(fileName)
file_time.append((fileName, fileTime))
file_time = sorted(file_time, key=lambda time: time[1])
filelist = []
for (f, _) in file_time:
filelist.append(f)

for fileName in filelist:
addDataFile(fileName)

  • Aaron

-----Original Message-----
From: Caba, Aaron (US) via Xansys xansys-temp@list.xansys.org
Sent: Friday, October 28, 2022 9:28 AM
To: XANSYS Mailing List Home xansys-temp@list.xansys.org
Cc: Caba, Aaron (US) Aaron.Caba@baesystems.com
Subject: [Xansys] Re: [WB or APDL?] Apply time varying heat transfer

External Email Alert

This email has been sent from an account outside of the BAE Systems network.
Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros.  For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.com.

Thanks all for the ideas!

I ended up doing a little scripting, and using a cool copy-paste feature in Mechanical.  I have 120 load case files, so I didn't want to do this manually.

To create and setup the External Data system I recorded a Project script and ended up with something like Jeff's posted script. I recorded a project-level WBJN script of me manually creating an External Data and importing and setting-up a couple of files.  From there it was pretty easy to add a loop to import all 120 files.  I had the script written before I found the next solution, but it would work as well as my script.

For applying the loads in Mechanical, Harish from ANSYS sent me a pointer to the help docs that directly addresses this problem:  https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v222/en/wb2_help/wb2h_MechLoadapp.html%23wb2h_ext_data_multi_set_ex

A couple of cool copy-paste operations and I had applied 120 load cases in less than 30 seconds.

Aaron C. Caba, Ph.D.
Sr. Principal R&D Engineer II
BAE Systems, Inc. | Ordnance Systems, Inc.

E-mail: aaron.caba@baesystems.commailto:aaron.caba@baesystems.com | Mail:  4050 Peppers Ferry Road, Radford VA 24143-0100 www.baesystems.comhttp://www.baesystems.com/

-----Original Message-----
From: Jeff Bronson Jeff.Bronson@ansys.com
Sent: Thursday, October 27, 2022 4:25 PM
To: XANSYS Mailing List Home xansys-temp@list.xansys.org; Caba, Aaron (US) Aaron.Caba@baesystems.com
Subject: RE: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer

External Email Alert

This email has been sent from an account outside of the BAE Systems network.

Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros.  For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.commailto:phishing@baesystems.com.

Hi Aaron,

I don't have an exact example for your situation but I think you can achieve what you are trying to do with some scripting.  Irene is right that you have an additional "dimension" to your external data that makes it cumbersome to use the GUI manually for all the individual files.  I have an example script that we use for adding a large number of thickness maps for 2D plane stress with thickness regions.  You can run something like this on the Workbench project page to automate setting up the External Data system.  I would set it up so that you have one External Data Cell that has 120 different Data Sources and the Identifier column has your time variable.  These can all be scripted and you can even record your actions when you create or modify a the External Data cell through File -> Scripting -> Record Journal.  You can run a journal macro through this same menu, or open a console window and enter script lines one by one.  Here is an example of setting up External data to read a bun  ch of 2D thickness map files that start with a _ character from the project UserFiles directory:

setup External Data System for Thicknesses (Project Page) import os uFilesDir = GetUserFilesDirectory().ToString()

StaticStrSys = GetSystem(Name='SYS')

Create and setup External Data system

ExtDataTemplate = GetTemplate(TemplateName="External Data") thickSystem = ExtDataTemplate.CreateSystem(Position="Left",RelativeTo=StaticStrSys)

thickSystem.DisplayText="Thicknesses"

thickSetup = thickSystem.GetContainer(ComponentName="Setup")

thickFilesPP=[]

filesPP=os.listdir(uFilesDir)

for file in filesPP:

if file.StartsWith('_'):

    thickFilesPP.append(file)

for tFile in thickFilesPP:

tFilePath=os.path.join(uFilesDir,tFile)

tAddedDataFile = thickSetup.AddDataFile(FilePath=tFilePath)

tFileName=tFile[1:-4]

tDataProperty = tAddedDataFile.GetDataProperty()

tDataProperty.FileIdentifier=tFileName

tDataProperty.SetDimensionType(Dimensions="Dimension2D")



cx=tDataProperty.ColumnsData[0]

tDataProperty.SetColumnDataType(ColumnData=cx,DataType="X Coordinate")



cy=tDataProperty.ColumnsData[1]

tDataProperty.SetColumnDataType(ColumnData=cy,DataType="Y Coordinate")



ct=tDataProperty.ColumnsData[2]

tDataProperty.SetColumnDataType(ColumnData=ct,DataType="Thickness")

Connect External Data to Static Str System

setupComponent1 = StaticStrSys.GetComponent(Name="Model")

setupComponent2 = thickSystem.GetComponent(Name="Setup")

setupComponent2.TransferData(TargetComponent=setupComponent1)

After the external data is setup, within Mechanical you can use the External Data object and create multiple lines within an Imported Heat Transfer object.  This should also be able to be scripted.  I don't have an example of this but within the Mechanical Scripting window (Automation tab -> Scripting) you should be able to record yourself setting one or two of the files up manually to see how it works, then nest it in a for loop to create all 120 load steps.

I think this would be your most efficient option, the APDL route will be much slower due to the mapping algorithms being based on a less efficient method.

Jeff Bronson  /  Principal Application Engineer

900 Victor's Way, Suite 350  /  Ann Arbor, MI 48108 Mobile 734-272-5746  /  office 734-213-1278

jeff.bronson@ansys.commailto:jeff.bronson@ansys.com  /  www.ansys.comhttp://www.ansys.com

-----Original Message-----

From: Slater, Irene M <SlaterIM@corning.commailto:SlaterIM@corning.com>

Sent: Thursday, October 27, 2022 3:37 PM

To: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>; XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Subject: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer

[External Sender]

Aaron,

Sorry. Yes, that is what I was suggesting.  I agree, there should be a better way.

Perhaps we will be lucky enough to have an ANSYS employee chime in and let us know if we are missing something.

And if we aren't, maybe there will be an enhancement request that is created.

I would not be surprised if this enhancement request is already on their list of things to do.

Wouldn't it be great if some code (Iron python, ACT or whathaveyou) already exists to do this - and that someone wrote a blog about it?

Personally, I think that if you use APDL - you may have to go through a time do-loop and that will be slow depending on the size of your model.

Since you are saying lots of things happening/changing, I won't ask if you can remove any unnecessary ones after you have reviewed the data that you will be importing.

By the way, it would have been so easy to do this directly from Thermal Mechanical - that would transfer the time (space varying) data very easily.  And, I bet the same goes for ANSYS fluent solvers within the WB environment.

Irene Slater

Corning Incorporated

-----Original Message-----

From: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>

Sent: Thursday, October 27, 2022 12:06 PM

To: Slater, Irene M <SlaterIM@corning.commailto:SlaterIM@corning.com>; XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer

Irene,

The CFD was done in STAR-CCM+, so no easy linking there  :(

I've done the External Data thing with rotating the and mapping and it works great.

My issue is I have 120 CSV files from 120 different time points through the analysis (lots is happening and changing).  Per your instructions, would I need to import each CSV and apply it at the appropriate time in Mechanical?  And I'm pretty sure I will be running similar but different analyses in the near future and I don't want to manually map all 100+ files by hand.

Aaron C. Caba, Ph.D.

Sr. Principal R&D Engineer II

BAE Systems, Inc. | Ordnance Systems, Inc.

E-mail: aaron.caba@baesystems.commailto:aaron.caba@baesystems.com | Mail:  4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&reserved=0 -----Original Message-----

From: Slater, Irene M <SlaterIM@corning.commailto:SlaterIM@corning.com>

Sent: Thursday, October 27, 2022 11:58 AM

To: XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>

Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer

External Email Alert

This email has been sent from an account outside of the BAE Systems network.

Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros.  For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.commailto:phishing@baesystems.com.

Aaron,

Workbench External Data makes this simple.  Usually, I have files for different time (or temperature) points.

First off, if it is from a Fluent or a CFX analysis - perhaps you could import their project to Mechanical and directly import the data, but that is if all the stars align.

Meaning, if your geometry/mesh is different, as I suspect it is, sometimes you'll need to do an interim thermal analysis.

Anyway, back to Engineering data - since you have the CSV file.

Click on the three dots and search for the file you want to read in.

Setup all the details properly:  choose 2D or 3D; scale/translate/revolve the incoming data; choose the proper column names; skip first/second/etc row if needed.  Verify that the data is read into Engineering Data properly.

Hook that up to a Mechanical analysis - and import it. You may not have the same csys as the CFD, so fix that.

Go back and forth between Engineering data and Mechanical, to make certain that the CFD data points align with your model.

Again, I usually have multiple files that represent different times - which can be read into ONE Engineering Data.

Actually, Engineering Data, with all the bells & whistles (yes, you can even "rotate" 2D data to create a 3D field) is pretty excellent and user friendly.

The subsequent mapping controls is rather nice too.  No need for an exact mesh match.

Regards,

Irene

-----Original Message-----

From: Caba, Aaron (US) via Xansys <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Sent: Thursday, October 27, 2022 10:45 AM

To: XANSYS Mailing List Home <xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org>

Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.commailto:Aaron.Caba@baesystems.com>

Subject: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer

I have a .csv file with time varying heat transfer information from a CFD analysis that I want to apply to a transient thermal model.  Is there an easy way to do this in WB using e.g. an External Data system, or do I need to dust off my APDL notes and start hacking in MAPDL?

When imported into an External Data, I can assign units to the HTC, X, Y, & Temp. columns, but there is not drop-down to assign Time.

HTC Solid (W/m^2-K),X (m),Y (m),Time (s),Temperature (K)

175.882249770533,-19.035485714285702,0.0139192000010409,0.251,2606.72

153.435713098819,-19.035485714285702,0.0141732000031226,0.251,2606.72

70.5855265126402,-18.4320865106402,0.0169545,0.251,2606.72

59.2383104668609,-18.131714803191,0.0169545,0.251,2606.72

47.0177289686141,-17.8313430977083,0.0169545,0.251,2606.72

Aaron C. Caba, Ph.D.

Sr. Principal R&D Engineer

BAE Systems, Inc.

4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&reserved=0


Xansys mailing list -- xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org To unsubscribe send an email to xansys-temp-leave@list.xansys.orgmailto:xansys-temp-leave@list.xansys.org If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day.

Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.ukmailto:xansys-mod@tynecomp.co.uk and not to the list _______________________________________________

Xansys mailing list -- xansys-temp@list.xansys.orgmailto:xansys-temp@list.xansys.org To unsubscribe send an email to xansys-temp-leave@list.xansys.orgmailto:xansys-temp-leave@list.xansys.org If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day.

Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.ukmailto:xansys-mod@tynecomp.co.uk and not to the list _______________________________________________
Xansys mailing list -- xansys-temp@list.xansys.org To unsubscribe send an email to xansys-temp-leave@list.xansys.org If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day.

Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.uk and not to the list

P.S. - Here's my final WB script to create the External Data system: # encoding: utf-8 # 2021 R2 import glob SetScriptVersion(Version="21.2.209") template1 = GetTemplate(TemplateName="External Data") system2 = template1.CreateSystem(Position="Below") setup1 = system2.GetContainer(ComponentName="Setup") def timeFromFileName(fileName): return float(fileName.split("_")[-1][0:-4]) def addDataFile(fileName): fileData = setup1.AddDataFile( FilePath=GetAbsoluteUserPathName(fileName)) fileTime = timeFromFileName(fileName) property1 = fileData.GetDataProperty() property1.SetDimensionType(Dimensions="Dimension2D") property1.ThetaXYUnit = "degree" property1.ThetaXY = -90 col_x = property1.ColumnsData[0] property1.SetColumnDataType(ColumnData=col_x, DataType="X Coordinate") col_y = property1.ColumnsData[1] property1.SetColumnDataType(ColumnData=col_y, DataType="Y Coordinate") col_htc = property1.ColumnsData[2] property1.SetColumnDataType(ColumnData=col_htc, DataType="Heat Transfer Coefficient") col_htc.Identifier = "HTC " + str(fileTime) col_temperture = property1.ColumnsData[3] property1.SetColumnDataType(ColumnData=col_temperture, DataType="Temperature") col_temperture.Unit = "K" fileData.SetStartImportAtLine(FileDataProperty=property1, LineNumber=2) rootFolder = "C:/ ... /Project/Results/" filePrefix = "htc_" filelist = glob.glob(rootFolder + filePrefix + '*.csv') # Sort the list of files by time so they are imported # into the External Data in the desired order # file name format is: htc_2.510000e-01.csv file_time = [] for fileName in filelist: fileTime = timeFromFileName(fileName) file_time.append((fileName, fileTime)) file_time = sorted(file_time, key=lambda time: time[1]) filelist = [] for (f, _) in file_time: filelist.append(f) for fileName in filelist: addDataFile(fileName) - Aaron -----Original Message----- From: Caba, Aaron (US) via Xansys <xansys-temp@list.xansys.org> Sent: Friday, October 28, 2022 9:28 AM To: XANSYS Mailing List Home <xansys-temp@list.xansys.org> Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.com> Subject: [Xansys] Re: [WB or APDL?] Apply time varying heat transfer External Email Alert This email has been sent from an account outside of the BAE Systems network. Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros. For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.com. Thanks all for the ideas! I ended up doing a little scripting, and using a cool copy-paste feature in Mechanical. I have 120 load case files, so I didn't want to do this manually. To create and setup the External Data system I recorded a Project script and ended up with something like Jeff's posted script. I recorded a project-level WBJN script of me manually creating an External Data and importing and setting-up a couple of files. From there it was pretty easy to add a loop to import all 120 files. I had the script written before I found the next solution, but it would work as well as my script. For applying the loads in Mechanical, Harish from ANSYS sent me a pointer to the help docs that directly addresses this problem: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v222/en/wb2_help/wb2h_MechLoadapp.html%23wb2h_ext_data_multi_set_ex A couple of cool copy-paste operations and I had applied 120 load cases in less than 30 seconds. Aaron C. Caba, Ph.D. Sr. Principal R&D Engineer II BAE Systems, Inc. | Ordnance Systems, Inc. E-mail: aaron.caba@baesystems.com<mailto:aaron.caba@baesystems.com> | Mail: 4050 Peppers Ferry Road, Radford VA 24143-0100 www.baesystems.com<http://www.baesystems.com/> -----Original Message----- From: Jeff Bronson <Jeff.Bronson@ansys.com> Sent: Thursday, October 27, 2022 4:25 PM To: XANSYS Mailing List Home <xansys-temp@list.xansys.org>; Caba, Aaron (US) <Aaron.Caba@baesystems.com> Subject: RE: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer External Email Alert This email has been sent from an account outside of the BAE Systems network. Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros. For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.com<mailto:phishing@baesystems.com>. Hi Aaron, I don't have an exact example for your situation but I think you can achieve what you are trying to do with some scripting. Irene is right that you have an additional "dimension" to your external data that makes it cumbersome to use the GUI manually for all the individual files. I have an example script that we use for adding a large number of thickness maps for 2D plane stress with thickness regions. You can run something like this on the Workbench project page to automate setting up the External Data system. I would set it up so that you have one External Data Cell that has 120 different Data Sources and the Identifier column has your time variable. These can all be scripted and you can even record your actions when you create or modify a the External Data cell through File -> Scripting -> Record Journal. You can run a journal macro through this same menu, or open a console window and enter script lines one by one. Here is an example of setting up External data to read a bun ch of 2D thickness map files that start with a _ character from the project UserFiles directory: # setup External Data System for Thicknesses (Project Page) import os uFilesDir = GetUserFilesDirectory().ToString() StaticStrSys = GetSystem(Name='SYS') # Create and setup External Data system ExtDataTemplate = GetTemplate(TemplateName="External Data") thickSystem = ExtDataTemplate.CreateSystem(Position="Left",RelativeTo=StaticStrSys) thickSystem.DisplayText="Thicknesses" thickSetup = thickSystem.GetContainer(ComponentName="Setup") thickFilesPP=[] filesPP=os.listdir(uFilesDir) for file in filesPP: if file.StartsWith('_'): thickFilesPP.append(file) for tFile in thickFilesPP: tFilePath=os.path.join(uFilesDir,tFile) tAddedDataFile = thickSetup.AddDataFile(FilePath=tFilePath) tFileName=tFile[1:-4] tDataProperty = tAddedDataFile.GetDataProperty() tDataProperty.FileIdentifier=tFileName tDataProperty.SetDimensionType(Dimensions="Dimension2D") cx=tDataProperty.ColumnsData[0] tDataProperty.SetColumnDataType(ColumnData=cx,DataType="X Coordinate") cy=tDataProperty.ColumnsData[1] tDataProperty.SetColumnDataType(ColumnData=cy,DataType="Y Coordinate") ct=tDataProperty.ColumnsData[2] tDataProperty.SetColumnDataType(ColumnData=ct,DataType="Thickness") # Connect External Data to Static Str System setupComponent1 = StaticStrSys.GetComponent(Name="Model") setupComponent2 = thickSystem.GetComponent(Name="Setup") setupComponent2.TransferData(TargetComponent=setupComponent1) After the external data is setup, within Mechanical you can use the External Data object and create multiple lines within an Imported Heat Transfer object. This should also be able to be scripted. I don't have an example of this but within the Mechanical Scripting window (Automation tab -> Scripting) you should be able to record yourself setting one or two of the files up manually to see how it works, then nest it in a for loop to create all 120 load steps. I think this would be your most efficient option, the APDL route will be much slower due to the mapping algorithms being based on a less efficient method. Jeff Bronson / Principal Application Engineer 900 Victor's Way, Suite 350 / Ann Arbor, MI 48108 Mobile 734-272-5746 / office 734-213-1278 jeff.bronson@ansys.com<mailto:jeff.bronson@ansys.com> / www.ansys.com<http://www.ansys.com> -----Original Message----- From: Slater, Irene M <SlaterIM@corning.com<mailto:SlaterIM@corning.com>> Sent: Thursday, October 27, 2022 3:37 PM To: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>>; XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Subject: [Xansys] Re: [EXTERNAL]--[WB or APDL?] Apply time varying heat transfer [External Sender] Aaron, Sorry. Yes, that is what I was suggesting. I agree, there should be a better way. Perhaps we will be lucky enough to have an ANSYS employee chime in and let us know if we are missing something. And if we aren't, maybe there will be an enhancement request that is created. I would not be surprised if this enhancement request is already on their list of things to do. Wouldn't it be great if some code (Iron python, ACT or whathaveyou) already exists to do this - and that someone wrote a blog about it? Personally, I think that if you use APDL - you may have to go through a time do-loop and that will be slow depending on the size of your model. Since you are saying lots of things happening/changing, I won't ask if you can remove any unnecessary ones after you have reviewed the data that you will be importing. By the way, it would have been so easy to do this directly from Thermal Mechanical - that would transfer the time (space varying) data very easily. And, I bet the same goes for ANSYS fluent solvers within the WB environment. Irene Slater Corning Incorporated -----Original Message----- From: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>> Sent: Thursday, October 27, 2022 12:06 PM To: Slater, Irene M <SlaterIM@corning.com<mailto:SlaterIM@corning.com>>; XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer Irene, The CFD was done in STAR-CCM+, so no easy linking there :( I've done the External Data thing with rotating the and mapping and it works great. My issue is I have 120 CSV files from 120 different time points through the analysis (lots is happening and changing). Per your instructions, would I need to import each CSV and apply it at the appropriate time in Mechanical? And I'm pretty sure I will be running similar but different analyses in the near future and I don't want to manually map all 100+ files by hand. Aaron C. Caba, Ph.D. Sr. Principal R&D Engineer II BAE Systems, Inc. | Ordnance Systems, Inc. E-mail: aaron.caba@baesystems.com<mailto:aaron.caba@baesystems.com> | Mail: 4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&amp;data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&amp;reserved=0 -----Original Message----- From: Slater, Irene M <SlaterIM@corning.com<mailto:SlaterIM@corning.com>> Sent: Thursday, October 27, 2022 11:58 AM To: XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>> Subject: RE: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer External Email Alert This email has been sent from an account outside of the BAE Systems network. Please treat the email with caution, especially if you are requested to click on a link, decrypt/open an attachment, or enable macros. For further information on how to spot phishing, access OSI IT Policies and report phishing by forwarding mail to phishing@baesystems.com<mailto:phishing@baesystems.com>. Aaron, Workbench External Data makes this simple. Usually, I have files for different time (or temperature) points. First off, if it is from a Fluent or a CFX analysis - perhaps you could import their project to Mechanical and directly import the data, but that is if all the stars align. Meaning, if your geometry/mesh is different, as I suspect it is, sometimes you'll need to do an interim thermal analysis. Anyway, back to Engineering data - since you have the CSV file. Click on the three dots and search for the file you want to read in. Setup all the details properly: choose 2D or 3D; scale/translate/revolve the incoming data; choose the proper column names; skip first/second/etc row if needed. Verify that the data is read into Engineering Data properly. Hook that up to a Mechanical analysis - and import it. You may not have the same csys as the CFD, so fix that. Go back and forth between Engineering data and Mechanical, to make certain that the CFD data points align with your model. Again, I usually have multiple files that represent different times - which can be read into ONE Engineering Data. Actually, Engineering Data, with all the bells & whistles (yes, you can even "rotate" 2D data to create a 3D field) is pretty excellent and user friendly. The subsequent mapping controls is rather nice too. No need for an exact mesh match. Regards, Irene -----Original Message----- From: Caba, Aaron (US) via Xansys <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Sent: Thursday, October 27, 2022 10:45 AM To: XANSYS Mailing List Home <xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org>> Cc: Caba, Aaron (US) <Aaron.Caba@baesystems.com<mailto:Aaron.Caba@baesystems.com>> Subject: [EXTERNAL]--[Xansys] [WB or APDL?] Apply time varying heat transfer I have a .csv file with time varying heat transfer information from a CFD analysis that I want to apply to a transient thermal model. Is there an easy way to do this in WB using e.g. an External Data system, or do I need to dust off my APDL notes and start hacking in MAPDL? When imported into an External Data, I can assign units to the HTC, X, Y, & Temp. columns, but there is not drop-down to assign Time. HTC Solid (W/m^2-K),X (m),Y (m),Time (s),Temperature (K) 175.882249770533,-19.035485714285702,0.0139192000010409,0.251,2606.72 153.435713098819,-19.035485714285702,0.0141732000031226,0.251,2606.72 70.5855265126402,-18.4320865106402,0.0169545,0.251,2606.72 59.2383104668609,-18.131714803191,0.0169545,0.251,2606.72 47.0177289686141,-17.8313430977083,0.0169545,0.251,2606.72 Aaron C. Caba, Ph.D. Sr. Principal R&D Engineer BAE Systems, Inc. 4050 Peppers Ferry Road, Radford VA 24143-0100 https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.baesystems.com%2F&amp;data=05%7C01%7Cjeff.bronson%40ansys.com%7C8fe1945b4a294739e33508dab8532d3b%7C34c6ce6715b84eff80e952da8be89706%7C0%7C0%7C638024964686501897%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=J5eRRd7WQQ8veeJxCp4PJsKIHiGh71%2B84BD1z2A8hxQ%3D&amp;reserved=0 _______________________________________________ Xansys mailing list -- xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org> To unsubscribe send an email to xansys-temp-leave@list.xansys.org<mailto:xansys-temp-leave@list.xansys.org> If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day. Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.uk<mailto:xansys-mod@tynecomp.co.uk> and not to the list _______________________________________________ Xansys mailing list -- xansys-temp@list.xansys.org<mailto:xansys-temp@list.xansys.org> To unsubscribe send an email to xansys-temp-leave@list.xansys.org<mailto:xansys-temp-leave@list.xansys.org> If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day. Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.uk<mailto:xansys-mod@tynecomp.co.uk> and not to the list _______________________________________________ Xansys mailing list -- xansys-temp@list.xansys.org To unsubscribe send an email to xansys-temp-leave@list.xansys.org If you are receiving too many emails from XANSYS please consider changing account settings to Digest mode which will send a single email per day. Please send administrative requests such as deletion from XANSYS to xansys-mod@tynecomp.co.uk and not to the list