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

Conjugated solver for momentum and energy equations system

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2009, 11:46
Default Conjugated solver for momentum and energy equations system
  #1
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 252
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Hello colleagues!

First of all I would like to express my gratitude to Professor Hrvoje Jasak for developing such powerful CFD tool like OpenFOAM!

My question concerns solution of momentum-energy equations system. In my study case they are conjugated due to drag force source terms for momentum equation. I'm developing transient solver for this task. So it would be rather useful to get an opinion of OpenFOAM experienced users:

1. Is there any built-in tool to solve system of conjugated PDE system?
2. Are there some methods of non-linear PDE solution implemented in OpenFOAM?

Suppose we have system:

dU/dt + F(U,T) = 0
dT/dt + G(U,T) = 0

(d/dt - is partial derivative, specific heat supposed to be constant so we get from enthalpy to temperature)

Adding energy equation (like in http://openfoamwiki.net/index.php/Ho...e_to_icoFoam):

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

# include "readPISOControls.H"
# include "CourantNo.H"

/************************************************/
/* MOMENTUM EQUATION */
/************************************************/

// Momentum equation system
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- fvm::laplacian(nu, U)
- fvm::Sp(S_D, U)
);

// Solution of momentum equation
solve(UEqn == - fvc::grad(p) + S_B);

// --- PISO loop

for (int corr=0; corr<nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();

U = rUA*UEqn.H();
// Interpolation using central differencing
phi = (fvc::interpolate(U) & mesh.Sf())
+ fvc::ddtPhiCorr(rUA, U, phi);

adjustPhi(phi, U, p);

for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::laplacian(rUA, p) == fvc::div(phi)
);

pEqn.setReference(pRefCell, pRefValue);
pEqn.solve();

if (nonOrth == nNonOrthCorr)
{
phi -= pEqn.flux();
}
}

# include "continuityErrs.H"

// Coorection of flow field
U -= rUA*(fvc::grad(p) - S_B);
U.correctBoundaryConditions();
}

/************************************************/
/* ENERGY EQUATION */
/************************************************/

// Energy equation system
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(alpha, T)
);

// Solve enqrgy equation
TEqn.solve();

runTime.write();

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

/************************************************** ***********************/

But now due to S_D (drag force source term) and S_B (buoyancy force source term), which are calculated each time step and both are based on temperature distribution, two equations for U and T are coupled. In previously presented implementation it is only possible to achieve proper steady state at the end of calculations, but not proper transient solution at each time-step. Would it be enough just to add additional loop (like, for example, in solidDisplacementFoam):

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


int iCorr = 0;
scalar initialResidual = 0;

do
{

.............

SOLVING MOMENTUM AND ENERGY EQUATIONS
.............


initialResidual = UEqn.solve().initialResidual();

} while (initialResidual > convergenceTolerance && ++iCorr < nCorr);


runTime.write();

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

/************************************************** ***********************/

Please correct me if I'm wrong at this point!
Actually it is also point of my interest: when does OpenFOAM switch values to new time step? Is it implemented after execution of "runTime++" operator? To achieve convergence criteria of both equations, old values in ddt operator should be GLOBAL OLD and do not change in internal "do {} while ()" loop.

Thank you! Waiting for your comments!
makaveli_lcf is offline   Reply With Quote

Old   March 27, 2009, 04:16
Default
  #2
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 252
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Ok, I found a solution, thank you all for attention.
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Old   April 13, 2009, 12:29
Default
  #3
Member
 
Nugroho Adi
Join Date: Mar 2009
Location: norway
Posts: 79
Rep Power: 17
mahaputra is on a distinguished road
Dear Dr. A. Vakhrushev

which solver you used for simulation?

Regards

Nugroho
mahaputra is offline   Reply With Quote

Old   April 14, 2009, 03:16
Default
  #4
Senior Member
 
Dr. Alexander Vakhrushev
Join Date: Mar 2009
Posts: 252
Blog Entries: 1
Rep Power: 19
makaveli_lcf is on a distinguished road
Send a message via ICQ to makaveli_lcf
Quote:
Originally Posted by mahaputra View Post
Dear Dr. A. Vakhrushev

which solver you used for simulation?

Regards

Nugroho
Hi Nugroho!
It is self-made solver on the basis of icoFoam (for laminar flow ofcourse).
__________________
Best regards,

Dr. Alexander VAKHRUSHEV

Christian Doppler Laboratory for "Metallurgical Applications of Magnetohydrodynamics"

Simulation and Modelling of Metallurgical Processes
Department of Metallurgy
University of Leoben

http://smmp.unileoben.ac.at
makaveli_lcf is offline   Reply With Quote

Reply

Tags
conjugated solver, coupling, energy, momentum


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
Conservation equations, momentum transfer forces Luke F Main CFD Forum 1 April 25, 2008 17:49
Derivation of momentum and energy equations Spiros Siouris Main CFD Forum 1 April 14, 2008 06:39
System of Equations Nora Main CFD Forum 3 June 4, 2007 02:27
FEM Formulation of 2D mass, momentum and energy eq Amit Main CFD Forum 13 May 6, 2005 14:23
momentum equations and continuity??? Lucas Rainer Main CFD Forum 8 September 15, 2003 06:00


All times are GMT -4. The time now is 01:43.