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

Dictionary Error for binaryAbsorptionEmission

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 30, 2023, 16:53
Question Dictionary Error for binaryAbsorptionEmission
  #1
New Member
 
Peter Bevington
Join Date: May 2023
Posts: 10
Rep Power: 2
pbevington is on a distinguished road
Hi all, I'm getting an error while trying to use the binaryAbsorptionEmission model for radiation modeling:

Code:
...
Selecting radiationModel fvDOM
Selecting absorptionEmissionModel binaryAbsorptionEmission

--> FOAM FATAL IO ERROR: (openfoam-2012)
Entry 'model1' not found in dictionary "/scratch1/09374/pbevingt/OpenFOAM2012/run/coalJet/constant/radiationProperties"


file: /scratch1/09374/pbevingt/OpenFOAM2012/run/coalJet/constant/radiationProperties at line 18 to 97.

    From Foam::dictionary &Foam::dictionary::subDict(const Foam::word &, Foam::keyType::option)
    in file db/dictionary/dictionary.C at line 557.

FOAM exiting
'model1' is a submodel for the binaryAbsorptionEmission model, defined in the constant/radiationProperties dictionary:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2012                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

radiation       on;

radiationModel  fvDOM;

P1Coeffs
{
    C               C [0 0 0 0 0 0 0] 0;
}

fvDOMCoeffs
{
    nPhi        4;      // azimuthal angles in PI/2 on X-Y.(from Y to X)
    nTheta      2;      // polar angles in PI (from Z to X-Y plane)
    tolerance   0.05;   // convergence tolerance for radiation iteration
    maxIter     1;      // maximum number of iterations
}

// Number of flow iterations per radiation iteration
solverFreq 10;

absorptionEmissionModel binaryAbsorptionEmission;

binaryAbsorptionEmissionCoeffs
{
    model1
    {
        absorptionEmissionModel wsggAbsorptionEmission;

        constantAbsorptionEmissionCoeffs
        {
            absorptivity    absorptivity    [0 -1 0 0 0 0 0] 0.5;
            emissivity      emissivity      [0 -1 0 0 0 0 0] 0.5;
            E               E   [1 -1 -3 0 0 0 0] 0;
        }

        greyMeanAbsorptionEmissionCoeffs
        {
            lookUpTableFileName     none;
            EhrrCoeff               0.2;
        }

        wsggAbsorptionEmissionCoeffs
        {
            meanBeamPathAutoCalcMode true;
            sector sector    [ 0  0  0  0  0  0  0] 360.0; //Degrees
            pathLength pathLength [ 0 1  0  0  0  0  0]  0.1; //m
            emissivityCoeffs 3(  0.4201 6.516 131.9 );
            fittingFactors  
            3        
            (
                4(6.508e-1 -5.551e-4 3.029e-7  -5.353e-11)
                4(-0.2504e-1  6.112e-4  -3.882e-7  6.528e-11)
                4(2.718e-1 -3.118e-4  1.221e-7  -1.612e-11)
            );
        }
    }
    model2
    {
        absorptionEmissionModel cloudAbsorptionEmission;
        cloudAbsorptionEmissionCoeffs
        {
            cloudNames
            (
                coalCloud1
            );
        }
    }
}

scatterModel    none;

cloudScatterCoeffs
{
    cloudNames
    (
        coalCloud1
    );
}

transmissivityModel none;

// ************************************************************************* //
As you can see, model1 is defined as within the dictionary file, so I'm confused as to why this error would be showing up. Any ideas? For reference, here is the binaryAbsorptionEmission constructor, as defined in binaryAbsorptionEmission.C:

Code:
 Foam::radiation::binaryAbsorptionEmission::binaryAbsorptionEmission
 (
     const dictionary& dict,
     const fvMesh& mesh
 )
 :
     absorptionEmissionModel(dict, mesh),
     coeffsDict_(dict.optionalSubDict(typeName + "Coeffs")),
     model1_
     (
         absorptionEmissionModel::New(coeffsDict_.subDict("model1"), mesh)
     ),
     model2_
     (
         absorptionEmissionModel::New(coeffsDict_.subDict("model2"), mesh)
     )
 {}
pbevington is offline   Reply With Quote

Old   May 31, 2023, 05:32
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 209
Rep Power: 5
Alczem is on a distinguished road
Hey

I am not familiar with this model, but did you try to define model1 and model2 outside of binaryAbsorptionEmissionCoeffs? The way the error is written lets me think that it might just be a matter of indentation. Maybe try this:
Code:
radiation       on;

radiationModel  fvDOM;

P1Coeffs
{
    C               C [0 0 0 0 0 0 0] 0;
}

fvDOMCoeffs
{
    nPhi        4;      // azimuthal angles in PI/2 on X-Y.(from Y to X)
    nTheta      2;      // polar angles in PI (from Z to X-Y plane)
    tolerance   0.05;   // convergence tolerance for radiation iteration
    maxIter     1;      // maximum number of iterations
}

