CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

melting problem: looking for appropriate solvers

Register Blogs Community New Posts Updated Threads Search

Like Tree186Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 8, 2014, 11:10
Default
  #181
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 19
chriss85 will become famous soon enough
Very nice! I might be able to use this at a later time so I'll keep it as reference.
Do you think it will be usable for highly transient phase changes, including evaporation?
chriss85 is offline   Reply With Quote

Old   October 9, 2014, 07:23
Default
  #182
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Quote:
Originally Posted by ahmmedshakil View Post
Hi anonymous,
First of all, both of the methods are good. But for the implementation it depends on what type of problem you are solving. Linearised Source Based Method (LSM) is robust, and it just takes (at least) 3-4 iteration for convergence. Second method, which called Fictitious Source Method (FSM), takes a little bit more iteration to converge.
Now for the use, it depends on how the thermal gradient is changing. If thermal gradient changes strongly with times, then LSM may give some false results for the melt front and you may observe some false diffusion. In this case, my personal observation, it is better to go with FSM. Another problem for the LSM is to get the convergence of the results.
Also, none of the method is good for isothermal phase change.
If thermo-physical properties are function of temperature, then LSM will cause problem unless careful steps are not taken.

cheers,
#shakil
Dear Ahmmed,

Thank you for your answer, I really appreciate it. So it's prefered yo use FSM implementation just as Rösler did in his convMeltFoam solver and correct the liquid fraction as explained in http://www.cfd-online.com/Forums/ope...tml#post467200 #80 Am I right?

Thank you

Rösler Thank you for all the work you did I will have a look in your thesis. Is there any way of having the index of your work so we can see the topics which are discussed?
ssss is offline   Reply With Quote

Old   October 9, 2014, 22:53
Default method
  #183
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 15
ahmmedshakil is on a distinguished road
Hi anonymous,
As I said earlier, it depends on the problem you are solving. And now I can reckon FSM will be good to use.

Cheers
#shakil
Quote:
Originally Posted by ssss View Post
Dear Ahmmed,

Thank you for your answer, I really appreciate it. So it's prefered yo use FSM implementation just as Rösler did in his convMeltFoam solver and correct the liquid fraction as explained in http://www.cfd-online.com/Forums/ope...tml#post467200 #80 Am I right?

Thank you

Rösler Thank you for all the work you did I will have a look in your thesis. Is there any way of having the index of your work so we can see the topics which are discussed?
ahmmedshakil is offline   Reply With Quote

Old   October 13, 2014, 09:34
Default
  #184
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
Quote:
Originally Posted by chriss85 View Post
Very nice! I might be able to use this at a later time so I'll keep it as reference.
Do you think it will be usable for highly transient phase changes, including evaporation?
I am happy that you like my work. The solve is designed for solid/liquid phase change. All the Darcy term and stuff would not be necessary for evaporation. However, its implementation should not be that hard.

@ssss: I will post the index the next days.

Cheers

Fabian
fabian_roesler is offline   Reply With Quote

Old   October 13, 2014, 10:01
Default
  #185
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 19
chriss85 will become famous soon enough
I think that I have been a bit unclear.
I am interested in simulating a highly transient solid->liquid->gas phase transition of a polymer, not just liquid->gas. I'm generally interested in simulating ablation flows (i.e. determine amount of ablated mass and temperature at a wall) and corresponding wall temperatures of a polymer surface in contact with a plasma with T on the order of some 10^4 K.

I haven't looked into the theory any further than common heat conduction equations yet, as this is only a small aspect of my work, so I can't judge myself right now if your method is suitable for my cause. I would expect that the Darcy term is still required in this case because there will still be a solid phase which is not moving?

I have also seen something similar under the term "2-phase-Stefan-problem". This is for tracking the phase-changing interfaces in a 1-dimensional case and might also be an option for me, as I expect my problem to be more or less 1D (since energy flow is largely 1D in the direction normal to the wall).
Kummi likes this.
chriss85 is offline   Reply With Quote

Old   October 17, 2014, 04:20
Default
  #186
