This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/coupled/MRFPorousFoam/UEqn.H

59 lines
1.4 KiB
C++
Raw Normal View History

2016-03-18 11:44:28 +00:00
{
// Update boundary velocity for consistency with the flux
mrfZones.correctBoundaryVelocity(U);
2015-04-27 14:34:02 +00:00
// Momentum equation
2016-03-18 11:44:28 +00:00
fvVectorMatrix UEqn
2015-04-27 14:34:02 +00:00
(
2016-03-18 11:44:28 +00:00
fvm::div(phi, U)
+ turbulence->divDevReff()
2015-04-27 14:34:02 +00:00
);
// Add MRF and porous sources implicitly. HJ, 18/Nov/2017
2016-03-18 11:44:28 +00:00
tmp<volTensorField> tTU;
if (addMRF || addPorosity)
2016-03-18 11:44:28 +00:00
{
tTU = tmp<volTensorField>
(
new volTensorField
(
IOobject
(
"TU",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh,
dimensionedTensor("zero", dimless/dimTime, tensor::zero)
)
);
volTensorField& TU = tTU();
// Add implicit MRF source as a Hodge dual of the rotational velocity
TU += *mrfZones.omega();
// Add implicit resistance
2016-03-18 11:44:28 +00:00
pZones.addResistance(UEqn, TU);
trTU = inv(TU + tensor(I)*UEqn.A());
trTU().rename("rAU");
}
else
{
trAU = 1.0/UEqn.A();
trAU().rename("rAU");
}
// Under-relax momentum. Note this will destroy the H and A
2016-03-18 11:44:28 +00:00
UEqn.relax();
// Insert momentum equation
UpEqn.insertEquation(0, UEqn);
# include "addImplicitMRFPorous.H"
# include "addBlockCoupledBC.H"
2016-03-18 11:44:28 +00:00
}