mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@ -16,17 +16,20 @@
|
|||||||
|
|
||||||
fvOptions.constrain(UEqn);
|
fvOptions.constrain(UEqn);
|
||||||
|
|
||||||
solve
|
if (momentumPredictor)
|
||||||
(
|
{
|
||||||
UEqn
|
solve
|
||||||
==
|
|
||||||
fvc::reconstruct
|
|
||||||
(
|
(
|
||||||
|
UEqn
|
||||||
|
==
|
||||||
|
fvc::reconstruct
|
||||||
(
|
(
|
||||||
- ghf*fvc::snGrad(rho)
|
(
|
||||||
- fvc::snGrad(p_rgh)
|
- ghf*fvc::snGrad(rho)
|
||||||
)*mesh.magSf()
|
- fvc::snGrad(p_rgh)
|
||||||
)
|
)*mesh.magSf()
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
|
}
|
||||||
|
|||||||
@ -2,3 +2,6 @@
|
|||||||
|
|
||||||
const int nNonOrthCorr =
|
const int nNonOrthCorr =
|
||||||
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
simple.lookupOrDefault<int>("nNonOrthogonalCorrectors", 0);
|
||||||
|
|
||||||
|
const bool momentumPredictor =
|
||||||
|
simple.lookupOrDefault("momentumPredictor", true);
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,7 +49,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(p, iF),
|
uniformJumpFvPatchField<Type>(p, iF),
|
||||||
phiName_("phi"),
|
phiName_("phi"),
|
||||||
rhoName_("rho"),
|
rhoName_("rho"),
|
||||||
uniformJump_(false)
|
uniformJump_(false),
|
||||||
|
nonDimensional_(false),
|
||||||
|
rpm_(0.0),
|
||||||
|
dm_(0.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -64,8 +67,17 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(p, iF, dict),
|
uniformJumpFvPatchField<Type>(p, iF, dict),
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false))
|
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false)),
|
||||||
{}
|
nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)),
|
||||||
|
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)),
|
||||||
|
dm_(dict.lookupOrDefault<scalar>("dm", 0.0))
|
||||||
|
{
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
dict.lookup("rpm") >> rpm_;
|
||||||
|
dict.lookup("dm") >> dm_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
@ -80,7 +92,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper),
|
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_)
|
uniformJump_(ptf.uniformJump_),
|
||||||
|
nonDimensional_(ptf.nonDimensional_),
|
||||||
|
rpm_(ptf.rpm_),
|
||||||
|
dm_(ptf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +108,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(ptf),
|
uniformJumpFvPatchField<Type>(ptf),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_)
|
uniformJump_(ptf.uniformJump_),
|
||||||
|
nonDimensional_(ptf.nonDimensional_),
|
||||||
|
rpm_(ptf.rpm_),
|
||||||
|
dm_(ptf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +125,10 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<Type>(ptf, iF),
|
uniformJumpFvPatchField<Type>(ptf, iF),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_),
|
||||||
uniformJump_(ptf.uniformJump_)
|
uniformJump_(ptf.uniformJump_),
|
||||||
|
nonDimensional_(ptf.nonDimensional_),
|
||||||
|
rpm_(ptf.rpm_),
|
||||||
|
dm_(ptf.dm_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -135,6 +156,9 @@ void Foam::fanFvPatchField<Type>::write(Ostream& os) const
|
|||||||
os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
|
os.writeEntryIfDifferent<word>("phi", "phi", phiName_);
|
||||||
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
os.writeEntryIfDifferent<word>("rho", "rho", rhoName_);
|
||||||
os.writeEntryIfDifferent<bool>("uniformJump", false, uniformJump_);
|
os.writeEntryIfDifferent<bool>("uniformJump", false, uniformJump_);
|
||||||
|
os.writeEntryIfDifferent<bool>("nonDimensional", false, nonDimensional_);
|
||||||
|
os.writeEntryIfDifferent<scalar>("rpm", false, rpm_);
|
||||||
|
os.writeEntryIfDifferent<scalar>("dm", false, dm_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,6 +34,24 @@ Description
|
|||||||
The jump is specified as a \c Function1 type, to enable the use of, e.g.
|
The jump is specified as a \c Function1 type, to enable the use of, e.g.
|
||||||
contant, polynomial, table values.
|
contant, polynomial, table values.
|
||||||
|
|
||||||
|
The switch nonDimensional can be used for a non-dimensional table. It needs
|
||||||
|
inputs rpm and dm of the fan. It should be used with uniformJump true.
|
||||||
|
|
||||||
|
The nonDimensional flux for the table is calculate as :
|
||||||
|
|
||||||
|
phi = 4.0*mDot/(rho*sqr(PI)*dm^3*omega)
|
||||||
|
where:
|
||||||
|
dm is the mean diameter.
|
||||||
|
omega is rad/sec.
|
||||||
|
|
||||||
|
The nonDimensinal pressure :
|
||||||
|
|
||||||
|
Psi = 2 deltaP/(rho*(sqr(PI*omega*dm)))
|
||||||
|
where:
|
||||||
|
deltaP is the pressure drop
|
||||||
|
|
||||||
|
The non-dimensional table should be given as Psi = F(phi).
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
@ -43,6 +61,9 @@ Usage
|
|||||||
rho | density field name | no | none
|
rho | density field name | no | none
|
||||||
uniformJump | applies a uniform pressure based on the averaged
|
uniformJump | applies a uniform pressure based on the averaged
|
||||||
velocity | no | false
|
velocity | no | false
|
||||||
|
nonDimensional | uses non-dimensional table | no | false
|
||||||
|
rpm | fan rpm for non-dimensional table | no | 0.0
|
||||||
|
dm | mean diameter for non-dimensional table | no | 0.0
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -114,6 +135,17 @@ class fanFvPatchField
|
|||||||
//- Uniform pressure drop
|
//- Uniform pressure drop
|
||||||
bool uniformJump_;
|
bool uniformJump_;
|
||||||
|
|
||||||
|
//- Swtich for using non-dimensional curve
|
||||||
|
Switch nonDimensional_;
|
||||||
|
|
||||||
|
// Parameters for non-dimensional table
|
||||||
|
|
||||||
|
//- Fan rpm
|
||||||
|
scalar rpm_;
|
||||||
|
|
||||||
|
//- Fan mean diameter
|
||||||
|
scalar dm_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -48,6 +48,15 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
|||||||
{
|
{
|
||||||
scalar area = gSum(patch().magSf());
|
scalar area = gSum(patch().magSf());
|
||||||
Un = gSum(Un*patch().magSf())/area;
|
Un = gSum(Un*patch().magSf())/area;
|
||||||
|
|
||||||
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
// Create an adimensional volumetric flow rate
|
||||||
|
Un =
|
||||||
|
120.0*Un/pow3(constant::mathematical::pi)
|
||||||
|
* patch().magSf()
|
||||||
|
/ pow3(dm_)/rpm_;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
@ -55,7 +64,18 @@ void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
|||||||
Un /= patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
Un /= patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->jump_ = max(this->jumpTable_->value(Un), scalar(0));
|
if (nonDimensional_)
|
||||||
|
{
|
||||||
|
scalarField deltap = this->jumpTable_->value(Un);
|
||||||
|
// Convert adimensional deltap from curve into deltaP
|
||||||
|
scalarField pdFan =
|
||||||
|
deltap*pow4(constant::mathematical::pi)*sqr(dm_*rpm_)/1800;
|
||||||
|
this->jump_ = max(pdFan, scalar(0));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->jump_ = max(this->jumpTable_->value(Un), scalar(0));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +93,10 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
|
|||||||
uniformJumpFvPatchField<scalar>(p, iF),
|
uniformJumpFvPatchField<scalar>(p, iF),
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false))
|
uniformJump_(dict.lookupOrDefault<bool>("uniformJump", false)),
|
||||||
|
nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)),
|
||||||
|
rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)),
|
||||||
|
dm_(dict.lookupOrDefault<scalar>("dm", 0.0))
|
||||||
{
|
{
|
||||||
if (this->cyclicPatch().owner())
|
if (this->cyclicPatch().owner())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -171,7 +171,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
{
|
{
|
||||||
// Create an adimensional flow rate
|
// Create an adimensional flow rate
|
||||||
volFlowRate =
|
volFlowRate =
|
||||||
120.0*volFlowRate/pow3(constant::mathematical::pi)/pow3(dm_);
|
120.0*volFlowRate/pow3(constant::mathematical::pi)/pow3(dm_)/rpm_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pressure drop for this flow rate
|
// Pressure drop for this flow rate
|
||||||
@ -180,7 +180,7 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs()
|
|||||||
if (nonDimensional_)
|
if (nonDimensional_)
|
||||||
{
|
{
|
||||||
// Convert the adimensional deltap from curve into deltaP
|
// Convert the adimensional deltap from curve into deltaP
|
||||||
pdFan = pdFan*pow4(constant::mathematical::pi)*rpm_*sqr(dm_)/1800;
|
pdFan = pdFan*pow4(constant::mathematical::pi)*sqr(dm_*rpm_)/1800;
|
||||||
}
|
}
|
||||||
|
|
||||||
totalPressureFvPatchScalarField::updateCoeffs
|
totalPressureFvPatchScalarField::updateCoeffs
|
||||||
|
|||||||
@ -280,7 +280,7 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -299,6 +299,10 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -310,7 +314,7 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
const fluxFieldType& phi
|
const fluxFieldType& phi
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -329,6 +333,10 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -341,7 +349,7 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
const GeometricField<Type, fvsPatchField, surfaceMesh>& Uf
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -362,6 +370,10 @@ steadyStateDdtScheme<Type>::fvcDdtUfCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -374,7 +386,7 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
const fluxFieldType& phi
|
const fluxFieldType& phi
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return tmp<fluxFieldType>
|
tmp<fluxFieldType> tCorr
|
||||||
(
|
(
|
||||||
new fluxFieldType
|
new fluxFieldType
|
||||||
(
|
(
|
||||||
@ -395,6 +407,10 @@ steadyStateDdtScheme<Type>::fvcDdtPhiCorr
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
tCorr.ref().setOriented();
|
||||||
|
|
||||||
|
return tCorr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -196,7 +196,7 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData
|
|||||||
const scalarField Tc(patchInternalField());
|
const scalarField Tc(patchInternalField());
|
||||||
|
|
||||||
// Heat transfer coefficient [W/m2/K]
|
// Heat transfer coefficient [W/m2/K]
|
||||||
const scalarField htc(qDot/(Tp - Tc + ROOTVSMALL));
|
const scalarField htc(qDot/(Tp - Tc + 1e-3));
|
||||||
|
|
||||||
const Field<scalar>& magSf(this->patch().magSf());
|
const Field<scalar>& magSf(this->patch().magSf());
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,7 +75,7 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
|
|||||||
|
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
label nMask = 0;
|
label nMask = 0;
|
||||||
for (size_t chari = 0; chari < fieldFileName.size(); chari++)
|
for (size_t chari = 0; chari < fieldFileName.size(); ++chari)
|
||||||
{
|
{
|
||||||
if (fieldFileName[chari] == '*')
|
if (fieldFileName[chari] == '*')
|
||||||
{
|
{
|
||||||
@ -130,7 +130,7 @@ Foam::tmp<Foam::Field<Type>> Foam::ensightSurfaceReader::readField
|
|||||||
label n = surfPtr_->size();
|
label n = surfPtr_->size();
|
||||||
forAll(values, cmptI)
|
forAll(values, cmptI)
|
||||||
{
|
{
|
||||||
values.setSize(n);
|
values[cmptI].setCapacity(n);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read data file using schema generated while reading the surface
|
// Read data file using schema generated while reading the surface
|
||||||
|
|||||||
@ -0,0 +1,51 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 1e-8;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
top
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
bottom
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (1 1 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
top
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
bottom
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
21
tutorials/verificationAndValidation/schemes/divergenceExample/Allrun
Executable file
21
tutorials/verificationAndValidation/schemes/divergenceExample/Allrun
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd ${0%/*} || exit 1 # run from this directory
|
||||||
|
|
||||||
|
# Source tutorial run functions
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
cat system/schemesToTest | while read scheme
|
||||||
|
do
|
||||||
|
echo "Updating fvSchmes to use $scheme"
|
||||||
|
sed "s/DIVSCHEME/$scheme/g" system/fvSchemes.template > system/fvSchemes
|
||||||
|
|
||||||
|
# Create a sanitised name for the scheme - remove 'special' characters
|
||||||
|
schemeTag=$(sed -e 's# #_#g#' -e 's#(##g' -e 's#)##g' -e 's#\.##g' <<< "$scheme")
|
||||||
|
|
||||||
|
runApplication -s ${schemeTag} scalarTransportFoam
|
||||||
|
|
||||||
|
# Save the line plot
|
||||||
|
mv postProcessing/sample1/100/line1_T.xy line1_T_${schemeTag}.xy
|
||||||
|
done
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
Divergence scheme test
|
||||||
|
======================
|
||||||
|
|
||||||
|
Various divergence schemes are examined on a 2-D structured mesh, where a
|
||||||
|
passive scalar is convected at 45deg to the mesh co-ordinate system using a
|
||||||
|
uniform flow velocity. Executing:
|
||||||
|
|
||||||
|
./Allrun
|
||||||
|
|
||||||
|
will update the system/fvSchemes file to use each scheme listed in the file
|
||||||
|
system/schemesToTest and perform the test using the scalarTransportFoam solver.
|
||||||
|
A test file for each run is generated that can be used to compare the predicted
|
||||||
|
scalar profile against the exact solution.
|
||||||
|
|
||||||
|
For more information, see:
|
||||||
|
|
||||||
|
https://www.openfoam.com/documentation/cpp-guide/html/guide-schemes-divergence-example.html
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
DT DT [0 2 -1 0 0] 0;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,89 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(0 0 0)
|
||||||
|
(1 0 0)
|
||||||
|
(1 1 0)
|
||||||
|
(0 1 0)
|
||||||
|
(0 0 0.1)
|
||||||
|
(1 0 0.1)
|
||||||
|
(1 1 0.1)
|
||||||
|
(0 1 0.1)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (50 50 1) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
top
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
bottom
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(1 5 4 0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
left
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
right
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
frontAndBack
|
||||||
|
{
|
||||||
|
type empty;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
(4 5 6 7)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
mergePatchPairs
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application scalarTransportFoam;
|
||||||
|
|
||||||
|
startFrom startTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 100;
|
||||||
|
|
||||||
|
deltaT 0.005;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 100;
|
||||||
|
|
||||||
|
purgeWrite 1;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
functions
|
||||||
|
{
|
||||||
|
sample1
|
||||||
|
{
|
||||||
|
type sets;
|
||||||
|
functionObjectLibs ("libsampling.so");
|
||||||
|
outputControl onEnd;
|
||||||
|
setFormat raw;
|
||||||
|
sets
|
||||||
|
(
|
||||||
|
line1
|
||||||
|
{
|
||||||
|
type uniform;
|
||||||
|
axis distance;
|
||||||
|
|
||||||
|
// Slightly perturbed so as not to align with face or edge
|
||||||
|
start (0 1 0.00501);
|
||||||
|
end (1 0 0.00501);
|
||||||
|
nPoints 200;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
interpolationScheme cellPoint;
|
||||||
|
fields (T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,T) Gauss limitedLinear 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear orthogonal;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default orthogonal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,T) Gauss DIVSCHEME;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear orthogonal;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default orthogonal;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
T
|
||||||
|
{
|
||||||
|
// solver smoothSolver;
|
||||||
|
// smoother symGaussSeidel;
|
||||||
|
solver PBiCG;
|
||||||
|
preconditioner DILU;
|
||||||
|
tolerance 1e-10;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SIMPLE
|
||||||
|
{
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
limitedLinear 0.2
|
||||||
|
limitedLinear 1.0
|
||||||
|
linear
|
||||||
|
linearUpwind grad(U)
|
||||||
|
LUST
|
||||||
|
midPoint
|
||||||
|
Minmod
|
||||||
|
MUSCL
|
||||||
|
QUICK
|
||||||
|
SFCD
|
||||||
|
SuperBee
|
||||||
|
UMIST
|
||||||
|
upwind
|
||||||
|
vanLeer
|
||||||
Reference in New Issue
Block a user