Material heating with phase change

Numerical methods and mathematical models of Elmer
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Material heating with phase change

Post by mzenker »

Hi,

I want to simulate the heating of a material containing water, taking into account the evaporation of the water at 100 °C. I thought I could use the Phase Change feature of the Heat Solver. So I set up a test case and run it with and without the phase change set to "temporal". When I do that, I get completely different results which seem totally unphysical to me. Maybe someone could have a short look on the attached project and tell me what I do wrong...
Caution: When you load the project into ElmerGUI, you have to have all solver xmls from the bin/edf-extra in the bin/edf directory.
BTW, I use Elmer Rev. 4649 on Windoze XP.

Thank you for a helpful hint,

Matthias
Attachments
Test_Phase.zip
(650.73 KiB) Downloaded 492 times
raback
Site Admin
Posts: 4838
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Material heating with phase change

Post by raback »

Hi

The definition of enthalpy is not perhaps quite successful here. As you can see from Model Manual Eq. 1.4 its basically an integral over heat capacity multiplied withe density! So the unit of enthalphy here is J/m^3.

Of the different enthalphy models I like most the version 'spatial 2' but my experience is rather limited.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Material heating with phase change

Post by mzenker »

Hi Peter,

thank you for the hint, I had defined the Enthalpy in J/kg as it is found in the tables.

Two questions:

1. Is there an elegant way to multiply a table column by a constant (or variable)?
I have tried naively:

Code: Select all

Material 2
  Name = "Testmat_linear"
  Enthalpy = Variable Temperature;Real MATC "[[0;100],Density*[0;360000]]"
  Electric Conductivity = 0.15
  Heat Conductivity = 0.5
  Heat Capacity = 3600
  Density = 1000
End
and got the following error message:

Code: Select all

Solver input file error: MATC ERROR: Expecting identifier, constant or leftpar.

...offending input line: [[0;100],Density*[0;360000]]
So obviously I made a mistake here.

2. What is the difference between the different enthalpy models? Since I do a transient simulation, I understood from the ModelsManual that I have to use "temporal" here.

EDIT: With a linear Enthalpy defined in J/m^3, I get consístent results, so the first step is done. The questions remain, however... ;)


Thank you,

Matthias
petroo
Posts: 148
Joined: 13 Jan 2010, 19:07
Location: Aachen, Germany

Re: Material heating with phase change

Post by petroo »

Hi Matthias,
mzenker wrote:

Code: Select all

Material 2
  Name = "Testmat_linear"
  Enthalpy = Variable Temperature;Real MATC "[[0;100],Density*[0;360000]]"
  Electric Conductivity = 0.15
  Heat Conductivity = 0.5
  Heat Capacity = 3600
  Density = 1000
End
At least your reference to the variable ("tx") is missing?

I guess you wanted to create a conditional statement. Here is one that worked for me, but in another context:

Code: Select all

Dichte = Variable Pressure; Real MATC "if (tx > 5) {874/(1+900/tx)} else {4.80509}"
Regards,

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

Re: Material heating with phase change

Post by raback »

Hi Matthias

2) The difference is mainly how heat capacity is defined from the given enthalpy curve.

spatial version use something like
c=dE/dT
where dT related to temperature difference between nodal values of element.

while temporal uses the chain rule,
c=(dE/dt)/(DT/dt)
where the differentials are taken with respect of time.

The inherent problem is that the melting heat results basicly to a delta peak in the heat capacity that must still be somehow integrated accurately enough. Therefore some smearing is advicable. Even then the temperal version may 'jump over' melting temperature with too long timesteps. The 'spatial 2' won't jump over melting point since no matter how small the bandwidth it will be located in some elements.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Material heating with phase change

Post by mzenker »

Hi Peter ("petroo"),

thank you for the answer - but my problem is different.
I want to multiply the second column of a table (matrix) by a scalar. The MATC statement I have tried would work in Scilab (and MATLAB also I guess).
My problem is: I need to use the enthalpy. From the tables I have the enthalpy in J/kg, for example:

Code: Select all

Enthalpy = Variable Temperature
Real
0 0
100 360000
End
But Elmer expects the Enthalpy in J/m^3, so it needs to be multiplied by the density.
For a few values I can do that manually. But I would find it more elegant to directly use the density which is known (by Elmer) for the material, and which may itself depend on temperature.
So the question is: How can I use tabulated values within MATC? Elmersolver does an interpolation which I want to use. Can I create the table within MATC and pass it to the solver? Or is there an interpolation function in MATC?

For the time being, I will have to stick to the manual method... ;)

Matthias
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Material heating with phase change

Post by mzenker »

Hi Peter,
raback wrote: The inherent problem is that the melting heat results basicly to a delta peak in the heat capacity that must still be somehow integrated accurately enough. Therefore some smearing is advicable. Even then the temperal version may 'jump over' melting temperature with too long timesteps. The 'spatial 2' won't jump over melting point since no matter how small the bandwidth it will be located in some elements.
Do I interpret your answer correctly that I can use the 'spatial 2' also for transient simulations?

Thank you,

Matthias
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Material heating with phase change

Post by mzenker »

Hi Peter,

now I get a solver crash during the 13th timestep (of 30).
The ElmerGUI log window says:

Code: Select all

Solver emitted error signal: 1
Solver emitted signal: QProcess::ProcessState: 0
There is no error message that I have seen in the solver log window.
A system error message popped up saying something like memory access error.
I use Elmer Rev. 4649 under Windoze XP.

The crashing project is in the attachment. I have tried both "temporal" and "spatial 2" for the phase change. The max. temperature is 105 °C, so just above the phase change.

I am going home now - will continue to look for a solution next week...

Thanks in advance for your help, and have a nice weekend!

Matthias
Attachments
Test_crash.zip
(718.14 KiB) Downloaded 458 times
raback
Site Admin
Posts: 4838
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Material heating with phase change

Post by raback »

Hi
mzenker wrote: But Elmer expects the Enthalpy in J/m^3, so it needs to be multiplied by the density.
For a few values I can do that manually. But I would find it more elegant to directly use the density which is known (by Elmer) for the material, and which may itself depend on temperature.
One could of course change the default unit for enthalpy since the current choise is rather poor. There is the problem with backward compability. Otherwise its just one line of code which I would be happy to do.

-Peter
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Material heating with phase change

Post by mzenker »

Hi Peter,
raback wrote: One could of course change the default unit for enthalpy since the current choise is rather poor. There is the problem with backward compability. Otherwise its just one line of code which I would be happy to do.
That would be fine for me, but backwards compatibility is of course an issue as well. I have no idea how often the Enthalpy material property is used so far, and how many users would be affected if the units were changed to Energy/mass.

Did you have the occasion to look at the project which makes ElmerSolver crash?

Thank you,

Matthias
Post Reply