volScalarField is a type of field in OpenFOAM which represents a scalar field defined over a volume (3D space). It is commonly used to store data such as temperature, pressure, density, and velocity.
Here are some code examples using volScalarField:
1. Definition of a volScalarField object:
volScalarField temp("temperature", mesh);
This creates a volScalarField object called "temp" with the name "temperature" and associates it with a mesh object.
2. Setting values of a volScalarField object:
temp = 273.15;
This sets the entire field "temp" to a value of 273.15 (in this case, representing 0 degrees Celsius).
3. Accessing a specific cell value in a volScalarField object:
scalar T = temp[cellI];
This retrieves the value of the temperature at a specific cell index "cellI" and stores it in a scalar variable "T".
Package/Library: OpenFOAM
C++ (Cpp) volScalarField - 30 examples found. These are the top rated real world C++ (Cpp) examples of volScalarField extracted from open source projects. You can rate examples to help us improve the quality of examples.