Change of behaviour of SaveScalars solver

Numerical methods and mathematical models of Elmer
Post Reply
gagliar
Posts: 80
Joined: 04 Sep 2009, 16:34
Location: LGGE - Grenoble
Contact:

Change of behaviour of SaveScalars solver

Post by gagliar »

Dear all,

I have noticed a change in the behaviour of the "Boundary Sum" of the SaveScalars solver.

When doing

Code: Select all

Variable 2 = String "Stress Vector 1"
Operator 2 = String "Boundary Sum"
in SaveScalars solver for two boundaries (i.e. Save Scalars = Logical True in BC1 and BC3),

I was getting two outputs, one sum for BC1 and one sum for BC3 (revision: 997386b2, compilation date: 2021-06-17)
2: boundary sum: stress vector 1 over bc 1
3: boundary sum: over bc 3

whereas now (revision: 762e8f2db, compilation date: 2023-09-12), I only get one output which is the sum over the two BCs.
2: boundary sum: stress vector 1 over bc save scalars

Is there a way to get the sum separately over the two BC (the old feature)?

Regards,
Olivier
tzwinger
Site Admin
Posts: 100
Joined: 24 Aug 2009, 12:20
Antispam: Yes

Re: Change of behaviour of SaveScalars solver

Post by tzwinger »

That is odd, since according to the history in github the most recent change in this file is 4 months old and doesn't seem to affect the described behaviour https://github.com/ElmerCSC/elmerfem/co ... calars.F90
tzwinger
Site Admin
Posts: 100
Joined: 24 Aug 2009, 12:20
Antispam: Yes

Re: Change of behaviour of SaveScalars solver

Post by tzwinger »

Oh, I wasn't aware you had a two year old Elmer version installed.
raback
Site Admin
Posts: 4832
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Change of behaviour of SaveScalars solver

Post by raback »

Hi Olivier,

This may have been intentional. This operator is a little problematic:

Code: Select all

Operator 2 = String "Boundary Sum"
If the two boundaries share a node what should be done about it? You have alternatives to consider it fifty-fifty in both, consider it in both, or consider it randomly in either. But the user would not know which one it is.

Of course there is no such problem if the BCs do not share a node. But you cannot have the behavior depend on that.

Since quite many years there has been the possibility to use "Mask Name i" as well which enables intentional separation. So I would perhaps not revert the operation of the code, but rather make following modifications in sif file:

Code: Select all

Solver 2
  ...
  Operator 2 = String "Boundary Sum" 
  Mask Name 2 = AA
  Mask Name 3 = BB
  ...

Boundary Condition 1 
  AA = Logical True
  ...
  
Boundary Condition 3 
  BB = Logical True
  ...
-Peter
gagliar
Posts: 80
Joined: 04 Sep 2009, 16:34
Location: LGGE - Grenoble
Contact:

Re: Change of behaviour of SaveScalars solver

Post by gagliar »

Hi Peter,

Thanks for the answer, I think it will solve the problem. Yes, indeed my two boundaries don't share any node and I need the sum on the two boundaries separately.

Olivier
Post Reply