[Scons-users] SCons for Ansys APDL Analysis

Brindley, Kyle Andrew kbrindley at lanl.gov
Wed Jan 3 12:26:35 EST 2024


Chris,

Thanks for the feedback. I'm glad the project looks useful!

Regarding the change directory commands in the action strings, this is mostly to address the limited options available in computational engineering software (Abaqus, Ansys, ect.) for redirecting output files outside the current working directory. Even for software that does provide output directory control, the options vary widely in name and behavior making it easier to handle all engineering software with a common directory change solution. It's not the normal way to run SCons, but I would characterize this as a limitation of the software we're driving and not a limitation of SCons.

If you haven't seen it yet, Ansys now has a Python API: https://docs.pyansys.com/version/dev/. I haven't used APDL, but I suspect the Python interface is more user friendly.

Hopefully you won't have to inspect or write too much source for your applications. I still can't promise Ansys support, but I'm happy to answer questions and address any difficulties you encounter.


Regards,





[signature_61897647]

Kyle Brindley, PhD

R&D Engineer

Advanced Engineering Analysis
pronouns: he/him/his



Los Alamos National Laboratory

http://lanl.gov



[signature_2770465158]<https://urldefense.com/v3/__https://www.instagram.com/losalamosnatlab/__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVoabZLQg$>[signature_954204818]<https://urldefense.com/v3/__https://twitter.com/LosAlamosNatLab__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFWcEY2xwA$>[signature_314665]<https://urldefense.com/v3/__https://www.linkedin.com/company/los-alamos-national-laboratory__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVu2TvhHA$>[signature_1590606376]<https://urldefense.com/v3/__https://www.facebook.com/LosAlamosNationalLab/__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVUUp6VRA$>

________________________________
From: Hubley, Christopher (GE Aerospace, US) <Christopher.Hubley at ge.com>
Sent: Saturday, November 4, 2023 7:01 AM
To: Brindley, Kyle Andrew <kbrindley at lanl.gov>; scons-users at scons.org <scons-users at scons.org>
Subject: [EXTERNAL] RE: [Scons-users] SCons for Ansys APDL Analysis


Kyle,

I just wanted to take a second to respond to your message and thank you for recommending WAVES. I think that your response slipped by me…



I tried and gave up on scons a year ago because I couldn’t get it to launch the ANSYS interpreter in my variant directory with my custom builder.



Here we are a year later… and I re-approached scons for a bolted joint analysis that I am working on in Python. I guess Chris does analysis in the third quarter.



The waves project looks cool!

It looks like you’ve written a scanner which parses Abaqus scripts and grabs dependencies? Very neat.



I inspected your code a bit and it looks as if you solved the problem that I had by changing directories prior to executing your build action, and feeding the interpreter absolute paths to the input files.



    #python/scons

    action = [f"{_cd_action_prefix} {program}..."]



Maybe that doesn’t seem like the normal way to run scons, but hey… if it works, it works. It solves the problem that I was having.

It also makes me feel a bit better… I felt like I was going insane when I couldn’t get scons to build where it was supposed to.



Here’s a minimal example of what I was trying to achieve…



Before building…

    project_root/

        SConstruct

        site_scons/

            site_init.py<https://urldefense.com/v3/__http://site_init.py__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFWB9S3_kQ$>

        source/

            SConscript

            model.db

            runfile.apdl

            boundary_conditions/

                case_001.inp

                case_002.inp

                ...



After building…

    project_root/

        SConstruct

        site_scons/

            site_init.py<https://urldefense.com/v3/__http://site_init.py__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFWB9S3_kQ$>

        source/

            SConscript

            model.db

            generate_runfiles.py<https://urldefense.com/v3/__http://generate_runfiles.py__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVrEq7fNA$>

            runfile_template.apdl

            boundary_conditions/

                case_001.inp

                case_002.inp

                ...

        results/

            mission_case_001.db

            mission_case_001.rst

            mission_case_001.out

            mission_case_001.err

            mission_case_002.db

            mission_case_002.rst

            mission_case_002.out

            mission_case_002.err

            ...



…where each mission case is run independently in the SConscript file.



I might give scons/waves another go for my next model. Thanks again!



-Chris



From: Brindley, Kyle Andrew <kbrindley at lanl.gov>
Sent: Thursday, May 11, 2023 2:16 PM
To: scons-users at scons.org
Subject: EXT: Re: [Scons-users] SCons for Ansys APDL Analysis



WARNING: This email originated from outside of GE. Please validate the sender's email address before clicking on links or attachments as they may not be safe.

Christopher,



I’m an R&D engineer from the Advanced Engineering Analysis group at Los Alamos National Laboratory (LANL). My background is computational materials science and structural analysis. I lead the WAVES software project with the goal of providing workflow automation for engineering analysis parametric studies. WAVES is developed by a small team of computer scientists and R&D engineers and our primary target audience is the engineering analysts in our group.



A colleague stumbled on your October 2022 email to the SCons users listserv “SCons for Ansys APDL Analysis” here: https://pairlist4.pair.net/pipermail/scons-users/2022-October/009077.html<https://urldefense.com/v3/__https://pairlist4.pair.net/pipermail/scons-users/2022-October/009077.html__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVhJMzIxQ$>



It was a timely email, but I had not yet joined the SCons listserv. We started the WAVES project in April 2022 to manage engineering simulation dependencies exactly as you describe, with the first open-source release this past January. We have a small, but growing internal user base that has used SCons and WAVES to good effect. My group at LANL primarily uses Abaqus, so the builders and tutorials are Abaqus-centric, but I believe you could adopt the software to Ansys using the examples.



  *   GitHub: https://github.com/lanl/waves<https://urldefense.com/v3/__https://github.com/lanl/waves__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFXpxiNeOQ$>
  *   GitHub-Pages: https://lanl.github.io/waves/<https://urldefense.com/v3/__https://lanl.github.io/waves/__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFUGv-xEWw$>



While LANL does have some Ansys users, I can’t promise Ansys or external support at this time. However, I would be happy to learn about your use cases, hear about your experiences adapting SCons to engineering analysis, and discuss any feedback you may have.



Regards,





[signature_61897647]

Kyle Brindley, PhD

R&D Engineer

Advanced Engineering Analysis
pronouns: he/him/his



Los Alamos National Laboratory

http://lanl.gov



[signature_2770465158]<https://urldefense.com/v3/__https://www.instagram.com/losalamosnatlab/__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVoabZLQg$>[signature_954204818]<https://urldefense.com/v3/__https://twitter.com/LosAlamosNatLab__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFWcEY2xwA$>[signature_314665]<https://urldefense.com/v3/__https://www.linkedin.com/company/los-alamos-national-laboratory__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVu2TvhHA$>[signature_1590606376]<https://urldefense.com/v3/__https://www.facebook.com/LosAlamosNationalLab/__;!!Bt8fGhp8LhKGRg!HsmqgENTGhP-c2OqxKw89170IcpyGgme_iX9gaX1ShjL2fnq0Pigzwh3ERHWb755UMfI3nR_GA7XRLgEVFVUUp6VRA$>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 9560 bytes
Desc: image001.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 2866 bytes
Desc: image002.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 2234 bytes
Desc: image003.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0012.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1971 bytes
Desc: image004.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0013.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 1522 bytes
Desc: image005.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0014.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 9560 bytes
Desc: image.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0015.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 2866 bytes
Desc: image.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0016.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 2234 bytes
Desc: image.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0017.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 1971 bytes
Desc: image.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0018.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 1522 bytes
Desc: image.png
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20240103/53824f37/attachment-0019.png>


More information about the Scons-users mailing list