Adding Boussinesq Approximation to multiphaseInterFoam?

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 October 2, 2019, 09: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::multiphaseMixture::rhoB() const { const volScalarField& T = U_.mesh().lookupObject("T"); PtrDictionary::const_iterator iter = phases_.begin(); tmp 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::multiphaseMixture::rhoB(const label patchi) const { PtrDictionary::const_iterator iter = phases_.begin(); tmp 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; }``` and in multiphaseMixture.H, I add : Code: ``` //- Return the mixture variable density tmp rhoB() const; //// //- Return the mixture variable density for patch tmp rhoB(const label patchi) const; ////``` rhoB being rho0*(1-beta(T-Tref)) I have this error : multiphaseMixture.C: In member function ‘Foam::tmp > Foam::multiphaseMixture::rhoB(Foam::label) const’: multiphaseMixture.C:233:96: error: no match for ‘operator-’ (operand types are ‘’ and ‘const dimensionedScalar {aka const Foam::dimensioned}’) tmp 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, 16:55 #2 Member   Eren Join Date: Aug 2018 Posts: 86 Rep Power: 8 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, 18:43
#3
New Member

Gowthaman Parivendhan
Join Date: Aug 2019
Location: Dublin, Ireland
Posts: 3
Rep Power: 6
Quote:
 Originally Posted by Alona 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::multiphaseMixture::rhoB() const { const volScalarField& T = U_.mesh().lookupObject("T"); PtrDictionary::const_iterator iter = phases_.begin(); tmp 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::multiphaseMixture::rhoB(const label patchi) const { PtrDictionary::const_iterator iter = phases_.begin(); tmp 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; }``` and in multiphaseMixture.H, I add : Code: ``` //- Return the mixture variable density tmp rhoB() const; //// //- Return the mixture variable density for patch tmp rhoB(const label patchi) const; ////``` rhoB being rho0*(1-beta(T-Tref)) I have this error : multiphaseMixture.C: In member function ‘Foam::tmp > Foam::multiphaseMixture::rhoB(Foam::label) const’: multiphaseMixture.C:233:96: error: no match for ‘operator-’ (operand types are ‘’ and ‘const dimensionedScalar {aka const Foam::dimensioned}’) tmp 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 !
Hi Alona,
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 Search this Thread: Advanced Search Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post ordinary OpenFOAM Running, Solving & CFD 2 June 9, 2020 17:43 dschmidt OpenFOAM Programming & Development 1 January 16, 2017 16:40 farhagim OpenFOAM Programming & Development 15 July 19, 2016 07:55 agustinvo Main CFD Forum 5 September 18, 2015 11:47 shahrooz.omd Main CFD Forum 0 June 23, 2015 08:03

All times are GMT -4. The time now is 02:53.

 Contact Us - CFD Online - Privacy Statement - Top