In this article the principles of the field operation and manipulation (FOAM) C++ class library for continuum mechanics are outlined. Our intention is to make it as easy as possible to develop reliable and efficient computational continuum-mechanics codes: this is achieved by making the top-level syntax of the code as close as possible to conventional mathematical notation for tensors and partial differential equations. Object-orientation techniques enable the creation of data types that closely mimic those of continuum mechanics, and the operator overloading possible in C++ allows normal mathematical symbols to be used for the basic operations. As an example, the implementation of various types of turbulence modeling in a FOAM computational-fluid-dynamics code is discussed, and calculations performed on a standard test case, that of flow around a square prism, are presented. To demonstrate the flexibility of the FOAM library, codes for solving structures and magnetohydrodynamics are also presented with appropriate test case results given. © 1998 American Institute of Physics.

1.
C. A. J. Fletcher, Computational Techniques for Fluid Dynamics, Springer Series in Computational Physics Vols. I and II, 2nd ed. (Springer, Berlin, 1991).
2.
J. H. Ferziger and M. Perić, Computational Methods for Fluid Dynamics (Springer, Berlin, 1996).
3.
H. K. Versteeg and W. Malalasekera, An Introduction to Computational Fluid Dynamics: The Finite Volume Method (Longman Scientific and Technical, 1995).
4.
B. W. R.
Forde
,
R. O.
Foschi
, and
S. F.
Stiemer
,
Comput. Struct.
34
,
355
(
1990
).
5.
B. Stroustrup, Proceedings of the 1st European Software Festival, 1991.
6.
B. Stroustrup, The C++ Programming Language, 3rd ed. (Addison–Wesley, Reading, MA, 1997).
7.
B. Stroustrup, OOPS Messenger, 1995, an addendum to the OOPSLA ’95 Proceedings.
8.
J. R. Cary, S. G. Shasharina, J. C. Cummings, J. V. W. Reynders, and P. J. Hinker, Comput. Phys. Commun. (submitted);
available at http://jove.colorado.edu/   ̃cary/CompCPP_F90SciOOP.html.
9.
Y.
Dubois-Pèlerin
and
Th.
Zimmermann
,
Comput. Methods Appl. Mech. Eng.
108
,
165
(
1993
).
10.
J-L.
Liu
,
I.-J.
Lin
,
M.-Z.
Shih
,
R.-C.
Chen
, and
M.-C.
Hseih
,
Appl. Numer. Math.
21
,
439
(
1996
).
11.
Th.
Zimmermann
,
Y.
Dubois-Pèlerin
, and
P.
Bomme
,
Comput. Methods Appl. Mech. Eng.
98
,
291
(
1992
).
12.
L.
Machiels
and
M. O.
Deville
,
ACM Trans. Math. Softw.
23
,
32
(
1997
).
13.
Th.
Zimmermann
and
D.
Eyheramendy
,
Comput. Methods Appl. Mech. Eng.
132
,
259
(
1996
).
14.
D.
Eyheramendy
and
Th.
Zimmermann
,
Comput. Methods Appl. Mech. Eng.
132
,
277
(
1996
).
15.
H. Jasak, Ph.D. thesis, Imperial College, 1996.
16.
O. Ubbink, Ph.D. thesis, Imperial College, 1997.
17.
C.
Fureby
,
G.
Tabor
,
H.
Weller
, and
A. D.
Gosman
,
Phys. Fluids
9
,
1416
(
1997
).
18.
S. Meyer, Effective C++ (Addison–Wesley, Reading, MA, 1992).
19.
M. R.
Hestens
and
E. L.
Steifel
,
J. Res.
29
,
409
(
1952
).
20.
D. A. H. Jacobs, Technical report, Central Electricity Research Laboratories, 1980.
21.
H. A.
van der Vorst
,
SIAM J. Comput.
13
,
631
(
1992
).
22.
R. I.
Issa
,
J. Comput. Phys.
62
,
40
(
1986
).
23.
R. I.
Issa
,
A. D.
Gosman
, and
A. P.
Watkins
,
J. Comput. Phys.
62
,
66
(
1986
).
24.
B. E.
Launder
and
D. B.
Spalding
,
Comput. Methods Appl. Mech. Eng.
3
,
269
(
1974
).
25.
V. C.
Patel
,
W.
Rodi
, and
G.
Scheuerer
,
AIAA J.
23
,
1308
(
1985
).
26.
B. E.
Launder
,
G. J.
Reece
, and
W.
Rodi
, “
Progress in the development of a Reynolds-stress Turbulence Closure
,”
J. Fluid Mech.
68
,
537
(
1975
).
27.
J.
Smagorinsky
,
Mon. Weather Rev.
91
,
99
(
1963
).
28.
U.
Schumann
,
J. Comput. Phys.
18
,
376
(
1975
).
29.
A.
Yoshizawa
,
Phys. Fluids A
29
,
2152
(
1986
).
30.
J. W.
Deardorff
,
Trans. ASME, Ser. I: J. Fluids Eng.
156
,
55
(
1973
).
31.
J. Bardina, J. H. Ferziger, and W. C. Reynolds, Technical Report No. TF-19, Stanford University, 1983.
32.
G.
Erlebacher
,
M. Y.
Hussaini
,
C. G.
Speziale
, and
T. A.
Zang
,
J. Fluid Mech.
238
,
155
(
1992
).
33.
D. Lyn, S. Einav, W. Rodi, and J. Park, Technical report, Karlsruhe University, 1994.
34.
D. F. G.
Durao
,
M. V.
Heitor
, and
J. C. F.
Pereira
,
Exp. Fluids
6
,
298
(
1988
).
35.
M. M.
Gibson
and
B. E.
Launder
,
J. Fluid Mech.
86
,
491
(
1978
).
36.
V.
Yakhot
,
S. A.
Orszag
,
S.
Thangam
,
T. B.
Gatski
, and
C. G.
Speziale
,
Phys. Fluids A
4
,
1510
(
1992
).
37.
I.
Demirdžić
and
S.
Muzaferija
,
Int. J. Numer. Methods Eng.
37
,
3751
(
1994
).
38.
I.
Demirdžić
and
S.
Muzaferija
,
Comput. Methods Appl. Mech. Eng.
125
,
235
(
1995
).
This content is only available via PDF.
You do not currently have access to this content.