void lcsMassSourcePluginFunction::doEvaluation()
{
    typedef DimensionedField<scalar,volMesh> dimScalarField;
    autoPtr<dimScalarField> pSrho;

    // pick up the first fitting class
    castAndCall(pSrho,dimScalarField,basicReactingCloud,reactingCloud,Srho());
    castAndCall(pSrho,dimScalarField,basicReactingMultiphaseCloud,reactingMultiphaseCloud,Srho());

    noCloudFound(pSrho);

    const dimScalarField &Srho=pSrho();

    autoPtr<volScalarField> pSource(
        new volScalarField(
            IOobject(
                cloudName()+"MassSource",
                mesh().time().timeName(),
                mesh(),
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            mesh(),
            Srho.dimensions(),
            "zeroGradient"
        )
    );

    pSource->internalField()=Srho.field();

    result().setObjectResult(pSource);
}
void lcsEnthalpySourcePluginFunction::doEvaluation()
{
    typedef DimensionedField<scalar,volMesh> dimScalarField;
    autoPtr<dimScalarField> pSh;

    // pick up the first fitting class
    castAndCall(pSh,dimScalarField,basicThermoCloud,thermoCloud,hsTrans());
    castAndCall(pSh,dimScalarField,basicReactingCloud,reactingCloud,hsTrans());
    castAndCall(pSh,dimScalarField,basicReactingMultiphaseCloud,reactingMultiphaseCloud,hsTrans());

    noCloudFound(pSh);

    const dimScalarField &Sh=pSh();

    autoPtr<volScalarField> pSource(
        new volScalarField(
            IOobject(
                cloudName()+"EnthalpySource",
                mesh().time().timeName(),
                mesh(),
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            mesh(),
            Sh.dimensions()/(dimTime*dimVolume),
            "zeroGradient"
        )
    );

    pSource->internalField()=Sh.field()/(mesh().V()*mesh().time().deltaT().value());

    result().setObjectResult(pSource);
}
void lcsSpeciesSourcePluginFunction::doEvaluation()
{
    wordList speciesList;
    label speciesIndex=getIndex(speciesList);

    if(speciesList.size()==0) {
        listAvailableClouds(Info);
        FatalErrorIn("lcsSpeciesSourcePluginFunction::doEvaluation()")
            << "No species list found (probably wrong cloud type)"
                << endl
                << "Supported cloud types (typeid): "                   \
                << supportedTypes() << endl                             \
                << exit(FatalError);
    }

    if(speciesIndex<0) {
        listAvailableClouds(Info);
        FatalErrorIn("lcsSpeciesSourcePluginFunction::doEvaluation()")
            << "Species " << speciesName_ << " not found in gas composition "
                << speciesList
                << endl
                << "Supported cloud types (typeid): "                   \
                << supportedTypes() << endl                             \
                << exit(FatalError);

    }

    autoPtr<dimScalarField> pSrho=internalEvaluate(speciesIndex);;

    noCloudFound(pSrho);

    const dimScalarField &Srho=pSrho();

    autoPtr<volScalarField> pSource(
        new volScalarField(
            IOobject(
                cloudName()+"SpeciesSource",
                mesh().time().timeName(),
                mesh(),
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            mesh(),
            Srho.dimensions(),
            "zeroGradient"
        )
    );

    pSource->internalField()=Srho.field();

    result().setObjectResult(pSource);
}
예제 #4
0
void lcsRhoEffPluginFunction::doEvaluation()
{
    autoPtr<volScalarField> prhoEff;

    // pick up the first fitting class
    castAndCall(prhoEff,volScalarField,basicKinematicCloud,kinematicCloud,rhoEff());
    castAndCall(prhoEff,volScalarField,swakFluidThermoCloudType,thermoCloud,rhoEff());
    castAndCall(prhoEff,volScalarField,basicReactingCloud,reactingCloud,rhoEff());
    castAndCall(prhoEff,volScalarField,basicReactingMultiphaseCloud,reactingMultiphaseCloud,rhoEff());

    noCloudFound(prhoEff);

    result().setObjectResult(prhoEff);
}