Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Frédéric Simonis
@fsimonis
See the coupling workflow docs for more information.
Yang Luo
@YangLuo0818

but mapping:rbf-thin-plate-splines is maybe not the best choice if your fluid (interface) mesh is large. Better use compact basis functions. Read more here: https://precice.org/configuration-mapping.html#radial-basis-function-mapping

Hello, @uekerman Benjamin, if we choose compact basis functions such as rbf-compact-tps-c2 as you recommend, is PETSc required to be installed?

Boris Martin
@boris-martin
If I remember right, PETSc is not required, but highly recommended, as otherwise a QR decomposition is used, which is inefficient with sparse matrices and not paralle
Yang Luo
@YangLuo0818
Boris, thanks! Does rbf-compact -tps need a pre-estimate parameter such as a shape-parameter?
Boris Martin
@boris-martin
Yes, and the shape parameter is actually the support radius when using compact functions
(Again, from memory, not 100% sure)
Yang Luo
@YangLuo0818
I saw there is a python tool tool to estimate this radius, normally we choose m=3~5?
Boris Martin
@boris-martin
That's what I heard yes
AymenAmiral1997
@AymenAmiral1997
hello everyone i have a question from who is the better in the IFS FEnics or calculiX ? and why?
Benjamin Rodenberg
@BenjaminRodenberg
@AymenAmiral1997 Do you mean FSI in general? This is hard to answer... I personally prefer FEniCS, because I know it better and you write down the equations that you want to solve on your own. This is also a weakness to some degree: You have to write down the equations and you have to write the solver + time stepping on your own. With CalculiX you get more "out-of-the-box", but also less control over what is happening and less flexibility. So short answer here: It depends a lot on what you need. If you want, you can also describe your application in our discourse forum in detail and this might help us to give a better answer (https://precice.discourse.group/).
Gerasimos Chourdakis
@MakisH

@AymenAmiral1997 that's a difficult question to answer. I will rephrase your question to "which structure solver should I use for FSI with preCICE". Assuming that you are not already familiar with one of the two (which would be the natural option):

  • FEniCS is a framework in which you have to (and can) define your own solver. You can use some of our tutorials as starting points. Similarly for deal.II (which we have more experience with for FSI).
  • CalculiX is a ready-to-use solver for structure FEM simulations. It is a bit old, but well-tested by its community. It has a bit of cryptic configuration format and post-processing tools, though.

At the bottom of this page you can see that we get similar results with both.

At the end of the day, I would suggest to use deal.II or FEniCS if you are willing to edit/write some code and you want to know exactly what is going on, or use CalculiX if you want a larger palette of options already implemented.

AymenAmiral1997
@AymenAmiral1997
@MakisH @BenjaminRodenberg thanks for the answers, i want to do the couplage with openfoam but i dont know who is the simple and effective between FEnics and calculiX
hinci
@hinci

Hello. I used to precice 1.6.1 for FSI simulation. Simulations completed with no error. Now I want to use precice 2.3.0 for same simulations. I installed and tested tutorials there are no error. I use nearest-neighbor mapping for my case and there is error "Mapping distance not available due to empty partition." and fluid stuck. I tried rbf-thin-plate-splines mapping this error does not occur but fluid still stuck. Full error text;

---[precice] Mapping distance not available due to empty partition.
---[precice] Mapping distance not available due to empty partition.
[Harun:00195] Process received signal
[Harun:00195] Signal: Floating point exception (8)
[Harun:00195] Signal code: Integer divide-by-zero (1)
[Harun:00195] Failing at address: 0x7fb4a460ceb1
[Harun:00195] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x143c0)[0x7fb4a3e7e3c0]
[Harun:00195] [ 1] /home/harun/preCICE/precice-2.3.0/lib/libprecice.so.2(_ZN7precice9partition17ReceivedPartition22createOwnerInformationEv+0xca1)[0x7fb4a460ceb1]
[Harun:00195] [ 2] /home/harun/preCICE/precice-2.3.0/lib/libprecice.so.2(_ZN7precice9partition17ReceivedPartition7computeEv+0x3ff)[0x7fb4a460d97f]
[Harun:00195] [ 3] /home/harun/preCICE/precice-2.3.0/lib/libprecice.so.2(_ZN7precice4impl19SolverInterfaceImpl17computePartitionsEv+0x1df)[0x7fb4a462cf8f]
[Harun:00195] [ 4] /home/harun/preCICE/precice-2.3.0/lib/libprecice.so.2(_ZN7precice4impl19SolverInterfaceImpl10initializeEv+0x502)[0x7fb4a463e6e2]
[Harun:00195] [ 5] SU2_CFD(+0x7176c0)[0x55ba40ad76c0]
[Harun:00195] [ 6] SU2_CFD(+0x52e704)[0x55ba408ee704]
[Harun:00195] [ 7] SU2_CFD(+0x179894)[0x55ba40539894]
[Harun:00195] [ 8] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fb4a3c9c0b3]

