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

Lagrangian particle modelling combined with CHT

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 28, 2013, 08:12
Default Lagrangian particle modelling combined with CHT
  #1
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
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
Chrisi1984 is offline   Reply With Quote

Old   March 3, 2013, 16:28
Default
  #2
Senior Member
 
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0
chegdan will become famous soon enoughchegdan will become famous soon enough
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.

Last edited by chegdan; March 3, 2013 at 16:44.
chegdan is offline   Reply With Quote

Old   March 5, 2013, 14:08
Default
  #3
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
Thanks that worked!
Chrisi1984 is offline   Reply With Quote

Old   March 8, 2013, 09:18
Default
  #4
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
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:siChemistryCombustionMo del> combustion
(
combustionModels:siChemistryCombustionModel::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!
Chrisi1984 is offline   Reply With Quote

Old   March 8, 2013, 09:57
Default
  #5
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
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
niklas is offline   Reply With Quote

Old   March 8, 2013, 11:14
Default
  #6
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
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
Chrisi1984 is offline   Reply With Quote

Old   March 8, 2013, 12:54
Default
  #7
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
spray, once that is done, wallfilm is trivial
niklas is offline   Reply With Quote

Old   March 8, 2013, 13:11
Default
  #8
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
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
Chrisi1984 is offline   Reply With Quote

Old   March 20, 2015, 05:30
Default
  #9
New Member
 
Bosen Wang
Join Date: Dec 2014
Posts: 1
Rep Power: 0
Bosen is on a distinguished road
Quote:
Originally Posted by Chrisi1984 View Post
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
Bosen is offline   Reply With Quote

Old   March 25, 2015, 23:40
Default
  #10
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
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
Chrisi1984 is offline   Reply With Quote

Old   May 26, 2021, 19:45
Default
  #11
New Member
 
Robert Crane
Join Date: Jul 2020
Posts: 8
Rep Power: 5
rcrane22 is on a distinguished road
Hi Chrisi, were you able to get this solver working? Any chance you would be willing to share it?

It would be very useful for a problem I am facing.

Cheers,
Rob
rcrane22 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
Blood Damage Modelling via Particle Tracking in a Centrifugal Heart Pump scatman CFX 7 January 8, 2018 00:59
print position of Lagrangian particle? sven82 OpenFOAM Running, Solving & CFD 4 June 16, 2016 08:58
Particle Reynolds number calculation in Lagrangian tracking? jiejie OpenFOAM Running, Solving & CFD 5 July 6, 2012 04:47
error message cuteapathy CFX 14 March 20, 2012 06:45
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29


All times are GMT -4. The time now is 10:48.