Page 1 of 1

No of elements in OpenFOAM2Elmer.F90

Posted: 13 Feb 2022, 18:58
by spacedout
Good Sunday

There is a check around line 424 in that file:

IF (totElementsFound < nElements) THEN
CALL Fatal('OpenFOAM2ElmerSolver','Elmer #'//TRIM(I2S(myLocalRank))//' has ' &
//TRIM(I2S(nElements))//' elements, OpenFOAM found '//TRIM(I2S(totElementsFound)))
END IF

Why should it be fatal if OpenFOAM found a lesser amount of elements than Elmer has ? After all, it could be very well be that OpenFOAM is solving a physical problem that only requires a smaller mesh. Moreover, that problem may only need to compute a solution on a subset of the spatial domain that Elmer is working on. It was my understanding that EOF is able to interpolate field variables when the Elmer and OpenFOAM meshes are completely different.

Take care
Marc

Re: No of elements in OpenFOAM2Elmer.F90

Posted: 14 Feb 2022, 18:10
by raback
Hi Marc,

You're referring to EOF library module located in EOF-library github. While we helped to write this coupled I would recommend asking "vencels" about this module. It is not eminent from the topic that this is an EOF question.

-Peter

Re: No of elements in OpenFOAM2Elmer.F90

Posted: 18 Feb 2022, 23:25
by vencels
Elmer's computational domain can be larger than OF domain.
The user selects a body from the Elmer side that needs to be coupled with OF.

The line in the code that you refer to means that if Elmer asks OF for interpolated values (within a selected body) for a given points (at element centers, gauss or DG node coordinates), then OF should return values for all of them. Since EOF uses interpolation functionality of Elmer and OF, it cannot extrapolate or guess values that are outside OF domain.

1) Make sure that coupled Elmer body has the same dimensions as OF computational domain
2) If you have curved surfaces, then this error can be caused by fine Elmer and coarse OF meshes. Elmer might ask for a point that lies outside OF mesh.