SaveLine issues and a Question

Numerical methods and mathematical models of Elmer
Post Reply
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

SaveLine issues and a Question

Post by gos »

Hello,

I use ever more SaveLine instances, and have run into a few issues, and have some requests:

I currently have 2 SaveLine commands.

Problems:

a) Only the first SaveLine command will have save a SaveLine.txt.names file: For subsequent SaveLine commands, no such file is saved,
so one must guess its contents, or change the order of the SaveLine commands to get info on the contents of the other saveline files.

b) A dummy Save Mask that is never set true must be included in SaveLine statements using PolyLines to avoid that unwanted Boundary info is saved with the Polyline info when another SaveLIne command sets a Mask to define which Boundary it should save Boundary info for.
I have found a way to circumvent this problem: See the two examples below !

c) If one defines the variables to be saved for a Boundary SaveLine, then no coordiates are saved ! See example below.

d) See inline comments for more problems with the SaveLine command:

Code: Select all

Solver 2
   Exec Solver = After TimeStep
   Equation = SaveLine
   Procedure = "SaveData" "SaveLine"
   Variable 1 = String "Temperature"
   Variable 2 = String "Strength"
      
   File Append = Logical False
   
   ! Causes the Boundary with "Save Line = Logical True" and "Bed_Top_Save_Mask = Logical True"
   ! For some reason Boundary Nodes will otherwise be included in data for this SaveLine instance!

   Save Mask = String "Not_Defined_Save_Mask"	
   
   Filename = "SL_Tcs_&_Strength_Mid_Top.txt"

   Polyline coordinates(2, 2) =  0.600 0.495    0.600 0.505  
 
End

Code: Select all

Solver 3
   Exec Solver = After TimeStep
   Equation = SaveLine
   Procedure = "SaveData" "SaveLine"
   
   ! If we specify ONLY Temperature as the var to be saved, coordinates will NOT be saved.
   ! If we specify NO Variable, ALL Variables (Temperature & Strength) AND Coordinates will be saved.
   ! Last 3 Columns are always: "Flux 1", "Flux 2", "Flux normal". "Flux normal" indicates when Heating goes negative:
   ! Negative "Flux normal" means Bed emits heat to concrete: Positive "Flux normal" means Slab emits heat to Bed. 
   ! Sign probably depends on direction of Boundary Line 8 drawn in GID?

   ! We need the Coordinates if we want to determine Flux at a specific Point. 
   !Variable 1 = String "Temperature"    
   
   ! This makes sure ONLY the Listed Variables will be exported !
   ! Unfortunately, one also looses the TimeStep info !
   ! See http://www.elmerfem.org/forum/viewtopic.php?f=3&t=1066
   ! Skip Boundary Info = Logical False
   
   ! This does NOT work: File is ALWAYS appended to, whatever the setting here !
   File Append = Logical False
   
   Save Flux  = Logical True
   Flux Variable = String "Temperature"
   Flux Coefficient = String "Heat Conductivity"
   
   ! Include Boundary Nodes for the Boundary with: "Save Line = Logical True" and "Bed_Top_Save_Mask = Logical True"
   ! See the case.sif file. 
   ! See CASE_SaveLine_Tcs_Mid_Top.txt on avoiding Boundary nodes being included in other Saveline instances.
   
   Save Mask = String "Bed_Top_Save_Mask"
   Filename = "SL_Bed_Heat_Flux_Mid_Top.txt"
End
I would be happy if these issues can be addressed in the near future :-)

Questions regarding the Flux info:

a) What is Flux1 and Flux2 ?

b) I gather the Flux Normal is what it says: A vector normal to the Boundary?
I want to know when the Flux changes sign. But what determines the sign of the Flux?
I understand that it changes sign when the direction of the flux changes, but how does Elmer define when the flux is positive and when it is negative?
-- The direction of the Boundary Line ?


gos
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: SaveLine issues

Post by raback »

Hi gos

a) You could copy a different instance of SaveData.so, say SaveDataB.so to get rid of some of the problems, this included. Any suggestions what kind of logic to follow?

b) I guess we could add a flag to the Solver in style of "Save Boundaries = False" so that the boundaries would not be saved. Perhaps this is a minor problem though...

c) You can always say "Variable 1 = Coordinate 1" etc.

-Peter
gos
Posts: 61
Joined: 13 Sep 2011, 21:22
Antispam: Yes

