-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18b59e5
commit e0538be
Showing
3 changed files
with
230 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
.. _ref_field_data: | ||
|
||
Field Data | ||
========== | ||
FieldData module provides access to Fluent surface, scalar and vector field | ||
data. Client can get multiple fields in a single request. | ||
|
||
* Request | ||
|
||
Multiple requests for fields can be appended in a single request with | ||
`add_get_<field>_requests` APIs. | ||
|
||
* add_get_surfaces_request | ||
To add surfaces request | ||
* add_get_scalar_fields_request | ||
To add scalar fields request | ||
* add_get_vector_fields_request | ||
To add vector fields request | ||
|
||
* Response | ||
|
||
All requested fields are returned in a single response with `get_fields` API | ||
|
||
* get_fields | ||
It provides the dictionary containing the requested fields as numpy array | ||
in the following order | ||
|
||
* tag_id [int]-> surface_id [int] -> field_name [str] -> field_data[np.array] | ||
|
||
|
||
Tag Id | ||
^^^^^^^ | ||
|
||
Tag id is generated by applying `bitwise or` on all tags for a request. following | ||
is the list of supported tags and their values: | ||
|
||
* OVERSET_MESH: 1, | ||
* ELEMENT_LOCATION: 2, | ||
* NODE_LOCATION: 4, | ||
* BOUNDARY_VALUES: 8, | ||
|
||
So if scalar field data is requested for element location[2] then tag_id in | ||
dictionary will be 2. Similarly if boundary values[8] are requested for | ||
node location[4] then tag_id will be (4|8) i.e. 12. | ||
|
||
Surface Id | ||
^^^^^^^^^^^ | ||
|
||
Surface ids are the one passed in the request. | ||
|
||
Field Name | ||
^^^^^^^^^^^ | ||
|
||
For a request multiple fields are returned. Number of fields depends upon the request type. | ||
|
||
* Surface request | ||
|
||
Response will contain any of the following fields depending upon the request arguments. | ||
|
||
* faces | ||
Contains faces connectivity | ||
* vertices | ||
Contains node coordinates | ||
* centroid | ||
Contains faces centroid | ||
* face-normal | ||
Contains faces Normal | ||
|
||
* Scalar field request | ||
|
||
Response will contain a single field with name same as scalar field name passed in the request. | ||
|
||
* vector field request | ||
|
||
Response will contain two fields | ||
|
||
* Vector field, with name same as vector field name passed in the request. | ||
* vector-scale. | ||
|
||
|
||
.. code-block:: python | ||
#Get field data | ||
field_data = session.field_data | ||
#Add requests | ||
#Data for surfaces for following requests will be returned in tag_id 0. As there is no tag. | ||
field_data.add_get_surfaces_request(surface_ids=[1], provide_vertices=True, | ||
provide_faces=False, provide_faces_centroid=True | ||
) | ||
field_data.add_get_surfaces_request(surface_ids=[2], provide_vertices=True, | ||
provide_faces=True | ||
) | ||
#Data for tempaeraure for following request will be returned in tag_id 12 i.e. 4|8. | ||
field_data.add_get_scalar_fields_request(surface_ids=[1,2], field_name="temperature", | ||
node_value=True, boundary_value=True | ||
) | ||
#Data for tempaeraure for following request will be returned in tag_id 4. | ||
field_data.add_get_scalar_fields_request(surface_ids=[3], field_name="temperature", | ||
node_value=True, boundary_value=False | ||
) | ||
#Data for pressure for following request will be returned in tag_id 2. | ||
field_data.add_get_scalar_fields_request(surface_ids=[1,4], field_name="pressure", | ||
node_value=False, boundary_value=False | ||
) | ||
#Get fields | ||
scalar_field_payload_data = field_data.get_fields() | ||
#Data will be returned in dictionary with order | ||
#`tag_id [int]-> surface_id [int] -> field_name [str] -> field_data [np.array]` | ||
{ | ||
0:{ | ||
1:{ | ||
"vertices": np.array #for vertices. | ||
"centroid": np.array #for faces centroid. | ||
}, | ||
2:{ | ||
"vertices": np.array #for vertices. | ||
"faces": np.array #for faces connectivity. | ||
}, | ||
}, | ||
12:{ | ||
1:{ | ||
"temperature": np.array #for temperature at node location with boundary values. | ||
}, | ||
2:{ | ||
"temperature": np.array #for temperature at node location with boundary values. | ||
}, | ||
}, | ||
4:{ | ||
3:{ | ||
"temperature": np.array #for temperature at node location. | ||
} | ||
}, | ||
2:{ | ||
1:{ | ||
"pressure": np.array #for pressure at element location. | ||
}, | ||
4:{ | ||
"pressure": np.array #for pressure at element location. | ||
}, | ||
}, | ||
} | ||
.. currentmodule:: ansys.fluent.core.services | ||
|
||
.. autosummary:: | ||
:toctree: _autosummary | ||
|
||
|
||
.. automethod:: ansys.fluent.core.services.field_data.FieldData.add_get_surfaces_request | ||
.. automethod:: ansys.fluent.core.services.field_data.FieldData.add_get_scalar_fields_request | ||
.. automethod:: ansys.fluent.core.services.field_data.FieldData.add_get_vector_fields_request | ||
.. automethod:: ansys.fluent.core.services.field_data.FieldData.get_fields |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ Solver | |
:hidden: | ||
|
||
settings | ||
tui | ||
tui | ||
fielddata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters