diff --git a/applications/solvers/dsmc/dsmcFoam/createFields.H b/applications/solvers/dsmc/dsmcFoam/createFields.H index 5f586665bbac29f6dc2d8ce19976267fa4679faf..5e5751bddfc3361f72dd36f3b94890b18c59883e 100644 --- a/applications/solvers/dsmc/dsmcFoam/createFields.H +++ b/applications/solvers/dsmc/dsmcFoam/createFields.H @@ -1,33 +1,5 @@ - // volScalarField rhoN - // ( - // IOobject - // ( - // "rhoN", - // runTime.timeName(), - // mesh, - // IOobject::MUST_READ, - // IOobject::AUTO_WRITE - // ), - // mesh - // ); - - - // volScalarField rhoM - // ( - // IOobject - // ( - // "rhoM", - // runTime.timeName(), - // mesh, - // IOobject::MUST_READ, - // IOobject::AUTO_WRITE - // ), - // mesh - // ); - - - Info<< "\nReading field U\n" << endl; + Info<< nl << "Reading field U" << endl; volVectorField U ( IOobject @@ -41,7 +13,7 @@ mesh ); - Info<< "\nReading field T\n" << endl; + Info<< nl << "Reading field T" << endl; volScalarField T ( IOobject @@ -55,6 +27,81 @@ mesh ); + Info<< nl << "Reading field rhoN" << endl; + volScalarField rhoN + ( + IOobject + ( + "rhoN", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< nl << "Reading field rhoM" << endl; + volScalarField rhoM + ( + IOobject + ( + "rhoM", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< nl << "Reading field rhoNdsmc (dsmc particle density)" << endl; + volScalarField dsmcRhoN + ( + IOobject + ( + "dsmcRhoN", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< nl + << "Fields required to record solid surface forces and heat flux:" + << endl; + + Info<< nl << "Reading field q (surface heat transfer)" << endl; + volScalarField q + ( + IOobject + ( + "q", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< nl << "Reading field fD (surface force density" << endl; + volVectorField fD + ( + IOobject + ( + "fD", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + Info<< "Constructing dsmcCloud " << endl; - dsmcCloud dsmc("dsmc", T, U); +dsmcCloud dsmc("dsmc", T, U); + //, rhoN, rhoM, dsmcRhoN, q, f); diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index 1b38143c90fc0e144b6f023a79975e06d4f6164b..babf4be2920cb4364b3d730a1e7f3e2fa6f03f83 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -109,6 +109,10 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch { const constantProperties& constProps(td.cloud().constProps(typeId_)); + scalar preInteractionEnergy = 0.5*constProps.mass()*(U_ & U_) + Ei_; + + vector preInteractionMomentum = constProps.mass()*U_; + td.cloud().wallInteraction().correct ( wpp, @@ -116,6 +120,14 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch U_, constProps.mass() ); + + scalar postInteractionEnergy = 0.5*constProps.mass()*(U_ & U_) + Ei_; + + vector postInteractionMomentum = constProps.mass()*U_; + + scalar deltaEnergy =preInteractionEnergy - postInteractionEnergy; + + vector deltaMomentum = preInteractionMomentum - postInteractionMomentum; }