CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Lagrangian particle modelling combined with CHT (http://www.cfd-online.com/Forums/openfoam-programming-development/113875-lagrangian-particle-modelling-combined-cht.html)

Chrisi1984 February 28, 2013 09:12

Lagrangian particle modelling combined with CHT
 
Hello all,

I am going to create a lagrangian solver (in best case a LTS lagrangian solver) that also allows conjugate heat transfer with solid regions.

My plan is to create a combination of the chtMultiRegionFoam and the LTSReactingParcelFoam solver.

But already in my first step implementing the LTS in the solver chtMultiRegionFoam I am facing problems:

To start the Pressure-velocity PIMPLE corrector loop in the LTS solver is implemented:
Quote:

// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
where as in the chtMulti solver a Pimple loop is started with a for loop:
Quote:

// --- PIMPLE loop
for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
If I try to use
Quote:

// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
in the chtMulti solver I receive the following error:

Quote:

chtMultiRegionSprayFoam.C:123:24: error: 'const class Foam::dictionary' has no member named 'loop'
Beside from some other changes I already added those headers

#include "pimpleControl.H"
#include "DataEntry.H"
#include "fvcSmooth.H"

#include "readPIMPLEControls.H"

to the solver.

What is the prerequisite to start the Pressure-velocity PIMPLE corrector loop with while?

Thank in advance for your help.

Kind regards

Chrisi

chegdan March 3, 2013 17:28

Chrisi,

Did you add a pimpleControl object? One can be declared using something like

Code:

.
.
.
#include "pimpleControl.H"
.
.
.

int main(int argc, char *argv[])
{
    #include "setRootCase.H"
    #include "createTime.H"
    #include "createMesh.H"
    #include "createFields.H"
    #include "createZones.H"
    #include "initContinuityErrs.H"

    pimpleControl pimple(mesh);

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Info<< "\nStarting time loop\n" << endl;

    while (runTime.run())
    {
        #include "readTimeControls.H"
        #include "CourantNo.H"
        #include "setDeltaT.H"

        runTime++;

        Info<< "Time = " << runTime.timeName() << nl << endl;

        // --- Pressure-velocity PIMPLE corrector loop
        while (pimple.loop())
        {
        .
        .
        .

this is from the pimpleFoam solver source.

Chrisi1984 March 5, 2013 15:08

Thanks that worked!

Chrisi1984 March 8, 2013 10:18

Hi again,

I made some progress in the mean time. But now I am facing a new problem that i can't get rid of for a while.

In the file "createFluidFields" I try to implement pointers. In the standard "reactingParcelFoam" solver it is implemented that way:
Quote:

autoPtr<combustionModels::psiChemistryCombustionMo del> combustion
(
combustionModels::psiChemistryCombustionModel::New
(
mesh
)
);

psiChemistryModel& chemistry = combustion->pChemistry();

hsCombustionThermo& thermo = chemistry.thermo();

SLGThermo slgThermo(mesh, thermo);
I tried to adapt that for the "createFluidFields" files with pointers in that way:

Quote:

PtrList<psiChemistryModel> pChemistry(fluidRegions.size());
PtrList<psiChemistryModel> chemistryFluid(fluidRegions.size());
PtrList<hsCombustionThermo> thermoFluid(fluidRegions.size());
PtrList<SLGThermo> slgThermoFluid(fluidRegions.size());
////////////////////////////////////
Info<< "*** Reading fluid mesh thermophysical properties for region "
<< fluidRegions[i].name() << nl << endl;

Info<< " Adding to thermoFluid\n" << endl;
pChemistry.set
(
i,
psiChemistryModel::New(fluidRegions[i]).ptr()
);




chemistryFluid.set

(
i,
pChemistry[i]
);

thermoFluid.set

(
i,
pChemistry[i].thermo()
);



slgThermoFluid.set

(
i,
SLGThermo(fluidRegions[i], thermoFluid[i])
);
I realized that the problem with that implementation are the missing references here:

psiChemistryModel& chemistry = combustion->pChemistry();

hsCombustionThermo& thermo = chemistry.thermo();

How can i handle the references with a pointer?

I already tried that:

Quote:

PtrList<hsCombustionThermo>& thermoFluid(fluidRegions.size());
But that resulted in that error:

Quote:

error: invalid initialization of non-const reference of type 'Foam::PtrList<Foam::hsCombustionThermo>&' from an rvalue of type 'Foam::label {aka int}'
Thanks for your help in advance!

niklas March 8, 2013 10:57

Do you want to have wallfilm/solid heat transfer also?
Because thats going to require alot more work than just modifying solvers.

I had a master thesis student to write a spray with wallfilm CHT multi-region) solver a few months ago, so it can be done, but if you are stuck at this level, you're going to have a really hard time ahead...just a warning :)

Chrisi1984 March 8, 2013 12:14

Hi,

yes i want to implement spray in the cht solver.

But in a first step the wallfilm model need not to be implemented.

Is the most of the work for the wallfilm modeling or just for dosing spray?

Kind regards

Chrisi

niklas March 8, 2013 13:54

spray, once that is done, wallfilm is trivial

Chrisi1984 March 8, 2013 14:11

Thanks for your hint. So I know that I have to be patient.

Nevertheless can you give me some help regarding my pointer problem?

Kind regrads

Chrisi

Bosen March 20, 2015 06:30

Quote:

Originally Posted by Chrisi1984 (Post 412608)
Thanks for your hint. So I know that I have to be patient.

Nevertheless can you give me some help regarding my pointer problem?

Kind regrads

Chrisi

Hi Chrisis,

Have you sloved the pointer problem? I am in trouble with the same problem.

Best regards.

Bosen

Chrisi1984 March 26, 2015 00:40

Hi Bosen,

I solved the problem with my pointer. Now the code is:

Quote:

pChemistry.set
(
i,
psiChemistryModel::New(fluidRegions[i]).ptr()
);


hsCombustionThermo& thermo = pChemistry[i].thermo();

SLGThermo slgThermo(fluidRegions[i], thermo);
Kind regards
Chrisi


All times are GMT -4. The time now is 19:07.