|
[Sponsors] |
March 15, 2016, 19:44 |
alpha in twoPhaseEulerFoam
|
#1 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Hi,
IN twoPhaseEulerFoam of OF300 version, we have following lines in createFields.H: Code:
phaseModel& phase1 = fluid.phase1(); phaseModel& phase2 = fluid.phase2(); volScalarField& alpha1 = phase1; volScalarField& alpha2 = phase2; Thank you. |
|
March 15, 2016, 20:16 |
|
#2 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Hi,
Another question about the twoPhaseEulerFoam is for the quantity residualAlpha: Code:
//- Return the residual phase-fraction for given phase // Used to stabilize the phase momentum as the phase-fraction -> 0 const dimensionedScalar& residualAlpha() const { return residualAlpha_; } |
|
March 16, 2016, 04:23 |
|
#3 | ||
Member
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 89
Rep Power: 17 |
Quote:
https://github.com/OpenFOAM/OpenFOAM...l/phaseModel.H Quote:
Probably not an issue for an isothermal jet, but if compressibility effects are significant continuity errors may also appear when volume fraction drops below the dgdt residual alphas that are hard coded (1e-4) into the twoPhaseSystem: https://github.com/OpenFOAM/OpenFOAM...oPhaseSystem.C Code:
forAll(dgdt_, celli) { if (dgdt_[celli] > 0.0) { Sp[celli] -= dgdt_[celli]/max(1.0 - alpha1[celli], 1e-4); Su[celli] += dgdt_[celli]/max(1.0 - alpha1[celli], 1e-4); } else if (dgdt_[celli] < 0.0) { Sp[celli] += dgdt_[celli]/max(alpha1[celli], 1e-4); } } |
|||
March 16, 2016, 04:24 |
|
#4 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
If you have a look at the file phaseModel.H (e.g. here: https://github.com/OpenFOAM/OpenFOAM...l/phaseModel.H), you will see that the class phaseModel is derived (among others) from volScalarField.
Thus, the class phaseModel is the volume fraction field alpha. See also the constructor in phaseModel.C for a further clue. |
|
March 16, 2016, 05:55 |
|
#5 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Dear Gerhard and Juho,
Thank you for your help. Make sense! For the turbulence modelling in twoPhaseEulerFoam, we have the following: Code:
if (pimple.turbCorr()) { fluid.correctTurbulence(); } Code:
void Foam::twoPhaseSystem::correctTurbulence() { phase1_.turbulence().correct(); phase2_.turbulence().correct(); } Code:
Foam::PhaseCompressibleTurbulenceModel<Foam::phaseModel>& Foam::phaseModel::turbulence() { return turbulence_(); } |
|
March 16, 2016, 06:20 |
|
#6 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
phase2_.turbulence().correct();
the method turbulence() returns the pointer to the turbulence model. And on this pointer the method correct() is called. The turbulence models used for the phases are of the type phaseCompressibleTurbulenceModel, and here the interesting part begins. It is true that you will not find any method correct() in phaseCompressibleTurbulenceModel. This is because this turbulence model class is derived from other base classes. The templated turbulence model framework is designed to cover everything from single to multiphase and from incompressible to compressible flows. In order to find the method correct() you have been looking so far, you need to dig through the organisation of the turbulence model framework. Maybe Section 20 on turbulence models is of help https://github.com/ParticulateFlow/O...Manual_PFM.pdf |
|
March 16, 2016, 07:10 |
|
#7 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Thank you Gerhard!
Your documentations are very impressive. I will read it. cheer, OFFO Quote:
|
||
March 16, 2016, 18:21 |
|
#8 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Dear Gerhard,
I spent some time in reading your document. This is the best OF help file I ever read, except the OF theory guide and user's guide. Still about the turbulence model, I can understand what you mean about the implementations of turbulence model in twoPhaseEulerFoam. However, I think it is a little difficult to see the role of the souece file: phaseCompressibleTurbulenceModels.C. I think it is a connection between the current solver and the turbulence model library in /src. Could you please say more about how they are linked? Thank you. Quote:
|
||
March 16, 2016, 19:01 |
|
#9 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Hello,
Thank you for your reply. About the thermophysical model, let us say particle laden flows, in the tutorials of fluidizedbed in twophaseEulerFoam (in OF3.0.0). the Theromotype for air (continuous phase) is Code:
thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleInternalEnergy; } Code:
thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo hConst; equationOfState rhoConst; specie specie; energy sensibleInternalEnergy; } Code:
thermo1.correct(); Info<< "min " << thermo1.T().name() << " " << min(thermo1.T()).value() << endl; thermo2.correct(); Info<< "min " << thermo2.T().name() << " " << min(thermo2.T()).value() << endl; Code:
scalarField& TCells = this->T_.internalField(); scalarField& psiCells = this->psi_.internalField(); scalarField& rhoCells = this->rho_.internalField(); 3> scalarField& muCells = this->mu_.internalField(); scalarField& alphaCells = this->alpha_.internalField(); (1) all these quantities are field quantities, how are they linked with the calculations for particulars. For example, rho1 are the dispersed phase meterial density. (2) I think rho in heRhoThermo.C is updated with EoS with the following: Code:
rhoCells[celli] = mixture_.rho(pCells[celli], TCells[celli]); Code:
thermo1.correct(); // update the thermophysical parameters of dispersed phase Confused. Thank you! Quote:
|
||
March 17, 2016, 04:11 |
|
#10 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
Hi,
I am not sure whether I understand you question correctly. The framework of OpenFOAM treats certain quantities as if they were variables, e.g. the phase density. The framework then provides methods to evaluate these variables, e.g. the equation of state for phase-densities. Finally, the framework offers a wide choice of models, which range from trivial (e.g. rhoConst) to more comples (e.g. perfectGas). You can see this all over OpenFOAM, e.g. the liftModel framework offers a model named noLift, which returns a field of zeros for the lift coefficient. Thus, the lift force evaluates to zero. It is a little wasted effort to multiply stuff by zero to get zero, however, this keeps the framework simple and versatile. There are no if conditions related to special cases such as laminar flow, no lift force or constant phase density. So, don't be confused when you see a method call to correct(), solve() or some other evaluation, when there is nothing to evaluate. If you go down the sequence of function calls, with the apropriate classes, then you will probably find methods which do nothing, in cases when it is appropriate to do nothing. |
|
March 18, 2016, 20:03 |
|
#11 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Thank you so much for your help.
Based on the tutorials, I can see that for particle-laden flows, different turbulence models are used for these two phases. For example, the available LES model include: Code:
//...List of LES models // Smagorinsky // kEqn // SmagorinskyZhang // NicenoKEqn // continuousGasKEqn // kineticTheoryModel // phasePressureModel --------------- The references are listed below for the future checking: 1, NicenoKEqn: http://www.sciencedirect.com/science...0925090800208X No turbulence model is used (assume laminar) for the dispersed phase (gas phase), while for continuous phase (liquid) two models (dynamics smagorinsky model and one equation model) are discussed. 2, SmagorinskyZhang http://www.sciencedirect.com/science...09250906005446 This belongs to a modified version of the Smagorinski model. The bubble induced turbulence is introduced into the effective sub-grid scale viscosity. Meanwhile, the effective viscosity of dispersed phase is estimated from that of the continuous phase with local density ratio. Last edited by openfoammaofnepo; March 20, 2016 at 18:00. |
|
March 19, 2016, 05:27 |
|
#12 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
Note the difference between which models OpenFOAM offers you to use, and what models make sense for a particular application. For the choice of models you best consult relevant academic literature for your particular application.
twoPhaseEulerFoam is completely agnostic of the actual physical experiment/set-up you want to simulate. Nothing in OpenFOAM prevents you from applying the kineticTheoryModel to bubbly flows or the SmagorinskyZhang model for gas-solid flows. In the case set-up this selection would be allowed, however, the kineticTheoryModel was derived specifically for gas-solid flows and the SmagorinskyZhang for bubbly flows. |
|
March 20, 2016, 18:19 |
|
#13 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Based on my investigations, it seems that there is no suitable LES model in OF so far when the dispersed phase is solid particle, such as in particle laden flows. This is based on the latest version of OpenFOAM 3.0.1. The exisiting LES models seems more suitable for gas-liquid flows, such as bubbly flows.
Quote:
|
||
March 21, 2016, 10:32 |
|
#14 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Hi,
In twoPhaseEulerFoam, is it possible to print out the residual and number of the iterations for the momentum equations as well? In stead of just say: 'Constructing momentum equations'. Since I should know the residuals of solving the momentum equations. In the current solver of twoPhaseEulerFoam, we can get as follows: ========== PIMPLE: iteration 1 MULES: Solving for alpha.particles MULES: Solving for alpha.particles alpha.particles volume fraction = 0 Min(alpha.particles) = 0 Max(alpha.particles) = 2.4e-05 Constructing momentum equations min T.particles 300 min T.air 300 GAMG: Solving for p_rgh, Initial residual = 1, Final residual = 6.98034e-09, No Iterations 22 ========== Thank you so much. |
|
March 22, 2016, 07:39 |
|
#15 | |
Member
Join Date: May 2015
Posts: 34
Rep Power: 11 |
Quote:
I am not 100% sure but, I think the only way this might be possible is with the debug flag in the compilation of openfoam. In pimpleControl.C is the following which indicates printing of more variables with their residuals: Code:
if (debug) { Info<< algorithmName_ << " loop:" << endl; Info<< " " << variableName << " PIMPLE iter " << corr_ << ": ini res = " << residualControl_[fieldI].initialResidual << ", abs tol = " << residual << " (" << residualControl_[fieldI].absTol << ")" << ", rel tol = " << relative << " (" << residualControl_[fieldI].relTol << ")" << endl; } |
||
March 22, 2016, 08:23 |
|
#16 | |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
What you describe has nothing to do with debug flags in compilation.
The code you mentioned is part of OpenFOAM's run-time debugging mechanism. It is enabled by adding the following dictionary to controlDict. Check out the global controlDict for other available options. The DebugSwitches dictionary in your case's controlDict overrides the settings of the global controlDict. Thus, there is no need to edit the global controlDict. Unless you know what you are doing, and have ample reason to change OpenFOAM's standard behaviour. Code:
DebugSwitches { pimpleControl 1; } Quote:
Furthermore, twoPhaseEulerFoam does not solve for the momentum explicitely. Thus, you won't find any calls similar to solve(UEqn). The solution algorithm is described in Henrik Rusche's thesis [http://powerlab.fsb.hr/ped/kturbo/Op...chePhD2002.pdf]. |
||
May 3, 2016, 11:25 |
|
#17 |
New Member
Ehsan
Join Date: Aug 2010
Location: QC, Canada
Posts: 29
Rep Power: 16 |
Hi friends,
Regarding to existence of very low value of alpha phase fraction (0.88e-3) , I was recently noticed twoPhaseEulerFoam doesnt solve alpha equation . I think I should change this section somehow (twoPhaseSystem.C) to enable code see alpha: Code:
forAll(dgdt_, celli) { if (dgdt_[celli] > 0.0 && alpha1[celli] > 0.0) { Sp[celli] -= dgdt_[celli]*alpha1[celli]; Su[celli] += dgdt_[celli]*alpha1[celli]; } else if (dgdt_[celli] < 0.0 && alpha1[celli] < 1.0) { Sp[celli] += dgdt_[celli]*(1.0 - alpha1[celli]); } } P.S I am working on an electrochemical reactor (please see attached pics). Cylinder vessel is occupied completely by water. Inlet is wallRotatingvelocity type and gas phase fraction (air) is equal to 0.88e-3 in Inlet. By the way, bubble size diameter is 145e-6 (order of micro) . gemometry.jpg |
|
May 3, 2016, 12:02 |
|
#18 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
The method twoPhaseSystem::solve() contains the solution of the alpha equation.
Like in this section: Code:
MULES::explicitSolve ( geometricOneField(), alpha1, phi_, alphaPhic1, Sp, Su, phase1_.alphaMax(), 0 ); However, the volume fraction is still solved for, otherwise the solver wouldn't work. |
|
July 4, 2016, 08:00 |
|
#19 |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Dear All,
In twoPhaseEulerFoam solver or many other solvers in OF, we have the terms defined by fvOptions. If in the case system folder, we do not put the fvOptions file, does it mean that all the fvOptions related terms in the source files will not be used or deactived automatically? I am not sure about this and a little how the fvOptions terms work when OpenFOAM is running. Thank you so much. |
|
July 4, 2016, 08:24 |
|
#20 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
You find an answer to your question by playing around.
There is a tutorial case of twoPhaseEulerFoam, named injection, which uses the fvOption framework. If you run the tutorial as is, then the solver tells you about the active fvOptions models. See the relevant lines of solver output below. Code:
No MRF models present Creating finite volume options from "constant/fvOptions" Selecting finite volume options model type scalarSemiImplicitSource Source: massSource1 - selecting cells using points - selected 1 cell(s) with volume 8e-06 Selecting finite volume options model type vectorSemiImplicitSource Source: momentumSource1 - selecting cells using points - selected 1 cell(s) with volume 8e-06 Selecting finite volume options model type scalarSemiImplicitSource Source: energySource1 - selecting cells using points - selected 1 cell(s) with volume 8e-06 Courant Number mean: 0 max: 0 Max Ur Courant Number = 0 Calculating field DDtU1 and DDtU2 Starting time loop Code:
No MRF models present No finite volume options present Courant Number mean: 0 max: 0 Max Ur Courant Number = 0 Calculating field DDtU1 and DDtU2 Starting time loop |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TwoPhaseEulerFoam high courant number | mwaqas | OpenFOAM Running, Solving & CFD | 11 | July 11, 2017 15:19 |
twoPhaseEulerFoam fvOptions for alpha | lavdwall | OpenFOAM Running, Solving & CFD | 8 | October 19, 2015 10:57 |
TwoPhaseEulerFoam alpha "ripples" | MichaelB88 | OpenFOAM Running, Solving & CFD | 1 | July 9, 2015 05:20 |
twoPhaseEulerFoam BC calculated from wall shear and alpha | potac | OpenFOAM Running, Solving & CFD | 0 | October 6, 2014 09:08 |
about bounded alpha equation for bubbleFoam and twoPhaseEulerFoam | kaifu | OpenFOAM | 2 | May 6, 2011 06:33 |