CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

melting problem

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree74Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 12, 2012, 08:06
Smile isothermal phase change
  #21
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 154
Rep Power: 8
fabian_roesler is on a distinguished road
Hi

Sorry, I messed up the two solvers and thought that David needed my solver for OF_2.1.
I once compiled the meltFoam solver for isothermal phase change problems for OF_1.7. I remember the problem you are talking about. You can go for icoFoam but I would suggest using the buoyantBoussinesPimpleFoam. You can use pimpleControls instead simpleControls in the old solver. However syntax changed a little bit during the years.

Regards

Fabian
fabian_roesler is offline   Reply With Quote

Old   June 13, 2012, 04:06
Default
  #22
Member
 
Anja Miehe
Join Date: Dec 2009
Location: Freiberg / Germany
Posts: 48
Rep Power: 7
AnjaMiehe is on a distinguished road
Hi,
I have absolutely no idea which of the solvers David meant but know he has both and you additional ideas. Thanks for the like.
Regards, Anja
AnjaMiehe is offline   Reply With Quote

Old   August 15, 2012, 13:45
Default
  #23
New Member
 
David
Join Date: May 2012
Location: Canada
Posts: 12
Rep Power: 5
salehda is on a distinguished road
Thanks Fabian and Anja , this had been helpful to me and I agree , i think that buoyantboussinesqFoam is more suitable
salehda is offline   Reply With Quote

Old   November 7, 2012, 09:29
Default
  #24
New Member
 
Chad
Join Date: Sep 2011
Posts: 16
Rep Power: 5
chaolian is on a distinguished road
Hello, AnjaI also modified meltFoam, instead of using enthalpy based update like yours I used temperature based update for my liquid fraction. All the others are similar to yours. But my results are not correct, do you have any suggestions? Thanks in advance.
Attached Files
File Type: gz my_meltFoam_solver.tar.gz (4.0 KB, 59 views)
chaolian is offline   Reply With Quote

Old   November 8, 2012, 04:09
Default linear step and continuous liquid fraction function
  #25
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 154
Rep Power: 8
fabian_roesler is on a distinguished road
Hi Chaolian

Nice that somebody else then Anja and I are interested into solid/liquid phase change problems. As you already know, the linear liquid fraction is the standard case from literature as proposed by many authors. There are some predictor corrector methods to update temperature to be consistent with the enthalpy-temperature-curve. This is necessary as the enthalpy equation is non-linear. In the case of a continuous liquid fraction function, you can substitute the function into the energy conservation equation. The drawback is that you still have a non-linear function. But as you do not solve for the liquid fraction anymore, the non-linear behavior is quite small. The error is small and so no or only a few iterations are necessary to solve the equation.
I once programed a solver for the linear function using the Brent et al. corrector method and some newer method by Voller. However the solver was not very stable and still 20 and more iterations for the temperature were necessary for solving.

Hope this helps

Best wishes

Fabian
atulAtcae likes this.
fabian_roesler is offline   Reply With Quote

Old   November 8, 2012, 04:37
Default
  #26
New Member
 
Chad
Join Date: Sep 2011
Posts: 16
Rep Power: 5
chaolian is on a distinguished road
Quote:
Originally Posted by fabian_roesler View Post
Hi Chaolian

Nice that somebody else then Anja and I are interested into solid/liquid phase change problems. As you already know, the linear liquid fraction is the standard case from literature as proposed by many authors. There are some predictor corrector methods to update temperature to be consistent with the enthalpy-temperature-curve. This is necessary as the enthalpy equation is non-linear. In the case of a continuous liquid fraction function, you can substitute the function into the energy conservation equation. The drawback is that you still have a non-linear function. But as you do not solve for the liquid fraction anymore, the non-linear behavior is quite small. The error is small and so no or only a few iterations are necessary to solve the equation.
I once programed a solver for the linear function using the Brent et al. corrector method and some newer method by Voller. However the solver was not very stable and still 20 and more iterations for the temperature were necessary for solving.

Hope this helps

Best wishes

Fabian
Hello Fabian,
It's very nice to get your reply. I totally agree with you that your erf fitting approach, and some other predictor corrector method are better than classical linear approach. What I want to do is just try to implement the classical approach as a good practice to learn OpenFOAM structure and coding syntax, etc.

Many thanks for your reply and comments,
Best,
Chao
chaolian is offline   Reply With Quote

Old   February 8, 2013, 12:05
Default
  #27
New Member
 
Tim Vincent
Join Date: Jan 2013
Posts: 2
Rep Power: 0
tvincent2k is on a distinguished road
Quote:
Originally Posted by fabian_roesler View Post
Hi all

