Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
HPCAPPs
OpenFOAM-GPU-v2.0
Commits
ea17556c
Commit
ea17556c
authored
Mar 07, 2024
by
shunbo
Browse files
Initial commit
parents
Changes
798
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
1499 additions
and
0 deletions
+1499
-0
applications/solvers/heatTransfer/solidFoam/hEqn.H
applications/solvers/heatTransfer/solidFoam/hEqn.H
+38
-0
applications/solvers/heatTransfer/solidFoam/solidFoam.C
applications/solvers/heatTransfer/solidFoam/solidFoam.C
+121
-0
applications/solvers/heatTransfer/thermoFoam/EEqn.H
applications/solvers/heatTransfer/thermoFoam/EEqn.H
+38
-0
applications/solvers/heatTransfer/thermoFoam/Make/files
applications/solvers/heatTransfer/thermoFoam/Make/files
+3
-0
applications/solvers/heatTransfer/thermoFoam/Make/options
applications/solvers/heatTransfer/thermoFoam/Make/options
+21
-0
applications/solvers/heatTransfer/thermoFoam/createFields.H
applications/solvers/heatTransfer/thermoFoam/createFields.H
+69
-0
applications/solvers/heatTransfer/thermoFoam/thermoFoam.C
applications/solvers/heatTransfer/thermoFoam/thermoFoam.C
+113
-0
applications/solvers/incompressible/adjointOptimisationFoam/Make/files
...solvers/incompressible/adjointOptimisationFoam/Make/files
+3
-0
applications/solvers/incompressible/adjointOptimisationFoam/Make/options
...lvers/incompressible/adjointOptimisationFoam/Make/options
+21
-0
applications/solvers/incompressible/adjointOptimisationFoam/adjointOptimisationFoam.C
...essible/adjointOptimisationFoam/adjointOptimisationFoam.C
+85
-0
applications/solvers/incompressible/adjointOptimisationFoam/createFields.H
...ers/incompressible/adjointOptimisationFoam/createFields.H
+6
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/Make/files
...rs/incompressible/adjointShapeOptimizationFoam/Make/files
+5
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/Make/options
.../incompressible/adjointShapeOptimizationFoam/Make/options
+16
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointContinuityErrs.H
...ible/adjointShapeOptimizationFoam/adjointContinuityErrs.H
+48
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C
...tOutletPressure/adjointOutletPressureFvPatchScalarField.C
+128
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H
...tOutletPressure/adjointOutletPressureFvPatchScalarField.H
+138
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C
...tOutletVelocity/adjointOutletVelocityFvPatchVectorField.C
+130
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H
...tOutletVelocity/adjointOutletVelocityFvPatchVectorField.H
+135
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C
...jointShapeOptimizationFoam/adjointShapeOptimizationFoam.C
+257
-0
applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H
...ncompressible/adjointShapeOptimizationFoam/createFields.H
+124
-0
No files found.
Too many changes to show.
To preserve performance only
798 of 798+
files are displayed.
Plain diff
Email patch
applications/solvers/heatTransfer/solidFoam/hEqn.H
0 → 100644
View file @
ea17556c
{
fvScalarMatrix
hEqn
(
fvm
::
ddt
(
betav
*
rho
,
h
)
-
(
thermo
.
isotropic
()
?
fvm
::
laplacian
(
betav
*
thermo
.
alpha
(),
h
,
"laplacian(alpha,h)"
)
:
fvm
::
laplacian
(
betav
*
taniAlpha
(),
h
,
"laplacian(alpha,h)"
)
)
==
fvOptions
(
rho
,
h
)
);
if
(
meshFluxCorr
)
{
surfaceScalarField
phihMesh
(
fvc
::
interpolate
(
betav
*
rho
*
h
)
*
mesh
.
phi
()
);
hEqn
-=
fvc
::
div
(
phihMesh
);
}
hEqn
.
relax
();
fvOptions
.
constrain
(
hEqn
);
hEqn
.
solve
();
//mesh.solver(h.select(finalIter)));
fvOptions
.
correct
(
h
);
thermo
.
correct
();
Info
<<
"Min/max T:"
<<
min
(
thermo
.
T
()).
value
()
<<
' '
<<
max
(
thermo
.
T
()).
value
()
<<
endl
;
radiation
->
correct
();
}
applications/solvers/heatTransfer/solidFoam/solidFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
solidFoam
Group
grpHeatTransferSolvers
Description
Solver for energy transport and thermodynamics on a solid.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "solidThermo.H"
#include "radiationModel.H"
#include "fvOptions.H"
#include "simpleControl.H"
#include "pimpleControl.H"
#include "coordinateSystem.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Solver for energy transport and thermodynamics on a solid"
);
#define NO_CONTROL
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createDynamicFvMesh.H"
#include "createFields.H"
#include "createFieldRefs.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Evolving thermodynamics
\n
"
<<
endl
;
if
(
mesh
.
solutionDict
().
found
(
"SIMPLE"
))
{
simpleControl
simple
(
mesh
);
while
(
simple
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
while
(
simple
.
correctNonOrthogonal
())
{
#include "hEqn.H"
}
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
}
else
{
pimpleControl
pimple
(
mesh
);
while
(
runTime
.
run
())
{
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
while
(
pimple
.
loop
())
{
if
(
pimple
.
firstIter
())
{
mesh
.
update
();
}
while
(
pimple
.
correct
())
{
#include "hEqn.H"
}
}
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/heatTransfer/thermoFoam/EEqn.H
0 → 100644
View file @
ea17556c
{
volScalarField
&
he
=
thermo
.
he
();
fvScalarMatrix
EEqn
(
fvm
::
ddt
(
rho
,
he
)
+
fvm
::
div
(
phi
,
he
)
+
fvc
::
ddt
(
rho
,
K
)
+
fvc
::
div
(
phi
,
K
)
+
(
he
.
name
()
==
"e"
?
fvc
::
div
(
fvc
::
absolute
(
phi
/
fvc
::
interpolate
(
rho
),
U
),
p
,
"div(phiv,p)"
)
:
-
dpdt
)
==
radiation
->
Sh
(
thermo
,
he
)
+
fvOptions
(
rho
,
he
)
);
if
(
turbulence
.
valid
())
{
EEqn
-=
fvm
::
laplacian
(
turbulence
->
alphaEff
(),
he
);
}
EEqn
.
relax
();
fvOptions
.
constrain
(
EEqn
);
EEqn
.
solve
();
fvOptions
.
correct
(
he
);
thermo
.
correct
();
radiation
->
correct
();
}
applications/solvers/heatTransfer/thermoFoam/Make/files
0 → 100644
View file @
ea17556c
thermoFoam.C
EXE = $(FOAM_APPBIN)/thermoFoam
applications/solvers/heatTransfer/thermoFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lradiationModels \
-lspecie \
-lturbulenceModels \
-lcompressibleTurbulenceModels
applications/solvers/heatTransfer/thermoFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading thermophysical properties
\n
"
<<
endl
;
autoPtr
<
rhoThermo
>
pThermo
(
rhoThermo
::
New
(
mesh
));
rhoThermo
&
thermo
=
pThermo
();
thermo
.
validate
(
args
.
executable
(),
"h"
,
"e"
);
volScalarField
rho
(
IOobject
(
"rho"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
),
thermo
.
rho
()
);
volScalarField
&
p
=
thermo
.
p
();
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "compressibleCreatePhi.H"
autoPtr
<
compressible
::
turbulenceModel
>
turbulence
;
IOobject
turbulencePropertiesHeader
(
"turbulenceProperties"
,
runTime
.
constant
(),
mesh
,
IOobject
::
MUST_READ_IF_MODIFIED
,
IOobject
::
NO_WRITE
,
false
);
if
(
turbulencePropertiesHeader
.
typeHeaderOk
<
IOdictionary
>
(
false
))
{
Info
<<
"Creating turbulence model
\n
"
<<
endl
;
turbulence
=
compressible
::
turbulenceModel
::
New
(
rho
,
U
,
phi
,
thermo
);
}
#include "createDpdt.H"
#include "createK.H"
#include "createRadiationModel.H"
#include "createFvOptions.H"
applications/solvers/heatTransfer/thermoFoam/thermoFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
thermoFoam
Group
grpHeatTransferSolvers
Description
Solver for energy transport and thermodynamics on a frozen flow field.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoThermo.H"
#include "turbulentFluidThermoModel.H"
#include "LESModel.H"
#include "radiationModel.H"
#include "fvOptions.H"
#include "simpleControl.H"
#include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Solver for energy transport and thermodynamics on a frozen flow field"
);
#define NO_CONTROL
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Evolving thermodynamics
\n
"
<<
endl
;
if
(
mesh
.
solutionDict
().
found
(
"SIMPLE"
))
{
simpleControl
simple
(
mesh
);
while
(
simple
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
while
(
simple
.
correctNonOrthogonal
())
{
#include "EEqn.H"
}
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
}
else
{
pimpleControl
pimple
(
mesh
);
while
(
runTime
.
run
())
{
++
runTime
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
while
(
pimple
.
correctNonOrthogonal
())
{
#include "EEqn.H"
}
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/incompressible/adjointOptimisationFoam/Make/files
0 → 100644
View file @
ea17556c
adjointOptimisationFoam.C
EXE = $(FOAM_APPBIN)/adjointOptimisationFoam
applications/solvers/incompressible/adjointOptimisationFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/fvOptions/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/optimisation/adjointOptimisation/adjoint/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lsampling \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels \
-ladjointOptimisation
applications/solvers/incompressible/adjointOptimisationFoam/adjointOptimisationFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2007-2019 PCOpt/NTUA
Copyright (C) 2013-2019 FOSS GP
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
adjointOptimisation
Description
An automated adjoint-based optimisation loop. Supports multiple types
of optimisation (shape, topology etc)
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "optimisationManager.H"
#include "primalSolver.H"
#include "adjointSolverManager.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
for
(
om
++
;
!
om
.
end
();
om
++
)
{
if
(
om
.
update
())
{
// Update design variables and solve all primal equations
om
.
updateDesignVariables
();
}
else
{
// Solve all primal equations
om
.
solvePrimalEquations
();
}
// Update primal-based quantities of the adjoint solvers
om
.
updatePrimalBasedQuantities
();
// Solve all adjoint equations
om
.
solveAdjointEquations
();
// Compute all sensitivities
om
.
computeSensitivities
();
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/incompressible/adjointOptimisationFoam/createFields.H
0 → 100644
View file @
ea17556c
// Construct optimisation manager
autoPtr
<
optimisationManager
>
optManagerPtr
(
optimisationManager
::
New
(
mesh
)
);
optimisationManager
&
om
=
optManagerPtr
();
applications/solvers/incompressible/adjointShapeOptimizationFoam/Make/files
0 → 100644
View file @
ea17556c
adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C
adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C
adjointShapeOptimizationFoam.C
EXE = $(FOAM_APPBIN)/adjointShapeOptimizationFoam
applications/solvers/incompressible/adjointShapeOptimizationFoam/Make/options
0 → 100644
View file @
ea17556c
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel
EXE_LIBS = \
-lfiniteVolume \
-lfvOptions \
-lmeshTools \
-lturbulenceModels \
-lincompressibleTurbulenceModels \
-lincompressibleTransportModels
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointContinuityErrs.H
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Global
continuityErrs
Description
Calculates and prints the continuity errors.
\*---------------------------------------------------------------------------*/
{
scalar
sumLocalContErr
=
runTime
.
deltaTValue
()
*
mag
(
fvc
::
div
(
phia
))().
weightedAverage
(
mesh
.
V
()).
value
();
scalar
globalContErr
=
runTime
.
deltaTValue
()
*
fvc
::
div
(
phia
)().
weightedAverage
(
mesh
.
V
()).
value
();
cumulativeAdjointContErr
+=
globalContErr
;
Info
<<
"Adjoint continuity errors : sum local = "
<<
sumLocalContErr
<<
", global = "
<<
globalContErr
<<
", cumulative = "
<<
cumulativeAdjointContErr
<<
endl
;
}
// ************************************************************************* //
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "adjointOutletPressureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
adjointOutletPressureFvPatchScalarField
::
adjointOutletPressureFvPatchScalarField
(
const
fvPatch
&
p
,
const
DimensionedField
<
scalar
,
volMesh
>&
iF
)
:
fixedValueFvPatchScalarField
(
p
,
iF
)
{}
Foam
::
adjointOutletPressureFvPatchScalarField
::
adjointOutletPressureFvPatchScalarField
(
const
adjointOutletPressureFvPatchScalarField
&
ptf
,
const
fvPatch
&
p
,
const
DimensionedField
<
scalar
,
volMesh
>&
iF
,
const
fvPatchFieldMapper
&
mapper
)
:
fixedValueFvPatchScalarField
(
ptf
,
p
,
iF
,
mapper
)
{}
Foam
::
adjointOutletPressureFvPatchScalarField
::
adjointOutletPressureFvPatchScalarField
(
const
fvPatch
&
p
,
const
DimensionedField
<
scalar
,
volMesh
>&
iF
,
const
dictionary
&
dict
)
:
fixedValueFvPatchScalarField
(
p
,
iF
,
dict
)
{}
Foam
::
adjointOutletPressureFvPatchScalarField
::
adjointOutletPressureFvPatchScalarField
(
const
adjointOutletPressureFvPatchScalarField
&
tppsf
,
const
DimensionedField
<
scalar
,
volMesh
>&
iF
)
:
fixedValueFvPatchScalarField
(
tppsf
,
iF
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void
Foam
::
adjointOutletPressureFvPatchScalarField
::
updateCoeffs
()
{
if
(
updated
())
{
return
;
}
const
fvsPatchField
<
scalar
>&
phip
=
patch
().
lookupPatchField
<
surfaceScalarField
,
scalar
>
(
"phi"
);
const
fvsPatchField
<
scalar
>&
phiap
=
patch
().
lookupPatchField
<
surfaceScalarField
,
scalar
>
(
"phia"
);
const
fvPatchField
<
vector
>&
Up
=
patch
().
lookupPatchField
<
volVectorField
,
vector
>
(
"U"
);
const
fvPatchField
<
vector
>&
Uap
=
patch
().
lookupPatchField
<
volVectorField
,
vector
>
(
"Ua"
);
operator
==
((
phiap
/
patch
().
magSf
()
-
1
.
0
)
*
phip
/
patch
().
magSf
()
+
(
Up
&
Uap
));
fixedValueFvPatchScalarField
::
updateCoeffs
();
}
void
Foam
::
adjointOutletPressureFvPatchScalarField
::
write
(
Ostream
&
os
)
const
{
fvPatchScalarField
::
write
(
os
);
writeEntry
(
"value"
,
os
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
makePatchTypeField
(
fvPatchScalarField
,
adjointOutletPressureFvPatchScalarField
);
}
// ************************************************************************* //
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.H
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::adjointOutletPressureFvPatchScalarField
Description
SourceFiles
adjointOutletPressureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef adjointOutletPressureFvPatchScalarField_H
#define adjointOutletPressureFvPatchScalarField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class adjointOutletPressureFvPatch Declaration
\*---------------------------------------------------------------------------*/
class
adjointOutletPressureFvPatchScalarField
:
public
fixedValueFvPatchScalarField
{
public:
//- Runtime type information
TypeName
(
"adjointOutletPressure"
);
// Constructors
//- Construct from patch and internal field
adjointOutletPressureFvPatchScalarField
(
const
fvPatch
&
,
const
DimensionedField
<
scalar
,
volMesh
>&
);
//- Construct from patch, internal field and dictionary
adjointOutletPressureFvPatchScalarField
(
const
fvPatch
&
,
const
DimensionedField
<
scalar
,
volMesh
>&
,
const
dictionary
&
);
//- Construct by mapping given adjointOutletPressureFvPatchScalarField
// onto a new patch
adjointOutletPressureFvPatchScalarField
(
const
adjointOutletPressureFvPatchScalarField
&
,
const
fvPatch
&
,
const
DimensionedField
<
scalar
,
volMesh
>&
,
const
fvPatchFieldMapper
&
);
//- Construct and return a clone
virtual
tmp
<
fvPatchScalarField
>
clone
()
const
{
return
tmp
<
fvPatchScalarField
>
(
new
adjointOutletPressureFvPatchScalarField
(
*
this
)
);
}
//- Construct as copy setting internal field reference
adjointOutletPressureFvPatchScalarField
(
const
adjointOutletPressureFvPatchScalarField
&
,
const
DimensionedField
<
scalar
,
volMesh
>&
);
//- Construct and return a clone setting internal field reference
virtual
tmp
<
fvPatchScalarField
>
clone
(
const
DimensionedField
<
scalar
,
volMesh
>&
iF
)
const
{
return
tmp
<
fvPatchScalarField
>
(
new
adjointOutletPressureFvPatchScalarField
(
*
this
,
iF
)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Write
virtual
void
write
(
Ostream
&
)
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "adjointOutletVelocityFvPatchVectorField.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
#include "surfaceFields.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
adjointOutletVelocityFvPatchVectorField
::
adjointOutletVelocityFvPatchVectorField
(
const
fvPatch
&
p
,
const
DimensionedField
<
vector
,
volMesh
>&
iF
)
:
fixedValueFvPatchVectorField
(
p
,
iF
)
{}
Foam
::
adjointOutletVelocityFvPatchVectorField
::
adjointOutletVelocityFvPatchVectorField
(
const
fvPatch
&
p
,
const
DimensionedField
<
vector
,
volMesh
>&
iF
,
const
dictionary
&
dict
)
:
fixedValueFvPatchVectorField
(
p
,
iF
,
dict
)
{}
Foam
::
adjointOutletVelocityFvPatchVectorField
::
adjointOutletVelocityFvPatchVectorField
(
const
adjointOutletVelocityFvPatchVectorField
&
ptf
,
const
fvPatch
&
p
,
const
DimensionedField
<
vector
,
volMesh
>&
iF
,
const
fvPatchFieldMapper
&
mapper
)
:
fixedValueFvPatchVectorField
(
ptf
,
p
,
iF
,
mapper
)
{}
Foam
::
adjointOutletVelocityFvPatchVectorField
::
adjointOutletVelocityFvPatchVectorField
(
const
adjointOutletVelocityFvPatchVectorField
&
pivpvf
,
const
DimensionedField
<
vector
,
volMesh
>&
iF
)
:
fixedValueFvPatchVectorField
(
pivpvf
,
iF
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Update the coefficients associated with the patch field
void
Foam
::
adjointOutletVelocityFvPatchVectorField
::
updateCoeffs
()
{
if
(
updated
())
{
return
;
}
const
fvsPatchField
<
scalar
>&
phiap
=
patch
().
lookupPatchField
<
surfaceScalarField
,
scalar
>
(
"phia"
);
const
fvPatchField
<
vector
>&
Up
=
patch
().
lookupPatchField
<
volVectorField
,
vector
>
(
"U"
);
scalarField
Un
(
mag
(
patch
().
nf
()
&
Up
));
vectorField
UtHat
((
Up
-
patch
().
nf
()
*
Un
)
/
(
Un
+
SMALL
));
vectorField
Uan
(
patch
().
nf
()
*
(
patch
().
nf
()
&
patchInternalField
()));
vectorField
::
operator
=
(
phiap
*
patch
().
Sf
()
/
sqr
(
patch
().
magSf
())
+
UtHat
);
//vectorField::operator=(Uan + UtHat);
fixedValueFvPatchVectorField
::
updateCoeffs
();
}
void
Foam
::
adjointOutletVelocityFvPatchVectorField
::
write
(
Ostream
&
os
)
const
{
fvPatchVectorField
::
write
(
os
);
writeEntry
(
"value"
,
os
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
makePatchTypeField
(
fvPatchVectorField
,
adjointOutletVelocityFvPatchVectorField
);
}
// ************************************************************************* //
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.H
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::adjointOutletVelocityFvPatchVectorField
Description
SourceFiles
adjointOutletVelocityFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef adjointOutletVelocityFvPatchVectorField_H
#define adjointOutletVelocityFvPatchVectorField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class adjointOutletVelocityFvPatch Declaration
\*---------------------------------------------------------------------------*/
class
adjointOutletVelocityFvPatchVectorField
:
public
fixedValueFvPatchVectorField
{
public:
//- Runtime type information
TypeName
(
"adjointOutletVelocity"
);
// Constructors
//- Construct from patch and internal field
adjointOutletVelocityFvPatchVectorField
(
const
fvPatch
&
,
const
DimensionedField
<
vector
,
volMesh
>&
);
//- Construct from patch, internal field and dictionary
adjointOutletVelocityFvPatchVectorField
(
const
fvPatch
&
,
const
DimensionedField
<
vector
,
volMesh
>&
,
const
dictionary
&
);
//- Construct by mapping given adjointOutletVelocityFvPatchVectorField
// onto a new patch
adjointOutletVelocityFvPatchVectorField
(
const
adjointOutletVelocityFvPatchVectorField
&
,
const
fvPatch
&
,
const
DimensionedField
<
vector
,
volMesh
>&
,
const
fvPatchFieldMapper
&
);
//- Construct and return a clone
virtual
tmp
<
fvPatchVectorField
>
clone
()
const
{
return
tmp
<
fvPatchVectorField
>
(
new
adjointOutletVelocityFvPatchVectorField
(
*
this
)
);
}
//- Construct as copy setting internal field reference
adjointOutletVelocityFvPatchVectorField
(
const
adjointOutletVelocityFvPatchVectorField
&
,
const
DimensionedField
<
vector
,
volMesh
>&
);
//- Construct and return a clone setting internal field reference
virtual
tmp
<
fvPatchVectorField
>
clone
(
const
DimensionedField
<
vector
,
volMesh
>&
iF
)
const
{
return
tmp
<
fvPatchVectorField
>
(
new
adjointOutletVelocityFvPatchVectorField
(
*
this
,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Write
virtual
void
write
(
Ostream
&
)
const
;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C
0 → 100644
View file @
ea17556c
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
ajointShapeOptimizationFoam
Group
grpIncompressibleSolvers
Description
Steady-state solver for incompressible, turbulent flow of non-Newtonian
fluids with optimisation of duct shape by applying "blockage" in regions
causing pressure loss as estimated using an adjoint formulation.
References:
\verbatim
"Implementation of a continuous adjoint for topology optimization of
ducted flows"
C. Othmer,
E. de Villiers,
H.G. Weller
AIAA-2007-3947
http://pdf.aiaa.org/preview/CDReadyMCFD07_1379/PV2007_3947.pdf
\endverbatim
Note that this solver optimises for total pressure loss whereas the
above paper describes the method for optimising power-loss.
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "turbulentTransportModel.H"
#include "simpleControl.H"
#include "fvOptions.H"
template
<
class
Type
>
void
zeroCells
(
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
vf
,
const
labelList
&
cells
)
{
forAll
(
cells
,
i
)
{
vf
[
cells
[
i
]]
=
Zero
;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
addNote
(
"Steady-state solver for incompressible, turbulent flow"
" of non-Newtonian fluids with duct shape optimisation"
" by applying 'blockage' in regions causing pressure loss"
);
#include "postProcess.H"
#include "addCheckCaseOptions.H"
#include "setRootCaseLists.H"
#include "createTime.H"
#include "createMesh.H"
#include "createControl.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "initAdjointContinuityErrs.H"
turbulence
->
validate
();
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
simple
.
loop
())
{
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
nl
<<
endl
;
//alpha +=
// mesh.relaxationFactor("alpha")
// *(lambda*max(Ua & U, zeroSensitivity) - alpha);
alpha
+=
mesh
.
fieldRelaxationFactor
(
"alpha"
)
*
(
min
(
max
(
alpha
+
lambda
*
(
Ua
&
U
),
zeroAlpha
),
alphaMax
)
-
alpha
);
zeroCells
(
alpha
,
inletCells
);
//zeroCells(alpha, outletCells);
// Pressure-velocity SIMPLE corrector
{
// Momentum predictor
tmp
<
fvVectorMatrix
>
tUEqn
(
fvm
::
div
(
phi
,
U
)
+
turbulence
->
divDevReff
(
U
)
+
fvm
::
Sp
(
alpha
,
U
)
==
fvOptions
(
U
)
);
fvVectorMatrix
&
UEqn
=
tUEqn
.
ref
();
UEqn
.
relax
();
fvOptions
.
constrain
(
UEqn
);
solve
(
UEqn
==
-
fvc
::
grad
(
p
));
fvOptions
.
correct
(
U
);
volScalarField
rAU
(
1
.
0
/
UEqn
.
A
());
volVectorField
HbyA
(
constrainHbyA
(
rAU
*
UEqn
.
H
(),
U
,
p
));
tUEqn
.
clear
();
surfaceScalarField
phiHbyA
(
"phiHbyA"
,
fvc
::
flux
(
HbyA
));
adjustPhi
(
phiHbyA
,
U
,
p
);
// Update the pressure BCs to ensure flux consistency
constrainPressure
(
p
,
U
,
phiHbyA
,
rAU
);
// Non-orthogonal pressure corrector loop
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
pEqn
(
fvm
::
laplacian
(
rAU
,
p
)
==
fvc
::
div
(
phiHbyA
)
);
pEqn
.
setReference
(
pRefCell
,
pRefValue
);
pEqn
.
solve
();
if
(
simple
.
finalNonOrthogonalIter
())
{
phi
=
phiHbyA
-
pEqn
.
flux
();
}
}
#include "continuityErrs.H"
// Explicitly relax pressure for momentum corrector
p
.
relax
();
// Momentum corrector
U
=
HbyA
-
rAU
*
fvc
::
grad
(
p
);
U
.
correctBoundaryConditions
();
fvOptions
.
correct
(
U
);
}
// Adjoint Pressure-velocity SIMPLE corrector
{
// Adjoint Momentum predictor
volVectorField
adjointTransposeConvection
((
fvc
::
grad
(
Ua
)
&
U
));
//volVectorField adjointTransposeConvection
//(
// fvc::reconstruct
// (
// mesh.magSf()*fvc::dotInterpolate(fvc::snGrad(Ua), U)
// )
//);
zeroCells
(
adjointTransposeConvection
,
inletCells
);
tmp
<
fvVectorMatrix
>
tUaEqn
(
fvm
::
div
(
-
phi
,
Ua
)
-
adjointTransposeConvection
+
turbulence
->
divDevReff
(
Ua
)
+
fvm
::
Sp
(
alpha
,
Ua
)
==
fvOptions
(
Ua
)
);
fvVectorMatrix
&
UaEqn
=
tUaEqn
.
ref
();
UaEqn
.
relax
();
fvOptions
.
constrain
(
UaEqn
);
solve
(
UaEqn
==
-
fvc
::
grad
(
pa
));
fvOptions
.
correct
(
Ua
);
volScalarField
rAUa
(
1
.
0
/
UaEqn
.
A
());
volVectorField
HbyAa
(
"HbyAa"
,
Ua
);
HbyAa
=
rAUa
*
UaEqn
.
H
();
tUaEqn
.
clear
();
surfaceScalarField
phiHbyAa
(
"phiHbyAa"
,
fvc
::
flux
(
HbyAa
));
adjustPhi
(
phiHbyAa
,
Ua
,
pa
);
// Non-orthogonal pressure corrector loop
while
(
simple
.
correctNonOrthogonal
())
{
fvScalarMatrix
paEqn
(
fvm
::
laplacian
(
rAUa
,
pa
)
==
fvc
::
div
(
phiHbyAa
)
);
paEqn
.
setReference
(
paRefCell
,
paRefValue
);
paEqn
.
solve
();
if
(
simple
.
finalNonOrthogonalIter
())
{
phia
=
phiHbyAa
-
paEqn
.
flux
();
}
}
#include "adjointContinuityErrs.H"
// Explicitly relax pressure for adjoint momentum corrector
pa
.
relax
();
// Adjoint momentum corrector
Ua
=
HbyAa
-
rAUa
*
fvc
::
grad
(
pa
);
Ua
.
correctBoundaryConditions
();
fvOptions
.
correct
(
Ua
);
}
laminarTransport
.
correct
();
turbulence
->
correct
();
runTime
.
write
();
runTime
.
printExecutionTime
(
Info
);
}
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H
0 → 100644
View file @
ea17556c
Info
<<
"Reading field p
\n
"
<<
endl
;
volScalarField
p
(
IOobject
(
"p"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading field U
\n
"
<<
endl
;
volVectorField
U
(
IOobject
(
"U"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "createPhi.H"
label
pRefCell
=
0
;
scalar
pRefValue
=
0
.
0
;
setRefCell
(
p
,
simple
.
dict
(),
pRefCell
,
pRefValue
);
mesh
.
setFluxRequired
(
p
.
name
());
Info
<<
"Reading field pa
\n
"
<<
endl
;
volScalarField
pa
(
IOobject
(
"pa"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
Info
<<
"Reading field Ua
\n
"
<<
endl
;
volVectorField
Ua
(
IOobject
(
"Ua"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
AUTO_WRITE
),
mesh
);
#include "createPhia.H"
label
paRefCell
=
0
;
scalar
paRefValue
=
0
.
0
;
setRefCell
(
pa
,
simple
.
dict
(),
paRefCell
,
paRefValue
);
mesh
.
setFluxRequired
(
pa
.
name
());
singlePhaseTransportModel
laminarTransport
(
U
,
phi
);
autoPtr
<
incompressible
::
turbulenceModel
>
turbulence
(
incompressible
::
turbulenceModel
::
New
(
U
,
phi
,
laminarTransport
)
);
dimensionedScalar
zeroSensitivity
(
dimVelocity
*
dimVelocity
,
Zero
);
dimensionedScalar
zeroAlpha
(
dimless
/
dimTime
,
Zero
);
dimensionedScalar
lambda
(
"lambda"
,
dimTime
/
sqr
(
dimLength
),
laminarTransport
);
dimensionedScalar
alphaMax
(
"alphaMax"
,
dimless
/
dimTime
,
laminarTransport
);
const
labelList
&
inletCells
=
mesh
.
boundary
()[
"inlet"
].
faceCells
();
//const labelList& outletCells = mesh.boundary()["outlet"].faceCells();
volScalarField
alpha
(
IOobject
(
"alpha"
,
runTime
.
timeName
(),
mesh
,
IOobject
::
READ_IF_PRESENT
,
IOobject
::
AUTO_WRITE
),
lambda
*
max
(
Ua
&
U
,
zeroSensitivity
)
);
zeroCells
(
alpha
,
inletCells
);
//zeroCells(alpha, outletCells);
#include "createFvOptions.H"
Prev
1
…
19
20
21
22
23
24
25
26
27
…
40
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment