Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c6892be
tested the import_surface_field_and_integral
feilin-flexcompute Nov 3, 2025
810e9c5
update from frontend simulation.json
feilin-flexcompute Dec 16, 2025
f0ea8dd
remove bucket
feilin-flexcompute Dec 17, 2025
ec936df
Implementation for uploading geometry dependency
angranl-flex Dec 17, 2025
649e02a
Implementation for uploading surface mesh dependency
angranl-flex Dec 17, 2025
9aac754
Add project interface to fetch imported dependency resources
angranl-flex Dec 17, 2025
2598a73
Add validation to check if the dependency resource with the same name…
angranl-flex Dec 18, 2025
67f8bce
Fix Geometry and SurfaceMesh Draft interface to keep backward compati…
angranl-flex Dec 22, 2025
758f344
Fix dependency name check
angranl-flex Dec 22, 2025
b3cdda3
Update the workflow to run case with dependency resources
angranl-flex Dec 22, 2025
50cea3c
Fix formatting
angranl-flex Dec 22, 2025
fea24a7
Interface change for uploading and getting dependency resources from …
angranl-flex Dec 22, 2025
0261a45
Update the tag validation logic to also check current tag settings af…
angranl-flex Dec 22, 2025
8553290
Update create_draft function to support include/exclude geometry comp…
angranl-flex Dec 22, 2025
cbd6507
Fix bug after schema change
angranl-flex Dec 23, 2025
c2bd7f9
Merge pull request #1665 from flexcompute/angran/viewAndEdit
angranl-flex Dec 23, 2025
7854c5b
Merge remote-tracking branch 'origin/main' into feilin/main/test_impo…
benflexcompute Dec 23, 2025
69241a3
Fix the bug introduced after resolving conflicts
angranl-flex Dec 23, 2025
e2d8e05
Add if check to enable geometry edit feature if applicable
angranl-flex Dec 23, 2025
d2413ed
Add merge geometry entity info API
angranl-flex Dec 23, 2025
f5f4ec2
Merge branch 'main' into feilin/main/test_import_surf_v4
angranl-flex Dec 23, 2025
ebddc6d
add subcomponents
feilin-flexcompute Dec 24, 2025
3558b84
Fix empty bodies_face_edge_ids returned by entity merge
angranl-flex Dec 24, 2025
603719f
Fix error captured by unit test and formatter
angranl-flex Dec 24, 2025
d3c4783
Merge branch 'main' into feilin/main/test_import_surf_v4
benflexcompute Dec 24, 2025
3e15012
Merge remote-tracking branch 'origin/main' into feilin/main/test_impo…
feilin-flexcompute Dec 24, 2025
baf4035
Add validation for improper surface field usage for imported surface
angranl-flex Dec 25, 2025
4b847a9
make private_attribute_sub_components an optional field in ImportedSu…
angranl-flex Dec 25, 2025
9d05f3d
Add fallback logic to enable_dependency_resources
angranl-flex Dec 25, 2025
3fb784f
Fix legacy project integration test
angranl-flex Dec 25, 2025
7b4e36b
add context reset to avoid interference from other test
angranl-flex Dec 25, 2025
77e0109
Fix all existing unit test
angranl-flex Dec 25, 2025
48181fc
Merge remote-tracking branch 'origin/main' into feilin/main/test_impo…
angranl-flex Dec 25, 2025
3ab7ae3
[SCFD-7181] Allow empty edge tag and attribute names
angranl-flex Dec 25, 2025
7d5b690
[SCFD-7128] Preserve user's face name settings after entity merge
angranl-flex Dec 26, 2025
21a704f
Add unit test for merge_geometry_entity_info endpoint
angranl-flex Dec 27, 2025
3ea349f
Update imported surface example
angranl-flex Dec 27, 2025
e69c6f1
log info update
angranl-flex Dec 28, 2025
94d6fff
fix mirroring functionality
feilin-flexcompute Dec 29, 2025
41f204e
lint
feilin-flexcompute Dec 29, 2025
8b86242
Merge branch 'main' into feilin/main/test_import_surf_v4
feilin-flexcompute Dec 30, 2025
d1b8de6
Implement more robust fix for mirroring functionality
angranl-flex Dec 31, 2025
4251b14
use draft in the example
angranl-flex Dec 31, 2025
fe55883
Address comments 1
angranl-flex Dec 31, 2025
1dca412
Add helper function to get project dependency resources
angranl-flex Dec 31, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import flow360 as fl
from flow360.examples import ObliqueChannel

ObliqueChannel.get_files()

project = fl.Project.from_volume_mesh(ObliqueChannel.mesh_filename, name="Cartesian channel mesh")

