synthetik-technologies / blastfoam

A CFD solver for multi-component compressible flow with application to high-explosive detonation, explosive safety and air blast
Other
215 stars 96 forks source link

Problem in blastRadiationModel #74

Closed carlo-fiorina closed 1 year ago

carlo-fiorina commented 1 year ago

Hi, I am a professor at Texas A&M and I would like use blastFoam in a project related to gas dynamics in fusion reactors. First of all, congrats for the amazing job and thanks for having shared this. For the moment, I have found just one small issue. I have tried to use a P1 radiation model. When I set up the radiationProperties dictionary, the solver says that the blastAbsorptionEmissionModels keyword is missing even when the keyword is there. I have looked into the code and the problem appears to be in the initialize() function in blastRadiationModel.C. Somehow (*this) fails in passing to the various functions the content of the radiationProperties dictionary (you can try to Info it). An inelegant workaround is to re-declare the dictionary (see code at the end of the message), but maybe someone more familiar with blastFoam and its structure could come up with a better solution. Worst case scenario, the proposed fix makes things work at least. Hope this helps.

void Foam::blastRadiationModel::initialise()
{

    IOobject radIO
    (
        "radiationProperties",
        mesh_.time().constant(),
        mesh_,
        IOobject::MUST_READ_IF_MODIFIED,
        IOobject::NO_WRITE,
        false
    );
    IOdictionary radDict(radIO);

    solverFreq_ = max(1, lookupOrDefault<label>("solverFreq", 1));

    absorptionEmission_.reset
    (
        //radiationModels::blastAbsorptionEmissionModel::New(*this, mesh_).ptr()
        radiationModels::blastAbsorptionEmissionModel::New(radDict, mesh_).ptr()
    );

    bAbsorptionEmission_.reset
    (
        &dynamicCast<const radiationModels::blastAbsorptionEmissionModel>
        (
            absorptionEmission_()
        )
    );

    //scatter_.reset(radiationModels::scatterModel::New(*this, mesh_).ptr());
    scatter_.reset(radiationModels::scatterModel::New(radDict, mesh_).ptr());

    //soot_.reset(radiationModels::sootModel::New(*this, mesh_).ptr());
    soot_.reset(radiationModels::sootModel::New(radDict, mesh_).ptr());
}
jheylmun commented 1 year ago

Hello, Thanks for finding this. Because of the work around I had for using the base radiation model the dictionary wasn't actually being read. The fix should be coming today though.

Thanks, Jeff

carlo-fiorina commented 1 year ago

Thanks! I'll test as soon as I have the chance