Senior Member
 
Fabian Roesler
Join Date: Mar 2009
Location: Germany
Posts: 213
Rep Power: 18
fabian_roesler is on a distinguished road
Hi chriss85

I'd say that solid>liquid>gas transition should be possible. "The only thing" you have to do is implementing the liquid to gas transition into my solver. I put that into quotes because this is no easy task. You have to account for the interface between liquid and gas by using an appropriate method like VOF etc. and extend it for phase change between the two phases. Have a look into these threads:

http://www.cfd-online.com/Forums/ope...e-boiling.html
http://www.cfd-online.com/Forums/ope...mentation.html
http://www.cfd-online.com/Forums/ope...nge-vof-2.html

Bitan Shu programmed a solver for liquid>gas transitions using interFoam as starting solver. However, there could be another solver, closer to what you search. Dig a little bit into the forum and you might find what you need.

To make it short: You can not solve your problem by just using my solver. You will have to invent something on your own or at least extend some existing solver including mine. This will be no easy task. But keep foaming

Cheers

Fabian
shuisheng, Zhiheng Wang and Kummi like this.
fabian_roesler is offline   Reply With Quote

Old   October 17, 2014, 06:33
Default
  #187
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 15
ahmmedshakil is on a distinguished road
Hi FOAMers',
Have anyone worked with the chtMultiregionFOAM for melting simulation ?( OR Have anyone add the melting solver with chtMultiRegionFoam ? ) If so, it will be great if you could share the ideas how you plugged the code....

Thanks in advance
#shakil
ahmmedshakil is offline   Reply With Quote

Old   October 17, 2014, 09:15
Default
  #188
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Quote:
Originally Posted by ahmmedshakil View Post
Hi FOAMers',
Have anyone worked with the chtMultiregionFOAM for melting simulation ?( OR Have anyone add the melting solver with chtMultiRegionFoam ? ) If so, it will be great if you could share the ideas how you plugged the code....

Thanks in advance
#shakil
What's your interest for using chtMultiregionFOAM? Grid Moving so that liquid and solid could be treated alone? Adding some solid-fins to modify the heat transfer?
ssss is offline   Reply With Quote

Old   October 17, 2014, 10:22
Default chtMultiregion+melting
  #189
Senior Member
 
Mohammad Shakil Ahmmed
Join Date: Oct 2012
Location: AUS
Posts: 137
Rep Power: 15
ahmmedshakil is on a distinguished road
Hi SSS,
I am solving a problem for multilayer systems. In my case I have two layer, and both of the layer has different properties and heat absorption. I have already model the case before melting. Now, I want to simulate the scenario when the top layer starts to melt; actually melting depth for the top layer. In my case, I am pretty much sure only the top layer will melt. Therefore, I have to plug in the melting code for top layer equation. If anyone can advice me how to do that, it will be great !.

Thanks in advance.
#shakil
Quote:
Originally Posted by ssss View Post
What's your interest for using chtMultiregionFOAM? Grid Moving so that liquid and solid could be treated alone? Adding some solid-fins to modify the heat transfer?
ahmmedshakil is offline   Reply With Quote

Old   October 17, 2014, 11:09
Default
  #190
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Maybe you should get the chtMultiRegion code, get rid of the turbulence parts and write your own TEqn to be solved in each of the fluid Regions.

I'm not too experienced with chtMultiRegion, but you should be able to implement it, although you will need to modify the createFields.H and the readTransportProperties, in order to get the need values for the solidification TEqn
ssss is offline   Reply With Quote

Old   October 19, 2014, 15:54
Default
  #191
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
I would like to ask also a question about Voller Linearized Source Term implementation:

Whenever I include TEqn.H inside the PIMPLE loop (in the outerloop or in the pressure correction loop) my solution advances in time a lot, let's say it should take 1000s to have a liquid fraction of 95%, but puting TEqn.H inside loop takes the time down to 50s, although the cualitative results are fabolous, it goes much quicker.

If I put the TEqn.H outside the PIMPLE loops (both of the loops) then I obtain the results I expect to have.

