-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add mergeTime option for readforce postproc (#15)
* add mergeTime option for readforce postproc * add postProc readforce example * coding style (black + ...)
- Loading branch information
1 parent
5343552
commit 14b180c
Showing
15 changed files
with
726 additions
and
447 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
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 |
---|---|---|
|
@@ -55,3 +55,6 @@ | |
#Setting axis labels | ||
plt.xlabel('U (m/s)') | ||
plt.ylabel('y (m)') | ||
|
||
# add grid | ||
plt.grid() |
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,38 @@ | ||
""" | ||
Read and Plot a time series of OpenFoam postProcessing force | ||
============================================================ | ||
This example reads and plots a series of postProcessing force | ||
""" | ||
|
||
############################################################################### | ||
# Read the postProcessing files | ||
# ----------------------------- | ||
# | ||
# .. note:: In this example it reads and merges two postProcessing files | ||
# automatically (with the 'mergeTime' option) | ||
|
||
# import readforce function from fluidfoam package | ||
from fluidfoam.readpostpro import readforce | ||
|
||
sol = '../output_samples/ascii/' | ||
|
||
force = readforce(sol, time_name = 'mergeTime') | ||
|
||
############################################################################### | ||
# Now plots the pressure force | ||
# ---------------------------- | ||
# | ||
|
||
import matplotlib.pyplot as plt | ||
|
||
plt.figure() | ||
|
||
plt.plot(force[:, 0], force[:, 1]) | ||
|
||
# Setting axis labels | ||
plt.xlabel('t (s)') | ||
plt.ylabel('p (Pa)') | ||
|
||
# add grid | ||
plt.grid() |
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 |
---|---|---|
|
@@ -60,3 +60,6 @@ | |
# Setting axis labels | ||
plt.xlabel('t (s)') | ||
plt.ylabel('p (Pa)') | ||
|
||
# add grid | ||
plt.grid() |
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
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
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
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
Oops, something went wrong.