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

laplacianfoam with solidification

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

Like Tree1Likes
  • 1 Post By dakos

Reply
 
LinkBack Thread Tools Display Modes
Old   November 9, 2009, 14:22
Default laplacianfoam with solidification
  #1
New Member
 
Join Date: May 2009
Posts: 7
Rep Power: 9
dakos is on a distinguished road
Hi,
I'm trying to add solidification to laplacianfoam (I'm not interested in convective flux, but only in conduction with heat source).
My problem is that the temperature I have calculated in a simple test doesn't seem correct (a simple square cavity with uniform temperature inside, 700C, and fixed temperature to the rigth wall, 500C).
The temperature decreases too fast!

Modification to laplacianfoam:

Info<< "\nCalculating temperature distribution\n" << endl;

for (runTime++; !runTime.end(); runTime++)
{
Info<< "Time = " << runTime.timeName() << nl << endl;

# include "readSIMPLEControls.H"

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
solve
(
rho * cp * fvm::ddt(T)
+ Lh * rho * fvc::ddt(alpha1)
- fvm::laplacian(kT, T)
);
alpha1 = max(min((T-Ts)/(Tl-Ts),scalar(1)),scalar(0));
Info<< "Liquid phase volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
<< " Min(alpha1) = " << min(alpha1).value()
<< " Min(alpha2) = " << min(alpha2).value()
<< endl;
alpha2 = scalar(1) - alpha1;
rho = alpha1*rho1 + alpha2*rho2;
cp = alpha1*cp1 + alpha2*cp2;
kT = alpha1*kT1 + alpha2*kT2;
}

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;
}

Info<< "End\n" << endl;

return(0);

Modification to Createfield:

Info<< "Reading transportProperties\n" << endl;

IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);


dimensionedScalar rho1
(
transportProperties.lookup("rho1")
);

dimensionedScalar rho2
(
transportProperties.lookup("rho2")
);

dimensionedScalar cp1
(
transportProperties.lookup("cp1")
);

dimensionedScalar cp2
(
transportProperties.lookup("cp2")
);

dimensionedScalar kT1
(
transportProperties.lookup("kT1")
);

dimensionedScalar kT2
(
transportProperties.lookup("kT2")
);

dimensionedScalar Tl
(
transportProperties.lookup("Tl")
);

dimensionedScalar Ts
(
transportProperties.lookup("Ts")
);

dimensionedScalar Lh
(
transportProperties.lookup("Lh")
);

Info<< "Reading field T\n" << endl;

volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Reading field alpha1\n" << endl;
volScalarField alpha1
(
IOobject
(
"alpha1",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Calculating field alpha2\n" << endl;
volScalarField alpha2("alpha2", scalar(1) - alpha1);

Info<< "Reading field rho\n" << endl;
volScalarField rho
(
IOobject
(
"rho",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Reading field cp\n" << endl;
volScalarField cp
(
IOobject
(
"cp",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Info<< "Reading field kT\n" << endl;
volScalarField kT
(
IOobject
(
"kT",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh
);

Can someone tell me where am I wrong?

Dario
brucechen likes this.
dakos is offline   Reply With Quote

Old   November 14, 2009, 07:15
Default
  #2
New Member
 
Join Date: May 2009
Posts: 7
Rep Power: 9
dakos is on a distinguished road
Hi,
the problem is in the source term that is always 0.
How can I use the old value of alpha1, to compute:

Q = Lh*rho*(alpha1-alpha1OLD)?

Dario
dakos is offline   Reply With Quote

Reply

Tags
phase change, solidification

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
Solidification in OpenFoam luke.christ OpenFOAM 24 September 10, 2013 07:50
About the solidification? H.P.LIU Phoenics 1 December 1, 2010 10:49
Restart for Solidification atulverma FLOW-3D 3 May 6, 2009 17:40
Solidification problem: viscosity ratio limited Deepak FLUENT 0 December 11, 2008 14:08
tracking the solidification front Kuba FLUENT 0 April 16, 2003 02:04


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