Boundary Condition and FluxSolver

Numerical methods and mathematical models of Elmer
Post Reply
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Boundary Condition and FluxSolver

Post by MrChips »

I want to be able to export the heat flux at a boundary with a fixed temperature condition. I figured the best way to try to get a handle on it would be to set up a model with a defined heat flux boundary condition that I then try to solve/export the heat flux at this boundary to see if they match up. I went through fluxsolver test files to learn about how to set this up. I used

Code: Select all

Solver 2
  Equation = ComputeFlux
  Procedure = "FluxSolver" "FluxSolver"
  Calculate Flux = Logical True
  Target Variable = String Temperature
  Flux Coefficient = String "Heat Conductivity"
End
from one of those fluxsolver files.

My VTU file now contains 'Temperature Flux'. Is this supposed to be the heat flux? The magnitude of the 'Temperature Flux' does not match what I set for the boundary condition. Shouldn't these match up?

If somebody is able to walk me through this I would appreciate it. Sorry, I know this probably basic stuff...

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

Re: Boundary Condition and FluxSolver

Post by raback »

They normal component of "Temperature Flux" at the boundary should be quite close to the prescribed heat flux on the boundary. Not exactly same but not too far off either. -Peter
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Re: Boundary Condition and FluxSolver

Post by MrChips »

Okay, well it is good to know I am on the right track.

I am computing the 'Temperature Flux' with the FluxSolver:

Code: Select all

Solver 4
  Exec Solver = Before Timestep
  Equation = ComputeFlux
  Procedure = "FluxSolver" "FluxSolver"
  Calculate Flux = Logical True
  Flux Variable = String Temperature
  Flux Coefficient = String "Heat Conductivity"
End
The Temperature flux magnitude doesn't match my set heat flux at all. It is less than half. To calculate the normal component could I use the NormalSolver or do I need to write a UDF to handle this? I have not used that solver before.
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Re: Boundary Condition and FluxSolver

Post by MrChips »

Maybe a photo would be more helpful. The model is 2D. This boundary has a heat flux set at 5161 W/m2. When I use Fluxsolver to compute the 'Temperature Flux' and review it in Paraview I get something completely different. Is this not the way to go about it? I would have expected it to be closer to the set heat flux. Instead I get something closer to ~3800. I know it will be slightly off because it is not exactly at normal, but it should be closer, no?

Image
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Boundary Condition and FluxSolver

Post by kevinarden »

I applied a heat flux of 300, and the normal temperature flux came out as 297. I did fluxsolver after not before
Exec Solver =After Timestep
Attachments
flux.png
(116.32 KiB) Not downloaded yet
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Boundary Condition and FluxSolver

Post by raback »

Hi

The difference is that the FluxSolver computes fluxes at the integration points and makes a best possible fit for them to the nodes. This is not exactly the same that was set at the boundaries. However, this gives some measure of goodness of the mesh as these two approximations should approach each other. The initial mesh is too coarse to capture the solution accurately. Kevin's mesh does a better job at this.

If you want to exactly capture what you describe you can use "Calculate Loads" and "Calculate Boundary Weights" (i think). The loads will be exact (in Watts) and you can get the normal flux by diving with the corresponding weight (in m^2).

-Peter
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Re: Boundary Condition and FluxSolver

Post by MrChips »

It makes sense that the resolution of the mesh is not fine enough to get the results to match up. Thank you kevinarden for taking the time to check your own simulation and responding to my questions!

Peter,

I've implemented the term 'Calculate Loads = Logical True' and 'Calculate Weights = Logical True' in the heat equation solver. I now have 'Temperature Loads' and 'Temperature Weights' in my VTU files. Now I get something like this:
Image

Is this 340.807 Watts and 0.00238177 m (for the 2D)?

I must be misinterpreting what you are saying. Dividing these through does not give anywhere near the boundary condition of 5161 that I have set.
raback
Site Admin
Posts: 4812
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Boundary Condition and FluxSolver

Post by raback »

Hi

The keyword was "calculate boundary weights = Logical True". The "calculate weights" will give you the corresponding volume each node represents. You want an area here...

-Peter
MrChips
Posts: 33
Joined: 12 Jul 2016, 00:16
Antispam: Yes
Location: Canada

Re: Boundary Condition and FluxSolver

Post by MrChips »

Peter,

This work really well. Thank you!
Post Reply