Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,575 changes: 1,575 additions & 0 deletions examples/analyze_results.ipynb

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions input/empty_domain.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
general:
geometry_module: panels2d
output_dir: output/empty2d
mesh_only: false
structural_analysis: false
fluid_analysis: true
thermal_analysis: true
domain:
x_min: -20.0
x_max: 100.0
y_min: 0.0
y_max: 20.0
# y_min: -30.0
# y_max: 30.0
# z_min: 0.0
# z_max: 20.0
l_char: 1.25
pv_array:
stream_rows: 0
span_rows: 0
stream_spacing: 10.0
span_spacing: 30.0
panel_chord: 4.1
panel_span: 24.25
panel_thickness: 0.1
elevation: 2.1
tracker_angle: 0.0
span_fixation_pts: [13.2]
solver:
dt: 0.01
t_final: 20.0
solver1_ksp: gmres
solver2_ksp: gmres
solver3_ksp: gmres
solver5_ksp: gmres
solver1_pc: hypre
solver2_pc: hypre
solver3_pc: hypre
solver5_pc: hypre
save_text_interval: 0.02
save_xdmf_interval: 0.02
fluid:
time_varying_inflow_window: 0.0
velocity_profile_type: loglaw
u_ref: 8.0
rho: 1.0
nu: 1.8e-05
beta: 0.00333
alpha: 0.00225 #2.25e-05 # high Pe # 0.00225 # low Pe (no stability needed) #
turbulence_model: smagorinsky
bc_y_max: slip
bc_y_min: slip
bc_z_max: slip
bc_z_min: noslip
wind_direction: 270.0
T_ambient: 300.0
T_bottom: 320.0
# structure:
# dt : 0.01
# rho: 124.0
# poissons_ratio: 0.3
# elasticity_modulus: 4.0e+09
# body_force_x: 0.0
# body_force_y: 0.0
# body_force_z: 0.0
# bc_list: []
# motor_connection: true
# tube_connection: true
# beta_relaxation: 0.5
10 changes: 8 additions & 2 deletions pvade/IO/input_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ properties:
default: "panels3d"
type: "string"
description: "The name of the directory in pvade/geometry/ that contains a DomainCreation.py file for generating the CAD description, prescribing mesh refinement, etc."
enum:
- "panels2d"
- "panels3d"
- "heliostats3d"
- "flag2d"
- "cylinder3d"
input_mesh_dir:
default: null
type:
Expand Down Expand Up @@ -119,14 +125,14 @@ properties:
properties:
stream_rows:
default: 3
minimum: 1
minimum: 0
maximum: 10
type: "integer"
description: "The number of panel rows in the streamwise direction."
units: "unitless"
span_rows:
default: 1
minimum: 1
minimum: 0
maximum: 10
type: "integer"
description: "The number of panel rows in the spanwise direction."
Expand Down
4 changes: 2 additions & 2 deletions pvade/fluid/boundary_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ def build_velocity_boundary_conditions(domain, params, functionspace, current_ti
)

if domain.rank == 0:
print("inflow_function = ", inflow_function.x.array[:])
print("inflow_function = ", inflow_function.x.array[:10])

dofs = get_facet_dofs_by_gmsh_tag(domain, functionspace, "x_min")
bcu.append(dolfinx.fem.dirichletbc(inflow_function, dofs))
Expand Down Expand Up @@ -432,7 +432,7 @@ def __call__(self, x):

# only applying Tbottom to cells from x=0 to x=0.75*x_max to avoid jet at the outlet sfc due to pressure BCa at exit
heated_cells = dolfinx.mesh.locate_entities(
domain.fluid.msh, ndim, lambda x: x[0] < (0.375 * params.domain.x_max)
domain.fluid.msh, ndim, lambda x: x[0] < (0.75 * params.domain.x_max)
)
T_bottom_function = dolfinx.fem.Function(functionspace)

Expand Down
4 changes: 4 additions & 0 deletions pvade/geometry/MeshManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ def _get_domain_markers(self, params):
# Cell Markers
self.domain_markers["fluid"] = {"idx": 8, "entity": "cell", "gmsh_tags": []}
self.domain_markers["structure"] = {"idx": 9, "entity": "cell", "gmsh_tags": []}
print('*** structure added to domain_markers')
# print('self.structure = ', self.structure)

# Structure Facet Markers
if (
Expand Down Expand Up @@ -161,6 +163,7 @@ def build(self, params):
):
self.geometry.build_structure(params)
else:
# TODO: add special treatment for panels2d when structural_analysis == False
self.geometry.build_FSI(params)
# Build the domain markers for each surface and cell
if hasattr(self.geometry, "domain_markers"):
Expand Down Expand Up @@ -329,6 +332,7 @@ def _create_submeshes_from_parent(self, params):
submesh_list.append("fluid")
if params.general.structural_analysis == True:
submesh_list.append("structure")
print('*** submesh_list = ', submesh_list)

for sub_domain_name in submesh_list:
if self.rank == 0:
Expand Down
7 changes: 7 additions & 0 deletions pvade/structure/StructureMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,16 @@ def __init__(self, domain, params):
# find hmin in mesh
num_cells = domain.structure.msh.topology.index_map(self.ndim).size_local
h = dolfinx.cpp.mesh.h(domain.structure.msh, self.ndim, range(num_cells))
# print('h = ', h)
# print('len(h) = ', len(h))

# This value of hmin is local to the mesh portion owned by the process
hmin_local = np.amin(h)
# if len(h) > 0:
# hmin_local = [np.amin(h)]
# else:
# hmin_local = [5.0] # what value should this be?
# print('hmin_local = ', hmin_local)

# collect the minimum hmin from all processes
self.hmin = np.zeros(1)
Expand Down
2 changes: 1 addition & 1 deletion pvade_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def main(input_file=None):

print(f"| f_x (drag) = {fx:.4f}")
print(f"| f_y (lift) = {fy:.4f}")
else:
elif params.pv_array.num_panels > 1: #excludes case when num_panels == 0
# still print info, but just for first row
fx = flow.integrated_force_x[0]
fy = flow.integrated_force_y[0]
Expand Down
Loading