How can I fix this issue? Can someone help me? Thanks.

Kürşat Yurt
@kursatyurt
@hinci which CFD and CSD software you are using? Are you using your own adapters or the preCICE ones? Could you open a topic on discourse with more information? I had similar problem while porting my adapters to preCICE I might help you if you are using your own adaptors
hinci
@hinci
Hi @kursatyurt I use SU2 for CFD, Calculix for CSD. The old version precice-config.xml has distribution-type="gather-scatter" but the new version did not recognise and I have to delete this part. Maybe It is the problem but i don't know how to use gather-scatter the new version.
@kursatyurt Also I saw your discourse topic, you say the problem gather scatter. But I don't know how to use gather scatter the new version of precice 2.3.0.
Ishaan Desai
@IshaanDesai
@hinci if you want to find the right usage of the tag gather-scatter with preCICE v2.3.0, have a look at the XML configuration documentation on our website. There you will find various configuration options and also the relevant tags in each of them.
hinci
@hinci
Thank you @IshaanDesai I will look.
hinci
@hinci
I include the command but still same error occur :(
Kürşat Yurt
@kursatyurt
AFAIK gather-scatter only has an effect if solvers are running in parallel. For debugging I would run on 1 proc both the CSD/CFD solvers. If it still throws the same error from my experience it is related to meshes somehow the construction of meshes on preCICE is skipped.
hinci
@hinci
Hi @kursatyurt I tried serial. There are no error but CFD stuck. I can solve this configuration and meshes with old version of precice.
I will open a topic on discourse.
AymenAmiral1997
@AymenAmiral1997
hello everyone i want to learn FEniCs for CFD but i dont have a good source can you give an advices?
Boris Martin
@boris-martin
Try "The FEniCS tutorial", it's a free book with lots of examples
(some parts are slightly out of date though)
AymenAmiral1997
@AymenAmiral1997
@boris-martin thanks
Pranjan2
@Pranjan2
Hi,
I am trying to run SU2 with Calculix on a large cluster. I launch both applications using a shell script., which is in turn controlled by a python script. The python script essentially takes all the necessary files and rearranges them into "Fluid" and "Solid" sub directories and then calls "execute.sh" to launch both applications. For smaller cases, this workflow works. However, for a large case, precice gets stuck at the following stage:
---[precice] Setting up preliminary slaves communication to coupling partner/s
---[precice] Receive global mesh Calculix_Mesh
---[precice] Prepare partition for mesh SU2_Mesh0
---[precice] Broadcast mesh Calculix_Mesh
---[precice] Filter mesh Calculix_Mesh by bounding box on slaves
---[precice] Mapping distance min:4.2294e-10 max:3.29171 avg: -nan var: -nan cnt: 928
---[precice] Mapping distance min:4.2294e-10 max:3.29171 avg: -nan var: -nan cnt: 928
I am not sure what the problem might be. I also tried running the shell script directly and it Precice seems to work fine
AymenAmiral1997
@AymenAmiral1997
hello everyone i have a question for how to do a couplage between openfoam and calculix in the example perpendicular flap? i create an other flap and i want to do the couplage?
Arved Enders-Seidlitz
@arvedes

Hi, I have a problem with the RBF interpolation in the fenics-x adapter. When I run my simulation I get the following warning:

WARNING:py.warnings:/usr/local/lib/python3.8/dist-packages/scipy/interpolate/rbf.py:257: LinAlgWarning: Ill-conditioned matrix (rcond=5.53004e-22): result may not be accurate.
  self.nodes = linalg.solve(self.A, self.di)

I found out that the interpolated values in my coupling_expression differ by 10°C from those in precice.read_data() and the simulation diverges. Do you have any idea how I could debug that?
When I set the values from precice.read_data() manually on my coupling expression the simulation works well.

Benjamin Uekermann
@uekerman
The condition of the matrix does not depend on the actual values. In such a situation, I would always export the mesh as vtk and look at it. Maybe, you have to mark some axis as dead?
The interpolation problem might not be well-defined if you map along an axis-symmetric surface. This means, preCICE tries to compute, for example, a 3D interpolant out of 2D information. If so, preCICE throws an error RBF linear system has not converged or Interpolation matrix C is not invertible. In this case, you can restrict the interpolation problem by ignoring certain coordinates, e.g. x-dead="true" to ignore the x coordinate.
Arved Enders-Seidlitz
@arvedes
image.png
It looks like this for the solid participant, it is the way I want it to be.
The interpolation from fluid participant to solid participant in the library works well, it is the RBF interpolation used in the adapter (from the points shown here to the same points again) that causes the problem.
Benjamin Rodenberg
@BenjaminRodenberg
@arvedes maybe an idea: The RBF interpolation in the FEniCS adapter uses a segregated RBF interpolation. Details are outlined in "Lindner, F., Mehl, M., & Uekermann, B. (2017). Radial basis function interpolation for black-box multi-physics simulations.". Rough idea: You first fit a polynomial, then you use RBF to approximate the remaining error between polynomial fit and actual data. This helps to exactly approximate data originating from a polynomial (like in the partitioned heat example). Can you try to remove the polynomial fit here: https://github.com/precice/fenicsx-adapter/blob/55366fbf7ade3d4018288be7f32762beb83fa0c0/fenicsxprecice/expression_core.py#L174 ? I will also quickly check whether there is an alternative implementation somewhere in the (legacy) FEniCS adapter.
This here is the pure RBF interpolation without the polynomial fitting: https://github.com/precice/fenics-adapter/blob/297944d234930235d36bcc155aaecb9b8fbdee96/fenicsadapter/expression_core.py#L160-L218 do you observe any differences?
Arved Enders-Seidlitz
@arvedes
Great, I will try that after lunch!
Benjamin Rodenberg
@BenjaminRodenberg
fyi: We cleaned this up here, because we did not see a usecase for the non-segregated version anymore (precice/fenics-adapter#86). If there is an observable difference, we obviously found a use-case.
Arved Enders-Seidlitz
@arvedes

I found out the following: It's better with the Rbf (max error of 15%) compared to segregated_interpolant_2d (max error of 19%). I used the following code

from scipy.interpolate import Rbf
from scipy.linalg import lstsq
import numpy as np

coords_x = np.loadtxt("interpolation_coords_x.txt")
coords_y = np.loadtxt("interpolation_coords_y.txt")
data = np.loadtxt("interpolation_data.txt")
def segregated_interpolant_2d(coords_x, coords_y, data):
    ...

rbf_interp = Rbf(coords_x, coords_y, data)
print(max(abs((rbf_interp(coords_x, coords_y) - data)/data)))

seg_interp = segregated_interpolant_2d(coords_x, coords_y, data)
print(max(abs((seg_interp (coords_x, coords_y) - data)/data)))

with coords, data exported from the simulation.

Benjamin Rodenberg
@BenjaminRodenberg

Both errors look too large to me. Rbfs are interpolating, so I would expect a much lower error. Here just an example with artificial data:

from scipy.interpolate import Rbf
import numpy as np
x = np.random.rand(100)
y = np.random.rand(100)
d = np.random.rand(100)
rbf = Rbf(x,y,d)
print(np.max(abs((rbf(x,y) - d)/d)))

If your data fluctuating a lot, the error might become large, though. I can simulate this effect with my toy example, by artificially scaling some values:

from scipy.interpolate import Rbf
import numpy as np
x = np.random.rand(100)
y = np.random.rand(100)
d = np.random.rand(100)
d[::2] *= 1000000
rbf = Rbf(x,y,d)
print(np.max(abs((rbf(x,y) - d)/d)))

Because this starts to look complicated and I don't really see a clear solution: Can we move to discourse? https://precice.discourse.group/
Then you could also share your data and I can take a look at it.

Arved Enders-Seidlitz
@arvedes
Thank you for the first comments :)
Kyle Davis
@KyleDavisSA
I answered in Discourse. For those following here, I did not get an error when using a different basis function. I used rbf = Rbf(coords[0,:], coords[1,:], data, function='thin-plate')and did not get any error. Without the added basis function I was able to recreate the problem.
Alexander Jaust
@ajaust
What is the best/preferred way to cite your preCICE v2 paper/preprint? arxiv or Open Research Europe?
Ishaan Desai
@IshaanDesai
Citing the Open Research Europe version would be more appropriate
Alexander Jaust
@ajaust
Thanks!
Frédéric Simonis
@fsimonis
@/all In case, you haven't heard through other channels: We got a new release! 2.4.0 :tada:
Checkout the blog post for a full overview.
Binding releases will follow soon.