No of elements in OpenFOAM2Elmer.F90

Mesh generators, CAD programs, and other tools
Post Reply
spacedout
Posts: 177
Joined: 30 Mar 2020, 23:27
Antispam: Yes

No of elements in OpenFOAM2Elmer.F90

Post 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
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: No of elements in OpenFOAM2Elmer.F90

Post 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
vencels
Posts: 63
Joined: 20 Sep 2016, 17:05
Antispam: Yes
Location: Latvia
Contact:

Re: No of elements in OpenFOAM2Elmer.F90

Post 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.
Post Reply