CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Adding heat generation and transfer to DPMFoam inc. buoyancy of fluid (https://www.cfd-online.com/Forums/openfoam-programming-development/201033-adding-heat-generation-transfer-dpmfoam-inc-buoyancy-fluid.html)

dussa April 19, 2018 17:01

Adding heat generation and transfer to DPMFoam inc. buoyancy of fluid
 
Hi everyone,
I have been getting further into my efforts to include additional models to the DPMFoam solver. My idea has a couple of additions being made to the existing DPMFoam solver:
  1. Adding an internal heating model for the particles
  2. Keeping the collision modelling and 4-way coupling currently present in the solver
  3. Adding the temperature fields to the flow solver portion of DPMFoam

For the time being I am referring to my new solver as fFoam
From the above things I have determined there are multiple things that need to be done. Firstly, to address point (1) I will need to create a new cloud and parcel model. I could add a heat generation term to the Thermo[cloud,parcel] classes, however then there would not be any collision modelling, as can be seen in the basicThermoCloud.H file:

basicThermoCloud.H
Code:

namespace Foam
{
    typedef ThermoCloud
    <                        <------- Collision modelling missing
        KinematicCloud
        <
            Cloud
            <
                basicThermoParcel
            >
        >
    > basicThermoCloud;
}

So the first thing I will do is create a new cloud and parcel class as shown below, adding Thermo to the existing basicKinematicColliding[Cloud,Parcel] classes and making the necessary changes in the relevant files:

basicThermoKinematicCollidingCloud.H
Code:

namespace Foam
{
    typedef ThermoCloud
    <
        CollidingCloud      <- - - - - Collision modelling included
        <
            KinematicCloud
            <
                Cloud
                <
                    basicThermoKinematicCollidingParcel <---new parcel type
                >
            >
        >
    > basicThermoKinematicCollidingCloud;
}

basicThermoKinematicCollidingParcel.H
Code:

namespace Foam
{
    typedef ThermoParcel
            <
                CollidingParcel
                <
                    KinematicParcel
                    <
                        particle
                    >
                >
            > basicThermoKinematicCollidingParcel;

There is a report by a student from Chalmers University about addition of a decay heat submodel which I base my implementation of an internal heat generation term off: Implementation of decay heat model as a submodel in lagrangian library for reactingParcelFoam solver. This takes care of point (1) and half of point (2), maintaining the collision modelling that is in the current DPMFoam solver.

Point (2) also requires the 4-way coupling of DPMFoam to remain intact (namely momentum source terms for the fluid that are influenced by the motion of the particles). This I would assume means maintaining declarations made in the DPMFoam solver and its subsequent createFields.H UcEqn.H and pEqn.H files, although because I am including ThermoCloud and ThermoParcel I assume that there will need to be some chages to these files. II have tried to emulate what happens in the reactingParcelFoam and coalChemistryFoam solvers to that end.

Point (3) means I obviously need to try to add the temperature field to the fluid portion of the solver, whilst I also want to include the temperature dependency of thermophysical properties (but initially only the density of the fluid). I have looked at the existing flow solvers and my criteria. It appears that buoyantPimpleFoam would be a good candidate to attempt to implement in fFoam.

Questions
I am only interested in simple internal energy in the particles, no phase change or surface reactions. I am having some trouble understanding what I should do to include the temperature in the solver. Currently there seems to be a couple ways various solvers include Temperature (T).
  • coalChemistryFoam and reactingParcelFoam both use a term that is
    Code:

    const volScalarField& T = thermo.T();
  • other solver like buoyantBoussinesqPimpleFoam include the temperature field explicitly in the createFields.H file such as
    Code:

    Info<< "Reading field T\n" << endl;
    volScalarField T
    (
        IOobject
        (
            "T",
            runTime.timeName(),
            mesh,
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh
    );


My question is; does anyone have an idea how I should implement the liquid phase temperature field in my solver, as there will also be a temperature of the solid phase that would be tracked independently of the fluid phase. Also, if anyone can explain to me how the line const volScalarField& T = thermo.T(); works that would be greatly appreciated too.
I will keep this thread updated with any progress I make,

kind regards,
Robert

dussa April 30, 2018 20:26

Hi again,

I am trying to compile a new Cloud/Parcel that includes thermodynamic effects in the basicKinematicCollidingCloud/Parcel (ie. I am trying to compile basicThermoKinematicCollidingCloud/Parcel) but I keep running in to an error whilst running wmake libso. The error message is:

Code:

Make/linux64GccDPInt32Opt/parcels/derived/basicThermoKinematicCollidingParcel/makeBasicThermoKinematicCollidingParcelSubmodels.o
In file included from /home/robert/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/HashTable.H:51:0,
                from /home/robert/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/objectRegistry.H:38,
                from /home/robert/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/cloud.H:38,
                from ../../lagrangian/basic/lnInclude/Cloud.H:39,
                from ../../lagrangian/intermediate/lnInclude/basicThermoKinematicCollidingCloud.H:35,
                from parcels/derived/basicThermoKinematicCollidingParcel/makeBasicThermoKinematicCollidingParcelSubmodels.C:26:
/home/robert/OpenFOAM/OpenFOAM-4.x/src/OpenFOAM/lnInclude/className.H:112:48: error: redefinition of ‘const Foam::word Foam::StochasticCollisionModel<Foam::KinematicCloud<Foam::Cloud<Foam::ThermoParcel<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > >::typeName’
    defineTemplateTypeNameWithName(Type, Type::typeName_())

It seems to say that when it is trying to compile makeBasicThermoKinematicCollidingParcelSubmodels.o that it is redefining 'const Foam::word Foam::StochasticCollisionModel<Foam....' etc. etc. (please see error message above). I have tried looking for where const Foam::word Foam::StochasticCollisionModel is defined originally, but I have failed to find anything.

I managed to get the library to compile by removing

#̶i̶n̶c̶l̶u̶d̶e̶ ̶"̶m̶a̶k̶e̶P̶a̶r̶c̶e̶l̶S̶t̶o̶c̶h̶a̶s̶t̶i̶c̶C̶o̶l̶l ̶i̶s̶i̶o̶n̶M̶o̶d̶e̶l̶s̶.̶H̶"̶
and
m̶a̶k̶e̶P̶a̶r̶c̶e̶l̶S̶t̶o̶c̶h̶a̶s̶t̶i̶c̶C̶o̶l̶l̶i̶ s̶i̶o̶n̶M̶o̶d̶e̶l̶s̶(̶b̶a̶s̶i̶c̶T̶h̶e̶r̶m̶o̶K̶i̶n̶ e̶m̶a̶t̶i̶c̶C̶o̶l̶l̶i̶d̶i̶n̶g̶C̶l̶o̶u̶d̶)̶;̶

from makeBasicThermoKinematicCollidingParcelSubmodels.C. I did this because I noticed that makeParcelStochasticCollisionModels.H only contains:
Code:

#include "NoStochasticCollision.H"
So it seems strange that makeParcelStochasticCollisionModels.H is included in the first place, as it is implementing the case of NoStochasticCollision.H.
Regardless, when I have run simulations with the standard basicKinematicCollidingCloud/Parcels (as used in DPMFoam) I have always had the stochasticCollisions set to none in $CASE_DIR/constant/kinematicCloudProperties file:
Code:

stochasticCollisionModel none;
If anyone see's an error with me excluding these StochasticCollisionModels from my basicThermoKinematicColliding[Cloud/Parcel]'s then please let me know. I will continue now with trying to implement them and reply with any progress/problems in case anyone is interested.

Rob.

gbot September 18, 2019 14:05

Hi Rob


Have you figured out your problem. If show would you mind sharing as I also need to add temperature to DPMFoam.


Kind Regards

SUDHA_PAL July 15, 2021 16:29

Using thermocloud in dpm foam
 
I want to consider thermal effects of particles in DPM Foam. Have you fogured out your problem?

emadsiadati July 8, 2022 12:35

Hi,
Could you couple these pacels and clouds?
I am having the exact same issues


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