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

NO_CONTROL, problem when solving the interFoam equations inside a single region

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 23, 2019, 05:20
Default NO_CONTROL, problem when solving the interFoam equations inside a single region
  #1
Member
 
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 9
frobaux is on a distinguished road
Hey foamers,
I'm currently trying to develop a solver based on chtMultiRegionFoam,


I would like to solve the equations from interFoam in the fluids zones,


for now I import fields following the logic of multiRegiondFoam, for example in createFluidFields.H:
Code:
PtrList<volVectorField> U(fluidRegions.size());
...
 U.set
    (
        i,
        new volScalarField
        (
            IOobject
            (
                "U",
                runTime.timeName(),
                fluidRegions[i],
                IOobject::MUST_READ,
                IOobject::AUTO_WRITE
            ),
            fluidRegions[i]
        )
    );
The problem is "setRefCell" needs pimple.dict()
Code:
setRefCell
(
    p[i],
    p_rgh[i],
    pimple.dict(),
    pRefCell[i],
    pRefValue[i]
);
And compilation returns an error as pimple is not defined in this scope.
when I comment the

Code:
#define NO_CONTROL
That part is ok to compile.

What is the use of NO_CONTROL, and why does it prevent pimple to be loaded?

Moreover, from what I know from C++, the #define should have two operands, STRING and REPLACEMENT_STRING right? so NO_CONTROL is replaced by nothing?


Thanks for your help
Fabien
frobaux is offline   Reply With Quote

Old   May 24, 2019, 08:21
Default
  #2
Member
 
Join Date: Dec 2018
Location: Darmstadt, Germany
Posts: 87
Rep Power: 7
raumpolizei is on a distinguished road
Hey,
Thanks for asking this question as I could also learn something valuable for myself .
I hope this part of the code will help you reason about the problem (from createControl.H)

Code:
 #if defined(NO_CONTROL)
 #elif defined(PISO_CONTROL)

     #include "createPisoControl.H"

 #elif defined(PIMPLE_CONTROL)

     #include "createPimpleControl.H"

 #elif defined(SIMPLE_CONTROL)

     #include "createSimpleControl.H"

 #endif
raumpolizei is offline   Reply With Quote

Old   May 24, 2019, 08:35
Default
  #3
Member
 
Fabien Robaux
Join Date: Oct 2016
Posts: 51
Rep Power: 9
frobaux is on a distinguished road
Oh, thank you for answering,

This is strange that "CONTROL" has to do with Pimple (which is defined in fvSolutions)
At the end, and because I don't completely get It, I have decided to use the PIMPLE dict located on the region directory (because I don't have a general mesh to construct a pimpleControl instance)
The only thing in the "main" pimple (in system/fvSolution) will be the nOuterCorr, which, from what I understand, are common for all regions (at least in chtMultiRegionFoam). This number is imported manuallly without the use of a pimpleControl instance.

Only I have to do in every loop over the regions (which involve a pimple) an include of
Code:
 pimpleControl pimple(fluidRegions[i]);

if( pimple.dict().found( "nOuterCorrectors") )
{
    FatalError << "entry nOuterCorrectors is present in dictionnary of the subregion '" 
        << fluidRegions[i].name() << "', It should be defined in the 'global' PIMPLE dict (in constant/fvSolutions)" << exit(FatalError);
}
Another way to do it would be to instanciante List of pimpleControl, but I didn't managed to do it.



Anyway with those method just hope that only the main loop that I will write manually will use nOuterCorrectors.



Thanks again for your help!

Last edited by frobaux; May 24, 2019 at 09:43.
frobaux is offline   Reply With Quote

Reply

Tags
#define, interfoam, no_control, regions


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
chtMultiRegionSimpleFoam: maximum number of iterations excedeed. Nkl OpenFOAM Running, Solving & CFD 19 October 10, 2019 02:42
HeatSource BC to the whole region in chtMultiRegionHeater xsa OpenFOAM Running, Solving & CFD 3 November 7, 2016 05:07
Orifice Plate with a fully developed flow - Problems with convergence jonmec OpenFOAM Running, Solving & CFD 3 July 28, 2011 05:24
Error while running rhoPisoFoam.. nileshjrane OpenFOAM Running, Solving & CFD 8 August 26, 2010 12:50
meshing F1 front wing Steve FLUENT 0 April 17, 2003 12:37


All times are GMT -4. The time now is 20:36.