volume_mesh = project.volume_mesh

normal_imported_surface = project.import_surface(
ObliqueChannel.extra["rectangle_normal"], name="normal"
)
oblique_imported_surface = project.import_surface(
ObliqueChannel.extra["rectangle_oblique"], name="oblique"
)
imported_surfaces = [normal_imported_surface, oblique_imported_surface]

with fl.create_draft(
new_run_from=volume_mesh,
imported_surfaces=imported_surfaces,
) as draft:
with fl.SI_unit_system:
op = fl.GenericReferenceCondition.from_mach(
mach=0.3,
)
massFlowRate = fl.UserVariable(
name="MassFluxProjected",
value=-1
* fl.solution.density
* fl.math.dot(fl.solution.velocity, fl.solution.node_unit_normal),
)
massFlowRateIntegral = fl.SurfaceIntegralOutput(
name="MassFluxIntegral",
output_fields=[massFlowRate],
surfaces=draft.surfaces["VOLUME/LEFT"],
)
params = fl.SimulationParams(
operating_condition=op,
models=[
fl.Fluid(
navier_stokes_solver=fl.NavierStokesSolver(absolute_tolerance=1e-10),
turbulence_model_solver=fl.NoneSolver(),
),
fl.Inflow(
entities=[draft.surfaces["VOLUME/LEFT"]],
total_temperature=op.thermal_state.temperature * 1.018,
velocity_direction=(1.0, 0.0, 0.0),
spec=fl.MassFlowRate(
value=op.velocity_magnitude * op.thermal_state.density * (0.2 * fl.u.m**2)
),
),
fl.Outflow(
entities=[draft.surfaces["VOLUME/RIGHT"]],
spec=fl.Pressure(op.thermal_state.pressure),
),
fl.SlipWall(
entities=[
draft.surfaces["VOLUME/FRONT"],
draft.surfaces["VOLUME/BACK"],
draft.surfaces["VOLUME/TOP"],
draft.surfaces["VOLUME/BOTTOM"],
]
),
],
time_stepping=fl.Steady(),
outputs=[
fl.VolumeOutput(
output_format="paraview",
output_fields=["primitiveVars"],
),
fl.SurfaceOutput(
output_fields=[
fl.solution.velocity,
fl.solution.Cp,
],
surfaces=[
draft.surfaces["VOLUME/FRONT"],
draft.imported_surfaces["normal"],
draft.imported_surfaces["oblique"],
],
),
fl.SurfaceIntegralOutput(
name="MassFlowRateImportedSurface",
output_fields=[massFlowRate],
surfaces=[
draft.imported_surfaces["normal"],
draft.imported_surfaces["oblique"],
],
),
],
)
project.run_case(params, "test_imported_surfaces_field_and_integral")
30 changes: 30 additions & 0 deletions flow360/cloud/flow360_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,36 @@ class NewVolumeMeshRequestV2(Flow360RequestsV2):
format: Literal["cgns", "aflr3"] = pd_v2.Field(description="data format")


class NewGeometryDependencyRequest(Flow360RequestsV2):
"""[Simulation V2] Import geometry dependency to a project's draft."""

name: str = pd_v2.Field(description="Geometry dependency name")
project_id: str = pd_v2.Field(alias="projectId")
files: List[GeometryFileMeta] = pd_v2.Field(description="list of files")
draft_id: str = pd_v2.Field(default="", alias="draftId")
tags: List[str] = pd_v2.Field(default=[], description="project tags")
length_unit: Literal["m", "mm", "cm", "inch", "ft"] = pd_v2.Field(
alias="lengthUnit", description="project length unit"
)
description: str = pd_v2.Field(default="", description="geometry dependency description")
icon: str = pd_v2.Field(default="", description="project description")


class NewSurfaceMeshDependencyRequest(Flow360RequestsV2):
"""[Simulation V2] Import surface mesh dependency to a project's draft."""

name: str = pd_v2.Field(description="Surface mesh dependency name")
project_id: str = pd_v2.Field(alias="projectId")
draft_id: str = pd_v2.Field(default="", alias="draftId")
tags: List[str] = pd_v2.Field(default=[], description="project tags")
file_name: str = pd_v2.Field(alias="fileName", description="Surface mesh file name")
length_unit: Literal["m", "mm", "cm", "inch", "ft"] = pd_v2.Field(
alias="lengthUnit", description="project length unit"
)
description: str = pd_v2.Field(default="", description="geometry dependency description")
icon: str = pd_v2.Field(default="", description="project description")


class _Resource(Flow360RequestsV2):
type: Literal["Case", "Project"]
id: str
Expand Down
Loading
Loading