This may be a small source of errors, because I'm not changing the temperature during both of the PIMPLE loops, and the temperature and the boussinesq density should change whenever the velocity field changes.

Anyone knows why is this happening?

Thank you very much.
ssss is offline   Reply With Quote

Old   January 16, 2015, 10:52
Default
  #192
New Member
 
Mithil Parekh
Join Date: Jun 2014
Location: Germany
Posts: 1
Rep Power: 0
mithil is on a distinguished road
Hello,

what are DCs and DCl in TEqn in meltFoam?

Mithil.
mithil is offline   Reply With Quote

Old   January 16, 2015, 11:09
Default
  #193
Member
 
Thomas Vossel
Join Date: Aug 2013
Location: Germany
Posts: 45
Rep Power: 13
ThomasV is on a distinguished road
Quote:
Originally Posted by mithil View Post
Hello,

what are DCs and DCl in TEqn in meltFoam?
They form the constants in the porosity function:

A = -C \cdot \frac{{( 1 - \alpha )}^2}{\alpha^3 + b}

The "C" in the equation is the DCl constant. The "b" in the equation is the "DCs" constant. The names might be confusing here as DCl means something like "Darcy constant large" and DCs means "Darcy constant small" - so nothing in terms of liquid or solid...

Both constants are defined in the transport properties and DCs is just there to prevent a division by zero (for that purpose a tiny number gets added to the denominator) and DCl is a more or less random "big number" meant to lead to a high number for the porosity function which then leads to decreased velocities in the momentum equation. While its number is not really random as it influences how fast the velocities will decrease, it's not really a fixed number you can look up but something you adjust to your case so the results match your expectations for the respective material you're simulating...
ThomasV is offline   Reply With Quote

Old   January 16, 2015, 11:11
Default
  #194
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

readTransportProperties.H
Code:
    // Reading large D'arcy-type source term constant DCl
    dimensionedScalar DCl(transportProperties.lookup("DCl"));

    // Reading small D'arcy-type source term constant DCs
    dimensionedScalar DCs(transportProperties.lookup("DCs"));
hEqn.H
Code:
DC = DCl*Foam::pow(1.0-alpha,2)/(Foam::pow(alpha,3)+DCs);
DCl should be large (~10^8), DCs is used to avoid division by zero and should be small (~10^-15 for example).
alexeym is offline   Reply With Quote

Old   March 23, 2015, 22:10
Default species
  #195
New Member
 
QP Dong
Join Date: Feb 2015
Posts: 7
Rep Power: 11
high_er is on a distinguished road
Quote:
Originally Posted by Yahoo View Post
Fabian:

Thanks for your answer, I really appreciate it.

However, the problem I am working on is somehow different so I am not sure I can use your solver. In your paper you have updated liquid fraction by an error function (equation (6) in the paper), but I want to use Lever Micro-segregation rule for liquid fraction, and since it is numerical very unstable so I have implemented the liquid fraction updating scheme by C. Prakash and V. Voller. in "ON THE NUMERICAL SOLUTION OF CONTINUUM MIXTURE MODEL EQUATIONS DESCRIBING BINARY SOLID-LIQUID PHASE CHANG, Numerical Heat Transfer, Part B:Volume 15, Issue 2, 1989"

I will updated you guys in this thread if i find sth interesting.
Hi Yahoo
I am working on the segregation with openfoam. Have you been successful in the species calculation? If so, would you pleased to give me some advice, or show me your solver? Thank you !
high_er is offline   Reply With Quote

Old   April 8, 2015, 01:21
Default
  #196
New Member
 
Join Date: Apr 2012
Posts: 24
Rep Power: 14
libya81 is on a distinguished road
Hi all,

I have a problem with modelling the melting/solidification of pcm in sphere by using the enthalpy method. I have to do this modelling using matlab and by using finite difference method.

Hello all,
I have went through all your posts and you are really doing a good job. Might my post is in the wrong place, but I decided to give it a try, since I have posted it in a different section.