I posted that it might take some time to review the meltFoam solver and port it from OF_1.7 to OF_2.1 but I felt like doing it instantly. So here you go . I hope you enjoy it.

Regards

Fabian
This is great! I'm glad to see people have been working on this. I took this code and modified it to use the SIMPLE algorithm for steady-state conditions and was able to solve the gallium melting test case with it.

Now I'm wondering if you have made any progress on adding motion to the solid region. It seems like it is a little more complicated than simply adding a DC*(volVectorField solidVelocity) term to the explicit terms of the momentum equation. I tried that and the solution won't converge.

Any ideas?
tvincent2k is offline   Reply With Quote

Old   February 13, 2013, 08:09
Default
  #28
Member
 
Anja Miehe
Join Date: Dec 2009
Location: Freiberg / Germany
Posts: 48
Rep Power: 7
AnjaMiehe is on a distinguished road
Hello Tim,

nice to see that this thread does put together people interested in solving for solidification with OpenFOAM.

As far as your question is concerned, I do not know why your code does not converge. I started from the updated code I posted, everything is still transient although I am dealing with continuous casting and do have quasi steady-state conditions as well. Then I added in the "createFields.H" the following field:
Code:
    Info<< "Reading field Us\n" << endl;
    volVectorField Us
    (   
        IOobject
        (   
            "Us",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),  
        mesh
    );
And the velocity equation looks as follows:
Code:
    fvVectorMatrix UEqn
    (   
        fvm::ddt(U)
      + fvm::div(phi, U)
      - fvm::laplacian(nu, U)
      + fvm::Sp(DC, U) // since DC=>0, all time implicit is possible
      - DC*Us  // additional term for moving solidified shell << continuous casting >>
    );  

    UEqn.relax();
This works for me, although there may be "better" approaches.
The Us field, you first copy the U file, then you change for your velocities - if they are that easy to be got. I am dealing with a curvilinear geometry, so I do produce my Us velocity field using a Stokes solution, that means I do use simpleFoam with the exact same region and boundaries but very high viscosity. Then, I do copy the final velocity field to be my Us.

I hope that will help you.
Regards, Anja
AnjaMiehe is offline   Reply With Quote

Old   February 13, 2013, 11:45
Default
  #29
New Member
 
Tim Vincent
Join Date: Jan 2013
Posts: 2
Rep Power: 0
tvincent2k is on a distinguished road
Thanks Anja! It looks like that is basically the same thing that I was trying. I did a little more investigating and found that my problem was related to need for greater relaxation. I had my T relaxationFactor set to 0.5 but I needed it at 0.2 for my problem. I am guessing this is related to the interaction between the complex temperature/velocity boundary condition that I am using and the constant velocity of the solid region. Happily my solution is converging now.
tvincent2k is offline   Reply With Quote

Old   February 13, 2013, 12:52
Default close-contact melting
  #30
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 154
Rep Power: 8
fabian_roesler is on a distinguished road
Hi Anja,
hi Tim

I can just confirm your steps to include solid movement into the solver. I used the following:


Code:
fvVectorMatrix UEqn
  (   
      fvm::ddt(rho, U)
   + fvm::div(rhoPhi, U)
   - fvm::laplacian(mu, U)
   + rho*fvm::Sp(DC, U)
   - rho*DC*Us 
  );
The main question is whether you have a fixed and constant velocity like in continuous molding or if you have unconstrained melting with settling solid. In this case you will need some equations of movement to describe the settling process of the solid phase. This leads to a complex highly non-linear and coupled problem. However it is necessary to model close-contact melting. This is what I am doing at the moment. But the model and solver are not yet validated with experimental data.

Best wishes

Fabian
fabian_roesler is offline   Reply With Quote

Old   March 4, 2013, 00:35
Default
  #31
New Member
 
Chad
Join Date: Sep 2011
Posts: 16
Rep Power: 5
chaolian is on a distinguished road
Quote:
Originally Posted by fabian_roesler View Post
Hi all

I posted that it might take some time to review the meltFoam solver and port it from OF_1.7 to OF_2.1 but I felt like doing it instantly. So here you go . I hope you enjoy it.

Regards

Fabian
Thanks for your work. But why don't you have U solver in system/fvSolution file? Don't you solve UEqn?
chaolian is offline   Reply With Quote

Old   March 4, 2013, 03:24
Default momentumPredictor
  #32
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 154
Rep Power: 8
fabian_roesler is on a distinguished road
Hi,

