fvc
and fvm
. They define functions such as grad
, div
, curl
, laplacian
, etc. to calculate various spatial derivatives (respectively, gradient, divergence, rotor, Laplacian, etc.), as well as ddt
and d2dt2
for time derivatives. As a result, if you have some psi
field, then its gradient is calculated by simply calling fvc::grad(psi)
, etc.fvc::grad
, etc. - this is an βexternal interfaceβ for a number of different functions that calculate the gradient according to different schemes; The choice of a specific scheme is performed at the stage of the program execution in accordance with what is written in the task parameter files. Accordingly, it is possible, without changing the code of the solver, to change the schemes used for the numerical differentiation. fvc::div(U) + alpha * fvc::laplacian(phi)
div
will recognize them (due to the fact that each field stores a link to its own grid) and will correctly take into account. Secondly, likewise, there are no explicitly granular conditions here - but they will also be correctly taken into account.grad
without correcting the solver code.fvc
and fvm
. Namely, the fvc
namespace fvc
return the corresponding field β i.e. just what you need for an explicit method; and the fvm
functions return a special object storing a contribution from the corresponding member to the matrix. solve ( fvm::ddt(rho,U) + fvc::div(phi,U) - fvc::laplacian(mu,U) == - fvc::grad(p) );
solve ( fvm::ddt(rho,U) + fvm::div(phi,U) - fvm::laplacian(mu,U) == - fvc::grad(p) );
solve
this call β along with similar calls for other solved equations β to be enclosed in an external time loop.)laplacian(mu, psi)
corresponds to solve( fvm::laplacian(psi) + k*k*fvm::Sp(1, psi) = f );
fvm::Sp
is a function that introduces the desired function directly into the equation implicitly without any derivatives. If I wrote just psi
, I would receive its explicit accounting, that is, simply substituting its βcurrentβ values.) template <class T> class Foo: public T
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Foo<Bar<Baz > >.
, , , constTransport<specieThermo<hConstThermo > >. perfectGas
β , () ..; hConstThermo
() ; specieThermo
; constTransport
() .
«» , , . , constTransport
sutherlandTransport
, . , , . OpenFOAM.
, .
-, , , , , β main
. , , icoFoam
PISO. , PISO main
, .
-, .H- , . , main
:
int main(int argc, char *argv[]) { #include "setRootCase.H" ...
setRootCase.H
( ):
Foam::argList args(argc, argv); if (!args.checkRootCase()) { Foam::FatalError.exit(); }
( , OpenFOAM β .)
-, OpenFOAM . , , , : , , β , , Field. ! ( -), - , .
, -, OpenFOAM , , , , . , OpenFOAM, (, ) , (wmake) ..
, - .. β . , OpenFOAM , β .
OpenFOAM
(User Guide) Doxygen- Programmer's guide (- , ) OpenFOAM-extend β OpenFOAM, , , , . OpenFOAM cfd-online.com β OpenFOAM; , , . OpenFOAM, pdf- ; .
Source: https://habr.com/ru/post/170675/
All Articles