I have read many papers and they mentioned I have to change the enthalpy governor equation to the following, the enthalpy term to a temperature or the temperature term to enthalpy to model it easily in matlab.

I have changed the temperature into enthalpy and now, all the terms in the implicit method equation are enthalpy. BUT, what about the boundary conditions, Am I need them, if so, I have them interms of temerature, how to change them into enthalpy.

any help will be greatly appreciated


Best
libya81 is offline   Reply With Quote

Old   May 7, 2015, 11:04
Default
  #197
New Member
 
Ole Richter
Join Date: Jun 2013
Posts: 11
Rep Power: 13
kuechenrole is on a distinguished road
Hey Fabian,

I'm working on a problem you might have already solved in your PhD and therefore I would like to ask you for a hint.

My Master thesis is about the simulation of casting processes including the filling, temperature transport and solidification and thus exactly the reversal of your subject.
In order to add the gas phase I'm trying to combine interFoam and convMeltFoam, as you suggested earlier.

Using the model of your PhD, everything seems to work out fine except the solution of the TEqn, which exploits whenever I include the calculation of the liquid fraction fl.

The only thing I changed so far is the update equation of the liquid fraction. I replaced the heat capacity cp of the hole cell with a cp calculated from just the liquid and solid phase.

I suggest that the new possibility of changing the fl by filling a cell instead of just melting solid is causing the trouble. By filling a cell I can produce huge differences of fl between two time steps, which the iteration algorithm for T and fl can't handle anymore.

Do you come to that problem?

My supervisor mentioned a smoothing function to restrict the time step if huge fl changes happen could be a solution. I haven't tried it yet, but will post again, if something works.

I have to excuse, if the solution is described in your PhD. We already ordered a book through inter-library loan, but it seems to be loaned. Do you know about a library online version? If I haven't got access by next week I will buy it. (Until then I'm dealing with the googleBooks prev)

Thanks,

ole
kuechenrole is offline   Reply With Quote

Old   May 7, 2015, 14:54
Default
  #198
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Dear kuechenrule,

The TEqn is known to create troubles in interFoam, even without working melting problems. Are you working with the fields multiplied by the density? Something like rhoCp, rhoPhiCp, etc. Which version of interFoam are you using?

Are you ensuring, that the TEqn and the liquidFraction converge in each of the PIMPLE/PISO iterations? Did you try if your code works without gas phase in it?

If you want to limit the timeStep, you could just change the maxDeltaT in the controlDict to the maximun value you want to achieve.

Anyway I'm pretty sure you have taken care of looking at this small problems. I will be glad if I could help you trying to debug the errors that the solver gives
ssss is offline   Reply With Quote

Old   May 7, 2015, 17:48
Default
  #199
New Member
 
Ole Richter
Join Date: Jun 2013
Posts: 11
Rep Power: 13
kuechenrole is on a distinguished road
Dear SSSS,

thanks for your help! Even if I used OpenFoam a few times, I'm new in the field of programming and manipulation. Thus please mention all small problems or mistakes that you suggest I could have done.

I'm working with rhoCp, rhoCpPhi, etc, since I consider big density differences. between gas and melt (liquid+solid).
I'm using OF 2.3.1 (are there specific versions for each solver?)
I do ensure convergence of the TEqn and fl by a fl residuum of e-6 in and a maximum iteration loop number of 150. Teqn is solved inside the PIMPLE loop.
The code seems to work without a gas phase (testcase: filled open cube with cold walls; just T transport no movement at all).

I'll will play with the time step a bit and try to find out, if it works. Thanks for the advice.

An other question arises today for me. The PIMPLE loop features the following order: alphaEqn -> UEqn -> TEqn -> pEqn. At which point do I update rho and rhoCp etc, which are dependent on the melt fraction (alpha1) and the liquid fraction (fl)? If I update rho outside the TEqn loop, the TEqn solves a different rho as the UEqn. If I update rho inside the TEqn, UEqn solves a different rho as pEqn. I think you got the point. Or does it not matter since the PIMPLE loop runs until all rho's are nearly equal?

