How to save body force?

Numerical methods and mathematical models of Elmer
Post Reply
YuriV
Posts: 2
Joined: 14 Jan 2016, 10:53
Antispam: Yes

How to save body force?

Post by YuriV »

Hi everyone!

Currently I'm trying to simulate heating of some rigid body by Gaussian laser beam. To do that I define the MATC function in my .sif file to calculate volumetric heating source as follows:

Code: Select all

$ function HeatSource(x) { \
  h = 1.12e-6; \
  p = 1.0e-3; \
  r = 0.48; \
  w = 500e-9; \
  d = 5870; \
  i_0 = p / (3.14 * w^2); \
  i = i_0 * exp(-(x(0)*x(0) + x(1)*x(1)) / w*w); \
  a = 8.15e+7; \
  v_s = i * (1 - r) * a * exp(-a * (h - x(2))); \
  m_s = v_s / d; \
  _HeatSource = m_s; \
}
where x is supposed to be a Cartesian coordinates array. The function above is used for Body Force declaration:

Code: Select all

Body Force 1
  Name = "Laser"
  Heat Source = Variable Coordinate
   Real MATC "HeatSource(tx)"
End
Is there any way to save calculated values and export the data obtained to ElmerPost or, for example, Paraview?

I will really appreciate any help.

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

Re: How to save body force?

Post by raback »

Hi

You could try "SaveMaterials" solver, Ch. 46 in
http://www.nic.funet.fi/pub/sci/physics ... Manual.pdf
and there define "Body Force Paramaters" > 0. Haven't used this myself but so it reads.

-Peter
YuriV
Posts: 2
Joined: 14 Jan 2016, 10:53
Antispam: Yes

Re: How to save body force?

Post by YuriV »

Hi, Peter!

Many thank for your reply. I have tried to use the "SaveBoundaryValues" solver as following:

Code: Select all

Solver 3
  Procedure = File "SaveData" "SaveBoundaryValues"
  Body Force Parameters = Integer "1"
  Parameter 1 = String "Heat Source"
  Exec Solver = Always
End
but it seems I did not get how it works. First of all, the first ElmerSolver message while processing model file is
Model Input: Unlisted keyword: [body force parameters] in section: [solver 3]
When the SaveBoundaryValues solver starts I see the following message
WARNING:: SaveBoundaryValues: Parameter heat source not present in any material
If I move "Heat Source" declaration from "Body Force" section to some "Boundary Condition" section, the "SaveBoundaryValues" produces output with calculated values but only for specified boundaries.
If someone have any ideas how to make it work for declarations inside "Body Force" section, please, share some.

Best regards
Yuri
Aerosmite
Posts: 5
Joined: 23 Mar 2023, 16:55
Antispam: Yes

Re: How to save body force?

Post by Aerosmite »

Up,

Also interested to know how to make this work!
Yongmei
Posts: 2
Joined: 09 Aug 2023, 19:16
Antispam: Yes

Re: How to save body force?

Post by Yongmei »

Hi,
I hope my answer is still relevant. Because I have lately searched this post.
The solution is that if you want to save the parameter in Body Force you need to use

Code: Select all

 Procedure = File "SaveData" "SaveMaterials"
instead of

Code: Select all

 Procedure = File "SaveData" "SaveBoundaryValues"
The 'Elmer Models Manual' is bit confusing on this...
Cheers
Post Reply