the U solver is only necessary when using a momentumPredictor step in PISO or PIMPLE. I don't do the predictor step as it does not help convergence for the melting case. Without predictor step, U is corrected after the pressure equation.

Regards

Fabian
fabian_roesler is offline   Reply With Quote

Old   March 4, 2013, 13:07
Default Concentration equation
  #33
New Member
 
Join Date: Apr 2012
Posts: 21
Rep Power: 5
Yahoo is on a distinguished road
It is good to see people are working on melting problem. Have you guys ever tries to include species equation in your codes? That is what I am working on right now. Any comments?
Yahoo is offline   Reply With Quote

Old   March 4, 2013, 13:11
Default
  #34
New Member
 
Chad
Join Date: Sep 2011
Posts: 16
Rep Power: 5
chaolian is on a distinguished road
Quote:
Originally Posted by Yahoo View Post
It is good to see people are working on melting problem. Have you guys ever tries to include species equation in your codes? That is what I am working on right now. Any comments?
I know in thermodynamic model there are some species parameters specified in constant/thermophysicalProperties file. But I don't know too much of it. Here's something about this model: http://www.openfoam.org/docs/user/thermophysical.php
chaolian is offline   Reply With Quote

Old   March 5, 2013, 03:45
Default Species
  #35
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 154
Rep Power: 8
fabian_roesler is on a distinguished road
Hi there

No, never tried that. But it should not be that hard to implement it. Just add another volScalarField C and solve for it after the energy conservation equation. You also have to use another liquid fraction function and an additional one for the concentration. As all melting solvers here in the thread refer to the enthalpy porosity method by Voller and Prakash you could have a look for their solver. They wrote an article on the method for additional species transport.

Regards


Fabian
Yahoo likes this.
fabian_roesler is offline   Reply With Quote

Old   March 5, 2013, 12:55
Default
  #36
New Member
 
Join Date: Apr 2012
Posts: 21
Rep Power: 5
Yahoo is on a distinguished road
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.
Thamali and high_er like this.
Yahoo is offline   Reply With Quote

Old   April 8, 2013, 18:30
Default
  #37
New Member
 
Join Date: Apr 2012
Posts: 21
Rep Power: 5
Yahoo is on a distinguished road
Hi Fabian
Would you please let me know why you have used "mesh.solver( .select(finalIter))" in your code? What does this statement do?
Yahoo is offline   Reply With Quote

Old   April 13, 2013, 02:47
Default p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.fin alInnerIter())))
  #38
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 154
Rep Power: 8
fabian_roesler is on a distinguished road
Hi Yahoo

Have a look into pisoFoam solver. There you have this statement split up. In most solvers, you specify two different tolerances. One for the last iteration and the other for all previous iterations. An example:

Code:
 
    p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())))
Code:
    
    p_rgh
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-8;
        relTol          0.01;
    }

    p_rghFinal
    {
        $p_rgh;
        relTol          0;
    }
Here the relative tolerance is set to zero for the last inner iteration to be sure to reach the absolute tolerance of 1e-8. The statement just sais when to choose the final tolerance, namely for the finalInnerIter().

Regards

Fabian
Yahoo likes this.
fabian_roesler is offline   Reply With Quote

Old   April 17, 2013, 13:35
Default
  #39
New Member
 
Join Date: Apr 2012
Posts: 21
Rep Power: 5
Yahoo is on a distinguished road
Hi Guys
Have you tried to compile erfConvectiveMeltingPimpleFoam.C (Fabian's code for melting) on OpenFOAM 2.2.0? I am getting this compile error:

make: *** No rule to make target `/opt/OpenFOAM-2.2.0/src/finiteVolume/lnInclude/newFvPatchField.C', needed by `erfConvectiveMeltingPimpleFoam.dep'. Stop.
Yahoo is offline   Reply With Quote

Old   April 18, 2013, 03:00
Default OF2.1 meltFoam
  #40
Senior Member
 
fabian_roesler's Avatar
 
Fabian Roesler
Join Date: Mar 2009
Location: Bad Friedrichshall, Germany
Posts: 154
Rep Power: 8
fabian_roesler is on a distinguished road
Hi,

you could just use the solver for OF2.1 I posted here :

melting problem

Regards

Fabian
Yahoo likes this.
fabian_roesler is offline   Reply With Quote

Reply

Tags
melting openfoam

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conduction problem venkataramana OpenFOAM 3 December 1, 2013 08:30
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13
Melting Problem M FLUENT 0 April 29, 2007 16:07
Is this problem well posed? Thomas P. Abraham Main CFD Forum 5 September 8, 1999 14:52


All times are GMT -4. The time now is 10:07.