|
[Sponsors] |
August 6, 2016, 10:01 |
BuoyantSimpleFOAM P_rgh deduction problem
|
#1 |
Member
Pedro
Join Date: Nov 2014
Posts: 50
Rep Power: 11 |
Hello Fellow Foamers!
I've been working with BuoyantSimpleFOAM and I've shifted my focus on understanding why, even when no energy is provided to the system, a spurious flow is created in the compressible buoyant Simple FOAM. This problem is not unique to me, (eg.: this thread and This thesis) and, it's more of a code verification exercise rather than an actual simulation. In actual simulations, this problem seems to give origin to bad convergence in open reservoirs. The reason for this could be the assumption behind the formulation of P_rgh assuming an incompressible fluid in buyoantSimpleFOAM, a compressible solver. The derivation of this quantity comes from the integration of the hidrostatic equilibrium if the density is considered constant we have which is rewritten in OpenFoam's Code:
p = p_rgh + rho*gh All of this is achieved only if incompressible flow is admitted . This is however the way that the solver is implemented in the compressible solver. The compressible approach, where rho is not constant, depends on the law that we assume the fluid obeys. In my case the Ideal gas Law. This leads to a more complex derivation of the hidrostatic pressure or in OpenFOAM's nomenclature, Code:
p = p_rgh * exp( (gh) / RperfectGas / T) My questions are: - As anyone dealt with this before? I've looked for threads about this particular problem, and I've found none where this was pointed out as the problem and fixed. - Why was this assumption done? Was it a mistake, or am I wrong? (EDIT: I was wrong, check post 5) - I'm currently trying to fix this by including the rho*g term in SimpleFOAM. Has anyone achieved this or know of a thread where this was done? (EDIT: Answered by Zeppo, #2 post in this thread) Thank you all for the long read. I apologize in advance for errors the mathematical notation may have, however I'm pretty sure the essence of the derivations is correct. cheers! Last edited by pupo; August 22, 2016 at 08:42. |
|
August 6, 2016, 16:37 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
AFAICS, buoyancy force can be added explicitly into fvVectorMatrix through fvOptions object:
Code:
//--- UEqn.H --- tmp<fvVectorMatrix> tUEqn ( fvm::div(phi, U) + MRF.DDt(rho, U) + turb.divDevRhoReff(U) == fvOptions(rho, U) ); Code:
//--- buoyancyForce.C --- Foam::fv::buoyancyForce::buoyancyForce ( const word& sourceName, const word& modelType, const dictionary& dict, const fvMesh& mesh ) : option(sourceName, modelType, dict, mesh), g_ ( IOobject ( "g", mesh.time().constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ) { ... } void Foam::fv::buoyancyForce::addSup ( const volScalarField& rho, fvMatrix<vector>& eqn, const label fieldi ) { eqn += rho*g_; } |
|
August 6, 2016, 18:17 |
|
#3 |
Member
Pedro
Join Date: Nov 2014
Posts: 50
Rep Power: 11 |
Thank you for your reply, I was not aware of this possible usage of fvOptions!
https://github.com/OpenFOAM/OpenFOAM...uoyancyForce.H The way to implement this is to add the following fvOptions file of the case: Code:
GravitySource { type buoyancyForce; active true; buoyancyForceCoeffs { fields (U); } } Is there any good source to learn how to use fvOptions? i've had a hard time with the documentation for this part of OpenFOAM and not many threads are clear about it's usage. Cheers! |
|
August 6, 2016, 18:34 |
|
#4 | |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
Quote:
Code:
fv::options fvOptions (fvMesh); tmp<fvVectorMatrix> tUEqn ( fvm::div(phi, U) + MRF.DDt(rho, U) + turb.divDevRhoReff(U) == fvOptions(rho, U) ); |
||
August 22, 2016, 08:41 |
|
#5 |
Member
Pedro
Join Date: Nov 2014
Posts: 50
Rep Power: 11 |
Yeap I was wrong.
So, turns out the definition of p_rgh is independent of the hydrostatic pressure. It's simply defined as: Code:
p = p_rgh + rho*gh I think it is important to notice that if rho is not constant in the domain, P_rgh will not be constant in the domain either. This is what distinguishes P_rgh from the dynamic pressure, and the source of my confusion and this thread. Hope this clarification is helpful for someone in the future. cheers! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with interFoam; Wave/wiggle alpha1 behavior | JonW | OpenFOAM | 10 | February 4, 2023 08:27 |
UDF compiling problem | Wouter | Fluent UDF and Scheme Programming | 6 | June 6, 2012 05:43 |
Error message when using buoyantSimpleFoam | almir | OpenFOAM | 3 | June 8, 2011 08:02 |
natural convection problem for a CHT problem | Se-Hee | CFX | 2 | June 10, 2007 07:29 |
Adiabatic and Rotating wall (Convection problem) | ParodDav | CFX | 5 | April 29, 2007 20:13 |