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

error adding void fraction into the solver & Error when chemistry is on

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 14, 2016, 07:02
Default chpjz0391
  #21
New Member
 
César Augusto Corrêa Miguéis
Join Date: Nov 2013
Location: Rio de Janeiro, Brasil
Posts: 26
Rep Power: 12
cmigueis is on a distinguished road
Hi, chpjz0391!

The addition of the collisionCloud into the coalChemistry Foam was accomplished!
You can analize the code in the reply that I've sent in december, 28, in this thread!

About the alphac, it's only required when your have a dense particulate flow - the magical number (I don't know how it was determined) is about 10 or 12% (or greater) of particle fraction (volumetric) into your domain.
I mean:

Vparticles/Vcell >= 0,12.

I hope this was helpful!

Regards from Brazil!
__________________
César Miguéis
Mechanical Engineer
MSc. Student at COPPE/UFRJ
cmigueis is offline   Reply With Quote

Old   June 14, 2016, 22:22
Default
  #22
Member
 
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 93
Rep Power: 10
chpjz0391 is on a distinguished road
Quote:
Originally Posted by cmigueis View Post
Hi, chpjz0391!

The addition of the collisionCloud into the coalChemistry Foam was accomplished!
You can analize the code in the reply that I've sent in december, 28, in this thread!

About the alphac, it's only required when your have a dense particulate flow - the magical number (I don't know how it was determined) is about 10 or 12% (or greater) of particle fraction (volumetric) into your domain.
I mean:

Vparticles/Vcell >= 0,12.

I hope this was helpful!

Regards from Brazil!
HI César,
Thanks for your reply.
I modified the lib and compiled it successfully. However, when I complied my solver I got the following error.
Code:
5): undefined reference to `Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > >::debug'/home/ping/OpenFOAM/root-3.0.1/platforms/linux64GccDPInt32Opt/lib/libmycollision.so: undefined reference to `Foam::WallModel<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > >::dictionaryConstructorTablePtr_'/home/ping/OpenFOAM/root-3.0.1/platforms/linux64GccDPInt32Opt/lib/libmycollision.so: undefined reference to `Foam::PairModel<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::ReactingMultiphaseParcel<Foam::ReactingParcel<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > > > > >::dictionaryConstructorTablePtr_'collect2: error: ld returned 1 exit status
Then I modified "makeBasicReactingMultiphaseParcelSubmodels.C" as well as "defineBasicReactingMultiphaseParcel.C"like yours.


makeBasicReactingMultiphaseParcelSubmodels.C
Code:
"ttypedef basicReactingMultiphaseCloud::collidingCloudType collidingParcelType;
makeParcelCollisionModels(collidingParcelType);
"
defineBasicReactingMultiphaseParcel.C
Code:
     typedef    Foam::ThermoParcel<CollidingParcel<KinematicParcel<particle> > > thermoParcel;
    typedef    Foam::ReactingParcel<ThermoParcel<CollidingParcel<KinematicParcel<particle> > > > reactingParcel;

    defineTemplateTypeNameAndDebug(thermoParcel, 0);
   defineTemplateTypeNameAndDebug(reactingParcel, 0);
However, this time I cannot even compile the lib .

Do you have any suggestion? I am using OpenFOAM 3.0.1 . Is the version problem? The attachment is my code.

Kind Regards,

Ping

mycollision.zip
chpjz0391 is offline   Reply With Quote

Old   August 14, 2016, 14:51
Default
  #23
Member
 
amin jalalian
Join Date: Mar 2014
Posts: 34
Rep Power: 12
amin_jalalian is on a distinguished road
Hi,
I think you must write "- alpha*rho.dimensionedInternalField()*g
==
"
amin_jalalian is offline   Reply With Quote

Old   August 14, 2016, 14:53
Default
  #24
Member
 
amin jalalian
Join Date: Mar 2014
Posts: 34
Rep Power: 12
amin_jalalian is on a distinguished road
Quote:
Originally Posted by cmigueis View Post
Hi Shuai! Did you have any progress?

