mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
COMP: avoid ambiguous construct from tmp - solvers/ incompressible
This commit is contained in:
@ -121,7 +121,7 @@ void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
makePatchTypeField
|
makeNonTemplatedPatchTypeField
|
||||||
(
|
(
|
||||||
fvPatchScalarField,
|
fvPatchScalarField,
|
||||||
adjointOutletPressureFvPatchScalarField
|
adjointOutletPressureFvPatchScalarField
|
||||||
|
|||||||
@ -96,10 +96,10 @@ void Foam::adjointOutletVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
const fvPatchField<vector>& Up =
|
const fvPatchField<vector>& Up =
|
||||||
patch().lookupPatchField<volVectorField, vector>("U");
|
patch().lookupPatchField<volVectorField, vector>("U");
|
||||||
|
|
||||||
scalarField Un = mag(patch().nf() & Up);
|
scalarField Un(mag(patch().nf() & Up));
|
||||||
vectorField UtHat = (Up - patch().nf()*Un)/(Un + SMALL);
|
vectorField UtHat((Up - patch().nf()*Un)/(Un + SMALL));
|
||||||
|
|
||||||
vectorField Uan = patch().nf()*(patch().nf() & patchInternalField());
|
vectorField Uan(patch().nf()*(patch().nf() & patchInternalField()));
|
||||||
|
|
||||||
vectorField::operator=(phiap*patch().Sf()/sqr(patch().magSf()) + UtHat);
|
vectorField::operator=(phiap*patch().Sf()/sqr(patch().magSf()) + UtHat);
|
||||||
//vectorField::operator=(Uan + UtHat);
|
//vectorField::operator=(Uan + UtHat);
|
||||||
@ -119,7 +119,7 @@ void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
makePatchTypeField
|
makeNonTemplatedPatchTypeField
|
||||||
(
|
(
|
||||||
fvPatchVectorField,
|
fvPatchVectorField,
|
||||||
adjointOutletVelocityFvPatchVectorField
|
adjointOutletVelocityFvPatchVectorField
|
||||||
|
|||||||
@ -114,7 +114,7 @@ int main(int argc, char *argv[])
|
|||||||
solve(UEqn() == -fvc::grad(p));
|
solve(UEqn() == -fvc::grad(p));
|
||||||
|
|
||||||
p.boundaryField().updateCoeffs();
|
p.boundaryField().updateCoeffs();
|
||||||
volScalarField rAU = 1.0/UEqn().A();
|
volScalarField rAU(1.0/UEqn().A());
|
||||||
U = rAU*UEqn().H();
|
U = rAU*UEqn().H();
|
||||||
UEqn.clear();
|
UEqn.clear();
|
||||||
phi = fvc::interpolate(U) & mesh.Sf();
|
phi = fvc::interpolate(U) & mesh.Sf();
|
||||||
@ -153,10 +153,13 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// Adjoint Momentum predictor
|
// Adjoint Momentum predictor
|
||||||
|
|
||||||
volVectorField adjointTransposeConvection = (fvc::grad(Ua) & U);
|
volVectorField adjointTransposeConvection((fvc::grad(Ua) & U));
|
||||||
//volVectorField adjointTransposeConvection = fvc::reconstruct
|
//volVectorField adjointTransposeConvection
|
||||||
//(
|
//(
|
||||||
// mesh.magSf()*(fvc::snGrad(Ua) & fvc::interpolate(U))
|
// fvc::reconstruct
|
||||||
|
// (
|
||||||
|
// mesh.magSf()*(fvc::snGrad(Ua) & fvc::interpolate(U))
|
||||||
|
// )
|
||||||
//);
|
//);
|
||||||
|
|
||||||
zeroCells(adjointTransposeConvection, inletCells);
|
zeroCells(adjointTransposeConvection, inletCells);
|
||||||
@ -174,7 +177,7 @@ int main(int argc, char *argv[])
|
|||||||
solve(UaEqn() == -fvc::grad(pa));
|
solve(UaEqn() == -fvc::grad(pa));
|
||||||
|
|
||||||
pa.boundaryField().updateCoeffs();
|
pa.boundaryField().updateCoeffs();
|
||||||
volScalarField rAUa = 1.0/UaEqn().A();
|
volScalarField rAUa(1.0/UaEqn().A());
|
||||||
Ua = rAUa*UaEqn().H();
|
Ua = rAUa*UaEqn().H();
|
||||||
UaEqn.clear();
|
UaEqn.clear();
|
||||||
phia = fvc::interpolate(Ua) & mesh.Sf();
|
phia = fvc::interpolate(Ua) & mesh.Sf();
|
||||||
|
|||||||
@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
fvVectorMatrix divR = turbulence->divDevReff(U);
|
fvVectorMatrix divR(turbulence->divDevReff(U));
|
||||||
divR.source() = flowMask & divR.source();
|
divR.source() = flowMask & divR.source();
|
||||||
|
|
||||||
fvVectorMatrix UEqn
|
fvVectorMatrix UEqn
|
||||||
|
|||||||
@ -13,7 +13,7 @@ forAll(patches, patchi)
|
|||||||
|
|
||||||
if (isA<wallFvPatch>(currPatch))
|
if (isA<wallFvPatch>(currPatch))
|
||||||
{
|
{
|
||||||
const vectorField nf = currPatch.nf();
|
const vectorField nf(currPatch.nf());
|
||||||
|
|
||||||
forAll(nf, facei)
|
forAll(nf, facei)
|
||||||
{
|
{
|
||||||
@ -67,8 +67,10 @@ else
|
|||||||
label cellId = patches[patchId].faceCells()[faceId];
|
label cellId = patches[patchId].faceCells()[faceId];
|
||||||
|
|
||||||
// create position array for graph generation
|
// create position array for graph generation
|
||||||
scalarField y =
|
scalarField y
|
||||||
|
(
|
||||||
wallNormal
|
wallNormal
|
||||||
& (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId]);
|
& (mesh.C().internalField() - mesh.C().boundaryField()[patchId][faceId])
|
||||||
|
);
|
||||||
|
|
||||||
Info<< " Height to first cell centre y0 = " << y[cellId] << endl;
|
Info<< " Height to first cell centre y0 = " << y[cellId] << endl;
|
||||||
|
|||||||
@ -77,7 +77,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
|
|
||||||
volScalarField rAU = 1.0/UEqn.A();
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
|
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
volScalarField rAU = 1.0/UEqn.A();
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
|
|
||||||
U = rAU*UEqn.H();
|
U = rAU*UEqn.H();
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||||
|
|||||||
@ -69,7 +69,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
volScalarField rAU = 1.0/UEqn.A();
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
|
|
||||||
U = rAU*UEqn.H();
|
U = rAU*UEqn.H();
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||||
|
|||||||
@ -9,7 +9,7 @@ tmp<fvVectorMatrix> UEqn
|
|||||||
|
|
||||||
UEqn().relax();
|
UEqn().relax();
|
||||||
|
|
||||||
volScalarField rAU = 1.0/UEqn().A();
|
volScalarField rAU(1.0/UEqn().A());
|
||||||
|
|
||||||
if (momentumPredictor)
|
if (momentumPredictor)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -79,7 +79,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
volScalarField rAU = 1.0/UEqn.A();
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
|
|
||||||
U = rAU*UEqn.H();
|
U = rAU*UEqn.H();
|
||||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
trTU = inv(tTU());
|
trTU = inv(tTU());
|
||||||
trTU().rename("rAU");
|
trTU().rename("rAU");
|
||||||
|
|
||||||
volVectorField gradp = fvc::grad(p);
|
volVectorField gradp(fvc::grad(p));
|
||||||
|
|
||||||
for (int UCorr=0; UCorr<nUCorr; UCorr++)
|
for (int UCorr=0; UCorr<nUCorr; UCorr++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -36,9 +36,11 @@ scalar waveCoNum = 0.0;
|
|||||||
|
|
||||||
if (mesh.nInternalFaces())
|
if (mesh.nInternalFaces())
|
||||||
{
|
{
|
||||||
scalarField sumPhi =
|
scalarField sumPhi
|
||||||
|
(
|
||||||
fvc::surfaceSum(mag(phi))().internalField()
|
fvc::surfaceSum(mag(phi))().internalField()
|
||||||
/h.internalField();
|
/ h.internalField()
|
||||||
|
);
|
||||||
|
|
||||||
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
CoNum = 0.5*gMax(sumPhi/mesh.V().field())*runTime.deltaTValue();
|
||||||
|
|
||||||
|
|||||||
@ -89,10 +89,10 @@ int main(int argc, char *argv[])
|
|||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
for (int corr=0; corr<nCorr; corr++)
|
for (int corr=0; corr<nCorr; corr++)
|
||||||
{
|
{
|
||||||
volScalarField rAU = 1.0/hUEqn.A();
|
volScalarField rAU(1.0/hUEqn.A());
|
||||||
surfaceScalarField ghrAUf = magg*fvc::interpolate(h*rAU);
|
surfaceScalarField ghrAUf(magg*fvc::interpolate(h*rAU));
|
||||||
|
|
||||||
surfaceScalarField phih0 = ghrAUf*mesh.magSf()*fvc::snGrad(h0);
|
surfaceScalarField phih0(ghrAUf*mesh.magSf()*fvc::snGrad(h0));
|
||||||
|
|
||||||
if (rotating)
|
if (rotating)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
p.boundaryField().updateCoeffs();
|
p.boundaryField().updateCoeffs();
|
||||||
|
|
||||||
volScalarField AU = UEqn().A();
|
volScalarField AU(UEqn().A());
|
||||||
U = UEqn().H()/AU;
|
U = UEqn().H()/AU;
|
||||||
UEqn.clear();
|
UEqn.clear();
|
||||||
phi = fvc::interpolate(U) & mesh.Sf();
|
phi = fvc::interpolate(U) & mesh.Sf();
|
||||||
|
|||||||
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
|||||||
solve(UEqn() == -fvc::grad(p));
|
solve(UEqn() == -fvc::grad(p));
|
||||||
|
|
||||||
p.boundaryField().updateCoeffs();
|
p.boundaryField().updateCoeffs();
|
||||||
volScalarField rAU = 1.0/UEqn().A();
|
volScalarField rAU(1.0/UEqn().A());
|
||||||
U = rAU*UEqn().H();
|
U = rAU*UEqn().H();
|
||||||
UEqn.clear();
|
UEqn.clear();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user