|
[Sponsors] |
February 7, 2011, 07:31 |
starting off with OpenFOAM
|
#1 |
New Member
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 22
Rep Power: 16 |
HI GUYS
I am a new user of OpenFOAM and would like to solve an unsteady energy equation for a compressible gas through a porous media. I have basic knowledge of C++ prograqming, please help. thanx in advance |
|
February 8, 2011, 03:24 |
|
#2 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Hi semaviso,
have a look into the rhoReactingFoam application to see how its done there. This is the general way to go. Look whether theres something you need. Best Kathrin |
|
February 16, 2011, 09:21 |
|
#3 |
New Member
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 22
Rep Power: 16 |
thanx Kathrin
I checked it out and now I want to understand the meaning of: 00008 volScalarField rUA = 1.0/UEqn.A(); 00009 U = rUA*UEqn.H(); from rhoReactingFoam/pEqn.H How can I write Darcy's formula (U_gas = (-permK/mu)*grad(p) ) U_gas being the gas flux or velocity in m/s in OpenFOAM to use with the mass transport equation. thanx again for your help. |
|
February 16, 2011, 10:48 |
|
#4 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
1. Question
This is part of the pressure velocity coupling see: http://powerlab.fsb.hr/ped/kturbo/Op...jeJasakPhD.pdf for details. What is done: UEqn.A() gives you the central coefficient of the the fvMatrix (fv=finiteVolume) UEqn. UEqn.H() gives you the H operator which is basically H(UEqn)=source(UEqn)-diagonal(UEqn)U in that way the velocity is evaluated by U = rUA*UEqn.H(); ok? 2. Question I'm not really sure what your trying to do. Can you specify a little? Do you want to use your U_gas in the continuity equation? Why? Best Kathrin |
|
February 16, 2011, 17:37 |
|
#5 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Hi semaviso!
There are several way to solve your problem: - either your add a source term in an existing momentum equation (for example rhoReactingFoam as suggested by Kathrin, or may be rhoPisoFoam will be easier to begin) : Code:
fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + turbulence->divDevRhoReff(U) == rho*g - fvm::Sp(mu/K,U) ); Code:
solve ( fvm::laplacian(-K/mu,P) ); Regards, Cyp Last edited by Cyp; February 17, 2011 at 06:44. |
|
February 17, 2011, 03:40 |
|
#6 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Maybe you want to have a look into rhoPorousFoam. I never worked with it. But it sounds promising.
Best Kathrin |
|
February 22, 2011, 09:21 |
|
#7 |
New Member
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 22
Rep Power: 16 |
thanx guys it worked.
another question is, how do I add a source term to an energy balance equation if the source term is as follows: [deltaH - T(Cp_ss - Cp_s)] deltaH : Heart of reaction Cp_ss : saturated solid (porous media) heat capacity Cp_s : solid (porous media) heat capacity |
|
February 23, 2011, 03:10 |
|
#8 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
Which variable are you solving for in your energy equation T or h?
Best Kathrin |
|
February 24, 2011, 04:09 |
|
#9 |
New Member
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 22
Rep Power: 16 |
Hi Kathrin
I want "T" but I had used the energy equation with "h". since h = Cp*T. thanx in advance |
|
February 25, 2011, 05:07 |
|
#10 |
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 17 |
could you post the equation you have?
Do you reconstruct the Temperature from the energy? Best Kathrin |
|
February 25, 2011, 05:38 |
|
#11 |
New Member
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 22
Rep Power: 16 |
the equation is from http://onlinelibrary.wiley.com/doi/10.1002/er.919/pdf
equation 1 of this publication. I have decided to use h becouse i found a lot of hEqn.H file that I think have something almost similar to this equation. |
|
February 25, 2011, 05:47 |
|
#12 |
Senior Member
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18 |
Hi semaviso!
You should try something like that: Code:
fvm::ddt(rho*Cpg,T) +fvm::div(phi,T) -fvm::laplacian(lambda,T) == fvm::Sp(m_dot*(Cpg-Cps),T) -m_dot*dH0 Code:
surfaceScalarField phi = rho*Cpg*linearInterpolate(U)&mesh.Sf(); Code:
surfaceScalarField phi = fvc::interpolate(rho)*fvc::interpolate(Cpg)*linearInterpolate(U)&mesh.Sf(); Cyp |
|
August 2, 2011, 08:50 |
|
#13 |
New Member
Sibusiso Mavuso
Join Date: Jul 2010
Location: South Africa/Pretoria
Posts: 22
Rep Power: 16 |
thank you a lot,
I have been tryin to modify the porousExplicitSourceReactingParcelFoam to solve for a compressible gas inside a porous reactor. Regards, SBU |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Superlinear speedup in OpenFOAM 13 | msrinath80 | OpenFOAM Running, Solving & CFD | 18 | March 3, 2015 06:36 |
Cross-compiling OpenFOAM 1.7.0 on Linux for Windows 32 and 64bits with Mingw-w64 | wyldckat | OpenFOAM Announcements from Other Sources | 3 | September 8, 2010 07:25 |
Modified OpenFOAM Forum Structure and New Mailing-List | pete | Site News & Announcements | 0 | June 29, 2009 06:56 |
The OpenFOAM extensions project | mbeaudoin | OpenFOAM | 16 | October 9, 2007 10:33 |
OpenFOAM Debian packaging current status problems and TODOs | oseen | OpenFOAM Installation | 9 | August 26, 2007 14:50 |