Re: SaveLine issues and a Question

Post by gos »

Hello,

Thanks peter,

Regarding the SaveLine instance problem, would it be possible for Elmer to use the Solver ID to distinguish the instances? I do not know wether these SO files are reentrant or not, so it's hard for me to have any constructive suggestion.


Any tip on my questions regarding the Flux at the bottom of my previous posting?


gos
xborras7
Posts: 37
Joined: 02 Sep 2013, 21:44
Antispam: Yes

Re: SaveLine issues and a Question

Post by xborras7 »

Hi,

Really simple:

I cannot save two lines in indepenent text files. I want the same data from 2 different boundaries in separate files.

SOLVER

Code: Select all

Solver 3
Exec Solver = After timestep
Equation = SaveLine
Procedure = "SaveData" "SaveLine"

Variable 1 = Coordinate 1
Variable 2 = Coordinate 2
Variable 3 = Stress_xx
Variable 4 = Stress_yy

Save Mask = String cone
Save Mask = String contact
End
BOUNDARY 1

Code: Select all

Boundary Condition 1
Save Line = True
cone = True
Filename = String "cone_surf.dat"
End
BOUNDARY 2

Code: Select all

Boundary Condition 2
Save Line = True
contact = True
Filename = String "contact_surf.dat"
End
That is what I understood for the different posts; according to the manual:

"a By Default SaveLine saves only the values that are on boundary marked with SaveLine flag. If the user wants several intances of the SaveLine subroutine, for saving different boudnaries to different files, the mask name may be defined by this keyword. The corresponding should use the smae flag in the Boundary Condition and Body section."

Thanks in advance,

/Xavi
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: SaveLine issues and a Question

Post by raback »

Hi, Try this instead:

Code: Select all

Solver 3
Exec Solver = After timestep
Equation = SaveLineA
Procedure = "SaveData" "SaveLine"

Variable 1 = Coordinate 1
Variable 2 = Coordinate 2
Variable 3 = Stress_xx
Variable 4 = Stress_yy

Save Mask = String cone
End


Solver 4
Exec Solver = After timestep
Equation = SaveLineB
Procedure = "SaveData" "SaveLine"

Variable 1 = Coordinate 1
Variable 2 = Coordinate 2
Variable 3 = Stress_xx
Variable 4 = Stress_yy

Save Mask = String contact
End
-Peter
xborras7
Posts: 37
Joined: 02 Sep 2013, 21:44
Antispam: Yes

Re: SaveLine issues and a Question

Post by xborras7 »

Thanks Peter,

It works. Just one tiny detail:

It only generates a single *.dat.names file for both Solvers. For my particular case it is not a problem since I am interested on the same variables for both boundaries. However, it could be tricky if not.

Working Solution

Code: Select all

Solver 3
Exec Solver = After timestep

Equation = SaveLineA
Procedure = "SaveData" "SaveLine"

Filename = String "cone_surf.dat"
Save Mask = String cone

Variable 1 = Coordinate 1
Variable 2 = Coordinate 2
Variable 3 = Stress_xx
Variable 4 = Stress_yy

End

Solver 4
Exec Solver = After timestep

Equation = SaveLineB
Procedure = "SaveData" "SaveLine"

Filename = String "contact_surf.dat"
Save Mask = String contact

Variable 1 = Coordinate 1
Variable 2 = Coordinate 2
Variable 3 = Stress_xx
Variable 4 = Stress_yy

End

Boundary Condition 8
Save Line = Logical True
cone = Logical True
End

Boundary Condition 9
Save Line = Logical True
contact = Logical True
End
xborras7
Posts: 37
Joined: 02 Sep 2013, 21:44
Antispam: Yes

Re: SaveLine issues and a Question

Post by xborras7 »

Hej gents,

I want to plot "stress_normal" and "stress_tangential" instead of the "stress_xx", "stress_yy" and "stress_xy" on one column of an output file using the SaveLine solver.

Is it possible with SaveLine function or I need to develop a UDF similar to SaveLine?

/Xavi
raback
Site Admin
Posts: 4851
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: SaveLine issues and a Question

Post by raback »

Hi Xavi

The SaveLine here saves data that was already computed. SaveLine itself cannot compute the quantities. You could perhaps compute the surface normal (NormalSolver) and compute the dot product in your postprocessing tool.

-Peter
Post Reply