I started to modify the coalChemistryFoam code to include the void fraction into the transport equations. In the coalChemistryFoam.c file I included the following code:

Code:
// Update continuous phase volume fraction field
        alpha = max(1.0 - coalCloud.theta() - limestoneCloud.theta(), 0.01);
        alpha.correctBoundaryConditions();
        alphaf = fvc::interpolate(alpha);
        alphaPhi = alphaf*phi;
that I adapted from the DPMFoam solver. The cloudName.theta() return the volumetric fraction of particles in the cell, so the alpha is the void fraction of the cell.

So, I modified the UEqn.h file into this (I'm gonna show only the modified part):

Code:
fvVectorMatrix UEqn
    (
        fvm::ddt(rho*alpha, U)
      + fvm::div(alphaPhi, U)
      + alpha*fvc::grad(p)
      + alpha*turbulence->divDevRhoReff(U)
      + alpha*rho.dimensionedInternalField()*g
     ==
        coalParcels.SU(U)
      + limestoneParcels.SU(U)
      + fvOptions(rho, U)
    );
The continuity equation looks like:

Code:
    {
    fvScalarMatrix rhoEqn
    (
        fvm::ddt(alpha,rho)
      + fvc::div(alpha,phi)
      ==
        coalParcels.Srho(rho)
    limestoneParcels.Srho(rho)
      + fvOptions(rho)
    );

    fvOptions.constrain(rhoEqn);

    rhoEqn.solve();

    fvOptions.correct(rho);
}

    );
Now I'm trying tho modify the energy equation, but I'm having a hard time trying to understand the code (I've already modified the temporal and the convective terms of the internal energy and the kinetic energy).
Code:
{
    volScalarField& he = thermo.he(); 

    fvScalarMatrix EEqn
    (
        fvm::ddt(alpha*rho, he) + mvConvection->fvmDiv(alphaPhi, he)
      + fvc::ddt(alpha*rho, K) + fvc::div(alphaPhi, K)
      + (
            he.name() == "e"
          ? fvc::div
            (
                fvc::absolute(phi/fvc::interpolate(rho), U),
                p,
                "div(phiv,p)"
            )
          : -dpdt
        )
      - fvm::laplacian(turbulence->alphaEff(), he)
     ==
        combustion->Sh()
      + coalParcels.Sh(he)
      + limestoneParcels.Sh(he)
      + radiation->Sh(thermo)
      + fvOptions(rho, he)
    );
Seems to me that this code should represent the Energy Equation in the for of the equation 12 in the article about the energy equation in the CFD DIrect ( http://cfd.direct/openfoam/energy-equation/ )



I'm stucked in this part:

Code:
+ (
            he.name() == "e"
          ? fvc::div
            (
                fvc::absolute(phi/fvc::interpolate(rho), U),
                p,
                "div(phiv,p)"
            )
          : -dpdt
        )
Can someone explain the code above? Which part of Eq. 12 (assuming that is the form of Eq 12 indeed) it represents?

Thanks in advance to everybody and regards from Brazil!

[ Moderator note: Moved from this thread: http://www.cfd-online.com/Forums/ope...ification.html - Reason: consolidation of the ongoing development ]

Hi,
I think you must write
"- alpha*rho.dimensionedInternalField()*g
== "
in UEqn.H
amin_jalalian is offline   Reply With Quote

Reply


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
OpenFoam_compressibleInterFoam solver_calculation void fraction in the Outlet sahar_rf OpenFOAM Post-Processing 0 August 20, 2014 12:13
void fraction talib Main CFD Forum 0 March 1, 2012 15:25
[blockMesh] BlockMeshmergePatchPairs hjasak OpenFOAM Meshing & Mesh Conversion 11 August 15, 2008 07:36
OpenFoam 14 installation problem gfcoppola OpenFOAM Installation 20 November 2, 2007 13:38
compressible two phase flow in CFX4.4 youngan CFX 0 July 1, 2003 23:32


All times are GMT -4. The time now is 01:45.