Commit 078c4275 authored by Mark Olesen's avatar Mark Olesen
Browse files

COMP: avoid ambiguous construct from tmp - solvers/ multiphase

parent 5a8f9252
......@@ -2,12 +2,14 @@ fvVectorMatrix UaEqn(Ua, Ua.dimensions()*dimVol/dimTime);
fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime);
{
volTensorField Rca = -nuEffa*(fvc::grad(Ua)().T());
volTensorField Rca(-nuEffa*(fvc::grad(Ua)().T()));
Rca = Rca + (2.0/3.0)*sqr(Ct)*I*k - (2.0/3.0)*I*tr(Rca);
surfaceScalarField phiRa =
surfaceScalarField phiRa
(
- fvc::interpolate(nuEffa)
*mesh.magSf()*fvc::snGrad(alpha)/fvc::interpolate(alpha + scalar(0.001));
*mesh.magSf()*fvc::snGrad(alpha)/fvc::interpolate(alpha + scalar(0.001))
);
UaEqn =
(
......@@ -34,12 +36,14 @@ fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime);
UaEqn.relax();
volTensorField Rcb = -nuEffb*fvc::grad(Ub)().T();
volTensorField Rcb(-nuEffb*fvc::grad(Ub)().T());
Rcb = Rcb + (2.0/3.0)*I*k - (2.0/3.0)*I*tr(Rcb);
surfaceScalarField phiRb =
surfaceScalarField phiRb
(
- fvc::interpolate(nuEffb)
*mesh.magSf()*fvc::snGrad(beta)/fvc::interpolate(beta + scalar(0.001));
*mesh.magSf()*fvc::snGrad(beta)/fvc::interpolate(beta + scalar(0.001))
);
UbEqn =
(
......
{
word scheme("div(phi,alpha)");
surfaceScalarField phir = phia - phib;
surfaceScalarField phir(phia - phib);
Info<< "Max Ur Courant Number = "
<< (
......
......@@ -171,15 +171,19 @@
Info<< "Calculating field DDtUa and DDtUb\n" << endl;
volVectorField DDtUa =
volVectorField DDtUa
(
fvc::ddt(Ua)
+ fvc::div(phia, Ua)
- fvc::div(phia)*Ua;
- fvc::div(phia)*Ua
);
volVectorField DDtUb =
volVectorField DDtUb
(
fvc::ddt(Ub)
+ fvc::div(phib, Ub)
- fvc::div(phib)*Ub;
- fvc::div(phib)*Ub
);
Info<< "Calculating field g.h\n" << endl;
......
......@@ -6,7 +6,7 @@ if (turbulence)
}
tmp<volTensorField> tgradUb = fvc::grad(Ub);
volScalarField G = 2*nutb*(tgradUb() && dev(symm(tgradUb())));
volScalarField G(2*nutb*(tgradUb() && dev(symm(tgradUb()))));
tgradUb.clear();
#include "wallFunctions.H"
......
volVectorField Ur = Ua - Ub;
volScalarField magUr = mag(Ur);
volVectorField Ur(Ua - Ub);
volScalarField magUr(mag(Ur));
volScalarField CdaMagUr =
(24.0*nub/da)*(scalar(1) + 0.15*pow(da*magUr/nub, 0.687));
volScalarField CdaMagUr
(
(24.0*nub/da)*(scalar(1) + 0.15*pow(da*magUr/nub, 0.687))
);
volScalarField CdbMagUr =
(24.0*nua/db)*(scalar(1) + 0.15*pow(db*magUr/nua, 0.687));
volScalarField CdbMagUr
(
(24.0*nua/db)*(scalar(1) + 0.15*pow(db*magUr/nua, 0.687))
);
volScalarField dragCoef
(
......@@ -13,4 +17,7 @@
0.75*(beta*rhob*CdaMagUr/da + alpha*rhoa*CdbMagUr/db)
);
volVectorField liftCoeff = Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U));
volVectorField liftCoeff
(
Cl*(beta*rhob + alpha*rhoa)*(Ur ^ fvc::curl(U))
);
{
surfaceScalarField alphaf = fvc::interpolate(alpha);
surfaceScalarField betaf = scalar(1) - alphaf;
surfaceScalarField alphaf(fvc::interpolate(alpha));
surfaceScalarField betaf(scalar(1) - alphaf);
volScalarField rUaA = 1.0/UaEqn.A();
volScalarField rUbA = 1.0/UbEqn.A();
volScalarField rUaA(1.0/UaEqn.A());
volScalarField rUbA(1.0/UbEqn.A());
surfaceScalarField rUaAf = fvc::interpolate(rUaA);
surfaceScalarField rUbAf = fvc::interpolate(rUbA);
surfaceScalarField rUaAf(fvc::interpolate(rUaA));
surfaceScalarField rUbAf(fvc::interpolate(rUbA));
Ua = rUaA*UaEqn.H();
Ub = rUbA*UbEqn.H();
surfaceScalarField phiDraga =
fvc::interpolate(beta/rhoa*dragCoef*rUaA)*phib + rUaAf*(g & mesh.Sf());
surfaceScalarField phiDragb =
fvc::interpolate(alpha/rhob*dragCoef*rUbA)*phia + rUbAf*(g & mesh.Sf());
surfaceScalarField phiDraga
(
fvc::interpolate(beta/rhoa*dragCoef*rUaA)*phib + rUaAf*(g & mesh.Sf())
);
surfaceScalarField phiDragb
(
fvc::interpolate(alpha/rhob*dragCoef*rUbA)*phia + rUbAf*(g & mesh.Sf())
);
forAll(p.boundaryField(), patchi)
{
......@@ -50,7 +54,7 @@
if (nonOrth == nNonOrthCorr)
{
surfaceScalarField SfGradp = pEqn.flux()/Dp;
surfaceScalarField SfGradp(pEqn.flux()/Dp);
phia -= rUaAf*SfGradp/rhoa;
phib -= rUbAf*SfGradp/rhob;
......
......@@ -34,7 +34,7 @@
{
const scalarField& nuw = nutb.boundaryField()[patchi];
scalarField magFaceGradU = mag(U.boundaryField()[patchi].snGrad());
scalarField magFaceGradU(mag(U.boundaryField()[patchi].snGrad()));
forAll(currPatch, facei)
{
......
......@@ -35,8 +35,10 @@ scalar acousticCoNum = 0.0;
if (mesh.nInternalFaces())
{
scalarField sumPhi =
fvc::surfaceSum(mag(phiv))().internalField();
scalarField sumPhi
(
fvc::surfaceSum(mag(phiv))().internalField()
);
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
......
......@@ -9,18 +9,18 @@
)/psi;
}
surfaceScalarField rhof = fvc::interpolate(rho, "rhof");
surfaceScalarField rhof(fvc::interpolate(rho, "rhof"));
volScalarField rAU = 1.0/UEqn.A();
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf("rAUf", rhof*fvc::interpolate(rAU));
volVectorField HbyA = rAU*UEqn.H();
volVectorField HbyA(rAU*UEqn.H());
phiv = (fvc::interpolate(HbyA) & mesh.Sf())
+ fvc::ddtPhiCorr(rAU, rho, U, phiv);
p.boundaryField().updateCoeffs();
surfaceScalarField phiGradp = rAUf*mesh.magSf()*fvc::snGrad(p);
surfaceScalarField phiGradp(rAUf*mesh.magSf()*fvc::snGrad(p));
phiv -= phiGradp/rhof;
......
......@@ -2,7 +2,7 @@
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phirb,alpha)");
surfaceScalarField phir = phic*interface.nHatf();
surfaceScalarField phir(phic*interface.nHatf());
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
{
......@@ -45,7 +45,8 @@
}
surfaceScalarField phiAlpha1 =
surfaceScalarField phiAlpha1
(
fvc::flux
(
phi,
......@@ -57,7 +58,8 @@
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
);
)
);
MULES::explicitSolve
(
......@@ -71,8 +73,8 @@
0
);
surfaceScalarField rho1f = fvc::interpolate(rho1);
surfaceScalarField rho2f = fvc::interpolate(rho2);
surfaceScalarField rho1f(fvc::interpolate(rho1));
surfaceScalarField rho2f(fvc::interpolate(rho2));
rhoPhi = phiAlpha1*(rho1f - rho2f) + phi*rho2f;
alpha2 = scalar(1) - alpha1;
......
......@@ -9,15 +9,15 @@
readLabel(piso.lookup("nAlphaSubCycles"))
);
surfaceScalarField phic = mag(phi/mesh.magSf());
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
volScalarField divU = fvc::div(phi);
volScalarField divU(fvc::div(phi));
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
......
......@@ -9,17 +9,17 @@
readLabel(piso.lookup("nAlphaSubCycles"))
);
surfaceScalarField phic = mag(phi/mesh.magSf());
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
fvc::makeAbsolute(phi, U);
volScalarField divU = fvc::div(phi);
volScalarField divU(fvc::div(phi));
fvc::makeRelative(phi, U);
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
......
......@@ -79,7 +79,7 @@ int main(int argc, char *argv[])
{
// Store divU from the previous mesh for the correctPhi
volScalarField divU = fvc::div(phi);
volScalarField divU(fvc::div(phi));
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
......
{
volScalarField rAU = 1.0/UEqn.A();
surfaceScalarField rAUf = fvc::interpolate(rAU);
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf(fvc::interpolate(rAU));
tmp<fvScalarMatrix> p_rghEqnComp;
......
......@@ -105,8 +105,8 @@
)
);
volScalarField rho1 = rho10 + psi1*p;
volScalarField rho2 = rho20 + psi2*p;
volScalarField rho1(rho10 + psi1*p);
volScalarField rho2(rho20 + psi2*p);
volScalarField rho
(
......@@ -138,8 +138,10 @@
fvc::interpolate(rho)*phi
);
volScalarField dgdt =
pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001));
volScalarField dgdt
(
pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001))
);
// Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, twoPhaseProperties);
......
{
volScalarField rAU = 1.0/UEqn.A();
surfaceScalarField rAUf = fvc::interpolate(rAU);
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf(fvc::interpolate(rAU));
tmp<fvScalarMatrix> p_rghEqnComp;
......
......@@ -56,7 +56,7 @@ void Foam::MULES::explicitLTSSolve
const fvMesh& mesh = psi.mesh();
psi.correctBoundaryConditions();
surfaceScalarField phiBD = upwind<scalar>(psi.mesh(), phi).flux(psi);
surfaceScalarField phiBD(upwind<scalar>(psi.mesh(), phi).flux(psi));
surfaceScalarField& phiCorr = phiPsi;
phiCorr -= phiBD;
......@@ -168,9 +168,11 @@ void Foam::MULES::implicitSolve
scalarField allCoLambda(mesh.nFaces());
{
surfaceScalarField Cof =
surfaceScalarField Cof
(
mesh.time().deltaT()*mesh.surfaceInterpolation::deltaCoeffs()
*mag(phi)/mesh.magSf();
*mag(phi)/mesh.magSf()
);
slicedSurfaceScalarField CoLambda
(
......@@ -226,7 +228,7 @@ void Foam::MULES::implicitSolve
- Su
);
surfaceScalarField phiBD = psiConvectionDiffusion.flux();
surfaceScalarField phiBD(psiConvectionDiffusion.flux());
surfaceScalarField& phiCorr = phiPsi;
phiCorr -= phiBD;
......@@ -408,7 +410,7 @@ void Foam::MULES::limiter
if (psiPf.coupled())
{
scalarField psiPNf = psiPf.patchNeighbourField();
scalarField psiPNf(psiPf.patchNeighbourField());
forAll(phiCorrPf, pFacei)
{
......
......@@ -2,13 +2,14 @@
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phirb,alpha)");
surfaceScalarField phic = mag(phi/mesh.magSf());
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
surfaceScalarField phir = phic*interface.nHatf();
surfaceScalarField phir(phic*interface.nHatf());
for (int aCorr=0; aCorr<nAlphaCorr; aCorr++)
{
surfaceScalarField phiAlpha =
surfaceScalarField phiAlpha
(
fvc::flux
(
phi,
......@@ -20,7 +21,8 @@
-fvc::flux(-phir, scalar(1) - alpha1, alpharScheme),
alpha1,
alpharScheme
);
)
);
MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0);
//MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
......
......@@ -11,7 +11,7 @@ label nAlphaSubCycles
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
......
{
volScalarField rAU = 1.0/UEqn.A();
surfaceScalarField rAUf = fvc::interpolate(rAU);
volScalarField rAU(1.0/UEqn.A());
surfaceScalarField rAUf(fvc::interpolate(rAU));
U = rAU*UEqn.H();
surfaceScalarField phiU
......
Markdown is supported
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