// Number of flow iterations per radiation iteration
solverFreq 10;

absorptionEmissionModel binaryAbsorptionEmission;

model1
{
    absorptionEmissionModel wsggAbsorptionEmission;

    constantAbsorptionEmissionCoeffs
    {
        absorptivity    absorptivity    [0 -1 0 0 0 0 0] 0.5;
        emissivity      emissivity      [0 -1 0 0 0 0 0] 0.5;
        E               E   [1 -1 -3 0 0 0 0] 0;
    }

    greyMeanAbsorptionEmissionCoeffs
    {
        lookUpTableFileName     none;
        EhrrCoeff               0.2;
    }

    wsggAbsorptionEmissionCoeffs
    {
        meanBeamPathAutoCalcMode true;
        sector sector    [ 0  0  0  0  0  0  0] 360.0; //Degrees
        pathLength pathLength [ 0 1  0  0  0  0  0]  0.1; //m
        emissivityCoeffs 3(  0.4201 6.516 131.9 );
        fittingFactors  
        3        
        (
            4(6.508e-1 -5.551e-4 3.029e-7  -5.353e-11)
            4(-0.2504e-1  6.112e-4  -3.882e-7  6.528e-11)
            4(2.718e-1 -3.118e-4  1.221e-7  -1.612e-11)
        );
    }
}
model2
{
    absorptionEmissionModel cloudAbsorptionEmission;
    cloudAbsorptionEmissionCoeffs
    {
        cloudNames
        (
            coalCloud1
        );
    }
}



I can't see any other reason right now sorry
Alczem is offline   Reply With Quote

Old   May 31, 2023, 17:58
Default
  #3
New Member
 
Peter Bevington
Join Date: May 2023
Posts: 10
Rep Power: 2
pbevington is on a distinguished road
I tried that playing around with the dictionary format, though I don't think that is it, as I found a tutorial for coalChemistryFoam that uses the above format and works just fine. This is from tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek:

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2212                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solverFreq      1;

radiationModel  P1;

P1Coeffs
{
    C               C [0 0 0 0 0 0 0] 0;
}

absorptionEmissionModel binaryAbsorptionEmission;

binaryAbsorptionEmissionCoeffs
{
    model1
    {
        absorptionEmissionModel constantAbsorptionEmission;
        constantAbsorptionEmissionCoeffs
        {
            absorptivity    absorptivity    [0 -1 0 0 0 0 0] 0.5;
            emissivity      emissivity      [0 -1 0 0 0 0 0] 0.5;
            E               E   [1 -1 -3 0 0 0 0] 0;
        }
    }
    model2
    {
        absorptionEmissionModel cloudAbsorptionEmission;
        cloudAbsorptionEmissionCoeffs
        {
            cloudNames
            (
                coalCloud1
                limestoneCloud1
            );
        }
    }
}

scatterModel    cloudScatter;

cloudScatterCoeffs
{
    cloudNames
    (
        coalCloud1
        limestoneCloud1
    );
}

transmissivityModel none;


// ************************************************************************* //
I even copied that radiationProperties dict exactly to my case, but to no success. My next thought was that it had to be my solver, which is using a custom copy of the src/thermophysicalModels/radiation library. However, compiling with the native radiation library gave no change in behavior...

For reference the error is occuring when we are trying to unpack the subDicts model1 and model2 of the CoeffsDict:

(src/thermophysicalModels/radiation/submodels/absorptionEmissionModel/binaryAbsorptionEmissionModel/binaryAbsorptionEmission.C):

Code:
  
 Foam::radiation::binaryAbsorptionEmission::binaryAbsorptionEmission
 (
     const dictionary& dict,
     const fvMesh& mesh
 )
 :
     absorptionEmissionModel(dict, mesh),
     coeffsDict_(dict.optionalSubDict(typeName + "Coeffs")),
     model1_
     (
         absorptionEmissionModel::New(coeffsDict_.subDict("model1") <-Error is occuring when calling subDict("model1") on the CoeffsDict, mesh)
     ),
     model2_
     (
         absorptionEmissionModel::New(coeffsDict_.subDict("model2"), mesh)
     )
 {}
I cannot for the life of me figure out why I would get different behavior with the same radiationProperties dictionary and the same radiation library code. Perhaps there is some other dictionary that affects the radiation model?
pbevington 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
Dictionary in turbulence model NewKid OpenFOAM Programming & Development 4 February 18, 2019 21:16
driftFluxFoam viscosity model modification problem dleduc OpenFOAM Programming & Development 15 October 1, 2018 09:37
ill defined primitiveEntry starting at keyword 'value' on line 197 ChangeDictionary Struggle_Achieve OpenFOAM Pre-Processing 2 December 20, 2017 03:58
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51
FoamX error aachenBomb case Ervin Adorean (Adorean) OpenFOAM Pre-Processing 13 March 7, 2005 03:50


All times are GMT -4. The time now is 02:34.