-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update fluent adapter for compatibility with preCICE versions >= 2.0.0 #1
Comments
On branch update_fluent182 some first steps regarding compatibility of preCICE 1.2.0 and fluent 18.2 were undertaken. Current state:
|
I use precice/fluent-adapter at update_fluent182, and precice-1.2.0( ps. I just add some debug code) |
See this report for more details. |
…18.2. Main changes: Makefiles and user.udf as source specification, changes in api beacuse of name changes
Files to remove (they are part of preCICE, not the adapter, if they need to be in the same folder as the adapter due to the way Fluent links things copy them over each time)
Remarks:
|
What we need to do as well: document all functions. At least a few lines in front of every function. |
I have a customer who needs to couple Fluent (20.2.0) to Abaqus for an FSI simulation. We are looking to preCICE as a possible answer. What can I do to help? |
Hi @mtree22, We worked on this adapter some time ago and were able to get to a semi-working state. Back then we were working with FLUENT
If you want to work with this adapter I can provide assistance from the adapter side. From the perspective of Fluent the adapter is essentially a set of User-Defined Functions (UDFs) which are called by Fluent at particular instances in each timestep and these UDFs then call the preCICE API commands. |
I have a working version of Fluent 20.2.0 on Scientific Linux 7.7 which I've used to run transient simulations all the way to completion. I also compiled preCICE 2.2.0 on this same OS. I can successfully run preCICE tutorials and other FSI simulations using OpenFOAM and CalculiX using this preCICE version and the OpenFOAM and CalculiX adapters. I'm hoping this covers the first challenge. I will definitely switch to the update_fluent_19_5_R3 branch for my testing. Do you happen to have a directory and case file setup that I can start from? Maybe something that aligns with the preCICE tutorials already? I'm thinking a fluid-fluent directory just like the fluid-openfoam directory that exists in tutorials/perpendicular-flap, or something like that... If not, I can start from scratch and make one myself. Do you want me to report my findings here or somewhere else? |
You have definitely already overcome the first challenge of having an OS on which both Fluent and preCICE work.
In our initial attempts we were trying to get a 2D lid-driven cavity with a flexible bottom case to work. In this case the fluid cavity is simulated using Fluent and the flexible bottom is simulated using a dummy structural solver. I can point you to a very preliminary case setup. Please ask me if something is not clear in this case setup. I had not got this FSI case to work but I guess this is probably a good place to start rather than blank slate. It would be very helpful if you reported your findings and we can do this here in the issue. That way we also have a record of our discussion which we can later refer to. |
I found your Cavity2D case shortly after I wrote that last comment. Yes, this definitely seems to be the first place to start. I opened Cavity2D.cas in the fluent GUI just to see what it looks like, and it's complaining about the pre-compiled UDFs that exist the libudf sub-directory:
I'm thinking I have to delete what you have here and compile my own UDFs, right? |
Yes you have to delete the folder |
Ok, I deleted
BUT when I ran that, Fluent responded that it translated that to this command:
the
That definitely progressed the sim further, but I was still met with an error. It looks like the error hits inside I'm attaching several files. Any idea how to move past this? |
Firstly the A possible problem I realized is in the configuration file. The line:
is problematic. Can you change it to |
I changed line 44 to |
Okay, lets try to debug further. In the file
This is suspicious because it indicates that Fluent is using an MPI shipped with it, or a Fluent compiled with a specific MPI. This could be problematic if we try to use it with a preCICE installation which is not compiled with the same MPI. Diagnostics can be done as follows:
I am not sure if this is a problem, but it is definitely worth a shot. |
I was curious about something else based on the log files. In the
This made me wonder if Fluent was actually running in "parallel". This may be a concern because lines 86 and 87 of fsi.c overwrite the So, I commented out lines 86 and 87 and re-ran. This resulted in proceeding a little further into reading the Now, to answer your questions:
It also appears that Fluent uses a wrapper to control which implementation and version of MPI that it uses. This means it's possible to run Fluent using a locally-installed version of OpenMPI by defining an So, first I'm going to try and compile preCICE using the OpenMPI libraries that are included in the Fluent install, even though I don't know what version they are. If that doesn't work, I'll re-compile preCICE with an older version of OpenMPI and then use the |
Firstly thanks for continuing to pursue this, it is really valuable to revive the adapter 😃 It was known that Fluent starts processes I am eager to know what happens when you really manage to have the same OpenMPI for preCICE and Fluent. I expect this will resolve some cryptic errors for us. |
Ah, I was misunderstanding what was happening inside fsi.c with regard to the two processes. I think you'll find I misunderstand quite a bit... Regardless, I undid any of my changes (commenting out of lines, adding of printf statements) to fsi.c and re-compiled the UDF. Then, I tried to go compile preCICE with a version of OpenMPI before 4.0.0, but I was having trouble getting PETSc to build, so I ventured into the world of Intel compilers and have landed on a consistent set of PETSc and preCICE that was build on Intel MPI 2018.4.274. Similar to the Also, at some point I added a 2nd preCICE log file (fluentCSM_alldebug.log) that doesn't filter out any messages at all. It's probably overkill, but I thought it might be useful. run_fluent.txt is a copy of the shell script I use to kick off the sim. fluentCSM_alldebug.log |
I also spent a lot of time misunderstanding stuff in this adapter so we are pretty much on the same page there 😉 It is great that you managed to get Fluent and preCICE to compile with the same MPI. Could you please document this somewhere? When we get the adapter to a working state, it would be essential to have these steps in the documentation for future users. At some point we will try to integrate this in the adapter documentation. We never reached as far as you have right now, so now we will have to do some debugging together to figure out what is going wrong. I see that the error is now in the function Lines 268 to 278 in 714d77b
Can you check if the the increment of |
I've been documenting a lot of what I did in the README.md file. Details of how to get Fluent to use any MPI are specified there. I forked this repo, so maybe we should move this discussion to a pull request sometime? That may make it easier for you to see the exact changes I've made and comment on them. Regardless, I went ahead and added some printf statements between lines 274 and 275. I asked the code to spit out
Which seems to come from a message on line 256. I also noticed a comment from the preCICE log:
I checked the Here are some new log files from this latest run: |
Yes lets discuss the documentation and also all other changes in a pull request once we have something working here. I checked the One very trivial thing I noticed is that whenever you attach the Another possible reason for the preCICE error could be that in the adapter we have only one of the two processes Regarding the error of |
Yes, when I try and upload a file with the .xml extension to these comments, GitHub yells at me as says that this filetype is not supported. The same thing happens with the fluent-2022*.log files. They are actually output in a .trn format. GitHub complains about that too. So, I just make a copy of them on my simulation directory and change the file extension. I'm certainly still running the simulation with a
Yes, I can open the GUI and run from within there. What would you like me to check out in the GUI? |
Okay, I was not aware of GitHub complaining then! I had another question regarding the configuration. You said that at some point you corrected some stuff regarding the consistent / conservative mapping right? Can you please send over the new config file? I just want to make sure we are not making some mistakes there.
I think it would be a good idea to check if all the instructions from this section are being done correctly. Can you open the |
Of course, here is the config file I'm using: And here is a diff file summarizing the changes I made:
Yes, I just opened Fluent GUI. Before opening the GUI, I defined the
From here I can successfully read the Cavity2D.cas file. Upon loading that file I checked the following:
All of this seems to be in order, if you ask me. |
All the GUI steps look to be in order. I think there is a problem with the object The I know that what I am suggesting is very vague and could possibly not lead us anywhere, but we have never really got this far with the adapter in recent times so we have to really look everywhere possible to figure out the problem. |
@mtree22 in addition to our discussion here over the last few days, lets try to have an extended discussion during the upcoming workshop on the user support day. We will upload the workshop schedule shortly and I will make it a point to have a time slot for us to talk. |
@IshaanDesai That sounds great! I'm already registered for the workshop and am looking forward to attending. In the meantime I'm trying to test out the domain object at the different stages of the adapter code. I wrote a "debug_udf.c" file that only calls a DEFINE_INIT macro to read in the domain object, but before I call
where lines 639-808 defines the struct called "domain_struct" that is behind the So, I'm trying to print values from
To try and give myself a sense of whether or not the domain exists, and whether something happens to it within |
Hi @mtree22 Sorry for the delayed response, things are busy as the workshop is close.
It is already promising that these values return some values other than
From what you are describing my guess is that Unfortunately I cannot see these things for myself as I do not have a running Fluent installation. The workshop is going to be a good platform for us to try things together 😄 |
This issue has been mentioned on preCICE Forum on Discourse. There might be relevant details there: https://precice.discourse.group/t/precice-workshop-2022-introduce-yourself/904/8 |
I don't think this is the case. I can grep the
line 739 of
Upon viewing dynamesh_tools.h, I see that the While looking at all of this, there are I'll continue working on this as much as possible before our meeting next Thursday (24 Feb). Also, do you mind if that meeting is during either of the last 2 blocks ( 13:00 - 15:00 or 16:00 - 18:00 CET)? I live in the eastern part of the United States, so I'm 6 hours behind Central European Time. If we schedule our meeting during that first block of time it will be an awful early morning for me (04:00). |
@mtree22 lets continue this discussion via the workshop on Thursday. I will arrange for us to meet in the later two blocks, thats not a problem 👍 |
@IshaanDesai @BenjaminRodenberg I jumped back into this today in preparation for our discussion tomorrow. I've made a bit of progress, so I wanted to note it here so we can all start on the same page. In order to pair down the problem, I wrote my own udf file ( I researched a bit online and found these instructions, which I'm using to step through the udf code line-by-line until the error occurs. Using this, I found that the error occurs on line 308 of my current working version of fsi.c. Again, I've added A LOT of printf and message statements, so this line number no longer makes sense. Instead, this equates to line 298 in this branches fsi.c file:
I'm hoping to be able to share my screen with you to show you gdb in progress while we step through the code together. From here, maybe we find an easy fix and everything just works out. Or, maybe we move on to the next challenge and strategize on how to tackle it. Talk to you tomorrow! |
We held a meeting as part of the preCICE workshop 2022 and learned some things about the Fluent adaptor. The current status is that a Fluent adaptor is not possible due to Boost library version incompatibilities. See here: #23 (comment) |
@mtree22 I updated the milestone with issues that are directly connected to getting the adapter running (https://github.com/precice/fluent-adapter/milestone/1). I would suggest to define preCICE 2.3.0 and Fluent 21.2.0 as our baseline until we get to a working state. Could you also push your latest updates? Let's use this branch for our work: https://github.com/precice/fluent-adapter/tree/fluent_21_2_0. I think the other branches are becoming a bit confusing, because they are very outdated. |
The current version (https://github.com/precice/fluent-adapter/commits/master) of this adapter is heavily outdated and does not work with recent preCICE versions. This issue should provide an overview over the progress of this task.
API calls that have to be updated
Possible Refactoring
all_indices
tovertexIDs
fsi.c
? Is this allowed for ufs? Currently there is a lot of functionality in one single file.Documentation of
fsi.c
fsi_init
fsi_write_and_advance
fsi_grid_motion
fsi_plot_coords
count_dynamic_threads
gather_write_positions
gather_read_positions
read_displacements
write_forces
check_write_positions
check_read_positions
regather_read_positions
Allow remeshing #4regather_write_positions
Allow remeshing #4Documentation of fsi_udf.c
Remove files
The text was updated successfully, but these errors were encountered: