Material heating with phase change
Material heating with phase change
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
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
-
- Site Admin
- Posts: 4838
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Material heating with phase change
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
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
Re: Material heating with phase change
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:
and got the following error message:
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
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
Code: Select all
Solver input file error: MATC ERROR: Expecting identifier, constant or leftpar.
...offending input line: [[0;100],Density*[0;360000]]
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
Re: Material heating with phase change
Hi Matthias,
I guess you wanted to create a conditional statement. Here is one that worked for me, but in another context:
Regards,
Peter
At least your reference to the variable ("tx") is missing?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
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}"
Peter
-
- Site Admin
- Posts: 4838
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Material heating with phase change
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
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
Re: Material heating with phase change
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:
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
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
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
Re: Material heating with phase change
Hi Peter,
Thank you,
Matthias
Do I interpret your answer correctly that I can use the 'spatial 2' also for transient simulations?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.
Thank you,
Matthias
Re: Material heating with phase change
Hi Peter,
now I get a solver crash during the 13th timestep (of 30).
The ElmerGUI log window says:
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
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
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
-
- Site Admin
- Posts: 4838
- Joined: 22 Aug 2009, 11:57
- Antispam: Yes
- Location: Espoo, Finland
- Contact:
Re: Material heating with phase change
Hi
-Peter
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.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.
-Peter
Re: Material heating with phase change
Hi Peter,
Did you have the occasion to look at the project which makes ElmerSolver crash?
Thank you,
Matthias
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.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.
Did you have the occasion to look at the project which makes ElmerSolver crash?
Thank you,
Matthias