Skip to content
Snippets Groups Projects
Commit 65bb236e authored by graham's avatar graham
Browse files

Added new fields to solver and basic calculation of momentum and energy change...

Added new fields to solver and basic calculation of momentum and energy change on wall impact.  Need to add references to new fields to DsmcCloud and constructors, all references are to be non-const as the field calculation will occur inside the DsmcCloud.
parent dc7c3ae7
No related merge requests found
// volScalarField rhoN Info<< nl << "Reading field U" << endl;
// (
// 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;
volVectorField U volVectorField U
( (
IOobject IOobject
...@@ -41,7 +13,7 @@ ...@@ -41,7 +13,7 @@
mesh mesh
); );
Info<< "\nReading field T\n" << endl; Info<< nl << "Reading field T" << endl;
volScalarField T volScalarField T
( (
IOobject IOobject
...@@ -55,6 +27,81 @@ ...@@ -55,6 +27,81 @@
mesh 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; Info<< "Constructing dsmcCloud " << endl;
dsmcCloud dsmc("dsmc", T, U); dsmcCloud dsmc("dsmc", T, U);
//, rhoN, rhoM, dsmcRhoN, q, f);
...@@ -109,6 +109,10 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch ...@@ -109,6 +109,10 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch
{ {
const constantProperties& constProps(td.cloud().constProps(typeId_)); 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 td.cloud().wallInteraction().correct
( (
wpp, wpp,
...@@ -116,6 +120,14 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch ...@@ -116,6 +120,14 @@ void Foam::DsmcParcel<ParcelType>::hitWallPatch
U_, U_,
constProps.mass() constProps.mass()
); );
scalar postInteractionEnergy = 0.5*constProps.mass()*(U_ & U_) + Ei_;
vector postInteractionMomentum = constProps.mass()*U_;
scalar deltaEnergy =preInteractionEnergy - postInteractionEnergy;
vector deltaMomentum = preInteractionMomentum - postInteractionMomentum;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment