Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Granular phase momentum budget #184

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
177 changes: 176 additions & 1 deletion solver/createFields.H
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,10 @@ Switch writeTau
(
forceProperties.getOrDefault<Switch>("writeTau", false)
);

Switch writeMomentumBudget
(
forceProperties.getOrDefault<Switch>("writeMomentumBudget", false)
);

Info<< "Initializing with specified pressure gradient:"
<< gradPOSC.value() << endl << endl;
Expand Down Expand Up @@ -876,6 +879,178 @@ volScalarField p
p_rbgh + rhob*gh
);


volVectorField SolidPressureContr
(
IOobject
(
"SolidPressureContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(p_rbgh)
);

volVectorField divTauaContr
(
IOobject
(
"divTauaContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);


volVectorField ViscStressContr
(
IOobject
(
"ViscStressContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField FrictContr
(
IOobject
(
"FrictContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField phiRaContr
(
IOobject
(
"phiRaContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField phiRa2Contr
(
IOobject
(
"phiRa2Contr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField divRcaContr
(
IOobject
(
"divRcaContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField RcaContr
(
IOobject
(
"RcaContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField BulkContr
(
IOobject
(
"BulkContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField gravityContr
(
IOobject
(
"gravityContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField DragContr
(
IOobject
(
"DragContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField SuspContr
(
IOobject
(
"SuspContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);

volVectorField ExtContr
(
IOobject
(
"ExtContr",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fvc::grad(pff)
);


label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell
Expand Down
59 changes: 57 additions & 2 deletions solver/writeOutput.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,66 @@ if (runTime.outputTime())
{
if (writeTau == 1)
{
Taua = rhoa*(alpha*nuEffa+nuFra)*dev(fvc::grad(Ua));
Taub = rhob*(scalar(1.0)-alpha)*nuEffb*dev(fvc::grad(Ub));
Taua = fvc::reconstruct(
fvc::interpolate(rhoa*(alpha*nuEffa+nuFra)) *
mesh.magSf()*fvc::snGrad(Ua)) +
rhoa*(alpha*nuEffa+nuFra)*dev(gradUaT);
Taub = fvc::reconstruct(
fvc::interpolate(rhob*(scalar(1.0)-alpha)*nuEffb) *
mesh.magSf()*fvc::snGrad(Ub)) +
rhob*(scalar(1.0)-alpha)*nuEffb*dev(gradUbT);
Taua.write();
Taub.write();
}
if (writeMomentumBudget == 1)
{

volTensorField Rca(
"Rca",
((2.0/3.0)*I)*((nuEffa+nuFra/(alpha+alphaSmall))*tr(gradUaT)
+ spherSigmaSGSa)
- (nuEffa+nuFra/(alpha+alphaSmall))*gradUaT
);

volTensorField Rca2(
"Rca2",
((2.0/3.0)*I)*((alpha*nuEffa+nuFra)*tr(gradUaT)
+ alpha*spherSigmaSGSa)
- (alpha*nuEffa+nuFra)*gradUaT
);
volVectorField Ra(
"Ra",
-nuEffa*fvc::grad(alpha)/(alpha+alphaSmall)
);

surfaceScalarField phiRa(
-fvc::interpolate(nuEffa)*mesh.magSf()*(fvc::snGrad(alpha))
/fvc::interpolate(alpha+ alphaSmall)
);

SolidPressureContr = -fvc::grad(pa+pff);
ViscStressContr = rhoa*alpha*fvc::laplacian(nuEffa, Ua);
FrictContr = rhoa*fvc::laplacian(nuFra, Ua);
phiRaContr = -rhoa*alpha*fvc::div(phiRa, Ua, "div(phiRa,Ua)");
phiRa2Contr = rhoa*alpha*fvc::Sp(fvc::div(phiRa), Ua);
divRcaContr = -rhoa*alpha*fvc::div(Rca);
RcaContr = -rhoa*alpha/(alpha+alphaSmall)*(fvc::grad(alpha) & Rca);
BulkContr = fvc::grad(lambdaUa*tr(gradUaT));
divTauaContr = ViscStressContr + FrictContr + phiRaContr +
phiRa2Contr + divRcaContr + RcaContr + BulkContr;

gravityContr=alpha/(alpha+alphaSmall)*(rhoa-rhob)*g;
DragContr=alpha*beta*K*(Ub-Ua);
ExtContr=rhoa*alpha*gradPOSC/(tilt*rhob +(1.0-tilt)*rhoa);
SuspContr=-SUS*K*beta*turbulenceb->nut()
*((SUS_I*iso-SUS_A*aniso) & fvc::grad(alpha));

divTauaContr.write();
gravityContr.write();
DragContr.write();
ExtContr.write();
SuspContr.write();
}
if (granularRheology.on())
{
pa.write();
Expand Down
Loading