Python action troubleshooting

I’m attempting to use preCICE to couple a difficult FSI analysis in the carotid artery. The densities of the fluid and solid are close to one another, thus creating the dreaded “added mass” effect that must be overcome. I’ve initialized my flow solver (OpenFoam) with a steady state solution, and I’m attempting to use a Python action to slowly ramp up the force that’s applied to the structural mechanics solver (CalculiX). I copied the file from the source code and modified it a bit in order to have it ramp the force values. I then stuck the Python file one level above the directory where I am executing the analysis because I have more than one analysis I’d like to use this Python action on. I don’t believe that is affecting my situation, but it might.

Regardless, I end up getting an error coming from PythonAction.cpp because _module == nullptr. I added some debug statements to the source code and modified my precice-config.xml file so I could read them out in an attempt to figure out what’s going wrong. I can’t find it… Any help will be most appreciated.

The pertinent files follow:
precice-config.xml (4.4 KB)
solid.log (5.1 KB)
fluid.log (33.1 KB)

Looks like I jumped the gun a bit on reporting this here. I went searching further and found an issue on the preCICE GitHub page. I don’t have the same issue as what is reported in the bug, but reading about the bug helped me realize my problem. I was writing “” for the module name, when I should have just written “PythonAction”. Once I made that fix in my precice-config.xml file, all is well.

Here’s the issue, and the specific comment I read, just for completeness:


@Mike_Tree does it mean the issue is resolved? May I ask you to mark your solution in this case as “solution” so that this thread will be closed?

Yes, this issue is resolve. My apologies for forgetting to mark the solution. Thanks for the reminder!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.