CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Adding Boussinesq Approximation to multiphaseInterFoam?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2019, 09:25
Default Adding Boussinesq Approximation to multiphaseInterFoam?
  #1
New Member
 
Aurelie
Join Date: May 2015
Posts: 2
Rep Power: 0
Alona is on a distinguished road
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;
}
and in multiphaseMixture.H, I add :



Code:
      

  //- Return the mixture variable density 
       tmp<volScalarField> rhoB() const;   ////

        //- Return the mixture variable density for patch
        tmp<scalarField> rhoB(const label patchi) const;  ////
rhoB being rho0*(1-beta(T-Tref))

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 !
Alona is offline   Reply With Quote

Old   October 8, 2019, 16:55
Default
  #2
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 8
ErenC is on a distinguished road
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) )
ErenC is offline   Reply With Quote

Old   November 20, 2019, 18:43
Default
  #3
New Member
 
Gowthaman Parivendhan
Join Date: Aug 2019
Location: Dublin, Ireland
Posts: 3
Rep Power: 6
gowthaman is on a distinguished road
Quote:
Originally Posted by Alona View Post
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;
}
and in multiphaseMixture.H, I add :



Code:
      

  //- Return the mixture variable density 
       tmp<volScalarField> rhoB() const;   ////

        //- Return the mixture variable density for patch
        tmp<scalarField> rhoB(const label patchi) const;  ////
rhoB being rho0*(1-beta(T-Tref))

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 !
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
gowthaman is offline   Reply With Quote

Reply

Tags
boussinesq approximation, multiphaseinterfoam


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiRegionHeater error ordinary OpenFOAM Running, Solving & CFD 2 June 9, 2020 17:43
Adding Boussinesq Approximation to multiphaseEulerFoam? dschmidt OpenFOAM Programming & Development 1 January 16, 2017 16:40
conjugateHeatFoam + interFoam farhagim OpenFOAM Programming & Development 15 July 19, 2016 07:55
Buoyancy: Boussinesq approximation or temperature dependence? agustinvo Main CFD Forum 5 September 18, 2015 11:47
Natural convection without boussinesq approximation shahrooz.omd Main CFD Forum 0 June 23, 2015 08:03


All times are GMT -4. The time now is 18:37.