|
[Sponsors] |
June 20, 2016, 12:59 |
BoussinesqBuoyantFoam
|
#1 |
Member
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11 |
Hi All
I was searching some old OpenFOAM version and came across the solver named 'BoussinesqBuoyantFoam' which is available in OpenFoam 1.6 version. This solver looks like the base code of a simple natural convection which contains the basic equations of U and T as shown below: fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) == -beta*(T - T0)*g ); solve(UEqn == -fvc::grad(p)); <-- This term is used when momentum predictor is used. (is it right?) solve ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DT, T) ); rho = rho0*(scalar(1) - beta*(T - T0)); But this solver is taken out in the after versions of OpenFOAM i.e. from 1.7 onwards and this solver got replaced (i feel so) with 'buoyantBoussinesqPimpleFoam' and buoyantBoussinesqSimpleFoam' and so on. But I want to ask this. -beta*(T - T0)*g <--- This term in the UEqn.H in the 'buoyantBoussinesqFoam' solver mentioned in OF 1.6 (i.e. the buoyancy term) is not seen in the R.H.S of UEqn.H in 'buoyantBoussinesqPimpleFoam or SimpleFoam. fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) ); UEqn.relax(); if (momentumPredictor) { solve ( UEqn == fvc::reconstruct ( ( fvc::interpolate(rhok)*(g & mesh.Sf()) - fvc::snGrad(p)*mesh.magSf() ) ) ); } can somone explain where the buoyancy term in this equation of UEqn.H is accounted?approxiamtion. Or is it like the solver 'buoyantBoussineqFoam' mentioned in OF 1.6 is the base code and generalized code for a simple problem dealing with Boussineq approximation and it has nothing to with buoyantBoussinesqPimpleFoam? Looking forward for suggestions Best Regards! |
|
June 21, 2016, 10:41 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
a) please use code-tags b) The newer version have rhok included and is defined as: Code:
// Kinematic density for buoyancy force volScalarField rhok ( IOobject ( "rhok", runTime.timeName(), mesh ), 1.0 - beta*(T - TRef) ); c) The older version used the PISO algorithm (I think), hence you are limited to small time-steps and there was no solver for steady-state solutions. Due to that they introduced PIMPLE and SIMPLE. Note that PIMPLE can work as PISO.
__________________
Keep foaming, Tobias Holzmann |
|
June 22, 2016, 02:31 |
|
#3 | |
Member
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11 |
Code:
// Kinematic density for buoyancy force volScalarField rhok ( IOobject ( "rhok", runTime.timeName(), mesh ), 1.0 - beta*(T - TRef) ); In UEqn.H Code:
if (pimple.momentumPredictor()) { solve ( UEqn == fvc::reconstruct ( ( - ghf*fvc::snGrad(rhok) - fvc::snGrad(p_rgh) )*mesh.magSf() ) ); fvOptions.correct(U); } Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nuw, U) == -g*beta*(T-Tref) ); UEqn.relax(); and also in PEqn.H Code:
surfaceScalarField phig(-rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); Quote:
Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) ); UEqn.relax(); Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nuw, U) == fvOptions(U) ); UEqn.relax(); // along with the pimple loop as the base solver Does this make sense at all? Am getting little by little of information everyday and keeps adding up my understanding of OF. Thanks for your valuable time and suggestions Best Regards |
||
June 22, 2016, 03:55 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
first of all. In Foam we are talking always about FLUXES. Hence it is not necessary to calculate the first guess of the velocity field (momentumPredictor on). Unfortunately I had never time to go deep into the pressure coupling (pEqn.H) but the phig are just some fluxes due to the fact that phi always represents fluxes. By the way, why you think that phig takes turbulence into account. Finally it will - yes, because we construct the UEqn.H (does not matter if we have momentumPredictor on or off) and using the UEqn matrix, we build the rAU field (that contains the turbulence etc). To your question to the UEqn... first we construct the matrix: Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) ); Code:
solve ( UEqn == fvc::reconstruct ( ( - ghf*fvc::snGrad(rhok) - fvc::snGrad(p_rgh) )*mesh.magSf() ) ); Code:
solve ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) + fvc::reconstruct ( ( - ghf*fvc::snGrad(rhok) - fvc::snGrad(p_rgh) )*mesh.magSf() ) ); Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) + g*rho*beta*(T-Tinf) );
__________________
Keep foaming, Tobias Holzmann |
|
June 22, 2016, 04:55 |
|
#5 | |
Member
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11 |
Quote:
would it be like this then for my laminar case (without rho in my buoyancy term as it is an in-compressible case) Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) + g*beta*(T-Tinf) ); Code:
if (pimple.momentumPredictor()) { solve ( UEqn == fvc::reconstruct ( ( - ghf*fvc::snGrad(rhok) - fvc::snGrad(p_rgh) )*mesh.magSf() ) ); fvOptions.correct(U); } Code:
fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) - fvm::laplacian(nu, U) + g*beta*(T-Tinf) ); // Done without any momentum.predictor loop Am i right Tobi? Thank you for your valuable suggestions Best Regards |
||
June 22, 2016, 05:15 |
|
#6 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
okay,.. you want to solve boussinesq approximation in a laminar flow field. Then use boussinesqBouyantPimple/SimpleFaom. There is no need to modify anything. Keep your turbulence->divDevReff(U) and set turbulence or RANSModel to laminar. Thats it. From the version you mentioned (the old stuff), note that there (if I remember correctly) we use the pressure field p instead of the p_rgh pressure field. Therefore you get a more complex equation or have to rearrange them. Finally OpenFOAM changes the code from readability to "why are theses terms there and what does they mean". This is simple because of numerical reasons... if I remember the old code, it was much easiert to follow the equations but in any case, the new code is more stable, and that is the main point. If you really want to understand why the solvers in 2.3.x or 3.x.x looks different to the old versions, derive the equations yourself, think about numerics and then you get the point. Good luck.
__________________
Keep foaming, Tobias Holzmann |
|
June 22, 2016, 05:57 |
|
#7 | ||||
Member
Akr
Join Date: Apr 2015
Location: India
Posts: 53
Rep Power: 11 |
Quote:
Quote:
Quote:
Quote:
Right now, As like you suggested me in another thread, i am trying to incorporate the non-dimensional parameters in the post-processing stage. Thank you for your time and valuable suggestions Best regards |
|||||
June 22, 2016, 07:18 |
|
#8 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
If you are interested in steady-state, just use buossinesqBouyantSimpleFoam. I can not figure out the problem. In addition, if the solver uses radiation too, just set radiation to false (thats it). As I told you, the solver is for laminar and turbulent flow fields!
__________________
Keep foaming, Tobias Holzmann |
|
|
|