I attached my TEqn. Please don't get me wrong, I don't want you to do my work, but maybe I did some obvious mistakes you can see.

alpha1 - melt fraction;
fl - liquid fraction of melt;
fs - solid fraction of melt;
rho1 - density of pure liquid;
rho2 - density of pure gas;
rhos - density of pure solid;

{
int iter = 0;
scalar residual = 1;
scalar meanResidual = 1;

do
{
iter++;
fl.storePrevIter();

rhoCp = alpha1*(fl*rho1*cp1 + fs*rhos*cps) + alpha2*rho2*cp2;
lambda = alpha1*(fl*lambda1 + fs*lambdas) + alpha2*lambda2;
rhoAlpha1 = alpha1*(alpha1*(fl*rho1 + fs*rhos) + alpha2*rho2);

rhoCpPhi = tphiAlpha()*fvc::interpolate(rho2*cp2 - (fl*rho1*cp1 + fs*rhos*cps)) + phi*fvc::interpolate(fl*rho1*cp1 + fs*rhos*cps);
rhoAlpha1Phi = fvc::interpolate(alpha1)*(tphiAlpha()*fvc::interpo late(rho2 - (fl*rho1 + fs*rhos)) + phi*fvc::interpolate(fl*rho1 + fs*rhos));

fvScalarMatrix TEqn
(
fvm::ddt(rhoCp, T)
+ fvm::div(rhoCpPhi, T)
+ L*fvc::ddt(rhoAlpha1, fl)
+ L*fvc::div(rhoAlpha1Phi, fl)
- Tmelt*fvc::ddt(rhoCp)
- Tmelt*fvc::div(rhoCpPhi)
- fvm::laplacian(lambda, T)
);

TEqn.solve();

Tcorr = (Tl-Ts)*fl+Ts;
fl = max(min(fl+alphaRel*(fl*cp1 + fs*cps)/L*(T-Tcorr),scalar(1)),scalar(0));
fs = scalar(1) - fl;

residual = max(mag(fl.internalField()-fl.prevIter().internalField()));
meanResidual = sum(mag(fl.internalField()-fl.prevIter().internalField())*mesh.V())/sum(mesh.V()).value();

} while ((iter < minTCorr || residual > alphaTol ) && iter <= maxTCorr);

cp = alpha1*(fl*cp1 + fs*cps) + alpha2*cp2;
h = cp*(T-Tmelt)+alpha1*fl*L;
}

Thanks,

ole
kuechenrole is offline   Reply With Quote

Old   May 7, 2015, 18:25
Default
  #200
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
Dear kuechenrule,

About the PIMPLE methods and the rho, this is the easiest way of dealing with it. With the PIMPLE or PISO iterative method you try to converge the equations, eventhough the densities may vary por each equation. Using small time-steps you could reduce the problem, because the smaller the time step the smaller the variations in density.

Moreover, I would now try to eliminate the density variation with the liquid and solid, just try to use the same density for them, as it may induce some problems. Furthermore, I would also use the same cp for both liquid and solid, so that you get rid of problems that can arise from using the interpolation methods.

Next, I would try to use another approach to the convMeltFoam. As you can see convMeltFoam taked into account the convective transport term for the liquidFraction, or "fl". Although this might work when there is no gas, and thus, when you are not using interFoam, once you add this term to interFoam, you are dealing with high gradients over the surfaces and thus, poblems whith the fvc::div term.

At last I would try to relax the TEqn, just adding TEqn.relax() after the TEqn.solve() code.

If you don't mind, I could have a look at your complete interFoam code, and try to fix it.

Thank you.
ssss is offline   Reply With Quote

Reply

Tags
melting openfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Melting and solidification with free surface problem? cqlwj123 CFX 6 July 25, 2013 03:46
Can I solve this problem by Fluent? Kai_kc FLUENT 1 October 27, 2010 06:29
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13
Melting Problem M FLUENT 0 April 29, 2007 17:07


All times are GMT -4. The time now is 21:23.