|
[Sponsors] |
Adding Boussinesq Approximation to multiphaseInterFoam? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 2, 2019, 10:25 |
Adding Boussinesq Approximation to multiphaseInterFoam?
|
#1 |
New Member
Aurelie
Join Date: May 2015
Posts: 2
Rep Power: 0 |
Hello,
I don't kown how to code well in C++ but I'm trying to implement the Boussinesq approximation into the multiphaseInterFoam Solver (OF 4.0). I have succeeded yet with interFoam. I added a file, T.Eqn with temperature equation and it compiles. I have trouble with the Boussinesq term, I don't how to deal with it, I tried this in multiphaseMixture.C : Code:
Foam::tmp<Foam::volScalarField> Foam::multiphaseMixture::rhoB() const { const volScalarField& T = U_.mesh().lookupObject<volScalarField>("T"); PtrDictionary<phase>::const_iterator iter = phases_.begin(); tmp<volScalarField> trhoB = iter()*(iter().rho()*(1.0-iter().beta()*(T-iter().Tref()))); volScalarField& rhoB = trhoB.ref(); for (++iter; iter != phases_.end(); ++iter) { rhoB += iter()*(iter().rho()*(1.0-iter().beta()*(T-iter().Tref()))); } return trhoB; } Foam::tmp<Foam::scalarField> Foam::multiphaseMixture::rhoB(const label patchi) const { PtrDictionary<phase>::const_iterator iter = phases_.begin(); tmp<scalarField> trhoB = iter().boundaryField()[patchi]*(iter().rho()*(1.0-iter().beta()*(T-iter().Tref()))); scalarField& rhoB = trhoB.ref(); for (++iter; iter != phases_.end(); ++iter) { rhoB += iter().boundaryField()[patchi]*(iter().rho()*(1.0-iter().beta()*(T-iter().Tref()))); } return trhoB; } Code:
//- Return the mixture variable density tmp<volScalarField> rhoB() const; //// //- Return the mixture variable density for patch tmp<scalarField> rhoB(const label patchi) const; //// I have this error : multiphaseMixture.C: In member function ‘Foam::tmp<Foam::Field<double> > Foam::multiphaseMixture::rhoB(Foam::label) const’: multiphaseMixture.C:233:96: error: no match for ‘operator-’ (operand types are ‘<unresolved overloaded function type>’ and ‘const dimensionedScalar {aka const Foam::dimensioned<double>}’) tmp<scalarField> trhoB = iter().boundaryField()[patchi]*(iter().rho()*(1.0-iter().beta()*(T-iter().Tref()))); ~^~~~~~~~~~~~~~ I don't know how and where define rhoB and T. Thanks ! |
|
October 8, 2019, 17:55 |
|
#2 |
Member
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 9 |
I dont know multiphaseInterFoam but,
There is no rho in buoyancy term. You need to define g(if its not defined in your solver) - beta and Tref in create fields, they are transport properties. g is vector, beta and Tref are scalars. After that you can add following line to your momentum equation. Code:
- (g * beta * (T-Tref) ) |
|
November 20, 2019, 19:43 |
|
#3 | |
New Member
Gowthaman Parivendhan
Join Date: Aug 2019
Location: Dublin, Ireland
Posts: 3
Rep Power: 7 |
Quote:
I'm trying to include Boussinesq approximation in interFoam but have some trouble in pressure Eqn. If you are interested, I can share the code or send you an email regarding this. Many thanks, Gowthaman |
||
Tags |
boussinesq approximation, multiphaseinterfoam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
multiRegionHeater error | ordinary | OpenFOAM Running, Solving & CFD | 2 | June 9, 2020 18:43 |
Adding Boussinesq Approximation to multiphaseEulerFoam? | dschmidt | OpenFOAM Programming & Development | 1 | January 16, 2017 17:40 |
conjugateHeatFoam + interFoam | farhagim | OpenFOAM Programming & Development | 15 | July 19, 2016 08:55 |
Buoyancy: Boussinesq approximation or temperature dependence? | agustinvo | Main CFD Forum | 5 | September 18, 2015 12:47 |
Natural convection without boussinesq approximation | shahrooz.omd | Main CFD Forum | 0 | June 23, 2015 09:03 |