From 98167e53a62407532c67a24874496fc84e5d4590 Mon Sep 17 00:00:00 2001 From: Feilin <52168719+feilin-flexcompute@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:25:47 -0400 Subject: [PATCH 1/3] [squash] generated examples for frontend Format Added example and ready for cleanning up cleaned up added minimal e2e example for simulation fixed init data service fixed init data service fix insolver translation service pushed all schema models removed modelingConstants for time being Fix unit tests and format Fix PyLint Added type and name for models and refinements reverted mesh units in init request --- .gitignore | 2 +- examples/simulation_e2e.py | 115 ++ flow360/component/flow360_params/updater.py | 1 + flow360/component/simulation/exposed_units.py | 6 + .../simulation/framework/cached_model_base.py | 59 - .../framework/multi_constructor_model_base.py | 181 +++ .../simulation/meshing_param/edge_params.py | 2 +- .../simulation/meshing_param/face_params.py | 4 +- .../simulation/meshing_param/params.py | 20 +- .../simulation/models/volume_models.py | 5 +- .../simulation/operating_condition.py | 50 +- flow360/component/simulation/services.py | 65 +- .../component/simulation/simulation_params.py | 2 +- .../translator/solver_translator.py | 62 +- .../component/simulation/translator/utils.py | 18 +- flow360/component/types.py | 11 +- flow360/component/utils.py | 11 +- flow360/utils.py | 30 + flow360/version.py | 2 +- pyproject.toml | 2 +- tests/data/cases/params_units.json | 2 +- tests/ref/case_params/params.json | 4 +- tests/ref/case_params/params.yaml | 4 +- tests/ref/case_params/params_units.json | 4 +- .../case_params/params_units_converted.json | 4 +- .../simulation/framework/test_cached_model.py | 82 -- .../framework/test_multi_constructor_model.py | 64 + tests/simulation/service/test_services_v2.py | 105 +- .../service/test_translator_service.py | 76 +- tests/test_flow360.py | 2 +- tests/test_utils.py | 2 + .../UDD/UserDefinedDynamic-release-24.6.json | 53 + ...chema-release-24.6-UserDefinedDynamic.json | 261 ++++ .../geometry/example-1-release-24.6.json | 22 + .../geometry/json-schema-release-24.6.json | 123 ++ .../meshing/example-1-release-24.6.json | 37 + .../meshing/json-schema-release-24.6.json | 1074 +++++++++++++++++ .../data_v2/models/fluid-release-24.6.json | 91 ++ .../models/freestream-release-24.6.json | 17 + .../inflow-MassFlowRate-release-24.6.json | 32 + .../inflow-TotalPressure-release-24.6.json | 32 + .../json-schema-release-24.6-fluid.json | 938 ++++++++++++++ .../json-schema-release-24.6-freestream.json | 801 ++++++++++++ .../json-schema-release-24.6-inflow.json | 853 +++++++++++++ .../json-schema-release-24.6-outflow.json | 154 +++ .../json-schema-release-24.6-periodic.json | 158 +++ ...on-schema-release-24.6-porouse_medium.json | 259 ++++ ...release-24.6-rotating_reference_frame.json | 261 ++++ .../json-schema-release-24.6-slip_wall.json | 65 + .../json-schema-release-24.6-solid.json | 366 ++++++ ...on-schema-release-24.6-symmetry_plane.json | 65 + .../models/json-schema-release-24.6-wall.json | 213 ++++ .../models/outflow-Mach-release-24.6.json | 13 + .../outflow-MassFlowRate-release-24.6.json | 16 + .../models/outflow-Pressure-release-24.6.json | 16 + .../periodic-Rotational-release-24.6.json | 25 + .../periodic-Translational-release-24.6.json | 20 + .../models/porouse_medium-release-24.6.json | 57 + ...rotating_reference_frame-release-24.6.json | 43 + .../models/slip_wall-release-24.6.json | 10 + .../data_v2/models/solid-release-24.6.json | 44 + .../models/symmetry_plane-release-24.6.json | 10 + .../data_v2/models/wall-release-24.6.json | 26 + .../example-1-release-24.6.json | 22 + .../example-2-release-24.6.json | 21 + .../example-3-release-24.6.json | 30 + .../example-4-release-24.6.json | 33 + .../json-schema-release-24.6.json | 648 ++++++++++ .../AeroAcousticOutput-release-24.6.json | 23 + .../IsosurfaceOutput-release-24.6.json | 26 + .../outputs/ProbeOutput-release-24.6.json | 57 + .../outputs/SliceOutput-release-24.6.json | 47 + .../SurfaceIntegralOutput-release-24.6.json | 38 + .../outputs/SurfaceOutput-release-24.6.json | 23 + ...TimeAverageSurfaceOutput-release-24.6.json | 24 + .../TimeAverageVolumeOutput-release-24.6.json | 12 + .../outputs/VolumeOutput-release-24.6.json | 11 + ...chema-release-24.6-AeroAcousticOutput.json | 60 + ...-schema-release-24.6-IsosurfaceOutput.json | 192 +++ .../json-schema-release-24.6-ProbeOutput.json | 150 +++ .../json-schema-release-24.6-SliceOutput.json | 174 +++ ...ma-release-24.6-SurfaceIntegralOutput.json | 163 +++ ...son-schema-release-24.6-SurfaceOutput.json | 156 +++ ...release-24.6-TimeAverageSurfaceOutput.json | 156 +++ ...-release-24.6-TimeAverageVolumeOutput.json | 112 ++ ...json-schema-release-24.6-VolumeOutput.json | 94 ++ .../example-1-release-24.6.json | 22 + .../json-schema-release-24.6.json | 123 ++ .../example-1-release-24.6.json | 584 +++++++++ .../example-2-release-24.6.json | 241 ++++ .../json-schema-release-24.6-steady.json | 172 +++ .../json-schema-release-24.6-unsteady.json | 199 +++ .../time_stepping/steady-release-24.6.json | 11 + .../time_stepping/unsteady-release-24.6.json | 17 + tools/integrations/schema_generation_v2.py | 650 ++++++++++ 95 files changed, 11081 insertions(+), 362 deletions(-) create mode 100644 examples/simulation_e2e.py delete mode 100644 flow360/component/simulation/framework/cached_model_base.py create mode 100644 flow360/component/simulation/framework/multi_constructor_model_base.py delete mode 100644 tests/simulation/framework/test_cached_model.py create mode 100644 tests/simulation/framework/test_multi_constructor_model.py create mode 100644 tools/integrations/data_v2/UDD/UserDefinedDynamic-release-24.6.json create mode 100644 tools/integrations/data_v2/UDD/json-schema-release-24.6-UserDefinedDynamic.json create mode 100644 tools/integrations/data_v2/geometry/example-1-release-24.6.json create mode 100644 tools/integrations/data_v2/geometry/json-schema-release-24.6.json create mode 100644 tools/integrations/data_v2/meshing/example-1-release-24.6.json create mode 100644 tools/integrations/data_v2/meshing/json-schema-release-24.6.json create mode 100644 tools/integrations/data_v2/models/fluid-release-24.6.json create mode 100644 tools/integrations/data_v2/models/freestream-release-24.6.json create mode 100644 tools/integrations/data_v2/models/inflow-MassFlowRate-release-24.6.json create mode 100644 tools/integrations/data_v2/models/inflow-TotalPressure-release-24.6.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-fluid.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-freestream.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-inflow.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-outflow.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-periodic.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-porouse_medium.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-rotating_reference_frame.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-slip_wall.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-solid.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-symmetry_plane.json create mode 100644 tools/integrations/data_v2/models/json-schema-release-24.6-wall.json create mode 100644 tools/integrations/data_v2/models/outflow-Mach-release-24.6.json create mode 100644 tools/integrations/data_v2/models/outflow-MassFlowRate-release-24.6.json create mode 100644 tools/integrations/data_v2/models/outflow-Pressure-release-24.6.json create mode 100644 tools/integrations/data_v2/models/periodic-Rotational-release-24.6.json create mode 100644 tools/integrations/data_v2/models/periodic-Translational-release-24.6.json create mode 100644 tools/integrations/data_v2/models/porouse_medium-release-24.6.json create mode 100644 tools/integrations/data_v2/models/rotating_reference_frame-release-24.6.json create mode 100644 tools/integrations/data_v2/models/slip_wall-release-24.6.json create mode 100644 tools/integrations/data_v2/models/solid-release-24.6.json create mode 100644 tools/integrations/data_v2/models/symmetry_plane-release-24.6.json create mode 100644 tools/integrations/data_v2/models/wall-release-24.6.json create mode 100644 tools/integrations/data_v2/operating_condition/example-1-release-24.6.json create mode 100644 tools/integrations/data_v2/operating_condition/example-2-release-24.6.json create mode 100644 tools/integrations/data_v2/operating_condition/example-3-release-24.6.json create mode 100644 tools/integrations/data_v2/operating_condition/example-4-release-24.6.json create mode 100644 tools/integrations/data_v2/operating_condition/json-schema-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/AeroAcousticOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/IsosurfaceOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/ProbeOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/SliceOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/SurfaceIntegralOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/SurfaceOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/TimeAverageSurfaceOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/TimeAverageVolumeOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/VolumeOutput-release-24.6.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-AeroAcousticOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-IsosurfaceOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-ProbeOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-SliceOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceIntegralOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageSurfaceOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageVolumeOutput.json create mode 100644 tools/integrations/data_v2/outputs/json-schema-release-24.6-VolumeOutput.json create mode 100644 tools/integrations/data_v2/reference_geometry/example-1-release-24.6.json create mode 100644 tools/integrations/data_v2/reference_geometry/json-schema-release-24.6.json create mode 100644 tools/integrations/data_v2/simulation_params/example-1-release-24.6.json create mode 100644 tools/integrations/data_v2/simulation_params/example-2-release-24.6.json create mode 100644 tools/integrations/data_v2/time_stepping/json-schema-release-24.6-steady.json create mode 100644 tools/integrations/data_v2/time_stepping/json-schema-release-24.6-unsteady.json create mode 100644 tools/integrations/data_v2/time_stepping/steady-release-24.6.json create mode 100644 tools/integrations/data_v2/time_stepping/unsteady-release-24.6.json create mode 100644 tools/integrations/schema_generation_v2.py diff --git a/.gitignore b/.gitignore index 8f80235f1..5b98d147b 100644 --- a/.gitignore +++ b/.gitignore @@ -328,4 +328,4 @@ tmp/ /.vscode # test residual -flow360/examples/cylinder/flow360mesh.json \ No newline at end of file +flow360/examples/cylinder2D/flow360mesh.json \ No newline at end of file diff --git a/examples/simulation_e2e.py b/examples/simulation_e2e.py new file mode 100644 index 000000000..424e61f2e --- /dev/null +++ b/examples/simulation_e2e.py @@ -0,0 +1,115 @@ +import os + +import flow360 as fl +from flow360.component.simulation.meshing_param.face_params import ( + BoundaryLayer, + SurfaceRefinement, +) +from flow360.component.simulation.models.surface_models import Freestream, Wall +from flow360.component.simulation.models.volume_models import Fluid +from flow360.component.simulation.operating_condition import AerospaceCondition +from flow360.component.simulation.primitives import ReferenceGeometry, Surface +from flow360.component.simulation.services import ( + simulation_to_case_json, + simulation_to_surface_meshing_json, + simulation_to_volume_meshing_json, +) +from flow360.component.simulation.simulation_params import ( + MeshingParams, + SimulationParams, +) +from flow360.component.simulation.time_stepping.time_stepping import Steady +from flow360.component.simulation.unit_system import SI_unit_system, u + +fl.UserConfig.set_profile("auto_test_1") +fl.Env.dev.active() + +from flow360.component.geometry import Geometry +from flow360.examples import Airplane + +SOLVER_VERSION = "workbench-24.6.0" + + +with SI_unit_system: + meshing = MeshingParams( + surface_layer_growth_rate=1.5, + refinements=[ + BoundaryLayer(first_layer_thickness=0.001), + SurfaceRefinement( + entities=[Surface(name="wing")], + max_edge_length=15 * u.cm, + curvature_resolution_angle=10 * u.deg, + ), + ], + ) + param = SimulationParams( + meshing=meshing, + reference_geometry=ReferenceGeometry( + moment_center=(1, 2, 3), moment_length=1.0 * u.m, area=1.0 * u.cm**2 + ), + operating_condition=AerospaceCondition(velocity_magnitude=100), + models=[ + Fluid(), + Wall( + entities=[ + Surface(name="fluid/rightWing"), + Surface(name="fluid/leftWing"), + Surface(name="fluid/fuselage"), + ], + ), + Freestream(entities=[Surface(name="fluid/farfield")]), + ], + time_stepping=Steady(max_steps=700), + ) + +params_as_dict = param.model_dump() +surface_json, hash = simulation_to_surface_meshing_json( + params_as_dict, "SI", {"value": 100.0, "units": "cm"} +) +print(surface_json) +volume_json, hash = simulation_to_volume_meshing_json( + params_as_dict, "SI", {"value": 100.0, "units": "cm"} +) +print(volume_json) +case_json, hash = simulation_to_case_json(params_as_dict, "SI", {"value": 100.0, "units": "cm"}) +print(case_json) + + +prefix = "testing-workbench-integration-airplane-csm" + +# geometry +geometry_draft = Geometry.from_file( + Airplane.geometry, name=f"{prefix}-geometry", solver_version=SOLVER_VERSION +) +geometry = geometry_draft.submit() +print(geometry) + +# surface mesh +params = fl.SurfaceMeshingParams(**surface_json) + +surface_mesh_draft = fl.SurfaceMesh.create( + geometry_id=geometry.id, + params=params, + name=f"{prefix}-surface-mesh", + solver_version=SOLVER_VERSION, +) +surface_mesh = surface_mesh_draft.submit() + +print(surface_mesh) + +# volume mesh +params = fl.VolumeMeshingParams(**volume_json) + +volume_mesh_draft = fl.VolumeMesh.create( + surface_mesh_id=surface_mesh.id, + name=f"{prefix}-volume-mesh", + params=params, + solver_version=SOLVER_VERSION, +) +volume_mesh = volume_mesh_draft.submit() +print(volume_mesh) + +# case +params = fl.Flow360Params(**case_json, legacy_fallback=True) +case_draft = volume_mesh.create_case(f"{prefix}-case", params, solver_version=SOLVER_VERSION) +case = case_draft.submit() diff --git a/flow360/component/flow360_params/updater.py b/flow360/component/flow360_params/updater.py index d73a47818..b84aa200d 100644 --- a/flow360/component/flow360_params/updater.py +++ b/flow360/component/flow360_params/updater.py @@ -18,6 +18,7 @@ def _no_update(params_as_dict): ("23.3.0", "23.3.*", _no_update), ("23.3.*", "24.2.*", _no_update), ("24.2.*", "24.2.*", _no_update), + ("24.2.*", "24.3.*", _no_update), # we should not allow to submit Flow360Params to version 24.3 ] diff --git a/flow360/component/simulation/exposed_units.py b/flow360/component/simulation/exposed_units.py index 463cefa67..71d74796d 100644 --- a/flow360/component/simulation/exposed_units.py +++ b/flow360/component/simulation/exposed_units.py @@ -26,4 +26,10 @@ "thermal_conductivity": [], "inverse_area": [], "inverse_length": [], + "angle": [], + "specific_energy": [], + "frequency": [], + "mass_flow_rate": [], + "power": [], + "moment": [], } diff --git a/flow360/component/simulation/framework/cached_model_base.py b/flow360/component/simulation/framework/cached_model_base.py deleted file mode 100644 index dfc05a3be..000000000 --- a/flow360/component/simulation/framework/cached_model_base.py +++ /dev/null @@ -1,59 +0,0 @@ -""" Base class for cached models. """ - -import abc -import inspect -from functools import wraps -from typing import Any, Callable, Dict - -import pydantic as pd - -from flow360.component.simulation.framework.base_model import Flow360BaseModel - - -# pylint: disable=missing-function-docstring -class CachedModelBase(Flow360BaseModel, metaclass=abc.ABCMeta): - """Base class for cached models.""" - - @classmethod - def model_constructor(cls, func: Callable) -> Callable: - @classmethod - @wraps(func) - def wrapper(cls, *args, **kwargs): - sig = inspect.signature(func) - result = func(cls, *args, **kwargs) - defaults = { - k: v.default - for k, v in sig.parameters.items() - if v.default is not inspect.Parameter.empty - } - # pylint: disable=protected-access - result._cached = result.__annotations__["_cached"]( - **{**result._cached.model_dump(), **defaults, **kwargs} - ) - # pylint: disable=protected-access - result._cached.constructor = func.__name__ - return result - - return wrapper - - def __init__(self, **data): - cached = data.pop("_cached", None) - super().__init__(**data) - if cached: - try: - self._cached = self.__annotations__["_cached"].model_validate(cached) - except pd.ValidationError: - pass - else: - defaults = {name: field.default for name, field in self.model_fields.items()} - self._cached = self.__annotations__["_cached"]( - **{**defaults, **data}, constructor="default" - ) - - @pd.model_serializer(mode="wrap") - def serialize_model(self, handler) -> Dict[str, Any]: - serialize_self = handler(self) - serialize_self["_cached"] = ( - self._cached.model_dump(exclude_none=True) if self._cached else None - ) - return serialize_self diff --git a/flow360/component/simulation/framework/multi_constructor_model_base.py b/flow360/component/simulation/framework/multi_constructor_model_base.py new file mode 100644 index 000000000..e052b0974 --- /dev/null +++ b/flow360/component/simulation/framework/multi_constructor_model_base.py @@ -0,0 +1,181 @@ +"""MultiConstructorModelBase class for Pydantic models with multiple constructors.""" + +import abc +import inspect +from contextlib import contextmanager +from functools import wraps +from typing import Any, Callable, Literal, Optional + +import pydantic as pd + +from flow360.component.simulation.framework.base_model import Flow360BaseModel + +# requirements for data models with custom constructors: +# 1. data model can be saved to JSON and read back to pydantic model without problems +# 2. data model can return data provided to custom constructor +# 3. data model can be created from JSON that contains only custom constructor inputs - incomplete JSON +# 4. incomplete JSON is not in a conflict with complete JSON (from point 1), such that there is no need for 2 parsers + + +@contextmanager +def _model_attribute_unlock(model, attr: str): + try: + # validate_assignment is set to False to allow for the attribute to be modified + # Otherwise, the attribute will STILL be frozen and cannot be modified + model.model_config["validate_assignment"] = False + model.model_fields[attr].frozen = False + yield + finally: + model.model_config["validate_assignment"] = True + model.model_fields[attr].frozen = True + + +class _MultiConstructorModelBase(Flow360BaseModel, metaclass=abc.ABCMeta): + + type_name: Literal["_MultiConstructorModelBase"] = pd.Field( + "_MultiConstructorModelBase", frozen=True + ) + private_attribute_constructor: str = pd.Field("default", frozen=True) + private_attribute_input_cache: Optional[Any] = pd.Field(None, frozen=True) + + @classmethod + def model_constructor(cls, func: Callable) -> Callable: + """ + [AI-Generated] Decorator for model constructor functions. + + This method wraps a constructor function to manage default argument values and cache the inputs. + + Args: + func (Callable): The constructor function to wrap. + + Returns: + Callable: The wrapped constructor function. + """ + + @classmethod + @wraps(func) + def wrapper(cls, **kwargs): + obj = func(cls, **kwargs) + sig = inspect.signature(func) + function_arg_defaults = { + k: v.default + for k, v in sig.parameters.items() + if v.default is not inspect.Parameter.empty + } + with _model_attribute_unlock(obj, "private_attribute_input_cache"): + obj.private_attribute_input_cache = obj.private_attribute_input_cache.__class__( + # Note: obj.private_attribute_input_cache should not be included here + # Note: Because it carries over the previous cached inputs. Whatever the user choose not to specify + # Note: should be using default values rather than the previous cached inputs. + **{ + **function_arg_defaults, # Defaults as the base (needed when load in UI) + **kwargs, # User specified inputs (overwrites defaults) + } + ) + with _model_attribute_unlock(obj, "private_attribute_constructor"): + obj.private_attribute_constructor = func.__name__ + return obj + + return wrapper + + +##:: Utility functions for multi-constructor models + + +def get_class_method(cls, method_name): + """ + Retrieve a class method by its name. + + Parameters + ---------- + cls : type + The class containing the method. + method_name : str + The name of the method as a string. + + Returns + ------- + method : callable + The class method corresponding to the method name. + + Raises + ------ + AttributeError + If the method_name is not a callable method of the class. + + Examples + -------- + >>> class MyClass: + ... @classmethod + ... def my_class_method(cls): + ... return "Hello from class method!" + ... + >>> method = get_class_method(MyClass, "my_class_method") + >>> method() + 'Hello from class method!' + """ + method = getattr(cls, method_name) + if not callable(method): + raise AttributeError(f"{method_name} is not a callable method of {cls.__name__}") + return method + + +def get_class_by_name(class_name, global_vars): + """ + Retrieve a class by its name from the global scope. + + Parameters + ---------- + class_name : str + The name of the class as a string. + + Returns + ------- + cls : type + The class corresponding to the class name. + + Raises + ------ + NameError + If the class_name is not found in the global scope. + TypeError + If the found object is not a class. + + Examples + -------- + >>> class MyClass: + ... pass + ... + >>> cls = get_class_by_name("MyClass") + >>> cls + + """ + cls = global_vars.get(class_name) + if cls is None: + raise NameError(f"Class '{class_name}' not found in the global scope.") + if not isinstance(cls, type): + raise TypeError(f"'{class_name}' found in global scope, but it is not a class.") + return cls + + +def model_custom_constructor_parser(model_as_dict, global_vars): + """Parse the dictionary, construct the object and return obj dict.""" + constructor_name = model_as_dict.get("private_attribute_constructor", None) + if constructor_name is not None: + model_cls = get_class_by_name(model_as_dict.get("type_name"), global_vars) + input_kwargs = model_as_dict.get("private_attribute_input_cache") + if constructor_name != "default": + constructor = get_class_method(model_cls, constructor_name) + return constructor(**input_kwargs).model_dump(exclude_none=True) + return model_as_dict + + +def parse_model_dict(model_as_dict, global_vars) -> dict: + """Recursively parses the model dictionary and attempts to construct the multi-constructor object.""" + if isinstance(model_as_dict, dict): + for key, value in model_as_dict.items(): + model_as_dict[key] = parse_model_dict(value, global_vars) + model_as_dict = model_custom_constructor_parser(model_as_dict, global_vars) + elif isinstance(model_as_dict, list): + model_as_dict = [parse_model_dict(item, global_vars) for item in model_as_dict] + return model_as_dict diff --git a/flow360/component/simulation/meshing_param/edge_params.py b/flow360/component/simulation/meshing_param/edge_params.py index 03f78c489..eb2dd3562 100644 --- a/flow360/component/simulation/meshing_param/edge_params.py +++ b/flow360/component/simulation/meshing_param/edge_params.py @@ -41,7 +41,7 @@ class ProjectAnisoSpacing(Flow360BaseModel): class _BaseEdgeRefinement(Flow360BaseModel): entities: EntityList[Edge] = pd.Field(alias="edges") growth_rate: Optional[float] = pd.Field( - None, description="Growth rate for volume prism layers.", ge=1 + None, description="Growth rate for surface mesh layers grown from edges.", ge=1 ) # Note: Per edge specification is actually not supported. This is a global setting in mesher. diff --git a/flow360/component/simulation/meshing_param/face_params.py b/flow360/component/simulation/meshing_param/face_params.py index df49eeaa4..4571b2e33 100644 --- a/flow360/component/simulation/meshing_param/face_params.py +++ b/flow360/component/simulation/meshing_param/face_params.py @@ -54,7 +54,7 @@ class BoundaryLayer(Flow360BaseModel): name: Optional[str] = pd.Field(None) refinement_type: Literal["BoundaryLayer"] = pd.Field("BoundaryLayer", frozen=True) - type: Literal["aniso", "projectAnisoSpacing", "none"] = pd.Field() + type: Literal["aniso", "projectAnisoSpacing", "none"] = pd.Field(default="aniso") entities: Optional[EntityList[Surface]] = pd.Field(None, alias="faces") # pylint: disable=no-member first_layer_thickness: LengthType.Positive = pd.Field( @@ -62,7 +62,7 @@ class BoundaryLayer(Flow360BaseModel): ) # pylint: disable=no-member growth_rate: pd.PositiveFloat = pd.Field( - description="Growth rate for volume prism layers.", ge=1 + default=1.2, description="Growth rate for volume prism layers.", ge=1 ) # Note: Per face specification is actually not supported. This is a global setting in mesher. diff --git a/flow360/component/simulation/meshing_param/params.py b/flow360/component/simulation/meshing_param/params.py index 0bd700267..6c0f315e0 100644 --- a/flow360/component/simulation/meshing_param/params.py +++ b/flow360/component/simulation/meshing_param/params.py @@ -48,12 +48,12 @@ class MeshingParams(Flow360BaseModel): # Volume **defaults**: farfield: Optional[Literal["auto", "quasi-3d", "user-defined"]] = pd.Field( - None, description="Type of farfield generation." + default="auto", description="Type of farfield generation." ) refinement_factor: Optional[pd.PositiveFloat] = pd.Field( - None, - description="""If refinementFactor=r is provided all spacings in refinement regions and first layer - thickness will be adjusted to generate r-times finer mesh.""", + default=1, + description="""If refinementFactor=r is provided all spacings in refinementregions + and first layer thickness will be adjusted to generate r-times finer mesh.""", ) gap_treatment_strength: Optional[float] = pd.Field( None, @@ -66,14 +66,14 @@ class MeshingParams(Flow360BaseModel): ) surface_layer_growth_rate: Optional[float] = pd.Field( - None, ge=1, description="Global growth rate of the anisotropic layers grown from the edges." + 1.2, ge=1, description="Global growth rate of the anisotropic layers grown from the edges." ) # Conditionally optional - refinements: Optional[List[AllowedRefinementTypes]] = pd.Field( - None, + refinements: List[AllowedRefinementTypes] = pd.Field( + default=[], description="Additional fine-tunning for refinements.", - ) # Note: May need discriminator for performance?? + ) # Will add more to the Union - volume_zones: Optional[List[Union[RotationCylinder]]] = pd.Field( - None, description="Creation of new volume zones." + volume_zones: List[RotationCylinder] = pd.Field( + default=[], description="Creation of new volume zones." ) diff --git a/flow360/component/simulation/models/volume_models.py b/flow360/component/simulation/models/volume_models.py index 4ead6186d..8f777a9ef 100644 --- a/flow360/component/simulation/models/volume_models.py +++ b/flow360/component/simulation/models/volume_models.py @@ -44,7 +44,7 @@ class ExpressionInitialConditionBase(Flow360BaseModel): """:class:`ExpressionInitialCondition` class""" type: Literal["expression"] = pd.Field("expression", frozen=True) - constants: Optional[Dict[str, str]] = pd.Field() + constants: Optional[Dict[str, str]] = pd.Field(None) # pylint: disable=missing-class-docstring @@ -253,8 +253,7 @@ class PorousMedium(Flow360BaseModel): darcy_coefficient: InverseAreaType.Point = pd.Field() forchheimer_coefficient: InverseLengthType.Point = pd.Field() volumetric_heat_source: Optional[Union[HeatSourceType, pd.StrictStr]] = pd.Field(None) - # needed for GenericVolume, need to check for conflict for Box - axes: Optional[List[Axis]] = pd.Field(None) + # Note: Axes will always come from the entity VolumeModelTypes = Union[ diff --git a/flow360/component/simulation/operating_condition.py b/flow360/component/simulation/operating_condition.py index 723326be7..ae50b0aa6 100644 --- a/flow360/component/simulation/operating_condition.py +++ b/flow360/component/simulation/operating_condition.py @@ -1,13 +1,17 @@ """Operating conditions for the simulation framework.""" -from typing import Optional, Tuple, Union +from __future__ import annotations + +from typing import Literal, Optional, Tuple, Union import pydantic as pd from typing_extensions import Self import flow360.component.simulation.units as u from flow360.component.simulation.framework.base_model import Flow360BaseModel -from flow360.component.simulation.framework.cached_model_base import CachedModelBase +from flow360.component.simulation.framework.multi_constructor_model_base import ( + _MultiConstructorModelBase, +) from flow360.component.simulation.models.material import Air, FluidMaterialTypes from flow360.component.simulation.unit_system import ( AngleType, @@ -21,14 +25,13 @@ from flow360.log import log # pylint: disable=no-member -VelocityVectorType = Union[VelocityType.Vector, Tuple[pd.StrictStr, pd.StrictStr, pd.StrictStr]] +VelocityVectorType = Union[Tuple[pd.StrictStr, pd.StrictStr, pd.StrictStr], VelocityType.Vector] class ThermalStateCache(Flow360BaseModel): """[INTERNAL] Cache for thermal state inputs""" # pylint: disable=no-member - constructor: Optional[str] = None altitude: Optional[LengthType.Positive] = None temperature_offset: Optional[TemperatureType] = None temperature: Optional[TemperatureType.Positive] = None @@ -36,7 +39,7 @@ class ThermalStateCache(Flow360BaseModel): material: Optional[FluidMaterialTypes] = None -class ThermalState(CachedModelBase): +class ThermalState(_MultiConstructorModelBase): """ Represents the thermal state of a fluid with specific properties. @@ -55,16 +58,19 @@ class ThermalState(CachedModelBase): # pylint: disable=fixme # TODO: romove frozen and throw warning if temperature/density is modified after construction from atmospheric model + type_name: Literal["ThermalState"] = pd.Field("ThermalState", frozen=True) temperature: TemperatureType.Positive = pd.Field(288.15 * u.K, frozen=True) density: DensityType.Positive = pd.Field(1.225 * u.kg / u.m**3, frozen=True) material: FluidMaterialTypes = pd.Field(Air(), frozen=True) - _cached: ThermalStateCache = ThermalStateCache() + private_attribute_input_cache: ThermalStateCache = ThermalStateCache() # pylint: disable=no-self-argument, not-callable, unused-argument - @CachedModelBase.model_constructor + @_MultiConstructorModelBase.model_constructor @pd.validate_call def from_standard_atmosphere( - cls, altitude: LengthType.Positive = 0 * u.m, temperature_offset: TemperatureType = 0 * u.K + cls, + altitude: LengthType.Positive = 0 * u.m, + temperature_offset: TemperatureType = 0 * u.K, ): """Constructs a thermal state from the standard atmosphere model.""" # pylint: disable=fixme @@ -72,11 +78,7 @@ def from_standard_atmosphere( density = 1.225 * u.kg / u.m**3 temperature = 288.15 * u.K - state = cls( - density=density, - temperature=temperature, - material=Air(), - ) + state = cls(density=density, temperature=temperature, material=Air()) return state @@ -127,7 +129,6 @@ def mu_ref(self, mesh_unit: LengthType.Positive) -> pd.PositiveFloat: class GenericReferenceConditionCache(Flow360BaseModel): """[INTERNAL] Cache for GenericReferenceCondition inputs""" - constructor: Optional[str] = None velocity_magnitude: Optional[VelocityType.Positive] = None thermal_state: Optional[ThermalState] = None mach: Optional[pd.PositiveFloat] = None @@ -136,7 +137,6 @@ class GenericReferenceConditionCache(Flow360BaseModel): class AerospaceConditionCache(Flow360BaseModel): """[INTERNAL] Cache for AerospaceCondition inputs""" - constructor: Optional[str] = None alpha: Optional[AngleType] = None beta: Optional[AngleType] = None reference_velocity_magnitude: Optional[VelocityType.Positive] = None @@ -146,17 +146,20 @@ class AerospaceConditionCache(Flow360BaseModel): reference_mach: Optional[pd.PositiveFloat] = None -class GenericReferenceCondition(CachedModelBase): +class GenericReferenceCondition(_MultiConstructorModelBase): """ Operating condition defines the physical (non-geometrical) reference values for the problem. """ + type_name: Literal["GenericReferenceCondition"] = pd.Field( + "GenericReferenceCondition", frozen=True + ) velocity_magnitude: VelocityType.Positive thermal_state: ThermalState = ThermalState() - _cached: GenericReferenceConditionCache = GenericReferenceConditionCache() + private_attribute_input_cache: GenericReferenceConditionCache = GenericReferenceConditionCache() # pylint: disable=no-self-argument, not-callable - @CachedModelBase.model_constructor + @_MultiConstructorModelBase.model_constructor @pd.validate_call def from_mach( cls, @@ -173,20 +176,21 @@ def mach(self) -> pd.PositiveFloat: return self.velocity_magnitude / self.thermal_state.speed_of_sound -class AerospaceCondition(CachedModelBase): +class AerospaceCondition(_MultiConstructorModelBase): """A specialized GenericReferenceCondition for aerospace applications.""" # pylint: disable=fixme # TODO: valildate reference_velocity_magnitude defined if velocity_magnitude=0 + type_name: Literal["AerospaceCondition"] = pd.Field("AerospaceCondition", frozen=True) alpha: AngleType = 0 * u.deg beta: AngleType = 0 * u.deg velocity_magnitude: VelocityType.NonNegative thermal_state: ThermalState = pd.Field(ThermalState(), alias="atmosphere") reference_velocity_magnitude: Optional[VelocityType.Positive] = None - _cached: AerospaceConditionCache = AerospaceConditionCache() + private_attribute_input_cache: AerospaceConditionCache = AerospaceConditionCache() # pylint: disable=too-many-arguments, no-self-argument, not-callable - @CachedModelBase.model_constructor + @_MultiConstructorModelBase.model_constructor @pd.validate_call def from_mach( cls, @@ -223,8 +227,8 @@ def check_valid_reference_velocity(self) -> Self: # Note: Decided to move `velocity==0 ref_velocity is not None` check to dedicated validator because user can # Note: still construct by just calling AerospaceCondition() - # # pylint: disable=no-self-argument, not-callable - # @CachedModelBase.model_constructor + # pylint: disable=no-self-argument, not-callable + # @_MultiConstructorModelBase.model_constructor # @pd.validate_call # def from_stationary( # cls, diff --git a/flow360/component/simulation/services.py b/flow360/component/simulation/services.py index 5bc589a94..d5145e65d 100644 --- a/flow360/component/simulation/services.py +++ b/flow360/component/simulation/services.py @@ -3,7 +3,11 @@ # pylint: disable=duplicate-code import pydantic as pd -from flow360.component.simulation.simulation_params import SimulationParams +from flow360.component.simulation.models.volume_models import Fluid +from flow360.component.simulation.simulation_params import ( + ReferenceGeometry, + SimulationParams, +) from flow360.component.simulation.translator.solver_translator import get_solver_json from flow360.component.simulation.translator.surface_meshing_translator import ( get_surface_meshing_json, @@ -19,7 +23,6 @@ imperial_unit_system, unit_system_manager, ) -from flow360.log import log unit_system_map = { "SI": SI_unit_system, @@ -64,6 +67,41 @@ def init_unit_system(unit_system_name) -> UnitSystem: return unit_system +def get_default_params(unit_system_name, length_unit) -> SimulationParams: + """ + Returns default parameters in a given unit system. The defaults are not correct SimulationParams object as they may + contain empty required values. When generating default case settings: + - Use Model() if all fields has defaults or there are no required fields + - Use Model.construct() to disable validation - when there are required fields without value + + Parameters + ---------- + unit_system_name : str + The name of the unit system to use for parameter initialization. + + Returns + ------- + SimulationParams + Default parameters for Flow360 simulation. + + """ + if length_unit is not None: + # TODO implement handling of length_unit (geometry unit and mesh unit), # pylint: disable=fixme + pass + + unit_system = init_unit_system(unit_system_name) + + with unit_system: + params = SimulationParams( + reference_geometry=ReferenceGeometry( + area=1, moment_center=(0, 0, 0), moment_length=(1, 1, 1) + ), + models=[Fluid()], + ) + + return params + + def validate_model(params_as_dict, unit_system_name): """ Validate a params dict against the pydantic model @@ -73,6 +111,7 @@ def validate_model(params_as_dict, unit_system_name): unit_system = init_unit_system(unit_system_name) validation_errors = None + validation_warnings = None validated_param = None try: @@ -101,7 +140,7 @@ def validate_model(params_as_dict, unit_system_name): errors_as_list.remove(field) error["loc"] = tuple(errors_as_list) - return validated_param, validation_errors + return validated_param, validation_errors, validation_warnings # pylint: disable=too-many-arguments @@ -109,7 +148,6 @@ def _translate_simulation_json( params_as_dict, unit_system_name, mesh_unit, - existing_json=None, target_name: str = None, translation_func=None, ): @@ -118,7 +156,8 @@ def _translate_simulation_json( """ translated_dict = None - param, errors = validate_model(params_as_dict, unit_system_name) + # pylint: disable=unused-variable + param, errors, warnings = validate_model(params_as_dict, unit_system_name) if errors is not None: # pylint: disable=fixme # TODO: Check if this looks good in terminal. @@ -133,43 +172,39 @@ def _translate_simulation_json( raise ValueError(f"No {target_name} parameters found in given SimulationParams.") # pylint: disable=fixme # TODO: Implement proper hashing. Currently floating point creates headache for reproducible hashing. - if existing_json is not None and hash(translated_dict) == existing_json["hash"]: - log.info(f"Translation of {target_name} is same as existing. Skipping translation.") - return existing_json - return translated_dict + # pylint: disable=protected-access + hash_value = SimulationParams._calculate_hash(translated_dict) + return translated_dict, hash_value -def simulation_to_surface_meshing_json(params_as_dict, unit_system_name, mesh_unit, existing_json): +def simulation_to_surface_meshing_json(params_as_dict, unit_system_name, mesh_unit): """Get JSON for surface meshing from a given simulaiton JSON.""" return _translate_simulation_json( params_as_dict, unit_system_name, mesh_unit, - existing_json, "surface meshing", get_surface_meshing_json, ) -def simulation_to_volume_meshing_json(params_as_dict, unit_system_name, mesh_unit, existing_json): +def simulation_to_volume_meshing_json(params_as_dict, unit_system_name, mesh_unit): """Get JSON for volume meshing from a given simulaiton JSON.""" return _translate_simulation_json( params_as_dict, unit_system_name, mesh_unit, - existing_json, "volume meshing", get_volume_meshing_json, ) -def simulation_to_case_json(params_as_dict, unit_system_name, mesh_unit, existing_json): +def simulation_to_case_json(params_as_dict, unit_system_name, mesh_unit): """Get JSON for case from a given simulaiton JSON.""" return _translate_simulation_json( params_as_dict, unit_system_name, mesh_unit, - existing_json, "case", get_solver_json, ) diff --git a/flow360/component/simulation/simulation_params.py b/flow360/component/simulation/simulation_params.py index f8edc0629..0610b4ffb 100644 --- a/flow360/component/simulation/simulation_params.py +++ b/flow360/component/simulation/simulation_params.py @@ -218,7 +218,7 @@ class SimulationParams(_ParamModelBase): """ Below can be mostly reused with existing models """ - time_stepping: Optional[Union[Steady, Unsteady]] = pd.Field(None) + time_stepping: Optional[Union[Steady, Unsteady]] = pd.Field(Steady()) user_defined_dynamics: Optional[List[UserDefinedDynamic]] = pd.Field(None) """ Support for user defined expression? diff --git a/flow360/component/simulation/translator/solver_translator.py b/flow360/component/simulation/translator/solver_translator.py index 7049b2de5..0b8eb5972 100644 --- a/flow360/component/simulation/translator/solver_translator.py +++ b/flow360/component/simulation/translator/solver_translator.py @@ -16,6 +16,7 @@ TimeAverageVolumeOutput, VolumeOutput, ) +from flow360.component.simulation.time_stepping.time_stepping import Steady, Unsteady from flow360.component.simulation.simulation_params import SimulationParams from flow360.component.simulation.translator.utils import ( convert_tuples_to_lists, @@ -163,37 +164,42 @@ def get_solver_json( replace_dict_value(translated["sliceOutput"], "outputFormat", "both", "paraview,tecplot") translated["sliceOutput"].update({"slices": {}, "outputFields": []}) - for output in input_params.outputs: - # validation: no more than one VolumeOutput, Slice and Surface cannot have difference format etc. - if isinstance(output, TimeAverageVolumeOutput): - # pylint: disable=fixme - # TODO: update time average entries - translated["volumeOutput"]["computeTimeAverages"] = True + if input_params.outputs is not None: + for output in input_params.outputs: + # validation: no more than one VolumeOutput, Slice and Surface cannot have difference format etc. + if isinstance(output, TimeAverageVolumeOutput): + # pylint: disable=fixme + # TODO: update time average entries + translated["volumeOutput"]["computeTimeAverages"] = True - elif isinstance(output, SurfaceOutput): - surfaces = translated["surfaceOutput"]["surfaces"] - for surface in output.entities.stored_entities: - surfaces[surface.name] = { - "outputFields": merge_unique_item_lists( - surfaces.get(surface.name, {}).get("outputFields", []), - output.output_fields.model_dump()["items"], - ) - } - elif isinstance(output, SliceOutput): - slices = translated["sliceOutput"]["slices"] - for slice_item in output.entities.items: - slices[slice_item.name] = { - "outputFields": merge_unique_item_lists( - slices.get(slice_item.name, {}).get("outputFields", []), - output.output_fields.model_dump()["items"], - ), - "sliceOrigin": list(remove_units_in_dict(dump_dict(slice_item))["sliceOrigin"]), - "sliceNormal": list(remove_units_in_dict(dump_dict(slice_item))["sliceNormal"]), - } + elif isinstance(output, SurfaceOutput): + surfaces = translated["surfaceOutput"]["surfaces"] + for surface in output.entities.stored_entities: + surfaces[surface.name] = { + "outputFields": merge_unique_item_lists( + surfaces.get(surface.name, {}).get("outputFields", []), + output.output_fields.model_dump()["items"], + ) + } + elif isinstance(output, SliceOutput): + slices = translated["sliceOutput"]["slices"] + for slice_item in output.entities.items: + slices[slice_item.name] = { + "outputFields": merge_unique_item_lists( + slices.get(slice_item.name, {}).get("outputFields", []), + output.output_fields.model_dump()["items"], + ), + "sliceOrigin": list( + remove_units_in_dict(dump_dict(slice_item))["sliceOrigin"] + ), + "sliceNormal": list( + remove_units_in_dict(dump_dict(slice_item))["sliceNormal"] + ), + } ##:: Step 5: Get timeStepping ts = input_params.time_stepping - if ts.type_name == "Unsteady": + if isinstance(ts, Unsteady): translated["timeStepping"] = { "CFL": dump_dict(ts.CFL), "physicalSteps": ts.steps, @@ -201,7 +207,7 @@ def get_solver_json( "maxPseudoSteps": ts.max_pseudo_steps, "timeStepSize": ts.step_size, } - else: + elif isinstance(ts, Steady): translated["timeStepping"] = { "CFL": dump_dict(ts.CFL), "physicalSteps": 1, diff --git a/flow360/component/simulation/translator/utils.py b/flow360/component/simulation/translator/utils.py index 4852aa9da..3a2ff225d 100644 --- a/flow360/component/simulation/translator/utils.py +++ b/flow360/component/simulation/translator/utils.py @@ -121,9 +121,10 @@ def remove_units_in_dict(input_dict): def has_instance_in_list(obj_list: list, class_type): """Check if a list contains an instance of a given type.""" - for obj in obj_list: - if isinstance(obj, class_type): - return True + if obj_list is not None: + for obj in obj_list: + if isinstance(obj, class_type): + return True return False @@ -131,11 +132,12 @@ def get_attribute_from_first_instance( obj_list: list, class_type, attribute_name: str, check_empty_entities: bool = False ): """In a list loop and find the first instance matching the given type and retrive the attribute""" - for obj in obj_list: - if isinstance(obj, class_type): - if check_empty_entities and obj.entities is not None: - continue - return getattr(obj, attribute_name) + if obj_list is not None: + for obj in obj_list: + if isinstance(obj, class_type): + if check_empty_entities and obj.entities is not None: + continue + return getattr(obj, attribute_name) return None diff --git a/flow360/component/types.py b/flow360/component/types.py index 1485514c5..7c39de91d 100644 --- a/flow360/component/types.py +++ b/flow360/component/types.py @@ -38,14 +38,9 @@ def __get_pydantic_core_schema__(cls, *args, **kwargs) -> CoreSchema: # pylint: disable=unused-argument @classmethod def __get_pydantic_json_schema__(cls, schema: CoreSchema, handler: GetJsonSchemaHandler): - new_schema = { - "type": "array", - "minItems": 3, - "maxItems": 3, - "items": [{"type": "number"}, {"type": "number"}, {"type": "number"}], - } - - schema.update(new_schema) + schema = {"properties": {"value": {"type": "array"}}} + schema["properties"]["value"]["items"] = {"type": "number"} + schema["properties"]["value"]["strictType"] = {"type": "vector3"} return schema diff --git a/flow360/component/utils.py b/flow360/component/utils.py index 4baebcb72..cb1b7a3e9 100644 --- a/flow360/component/utils.py +++ b/flow360/component/utils.py @@ -57,15 +57,20 @@ def match_file_pattern(patterns, filename): # pylint: disable=redefined-builtin -def is_valid_uuid(id, allow_none=False): +def is_valid_uuid(id, allow_none=False, valid_prefixes=None): """ Checks if id is valid """ + if valid_prefixes is None: + valid_prefixes = ["folder-", "g-"] if id is None and allow_none: return try: - if id and id.startswith("folder-"): - id = id[len("folder-") :] + if id: + for prefix in valid_prefixes: + if id.startswith(prefix): + id = id[len(prefix) :] + break uuid.UUID(str(id)) except ValueError as exc: raise Flow360ValueError(f"{id} is not a valid UUID.") from exc diff --git a/flow360/utils.py b/flow360/utils.py index 23a52583e..198917f1c 100644 --- a/flow360/utils.py +++ b/flow360/utils.py @@ -2,6 +2,9 @@ utilities module """ +import time +from functools import wraps + # pylint: disable=invalid-name class classproperty(property): @@ -9,3 +12,30 @@ class classproperty(property): def __get__(self, owner_self, owner_cls): return self.fget(owner_cls) + + +def measure_execution_time(func): + """ + Decorator to measure the execution time of a function. + + Parameters + ---------- + func : function + The function whose execution time is to be measured. + + Returns + ------- + wrapper : function + The wrapped function with added execution time measurement. + """ + + @wraps(func) + def wrapper(*args, **kwargs): + start_time = time.time() # Record the start time + result = func(*args, **kwargs) # Call the original function + end_time = time.time() # Record the end time + execution_time = end_time - start_time # Calculate the execution time + print(f"Execution time of {func.__name__}: {execution_time:.4f} seconds") + return result + + return wrapper diff --git a/flow360/version.py b/flow360/version.py index fe6c39f26..b97428a2f 100644 --- a/flow360/version.py +++ b/flow360/version.py @@ -2,4 +2,4 @@ version """ -__version__ = "24.2.0" +__version__ = "24.3.0" diff --git a/pyproject.toml b/pyproject.toml index e5a884fb4..c48b17ef6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "flow360" -version = "v0.2.0" +version = "v24.3.0" description = "" authors = ["Flexcompute "] diff --git a/tests/data/cases/params_units.json b/tests/data/cases/params_units.json index 569004951..46962e7da 100644 --- a/tests/data/cases/params_units.json +++ b/tests/data/cases/params_units.json @@ -2,7 +2,7 @@ "unitSystem": { "name": "SI" }, - "version": "24.2.0b2", + "version": "24.3.0", "geometry": { "refArea": { "value": 1.0, diff --git a/tests/ref/case_params/params.json b/tests/ref/case_params/params.json index b30940038..ee49157de 100644 --- a/tests/ref/case_params/params.json +++ b/tests/ref/case_params/params.json @@ -2,7 +2,7 @@ "unitSystem": { "name": "SI" }, - "version": "24.2.0", + "version": "24.3.0", "geometry": { "refArea": { "value": 1.0, @@ -150,5 +150,5 @@ } } }, - "hash": "a53580abf4c987dea96533b79558f1d65d26e33fbe9a200e2e163ec2be23c318" + "hash": "669f1c5930bb774790bb10e43b90abc8082c3f35ff70f00303c632ee25dfbcd8" } diff --git a/tests/ref/case_params/params.yaml b/tests/ref/case_params/params.yaml index 1fb8ceb42..c2a1ed317 100644 --- a/tests/ref/case_params/params.yaml +++ b/tests/ref/case_params/params.yaml @@ -21,7 +21,7 @@ geometry: refArea: units: 2*m**2 value: 1.0 -hash: a53580abf4c987dea96533b79558f1d65d26e33fbe9a200e2e163ec2be23c318 +hash: 669f1c5930bb774790bb10e43b90abc8082c3f35ff70f00303c632ee25dfbcd8 navierStokesSolver: CFLMultiplier: 1.0 absoluteTolerance: 1.0e-10 @@ -109,7 +109,7 @@ timeStepping: timeStepSize: inf unitSystem: name: SI -version: 24.2.0 +version: 24.3.0 volumeOutput: animationFrequency: -1 animationFrequencyOffset: 0 diff --git a/tests/ref/case_params/params_units.json b/tests/ref/case_params/params_units.json index 3cb0fa59f..17b7fad39 100644 --- a/tests/ref/case_params/params_units.json +++ b/tests/ref/case_params/params_units.json @@ -2,7 +2,7 @@ "unitSystem": { "name": "SI" }, - "version": "24.2.0", + "version": "24.3.0", "geometry": { "refArea": { "value": 1.0, @@ -190,5 +190,5 @@ "relativeTolerance": 0.0, "updateJacobianFrequency": 4 }, - "hash": "4c590bef145e27eaa5557667c35d04018d8c95907b43df10879000a087f6cd88" + "hash": "55e7a640706be1450b788f75a7d196a89d16dedad9c4ad4949afc430909a22a2" } \ No newline at end of file diff --git a/tests/ref/case_params/params_units_converted.json b/tests/ref/case_params/params_units_converted.json index 7e0690322..6dce43524 100644 --- a/tests/ref/case_params/params_units_converted.json +++ b/tests/ref/case_params/params_units_converted.json @@ -2,7 +2,7 @@ "unitSystem": { "name": "SI" }, - "version": "24.2.0", + "version": "24.3.0", "geometry": { "refArea": { "value": 1.0, @@ -176,5 +176,5 @@ "relativeTolerance": 0.0, "updateJacobianFrequency": 4 }, - "hash": "4c8df0e4fd516a5167f306895ca9548baf8280ce42732d7f454e4ed078480206" + "hash": "1c82ba23a634e71cb0e0d90cbfb210acdc478f3bccc24f3682594bb4d26f231e" } \ No newline at end of file diff --git a/tests/simulation/framework/test_cached_model.py b/tests/simulation/framework/test_cached_model.py deleted file mode 100644 index 063143dce..000000000 --- a/tests/simulation/framework/test_cached_model.py +++ /dev/null @@ -1,82 +0,0 @@ -import json -import os -import tempfile -from typing import Optional - -import pydantic as pd -import pytest - -import flow360.component.simulation.units as u -from flow360.component.simulation.framework.base_model import Flow360BaseModel -from flow360.component.simulation.framework.cached_model_base import CachedModelBase -from flow360.component.simulation.unit_system import ( - DensityType, - LengthType, - TemperatureType, -) -from tests.utils import to_file_from_file_test - - -class TempThermalStateCache(Flow360BaseModel): - constructor: Optional[str] = None - altitude: Optional[LengthType.Positive] = None - temperature_offset: Optional[TemperatureType] = None - some_value: Optional[float] = None - temperature: Optional[TemperatureType.Positive] = None - density: Optional[DensityType.Positive] = None - - -class TempThermalState(CachedModelBase): - temperature: TemperatureType.Positive = pd.Field(288.15 * u.K, frozen=True) - density: DensityType.Positive = pd.Field(1.225 * u.kg / u.m**3, frozen=True) - some_value: float = 0.1 - _cached: TempThermalStateCache = TempThermalStateCache() - - @CachedModelBase.model_constructor - def from_standard_atmosphere( - cls, altitude: LengthType.Positive = 0 * u.m, temperature_offset: TemperatureType = 0 * u.K - ): - density = 1.225 * u.kg / u.m**3 - temperature = 288.15 * u.K - - state = cls( - density=density, - temperature=temperature, - ) - - return state - - @property - def altitude(self) -> Optional[LengthType.Positive]: - return self._cached.altitude - - -class TempOperatingCondition(Flow360BaseModel): - thermal_state: TempThermalState - some_value: float - - -@pytest.mark.usefixtures("array_equality_override") -def test_cache_model(): - operating_condition = TempOperatingCondition( - some_value=1230, - thermal_state=TempThermalState.from_standard_atmosphere(altitude=100 * u.m), - ) - - with tempfile.NamedTemporaryFile(mode="w", suffix=".json", delete=False) as temp_file: - temp_file_name = temp_file.name - - try: - operating_condition.to_file(temp_file_name) - with open(temp_file_name) as fp: - model_dict = json.load(fp) - assert model_dict["thermal_state"]["_cached"]["some_value"] == 0.1 - assert ( - model_dict["thermal_state"]["_cached"]["constructor"] == "from_standard_atmosphere" - ) - loaded_model = TempOperatingCondition(**model_dict) - assert loaded_model == operating_condition - assert loaded_model.thermal_state._cached.altitude == 100 * u.m - assert loaded_model.thermal_state._cached.temperature_offset == 0 * u.K - finally: - os.remove(temp_file_name) diff --git a/tests/simulation/framework/test_multi_constructor_model.py b/tests/simulation/framework/test_multi_constructor_model.py new file mode 100644 index 000000000..391d4d9fd --- /dev/null +++ b/tests/simulation/framework/test_multi_constructor_model.py @@ -0,0 +1,64 @@ +import json +import os +import tempfile +from typing import Optional + +import pydantic as pd +import pytest + +import flow360.component.simulation.units as u +from flow360.component.simulation.framework.multi_constructor_model_base import ( + _MultiConstructorModelBase, + parse_model_dict, +) +from flow360.component.simulation.operating_condition import ( + AerospaceCondition, + AerospaceConditionCache, + ThermalState, +) + + +@pytest.fixture +def get_aerospace_condition_default(): + return AerospaceCondition( + velocity_magnitude=0.8 * u.km / u.s, + alpha=5 * u.deg, + thermal_state=ThermalState(), + reference_velocity_magnitude=100 * u.m / u.s, + ) + + +@pytest.fixture +def get_aerospace_condition_using_from(): + return AerospaceCondition.from_mach( + mach=0.8, + alpha=5 * u.deg, + thermal_state=ThermalState.from_standard_atmosphere(altitude=1000 * u.m), + ) + + +def test_full_model(get_aerospace_condition_default, get_aerospace_condition_using_from): + full_data = get_aerospace_condition_default.model_dump(exclude_none=True) + data_parsed = parse_model_dict(full_data, globals()) + assert sorted(data_parsed.items()) == sorted(full_data.items()) + + full_data = get_aerospace_condition_using_from.model_dump(exclude_none=True) + data_parsed = parse_model_dict(full_data, globals()) + assert sorted(data_parsed.items()) == sorted(full_data.items()) + + +def test_incomplete_model(get_aerospace_condition_default, get_aerospace_condition_using_from): + full_data = get_aerospace_condition_default.model_dump(exclude_none=True) + incomplete_data = full_data + full_data["private_attribute_input_cache"] = None + data_parsed = parse_model_dict(incomplete_data, globals()) + assert sorted(data_parsed.items()) == sorted(full_data.items()) + + full_data = get_aerospace_condition_using_from.model_dump(exclude_none=True) + incomplete_data = { + "type_name": full_data["type_name"], + "private_attribute_constructor": full_data["private_attribute_constructor"], + "private_attribute_input_cache": full_data["private_attribute_input_cache"], + } + data_parsed = parse_model_dict(incomplete_data, globals()) + assert sorted(data_parsed.items()) == sorted(full_data.items()) diff --git a/tests/simulation/service/test_services_v2.py b/tests/simulation/service/test_services_v2.py index bd7c2105a..69b1443cf 100644 --- a/tests/simulation/service/test_services_v2.py +++ b/tests/simulation/service/test_services_v2.py @@ -8,6 +8,12 @@ def change_test_dir(request, monkeypatch): monkeypatch.chdir(request.fspath.dirname) +def test_init_service(): + data = services.get_default_params("SI", "m") + print(data) + assert data + + def test_validate_service(): params_data = { "meshing": { @@ -15,7 +21,7 @@ def test_validate_service(): "refinement_factor": 1.0, "gap_treatment_strength": 0.2, "surface_layer_growth_rate": 1.5, - "refinements": None, + "refinements": [], }, "reference_geometry": { "moment_center": {"value": [0, 0, 0], "units": "m"}, @@ -28,39 +34,10 @@ def test_validate_service(): "max_steps": 10, "CFL": {"type": "ramp", "initial": 1.5, "final": 1.5, "ramp_steps": 5}, }, - "operating_condition": { - "alpha": {"units": "flow360_angle_unit", "value": 0.5235987755982988}, - "beta": {"units": "flow360_angle_unit", "value": 0.3490658503988659}, - "reference_velocity_magnitude": {"units": "flow360_velocity_unit", "value": 0.5}, - "thermal_state": { - "_cached": {"altitude": 123, "temperature_offset": 1234}, - "density": {"units": "flow360_density_unit", "value": 1.0}, - "material": { - "dynamic_viscosity": { - "effective_temperature": { - "units": "flow360_temperature_unit", - "value": 0.37000000000000005, - }, - "reference_temperature": { - "units": "flow360_temperature_unit", - "value": 0.91, - }, - "reference_viscosity": { - "units": "flow360_viscosity_unit", - "value": 5.002915451895044e-12, - }, - }, - "name": "air", - "type": "air", - }, - "temperature": {"units": "flow360_temperature_unit", "value": 1.0}, - }, - "velocity_magnitude": {"units": "flow360_velocity_unit", "value": 0.8}, - }, "user_defined_dynamics": [], } - _, errors = services.validate_model(params_as_dict=params_data, unit_system_name="SI") + _, errors, _ = services.validate_model(params_as_dict=params_data, unit_system_name="SI") assert errors is None @@ -72,7 +49,7 @@ def test_validate_error(): "refinement_factor": 1.0, "gap_treatment_strength": 0.2, "surface_layer_growth_rate": 1.5, - "refinements": None, + "refinements": [], }, "reference_geometry": { "moment_center": {"value": [0, 0, 0], "units": "m"}, @@ -85,39 +62,10 @@ def test_validate_error(): "max_steps": 10, "CFL": {"type": "ramp", "initial": 1.5, "final": 1.5, "ramp_steps": 5}, }, - "operating_condition": { - "alpha": {"units": "flow360_angle_unit", "value": 0.5235987755982988}, - "beta": {"units": "flow360_angle_unit", "value": 0.3490658503988659}, - "reference_velocity_magnitude": {"units": "flow360_velocity_unit", "value": 0.5}, - "thermal_state": { - "_cached": {"altitude": 123, "temperature_offset": 1234}, - "density": {"units": "flow360_density_unit", "value": 1.0}, - "material": { - "dynamic_viscosity": { - "effective_temperature": { - "units": "flow360_temperature_unit", - "value": 0.37000000000000005, - }, - "reference_temperature": { - "units": "flow360_temperature_unit", - "value": 0.91, - }, - "reference_viscosity": { - "units": "flow360_viscosity_unit", - "value": 5.002915451895044e-12, - }, - }, - "name": "air", - "type": "air", - }, - "temperature": {"units": "flow360_temperature_unit", "value": 1.0}, - }, - "velocity_magnitude": {"units": "flow360_velocity_unit", "value": 0.8}, - }, "user_defined_dynamics": [], } - _, errors = services.validate_model(params_as_dict=params_data, unit_system_name="SI") + _, errors, _ = services.validate_model(params_as_dict=params_data, unit_system_name="SI") assert len(errors) == 1 assert errors[0]["loc"] == ("meshing", "farfield") @@ -130,7 +78,7 @@ def test_validate_multiple_errors(): "refinement_factor": 1.0, "gap_treatment_strength": 0.2, "surface_layer_growth_rate": 1.5, - "refinements": None, + "refinements": [], }, "reference_geometry": { "moment_center": {"value": [0, 0, 0], "units": "m"}, @@ -143,39 +91,10 @@ def test_validate_multiple_errors(): "max_steps": 10, "CFL": {"type": "ramp", "initial": 1.5, "final": 1.5, "ramp_steps": 5}, }, - "operating_condition": { - "alpha": {"units": "flow360_angle_unit", "value": 0.5235987755982988}, - "beta": {"units": "flow360_angle_unit", "value": 0.3490658503988659}, - "reference_velocity_magnitude": {"units": "flow360_velocity_unit", "value": 0.5}, - "thermal_state": { - "_cached": {"altitude": 123, "temperature_offset": 1234}, - "density": {"units": "flow360_density_unit", "value": 1.0}, - "material": { - "dynamic_viscosity": { - "effective_temperature": { - "units": "flow360_temperature_unit", - "value": 0.37000000000000005, - }, - "reference_temperature": { - "units": "flow360_temperature_unit", - "value": 0.91, - }, - "reference_viscosity": { - "units": "flow360_viscosity_unit", - "value": 5.002915451895044e-12, - }, - }, - "name": "air", - "type": "air", - }, - "temperature": {"units": "flow360_temperature_unit", "value": 1.0}, - }, - "velocity_magnitude": {"units": "flow360_velocity_unit", "value": 0.8}, - }, "user_defined_dynamics": [], } - _, errors = services.validate_model(params_as_dict=params_data, unit_system_name="SI") + _, errors, _ = services.validate_model(params_as_dict=params_data, unit_system_name="SI") assert len(errors) == 2 assert errors[0]["loc"] == ("meshing", "farfield") diff --git a/tests/simulation/service/test_translator_service.py b/tests/simulation/service/test_translator_service.py index 848fdec0f..7b15d5b75 100644 --- a/tests/simulation/service/test_translator_service.py +++ b/tests/simulation/service/test_translator_service.py @@ -2,11 +2,24 @@ import pytest +from flow360.component.simulation.meshing_param.face_params import ( + BoundaryLayer, + SurfaceRefinement, +) +from flow360.component.simulation.models.surface_models import Freestream, Wall +from flow360.component.simulation.models.volume_models import Fluid +from flow360.component.simulation.operating_condition import AerospaceCondition +from flow360.component.simulation.primitives import ReferenceGeometry, Surface from flow360.component.simulation.services import ( simulation_to_case_json, simulation_to_surface_meshing_json, simulation_to_volume_meshing_json, ) +from flow360.component.simulation.simulation_params import ( + MeshingParams, + SimulationParams, +) +from flow360.component.simulation.unit_system import SI_unit_system, u def test_simulation_to_surface_meshing_json(): @@ -43,17 +56,15 @@ def test_simulation_to_surface_meshing_json(): "version": "24.2.0", } - simulation_to_surface_meshing_json(param_data, "SI", {"value": 100.0, "units": "cm"}, None) + simulation_to_surface_meshing_json(param_data, "SI", {"value": 100.0, "units": "cm"}) bad_param_data = deepcopy(param_data) bad_param_data["meshing"]["refinements"][0]["max_edge_length"]["value"] = -12.0 with pytest.raises(ValueError, match="Input should be greater than 0"): - simulation_to_surface_meshing_json( - bad_param_data, "SI", {"value": 100.0, "units": "cm"}, None - ) + simulation_to_surface_meshing_json(bad_param_data, "SI", {"value": 100.0, "units": "cm"}) with pytest.raises(ValueError, match="Mesh unit is required for translation."): - simulation_to_surface_meshing_json(param_data, "SI", None, None) + simulation_to_surface_meshing_json(param_data, "SI", None) # TODO: This needs more consideration. Is it allowed/possible to translate into an empty dict? # with pytest.raises( @@ -162,17 +173,15 @@ def test_simulation_to_volume_meshing_json(): "version": "24.2.0", } - simulation_to_volume_meshing_json(param_data, "SI", {"value": 100.0, "units": "cm"}, None) + simulation_to_volume_meshing_json(param_data, "SI", {"value": 100.0, "units": "cm"}) bad_param_data = deepcopy(param_data) bad_param_data["meshing"]["refinements"][0]["spacing"]["value"] = -12.0 with pytest.raises(ValueError, match="Input should be greater than 0"): - simulation_to_volume_meshing_json( - bad_param_data, "SI", {"value": 100.0, "units": "cm"}, None - ) + simulation_to_volume_meshing_json(bad_param_data, "SI", {"value": 100.0, "units": "cm"}) with pytest.raises(ValueError, match="Mesh unit is required for translation."): - simulation_to_volume_meshing_json(param_data, "SI", None, None) + simulation_to_volume_meshing_json(param_data, "SI", None) def test_simulation_to_case_json(): @@ -320,12 +329,53 @@ def test_simulation_to_case_json(): "version": "24.2.0", } - simulation_to_case_json(param_data, "SI", {"value": 100.0, "units": "cm"}, None) + simulation_to_case_json(param_data, "SI", {"value": 100.0, "units": "cm"}) bad_param_data = deepcopy(param_data) bad_param_data["reference_geometry"]["area"]["value"] = -12.0 with pytest.raises(ValueError, match="Input should be greater than 0"): - simulation_to_case_json(bad_param_data, "SI", {"value": 100.0, "units": "cm"}, None) + simulation_to_case_json(bad_param_data, "SI", {"value": 100.0, "units": "cm"}) with pytest.raises(ValueError, match="Mesh unit is required for translation."): - simulation_to_case_json(param_data, "SI", None, None) + simulation_to_case_json(param_data, "SI", None) + + +def test_simulation_to_all_translation(): + with SI_unit_system: + meshing = MeshingParams( + surface_layer_growth_rate=1.5, + refinements=[ + BoundaryLayer(first_layer_thickness=0.001), + SurfaceRefinement( + entities=[Surface(name="wing")], + max_edge_length=15 * u.cm, + curvature_resolution_angle=10 * u.deg, + ), + ], + ) + param = SimulationParams( + meshing=meshing, + reference_geometry=ReferenceGeometry( + moment_center=(1, 2, 3), moment_length=1.0 * u.m, area=1.0 * u.cm**2 + ), + operating_condition=AerospaceCondition(velocity_magnitude=100), + models=[ + Fluid(), + Wall( + entities=[Surface(name="wing")], + ), + Freestream(entities=[Surface(name="farfield")]), + ], + ) + + params_as_dict = param.model_dump() + surface_json, hash = simulation_to_surface_meshing_json( + params_as_dict, "SI", {"value": 100.0, "units": "cm"} + ) + print(surface_json) + volume_json, hash = simulation_to_volume_meshing_json( + params_as_dict, "SI", {"value": 100.0, "units": "cm"} + ) + print(volume_json) + case_json, hash = simulation_to_case_json(params_as_dict, "SI", {"value": 100.0, "units": "cm"}) + print(case_json) diff --git a/tests/test_flow360.py b/tests/test_flow360.py index 18a20a1af..5bb87bac1 100644 --- a/tests/test_flow360.py +++ b/tests/test_flow360.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == "24.2.0" + assert __version__ == "24.3.0" diff --git a/tests/test_utils.py b/tests/test_utils.py index ebd596b73..ea468816e 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -61,6 +61,8 @@ def test_shared_confirm_proceed(mock_response, monkeypatch): def test_valid_uuid(): is_valid_uuid("123e4567-e89b-12d3-a456-426614174000") is_valid_uuid("folder-123e4567-e89b-12d3-a456-426614174000") + is_valid_uuid("g-123e4567-e89b-12d3-a456-426614174000") + with pytest.raises(Flow360ValueError): is_valid_uuid("not-a-valid-uuid") diff --git a/tools/integrations/data_v2/UDD/UserDefinedDynamic-release-24.6.json b/tools/integrations/data_v2/UDD/UserDefinedDynamic-release-24.6.json new file mode 100644 index 000000000..e33b08668 --- /dev/null +++ b/tools/integrations/data_v2/UDD/UserDefinedDynamic-release-24.6.json @@ -0,0 +1,53 @@ +{ + "name": "fake", + "input_vars": [ + "fake" + ], + "constants": { + "ff": 123.0 + }, + "output_vars": { + "fake_out": "1+1;" + }, + "state_vars_initial_value": [ + "0+0;" + ], + "update_law": [ + "1-2;" + ], + "input_boundary_patches": { + "stored_entities": [ + { + "name": "my_wall" + } + ] + }, + "output_target": { + "name": "my_cylinder-1", + "axis": [ + 1.0, + 0.0, + 0.0 + ], + "center": { + "value": [ + 1.2, + 2.3, + 3.4 + ], + "units": "m" + }, + "height": { + "value": 3.0, + "units": "m" + }, + "inner_radius": { + "value": 3.0, + "units": "m" + }, + "outer_radius": { + "value": 5.0, + "units": "m" + } + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/UDD/json-schema-release-24.6-UserDefinedDynamic.json b/tools/integrations/data_v2/UDD/json-schema-release-24.6-UserDefinedDynamic.json new file mode 100644 index 000000000..36325d3d8 --- /dev/null +++ b/tools/integrations/data_v2/UDD/json-schema-release-24.6-UserDefinedDynamic.json @@ -0,0 +1,261 @@ +{ + "$defs": { + "Cylinder": { + "additionalProperties": false, + "description": "Represents a cylinder in three-dimensional space.\n\nParameters\n----------\nname : \n axis : \n center : \n height : \n inner_radius : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n outer_radius : \n \nAttributes:\n axis (Axis): The axis of the cylinder.\n center (LengthType.Point): The center point of the cylinder.\n height (LengthType.Postive): The height of the cylinder.\n inner_radius (LengthType.Positive): The inner radius of the cylinder.\n outer_radius (LengthType.Positive): The outer radius of the cylinder.", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "axis": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + }, + "title": "Axis" + }, + "center": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Center" + }, + "height": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Height" + }, + "inner_radius": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inner Radius" + }, + "outer_radius": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Outer Radius" + } + }, + "required": [ + "name", + "axis", + "center", + "height", + "outer_radius" + ], + "title": "Cylinder", + "type": "object" + }, + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + } + }, + "additionalProperties": false, + "description": ":class:`UserDefinedDynamic` class\n\nParameters\n----------\nname : \n input_vars : typing.List[str]\n constants : typing.Optional[typing.Dict[str, float]] = None\n output_vars : typing.Optional[typing.Dict[str, typing.Annotated[str, AfterValidator(func=)]]] = None\n state_vars_initial_value : typing.List[typing.Annotated[str, AfterValidator(func=)]]\n update_law : typing.List[typing.Annotated[str, AfterValidator(func=)]]\n input_boundary_patches : typing.Optional[abc.EntityList[Surface]] = None\n output_target : typing.Optional[flow360.component.simulation.primitives.Cylinder] = None\n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "input_vars": { + "items": { + "type": "string" + }, + "title": "Input Vars", + "type": "array" + }, + "constants": { + "anyOf": [ + { + "additionalProperties": { + "type": "number" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Constants" + }, + "output_vars": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Output Vars" + }, + "state_vars_initial_value": { + "items": { + "type": "string" + }, + "title": "State Vars Initial Value", + "type": "array" + }, + "update_law": { + "items": { + "type": "string" + }, + "title": "Update Law", + "type": "array" + }, + "input_boundary_patches": { + "anyOf": [ + { + "$ref": "#/$defs/EntityList_Surface_" + }, + { + "type": "null" + } + ], + "default": null + }, + "output_target": { + "anyOf": [ + { + "$ref": "#/$defs/Cylinder" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "required": [ + "name", + "input_vars", + "state_vars_initial_value", + "update_law" + ], + "title": "UserDefinedDynamic", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/geometry/example-1-release-24.6.json b/tools/integrations/data_v2/geometry/example-1-release-24.6.json new file mode 100644 index 000000000..259d44db1 --- /dev/null +++ b/tools/integrations/data_v2/geometry/example-1-release-24.6.json @@ -0,0 +1,22 @@ +{ + "moment_center": { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "m" + }, + "moment_length": { + "value": [ + 4.0, + 5.0, + 6.0 + ], + "units": "m" + }, + "area": { + "value": 10.0, + "units": "m**2" + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/geometry/json-schema-release-24.6.json b/tools/integrations/data_v2/geometry/json-schema-release-24.6.json new file mode 100644 index 000000000..00d2e9eea --- /dev/null +++ b/tools/integrations/data_v2/geometry/json-schema-release-24.6.json @@ -0,0 +1,123 @@ +{ + "additionalProperties": false, + "description": "Contains all geometrical related refrence values\nNote:\n- mesh_unit is removed from here and will be a property\nTODO:\n- Support expression for time-dependent axis etc?\n- What about force axis?\n\n\nParameters\n----------\nmoment_center : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n moment_length : typing.Union[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], NoneType] = None\n area : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n ", + "properties": { + "moment_center": { + "anyOf": [ + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Moment Center" + }, + "moment_length": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Moment Length" + }, + "area": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "area", + "enum": [ + "m**2", + "cm**2", + "ft**2" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Area" + } + }, + "title": "ReferenceGeometry", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/meshing/example-1-release-24.6.json b/tools/integrations/data_v2/meshing/example-1-release-24.6.json new file mode 100644 index 000000000..97aebce80 --- /dev/null +++ b/tools/integrations/data_v2/meshing/example-1-release-24.6.json @@ -0,0 +1,37 @@ +{ + "farfield": "auto", + "refinement_factor": 1.0, + "gap_treatment_strength": null, + "surface_layer_growth_rate": 1.5, + "refinements": [ + { + "refinement_type": "BoundaryLayer", + "type": "aniso", + "entities": null, + "first_layer_thickness": { + "value": 0.001, + "units": "m" + }, + "growth_rate": 1.2 + }, + { + "refinement_type": "SurfaceRefinement", + "entities": { + "stored_entities": [ + { + "name": "wing" + } + ] + }, + "max_edge_length": { + "value": 15.0, + "units": "cm" + }, + "curvature_resolution_angle": { + "value": 10.0, + "units": "degree" + } + } + ], + "volume_zones": [] +} \ No newline at end of file diff --git a/tools/integrations/data_v2/meshing/json-schema-release-24.6.json b/tools/integrations/data_v2/meshing/json-schema-release-24.6.json new file mode 100644 index 000000000..69cd860fd --- /dev/null +++ b/tools/integrations/data_v2/meshing/json-schema-release-24.6.json @@ -0,0 +1,1074 @@ +{ + "$defs": { + "AngleBasedRefinement": { + "additionalProperties": false, + "description": "Surface edge refinement by specifying curvature resolution in degrees\n\nParameters\n----------\ntype : typing.Literal['angle'] = angle\n value : \n ", + "properties": { + "type": { + "const": "angle", + "default": "angle", + "enum": [ + "angle" + ], + "title": "Type", + "type": "string" + }, + "value": { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "angle", + "enum": [ + "rad" + ], + "type": "string" + } + }, + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "AngleBasedRefinement", + "type": "object" + }, + "AspectRatioBasedRefinement": { + "additionalProperties": false, + "description": "Surface edge refinement by specifying maximum aspect ratio of the anisotropic cells\n\nParameters\n----------\ntype : typing.Literal['aspectRatio'] = aspectRatio\n value : \n ", + "properties": { + "type": { + "const": "aspectRatio", + "default": "aspectRatio", + "enum": [ + "aspectRatio" + ], + "title": "Type", + "type": "string" + }, + "value": { + "exclusiveMinimum": 0.0, + "title": "Value", + "type": "number" + } + }, + "required": [ + "value" + ], + "title": "AspectRatioBasedRefinement", + "type": "object" + }, + "AxisymmetricRefinement": { + "additionalProperties": false, + "description": "Note:\n- This basically creates the \"rotorDisks\" type of volume refinement that we used to have.\n\nParameters\n----------\nrefinement_type : typing.Literal['AxisymmetricRefinement'] = AxisymmetricRefinement\n entities : \n spacing_axial : \n spacing_radial : \n spacing_circumferential : \n \n- `enclosed_objects` is actually just a way of specifying the enclosing patches of a volume zone. Therefore in the future when supporting arbitrary-axisymmetric shaped sliding interface, we may not need this attribute at all. For example if the new class already has an entry to list all the enclosing patches.\n\n- We may provide a helper function to automatically determine what is inside the encloeud_objects list based on the mesh data. But this currently is out of scope due to the estimated efforts.", + "properties": { + "refinement_type": { + "const": "AxisymmetricRefinement", + "default": "AxisymmetricRefinement", + "enum": [ + "AxisymmetricRefinement" + ], + "title": "Refinement Type", + "type": "string" + }, + "entities": { + "$ref": "#/$defs/EntityList_Cylinder_" + }, + "spacing_axial": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Spacing Axial" + }, + "spacing_radial": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Spacing Radial" + }, + "spacing_circumferential": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Spacing Circumferential" + } + }, + "required": [ + "entities", + "spacing_axial", + "spacing_radial", + "spacing_circumferential" + ], + "title": "AxisymmetricRefinement", + "type": "object" + }, + "BoundaryLayer": { + "additionalProperties": false, + "description": "These affects volume meshing.\nNote:\n- We do not support per volume specification of these settings so the entities will be **obsolete** for now.\nShould we have it at all in the release?\n\nParameters\n----------\nrefinement_type : typing.Literal['BoundaryLayer'] = BoundaryLayer\n type : typing.Literal['aniso', 'projectAnisoSpacing', 'none'] = aniso\n entities : typing.Optional[abc.EntityList[Surface]] = None\n first_layer_thickness : \n First layer thickness for volumetric anisotropic layers.\ngrowth_rate : = 1.2\n Growth rate for volume prism layers.\n\n- `None` entities will be expanded (or just ignored and convert to global default, depending on implementation) before\nsubmission. This is supposed to be applied to all the matching entities. We allow this so that we do not need to\nhave dedicated field for global settings. This is also consistent with the `FluidDynamics` class' design.", + "properties": { + "refinement_type": { + "const": "BoundaryLayer", + "default": "BoundaryLayer", + "enum": [ + "BoundaryLayer" + ], + "title": "Refinement Type", + "type": "string" + }, + "type": { + "default": "aniso", + "enum": [ + "aniso", + "projectAnisoSpacing", + "none" + ], + "title": "Type", + "type": "string" + }, + "faces": { + "anyOf": [ + { + "$ref": "#/$defs/EntityList_Surface_" + }, + { + "type": "null" + } + ], + "default": null + }, + "first_layer_thickness": { + "description": "First layer thickness for volumetric anisotropic layers.", + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "First Layer Thickness" + }, + "growth_rate": { + "default": 1.2, + "description": "Growth rate for volume prism layers.", + "exclusiveMinimum": 0.0, + "minimum": 1.0, + "title": "Growth Rate", + "type": "number" + } + }, + "required": [ + "first_layer_thickness" + ], + "title": "BoundaryLayer", + "type": "object" + }, + "Box": { + "additionalProperties": false, + "description": "Represents a box in three-dimensional space.\n\nParameters\n----------\nname : \n center : \n size : \n axes : typing.Tuple[flow360.component.types.Axis, flow360.component.types.Axis]\n \nAttributes:\n center (LengthType.Point): The coordinates of the center of the box.\n size (LengthType.Point): The dimensions of the box (length, width, height).\n axes (Tuple[Axis, Axis]]): The axes of the box.", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "center": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Center" + }, + "size": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Size" + }, + "axes": { + "maxItems": 2, + "minItems": 2, + "prefixItems": [ + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + } + }, + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + } + } + ], + "title": "Axes", + "type": "array" + } + }, + "required": [ + "name", + "center", + "size", + "axes" + ], + "title": "Box", + "type": "object" + }, + "Cylinder": { + "additionalProperties": false, + "description": "Represents a cylinder in three-dimensional space.\n\nParameters\n----------\nname : \n axis : \n center : \n height : \n inner_radius : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n outer_radius : \n \nAttributes:\n axis (Axis): The axis of the cylinder.\n center (LengthType.Point): The center point of the cylinder.\n height (LengthType.Postive): The height of the cylinder.\n inner_radius (LengthType.Positive): The inner radius of the cylinder.\n outer_radius (LengthType.Positive): The outer radius of the cylinder.", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "axis": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + }, + "title": "Axis" + }, + "center": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Center" + }, + "height": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Height" + }, + "inner_radius": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inner Radius" + }, + "outer_radius": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Outer Radius" + } + }, + "required": [ + "name", + "axis", + "center", + "height", + "outer_radius" + ], + "title": "Cylinder", + "type": "object" + }, + "Edge": { + "additionalProperties": false, + "description": "Edge with edge name defined in the geometry file\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Edge", + "type": "object" + }, + "EntityList_Box_Cylinder_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[typing.Union[flow360.component.simulation.primitives.Box, flow360.component.simulation.primitives.Cylinder]]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/Box" + }, + { + "$ref": "#/$defs/Cylinder" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Box,Cylinder]", + "type": "object" + }, + "EntityList_Cylinder_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Cylinder]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Cylinder" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Cylinder]", + "type": "object" + }, + "EntityList_Cylinder_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[typing.Union[flow360.component.simulation.primitives.Cylinder, flow360.component.simulation.primitives.Surface]]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/Cylinder" + }, + { + "$ref": "#/$defs/Surface" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Cylinder,Surface]", + "type": "object" + }, + "EntityList_Edge_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Edge]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Edge" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Edge]", + "type": "object" + }, + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "HeightBasedRefinement": { + "additionalProperties": false, + "description": "Surface edge refinement by specifying first layer height of the anisotropic layers\n\nParameters\n----------\ntype : typing.Literal['height'] = height\n value : \n ", + "properties": { + "type": { + "const": "height", + "default": "height", + "enum": [ + "height" + ], + "title": "Type", + "type": "string" + }, + "value": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "HeightBasedRefinement", + "type": "object" + }, + "ProjectAnisoSpacing": { + "additionalProperties": false, + "description": "Project the anisotropic spacing from neighboring faces to the edge\n\nParameters\n----------\ntype : typing.Literal['projectAnisoSpacing'] = projectAnisoSpacing\n ", + "properties": { + "type": { + "const": "projectAnisoSpacing", + "default": "projectAnisoSpacing", + "enum": [ + "projectAnisoSpacing" + ], + "title": "Type", + "type": "string" + } + }, + "title": "ProjectAnisoSpacing", + "type": "object" + }, + "RotationCylinder": { + "additionalProperties": false, + "description": "This is the original SlidingInterface. This will create new volume zones\nWill add RotationSphere class in the future.\nPlease refer to\nhttps://www.notion.so/flexcompute/Python-model-design-document-78d442233fa944e6af8eed4de9541bb1?pvs=4#c2de0b822b844a12aa2c00349d1f68a3\n\n\nParameters\n----------\nrefinement_type : typing.Literal['AxisymmetricRefinement'] = AxisymmetricRefinement\n entities : \n spacing_axial : \n spacing_radial : \n spacing_circumferential : \n enclosed_objects : typing.Optional[abc.EntityList[Cylinder,Surface]] = None\n Entities enclosed by this sliding interface. Can be faces, boxes and/or other cylinders etc. This helps determining the volume zone boundary.", + "properties": { + "refinement_type": { + "const": "AxisymmetricRefinement", + "default": "AxisymmetricRefinement", + "enum": [ + "AxisymmetricRefinement" + ], + "title": "Refinement Type", + "type": "string" + }, + "entities": { + "$ref": "#/$defs/EntityList_Cylinder_" + }, + "spacing_axial": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Spacing Axial" + }, + "spacing_radial": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Spacing Radial" + }, + "spacing_circumferential": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Spacing Circumferential" + }, + "enclosed_objects": { + "anyOf": [ + { + "$ref": "#/$defs/EntityList_Cylinder_Surface_" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Entities enclosed by this sliding interface. Can be faces, boxes and/or other cylinders etc. This helps determining the volume zone boundary." + } + }, + "required": [ + "entities", + "spacing_axial", + "spacing_radial", + "spacing_circumferential" + ], + "title": "RotationCylinder", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "SurfaceEdgeRefinement": { + "additionalProperties": false, + "description": "Grow anisotropic layers orthogonal to the edge.\n\nParameters\n----------\nentities : \n growth_rate : typing.Optional[float] = None\n Growth rate for surface mesh layers grown from edges.\nrefinement_type : typing.Literal['SurfaceEdgeRefinement'] = SurfaceEdgeRefinement\n method : typing.Union[flow360.component.simulation.meshing_param.edge_params.AngleBasedRefinement, flow360.component.simulation.meshing_param.edge_params.HeightBasedRefinement, flow360.component.simulation.meshing_param.edge_params.AspectRatioBasedRefinement, flow360.component.simulation.meshing_param.edge_params.ProjectAnisoSpacing, NoneType] = None\n \nIf `method` is None then it projects the anisotropic spacing from neighboring faces to the edge\n(equivalent to `ProjectAniso` in old params).", + "properties": { + "edges": { + "$ref": "#/$defs/EntityList_Edge_" + }, + "growth_rate": { + "anyOf": [ + { + "minimum": 1.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Growth rate for surface mesh layers grown from edges.", + "title": "Growth Rate" + }, + "refinement_type": { + "const": "SurfaceEdgeRefinement", + "default": "SurfaceEdgeRefinement", + "enum": [ + "SurfaceEdgeRefinement" + ], + "title": "Refinement Type", + "type": "string" + }, + "method": { + "anyOf": [ + { + "discriminator": { + "mapping": { + "angle": "#/$defs/AngleBasedRefinement", + "aspectRatio": "#/$defs/AspectRatioBasedRefinement", + "height": "#/$defs/HeightBasedRefinement", + "projectAnisoSpacing": "#/$defs/ProjectAnisoSpacing" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/$defs/AngleBasedRefinement" + }, + { + "$ref": "#/$defs/HeightBasedRefinement" + }, + { + "$ref": "#/$defs/AspectRatioBasedRefinement" + }, + { + "$ref": "#/$defs/ProjectAnisoSpacing" + } + ] + }, + { + "type": "null" + } + ], + "default": null, + "title": "Method" + } + }, + "required": [ + "edges" + ], + "title": "SurfaceEdgeRefinement", + "type": "object" + }, + "SurfaceRefinement": { + "additionalProperties": false, + "description": "These affects surface meshing.\n\nParameters\n----------\nrefinement_type : typing.Literal['SurfaceRefinement'] = SurfaceRefinement\n entities : typing.Optional[abc.EntityList[Surface]] = None\n max_edge_length : \n Local maximum edge length for surface cells.\ncurvature_resolution_angle : \n \n Global maximum angular deviation in degrees. This value will restrict:\n (1) The angle between a cell\u2019s normal and its underlying surface normal\n (2) The angle between a line segment\u2019s normal and its underlying curve normal\n \n\nNote:\n- `None` entities will be expanded (or just ignored and convert to global default, depending on implementation)\nbefore submission. This is supposed to be applied to all the matching entities. We allow this so that we do not\nneed to have dedicated field for global settings. This is also consistent with the `FluidDynamics` class' design.\n\n- For `SurfaceRefinement` we may need validation to detect if default has been set or not. This is because we need\nthese defaults so that the when face name is not present, what config we ues. Depending on how we go down the road.", + "properties": { + "refinement_type": { + "const": "SurfaceRefinement", + "default": "SurfaceRefinement", + "enum": [ + "SurfaceRefinement" + ], + "title": "Refinement Type", + "type": "string" + }, + "faces": { + "anyOf": [ + { + "$ref": "#/$defs/EntityList_Surface_" + }, + { + "type": "null" + } + ], + "default": null + }, + "max_edge_length": { + "description": "Local maximum edge length for surface cells.", + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Max Edge Length" + }, + "curvature_resolution_angle": { + "description": "\n Global maximum angular deviation in degrees. This value will restrict:\n (1) The angle between a cell\u2019s normal and its underlying surface normal\n (2) The angle between a line segment\u2019s normal and its underlying curve normal\n ", + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "angle", + "enum": [ + "rad" + ], + "type": "string" + } + }, + "title": "Curvature Resolution Angle" + } + }, + "required": [ + "max_edge_length", + "curvature_resolution_angle" + ], + "title": "SurfaceRefinement", + "type": "object" + }, + "UniformRefinement": { + "additionalProperties": false, + "description": "Parameters\n----------\nrefinement_type : typing.Literal['UniformRefinement'] = UniformRefinement\n entities : \n spacing : \n ", + "properties": { + "refinement_type": { + "const": "UniformRefinement", + "default": "UniformRefinement", + "enum": [ + "UniformRefinement" + ], + "title": "Refinement Type", + "type": "string" + }, + "entities": { + "$ref": "#/$defs/EntityList_Box_Cylinder_" + }, + "spacing": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Spacing" + } + }, + "required": [ + "entities", + "spacing" + ], + "title": "UniformRefinement", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Meshing parameters for volume and/or surface mesher.\n\nParameters\n----------\nfarfield : typing.Optional[typing.Literal['auto', 'quasi-3d', 'user-defined']] = auto\n Type of farfield generation.\nrefinement_factor : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = 1\n If refinementFactor=r is provided all spacings in refinement regions and first layer thickness will be adjusted to generate r-times finer mesh.\ngap_treatment_strength : typing.Optional[float] = None\n Narrow gap treatment strength used when two surfaces are in close proximity. Use a value between 0 and 1, where 0 is no treatment and 1 is the most conservative treatment. This parameter has a global impact where the anisotropic transition into the isotropic mesh. However, the impact on regions without close proximity is negligible.\nsurface_layer_growth_rate : typing.Optional[float] = 1.2\n Global growth rate of the anisotropic layers grown from the edges.\nrefinements : typing.List[typing.Annotated[typing.Union[flow360.component.simulation.meshing_param.edge_params.SurfaceEdgeRefinement, flow360.component.simulation.meshing_param.face_params.SurfaceRefinement, flow360.component.simulation.meshing_param.face_params.BoundaryLayer, flow360.component.simulation.meshing_param.volume_params.UniformRefinement, flow360.component.simulation.meshing_param.volume_params.AxisymmetricRefinement], FieldInfo(annotation=NoneType, required=True, discriminator='refinement_type')]] = []\n Additional fine-tunning for refinements.\nvolume_zones : typing.List[flow360.component.simulation.meshing_param.volume_params.RotationCylinder] = []\n Creation of new volume zones.\n\nIn `Simulation` this only contains what the user specifies. `Simulation` can derive and add more items according to other aspects of simulation. (E.g. BETDisk volume -> ZoneRefinement)\n\nMeshing related but may and maynot (user specified) need info from `Simulation`:\n1. Add rotational zones.\n2. Add default BETDisk refinement.\n\nAffects volume meshing:\n- farfield\n- refinement_factor\n- gap_treatment_strength\n- `class` BoundaryLayer\n- `class` UniformRefinement\n- `class` AxisymmetricRefinement\n- `class` RotationCylinder\n\nAffects surface meshing:\n- surface_layer_growth_rate\n- `class` SurfaceRefinement\n- `class` SurfaceEdgeRefinement", + "properties": { + "farfield": { + "anyOf": [ + { + "enum": [ + "auto", + "quasi-3d", + "user-defined" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "default": "auto", + "description": "Type of farfield generation.", + "title": "Farfield" + }, + "refinement_factor": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1, + "description": "If refinementFactor=r is provided all spacings in refinement regions and first layer thickness will be adjusted to generate r-times finer mesh.", + "title": "Refinement Factor" + }, + "gap_treatment_strength": { + "anyOf": [ + { + "maximum": 1.0, + "minimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Narrow gap treatment strength used when two surfaces are in close proximity. Use a value between 0 and 1, where 0 is no treatment and 1 is the most conservative treatment. This parameter has a global impact where the anisotropic transition into the isotropic mesh. However, the impact on regions without close proximity is negligible.", + "title": "Gap Treatment Strength" + }, + "surface_layer_growth_rate": { + "anyOf": [ + { + "minimum": 1.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": 1.2, + "description": "Global growth rate of the anisotropic layers grown from the edges.", + "title": "Surface Layer Growth Rate" + }, + "refinements": { + "default": [], + "description": "Additional fine-tunning for refinements.", + "items": { + "discriminator": { + "mapping": { + "AxisymmetricRefinement": "#/$defs/AxisymmetricRefinement", + "BoundaryLayer": "#/$defs/BoundaryLayer", + "SurfaceEdgeRefinement": "#/$defs/SurfaceEdgeRefinement", + "SurfaceRefinement": "#/$defs/SurfaceRefinement", + "UniformRefinement": "#/$defs/UniformRefinement" + }, + "propertyName": "refinement_type" + }, + "oneOf": [ + { + "$ref": "#/$defs/SurfaceEdgeRefinement" + }, + { + "$ref": "#/$defs/SurfaceRefinement" + }, + { + "$ref": "#/$defs/BoundaryLayer" + }, + { + "$ref": "#/$defs/UniformRefinement" + }, + { + "$ref": "#/$defs/AxisymmetricRefinement" + } + ] + }, + "title": "Refinements", + "type": "array" + }, + "volume_zones": { + "default": [], + "description": "Creation of new volume zones.", + "items": { + "$ref": "#/$defs/RotationCylinder" + }, + "title": "Volume Zones", + "type": "array" + } + }, + "title": "MeshingParams", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/fluid-release-24.6.json b/tools/integrations/data_v2/models/fluid-release-24.6.json new file mode 100644 index 000000000..4e28757c8 --- /dev/null +++ b/tools/integrations/data_v2/models/fluid-release-24.6.json @@ -0,0 +1,91 @@ +{ + "material": { + "type": "air", + "name": "air", + "dynamic_viscosity": { + "reference_viscosity": { + "value": 1.716e-05, + "units": "Pa*s" + }, + "reference_temperature": { + "value": 273.15, + "units": "K" + }, + "effective_temperature": { + "value": 110.4, + "units": "K" + } + } + }, + "initial_condition": { + "type": "expression", + "constants": null, + "rho": "1;", + "u": "1;", + "v": "1;", + "w": "1;", + "p": "1;" + }, + "navier_stokes_solver": { + "absolute_tolerance": 1e-10, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 1, + "update_jacobian_frequency": 4, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 30, + "absolute_tolerance": null, + "relative_tolerance": null + }, + "CFL_multiplier": 1.0, + "kappa_MUSCL": -1.0, + "numerical_dissipation_factor": 1.0, + "limit_velocity": false, + "limit_pressure_density": false, + "type_name": "Compressible", + "low_mach_preconditioner": false, + "low_mach_preconditioner_threshold": null + }, + "turbulence_model_solver": { + "absolute_tolerance": 1e-08, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 4, + "update_jacobian_frequency": 4, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 20, + "absolute_tolerance": null, + "relative_tolerance": null + }, + "CFL_multiplier": 2.0, + "type_name": "SpalartAllmaras", + "DDES": false, + "grid_size_for_LES": "maxEdgeLength", + "reconstruction_gradient_limiter": 0.5, + "quadratic_constitutive_relation": false, + "modeling_constants": { + "type_name": "SpalartAllmarasConsts", + "C_DES": 0.72, + "C_d": 8.0 + }, + "rotation_correction": false + }, + "transition_model_solver": { + "absolute_tolerance": 1e-07, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 4, + "update_jacobian_frequency": 4, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 20, + "absolute_tolerance": null, + "relative_tolerance": null + }, + "type_name": "AmplificationFactorTransport", + "turbulence_intensity_percent": 1.0, + "N_crit": 8.15 + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/freestream-release-24.6.json b/tools/integrations/data_v2/models/freestream-release-24.6.json new file mode 100644 index 000000000..ce6db37fa --- /dev/null +++ b/tools/integrations/data_v2/models/freestream-release-24.6.json @@ -0,0 +1,17 @@ +{ + "type": "Freestream", + "entities": { + "stored_entities": [ + { + "name": "my_free_stream" + } + ] + }, + "turbulence_quantities": null, + "velocity": [ + "1", + "2", + "0" + ], + "velocity_type": "absolute" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/inflow-MassFlowRate-release-24.6.json b/tools/integrations/data_v2/models/inflow-MassFlowRate-release-24.6.json new file mode 100644 index 000000000..1fa0d161f --- /dev/null +++ b/tools/integrations/data_v2/models/inflow-MassFlowRate-release-24.6.json @@ -0,0 +1,32 @@ +{ + "type": "Inflow", + "entities": { + "stored_entities": [ + { + "name": "my_inflow1" + } + ] + }, + "turbulence_quantities": { + "type_name": "SpecificDissipationRateAndTurbulentKineticEnergy", + "turbulent_kinetic_energy": { + "value": 123.0, + "units": "ft**2/s**2" + }, + "specific_dissipation_rate": { + "value": 1000.0, + "units": "1/s" + } + }, + "total_temperature": { + "value": 300.0, + "units": "K" + }, + "velocity_direction": null, + "spec": { + "value": { + "value": 123.0, + "units": "lb/s" + } + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/inflow-TotalPressure-release-24.6.json b/tools/integrations/data_v2/models/inflow-TotalPressure-release-24.6.json new file mode 100644 index 000000000..ec21766c1 --- /dev/null +++ b/tools/integrations/data_v2/models/inflow-TotalPressure-release-24.6.json @@ -0,0 +1,32 @@ +{ + "type": "Inflow", + "entities": { + "stored_entities": [ + { + "name": "my_inflow1" + } + ] + }, + "turbulence_quantities": { + "type_name": "SpecificDissipationRateAndTurbulentKineticEnergy", + "turbulent_kinetic_energy": { + "value": 123.0, + "units": "ft**2/s**2" + }, + "specific_dissipation_rate": { + "value": 1000.0, + "units": "1/s" + } + }, + "total_temperature": { + "value": 300.0, + "units": "K" + }, + "velocity_direction": null, + "spec": { + "value": { + "value": 123.0, + "units": "Pa" + } + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-fluid.json b/tools/integrations/data_v2/models/json-schema-release-24.6-fluid.json new file mode 100644 index 000000000..f4dd94cee --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-fluid.json @@ -0,0 +1,938 @@ +{ + "$defs": { + "Air": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['air'] = air\n name : = air\n dynamic_viscosity : typing.Union[flow360.component.simulation.models.material.Sutherland, typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = Sutherland(reference_viscosity=unyt_quantity(1.716e-05,, 'Pa*s'), reference_temperature=unyt_quantity(273.15,, 'K'), effective_temperature=unyt_quantity(110.4,, 'K'))\n ", + "properties": { + "type": { + "const": "air", + "default": "air", + "enum": [ + "air" + ], + "title": "Type", + "type": "string" + }, + "name": { + "default": "air", + "title": "Name", + "type": "string" + }, + "dynamic_viscosity": { + "anyOf": [ + { + "$ref": "#/$defs/Sutherland" + }, + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "viscosity", + "enum": [ + "Pa*s", + "dyn*s/cm**2", + "lbf*s/ft**2" + ], + "type": "string" + } + } + } + ], + "default": { + "referenceViscosity": { + "units": "Pa*s", + "value": 1.716e-05 + }, + "referenceTemperature": { + "units": "K", + "value": 273.15 + }, + "effectiveTemperature": { + "units": "K", + "value": 110.4 + } + }, + "title": "Dynamic Viscosity" + } + }, + "title": "Air", + "type": "object" + }, + "KOmegaSST": { + "additionalProperties": false, + "description": ":class:`KOmegaSST` class\n\nParameters\n----------\nabsolute_tolerance : = 1e-08\n relative_tolerance : = 0\n order_of_accuracy : typing.Literal[1, 2] = 2\n equation_eval_frequency : = 4\n update_jacobian_frequency : = 4\n max_force_jac_update_physical_steps : = 0\n linear_solver : = LinearSolver(max_iterations=20, absolute_tolerance=None, relative_tolerance=None)\n CFL_multiplier : = 2.0\n type_name : typing.Literal['kOmegaSST'] = kOmegaSST\n DDES : = False\n grid_size_for_LES : typing.Literal['maxEdgeLength', 'meanEdgeLength'] = maxEdgeLength\n reconstruction_gradient_limiter : = 1.0\n quadratic_constitutive_relation : = False\n modeling_constants : = KOmegaSSTModelConstants(type_name='kOmegaSSTConsts', C_DES1=0.78, C_DES2=0.61, C_d1=20.0, C_d2=3.0)\n ", + "properties": { + "absolute_tolerance": { + "default": 1e-08, + "exclusiveMinimum": 0.0, + "title": "Absolute Tolerance", + "type": "number" + }, + "relative_tolerance": { + "default": 0, + "minimum": 0.0, + "title": "Relative Tolerance", + "type": "number" + }, + "order_of_accuracy": { + "default": 2, + "enum": [ + 1, + 2 + ], + "title": "Order Of Accuracy", + "type": "integer" + }, + "equation_eval_frequency": { + "default": 4, + "exclusiveMinimum": 0, + "title": "Equation Eval Frequency", + "type": "integer" + }, + "update_jacobian_frequency": { + "default": 4, + "exclusiveMinimum": 0, + "title": "Update Jacobian Frequency", + "type": "integer" + }, + "max_force_jac_update_physical_steps": { + "default": 0, + "minimum": 0, + "title": "Max Force Jac Update Physical Steps", + "type": "integer" + }, + "linear_solver": { + "allOf": [ + { + "$ref": "#/$defs/LinearSolver" + } + ], + "default": { + "maxIterations": 20, + "absoluteTolerance": null, + "relativeTolerance": null + } + }, + "CFL_multiplier": { + "default": 2.0, + "exclusiveMinimum": 0.0, + "title": "Cfl Multiplier", + "type": "number" + }, + "type_name": { + "const": "kOmegaSST", + "default": "kOmegaSST", + "enum": [ + "kOmegaSST" + ], + "title": "Type Name", + "type": "string" + }, + "DDES": { + "default": false, + "title": "Ddes", + "type": "boolean" + }, + "grid_size_for_LES": { + "default": "maxEdgeLength", + "enum": [ + "maxEdgeLength", + "meanEdgeLength" + ], + "title": "Grid Size For Les", + "type": "string" + }, + "reconstruction_gradient_limiter": { + "default": 1.0, + "maximum": 2.0, + "minimum": 0.0, + "title": "Reconstruction Gradient Limiter", + "type": "number" + }, + "quadratic_constitutive_relation": { + "default": false, + "title": "Quadratic Constitutive Relation", + "type": "boolean" + }, + "modeling_constants": { + "allOf": [ + { + "$ref": "#/$defs/KOmegaSSTModelConstants" + } + ], + "default": { + "typeName": "kOmegaSSTConsts", + "CDES1": 0.78, + "CDES2": 0.61, + "CD1": 20.0, + "CD2": 3.0 + } + } + }, + "title": "KOmegaSST", + "type": "object" + }, + "KOmegaSSTModelConstants": { + "additionalProperties": false, + "description": ":class:`KOmegaSSTModelConstants` class\n\nParameters\n----------\ntype_name : typing.Literal['kOmegaSSTConsts'] = kOmegaSSTConsts\n C_DES1 : = 0.78\n C_DES2 : = 0.61\n C_d1 : = 20.0\n C_d2 : = 3.0\n ", + "properties": { + "type_name": { + "const": "kOmegaSSTConsts", + "default": "kOmegaSSTConsts", + "enum": [ + "kOmegaSSTConsts" + ], + "title": "Type Name", + "type": "string" + }, + "C_DES1": { + "default": 0.78, + "minimum": 0.0, + "title": "C Des1", + "type": "number" + }, + "C_DES2": { + "default": 0.61, + "minimum": 0.0, + "title": "C Des2", + "type": "number" + }, + "C_d1": { + "default": 20.0, + "minimum": 0.0, + "title": "C D1", + "type": "number" + }, + "C_d2": { + "default": 3.0, + "minimum": 0.0, + "title": "C D2", + "type": "number" + } + }, + "title": "KOmegaSSTModelConstants", + "type": "object" + }, + "LinearSolver": { + "additionalProperties": false, + "description": ":class:`LinearSolver` class for setting up linear solver for heat equation\n\nParameters\n----------\nmax_iterations : = 30\n absolute_tolerance : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n relative_tolerance : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n \n\nParameters\n----------\n\nmax_iterations : PositiveInt, optional\n Maximum number of linear solver iterations, by default 50\n\nabsolute_tolerance : PositiveFloat, optional\n The linear solver converges when the final residual of the pseudo steps below this value. Either absolute\n tolerance or relative tolerance can be used to determine convergence, by default 1e-10\n\nrelative_tolerance :\n The linear solver converges when the ratio of the final residual and the initial\n residual of the pseudo step is below this value.\n\nvalidation: tolerance settings only available to HeatEquationSolver\n\nReturns\n-------\n:class:`LinearSolver`\n An instance of the component class LinearSolver.\n\n\nExample\n-------\n>>> ls = LinearSolver(\n max_iterations=50,\n absoluteTolerance=1e-10\n )", + "properties": { + "max_iterations": { + "default": 30, + "exclusiveMinimum": 0, + "title": "Max Iterations", + "type": "integer" + }, + "absolute_tolerance": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Absolute Tolerance" + }, + "relative_tolerance": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Relative Tolerance" + } + }, + "title": "LinearSolver", + "type": "object" + }, + "NavierStokesInitialCondition": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['expression'] = expression\n constants : typing.Optional[typing.Dict[str, str]] = None\n rho : \n u : \n v : \n w : \n p : \n ", + "properties": { + "type": { + "const": "expression", + "default": "expression", + "enum": [ + "expression" + ], + "title": "Type", + "type": "string" + }, + "constants": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Constants" + }, + "rho": { + "title": "Rho", + "type": "string" + }, + "u": { + "title": "U", + "type": "string" + }, + "v": { + "title": "V", + "type": "string" + }, + "w": { + "title": "W", + "type": "string" + }, + "p": { + "title": "P", + "type": "string" + } + }, + "required": [ + "rho", + "u", + "v", + "w", + "p" + ], + "title": "NavierStokesInitialCondition", + "type": "object" + }, + "NavierStokesModifiedRestartSolution": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['restartManipulation'] = restartManipulation\n constants : typing.Optional[typing.Dict[str, str]] = None\n rho : \n u : \n v : \n w : \n p : \n ", + "properties": { + "type": { + "const": "restartManipulation", + "default": "restartManipulation", + "enum": [ + "restartManipulation" + ], + "title": "Type", + "type": "string" + }, + "constants": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Constants" + }, + "rho": { + "title": "Rho", + "type": "string" + }, + "u": { + "title": "U", + "type": "string" + }, + "v": { + "title": "V", + "type": "string" + }, + "w": { + "title": "W", + "type": "string" + }, + "p": { + "title": "P", + "type": "string" + } + }, + "required": [ + "rho", + "u", + "v", + "w", + "p" + ], + "title": "NavierStokesModifiedRestartSolution", + "type": "object" + }, + "NavierStokesSolver": { + "additionalProperties": false, + "description": ":class:`NavierStokesSolver` class for setting up compressible Navier-Stokes solver\n\nParameters\n----------\nabsolute_tolerance : = 1e-10\n relative_tolerance : = 0\n order_of_accuracy : typing.Literal[1, 2] = 2\n equation_eval_frequency : = 1\n update_jacobian_frequency : = 4\n max_force_jac_update_physical_steps : = 0\n linear_solver : = LinearSolver(max_iterations=30, absolute_tolerance=None, relative_tolerance=None)\n CFL_multiplier : = 1.0\n kappa_MUSCL : = -1\n numerical_dissipation_factor : = 1\n limit_velocity : = False\n limit_pressure_density : = False\n type_name : typing.Literal['Compressible'] = Compressible\n low_mach_preconditioner : = False\n low_mach_preconditioner_threshold : typing.Optional[typing.Annotated[float, Ge(ge=0)]] = None\n \nParameters\n----------\n\nabsolute_tolerance :\n Tolerance for the NS residual, below which the solver goes to the next physical step\n\nrelative_tolerance :\n Tolerance to the relative residual, below which the solver goes to the next physical step. Relative residual is\n defined as the ratio of the current pseudoStep\u2019s residual to the maximum residual present in the first\n 10 pseudoSteps within the current physicalStep. NOTE: relativeTolerance is ignored in steady simulations and\n only absoluteTolerance is used as the convergence criterion\n\nCFL_multiplier :\n Factor to the CFL definitions defined in \u201ctimeStepping\u201d section\n\nkappa_MUSCL :\n Kappa for the MUSCL scheme, range from [-1, 1], with 1 being unstable. The default value of -1 leads to a 2nd\n order upwind scheme and is the most stable. A value of 0.33 leads to a blended upwind/central scheme and is\n recommended for low subsonic flows leading to reduced dissipation\n\nupdate_jacobian_frequency :\n Frequency at which the jacobian is updated.\n\nequation_eval_frequency :\n Frequency at which to update the compressible NS equation in loosely-coupled simulations\n\nmax_force_jac_update_physical_steps :\n When which physical steps, the jacobian matrix is updated every pseudo step\n\norder_of_accuracy :\n Order of accuracy in space\n\nlimit_velocity :\n Limiter for velocity\n\nlimit_pressure_density :\n Limiter for pressure and density\n\nnumerical_dissipation_factor :\n A factor in the range [0.01, 1.0] which exponentially reduces the dissipation of the numerical flux.\n The recommended starting value for most low-dissipation runs is 0.2\n\nlinear_solver:\n Linear solver settings\n\nlow_mach_preconditioner:\n Uses preconditioning for accelerating low Mach number flows.\n\nlow_mach_preconditioner_threshold:\n For flow regions with Mach numbers smaller than threshold, the input Mach number to the preconditioner is\n assumed to be the threshold value if it is smaller than the threshold.\n The default value for the threshold is the freestream Mach number.\n\nReturns\n-------\n:class:`NavierStokesSolver`\n An instance of the component class NavierStokesSolver.\n\nExample\n-------\n>>> ns = NavierStokesSolver(absolute_tolerance=1e-10)", + "properties": { + "absolute_tolerance": { + "default": 1e-10, + "exclusiveMinimum": 0.0, + "title": "Absolute Tolerance", + "type": "number" + }, + "relative_tolerance": { + "default": 0, + "minimum": 0.0, + "title": "Relative Tolerance", + "type": "number" + }, + "order_of_accuracy": { + "default": 2, + "enum": [ + 1, + 2 + ], + "title": "Order Of Accuracy", + "type": "integer" + }, + "equation_eval_frequency": { + "default": 1, + "exclusiveMinimum": 0, + "title": "Equation Eval Frequency", + "type": "integer" + }, + "update_jacobian_frequency": { + "default": 4, + "exclusiveMinimum": 0, + "title": "Update Jacobian Frequency", + "type": "integer" + }, + "max_force_jac_update_physical_steps": { + "default": 0, + "minimum": 0, + "title": "Max Force Jac Update Physical Steps", + "type": "integer" + }, + "linear_solver": { + "allOf": [ + { + "$ref": "#/$defs/LinearSolver" + } + ], + "default": { + "maxIterations": 30, + "absoluteTolerance": null, + "relativeTolerance": null + } + }, + "CFL_multiplier": { + "default": 1.0, + "exclusiveMinimum": 0.0, + "title": "Cfl Multiplier", + "type": "number" + }, + "kappa_MUSCL": { + "default": -1, + "maximum": 1.0, + "minimum": -1.0, + "title": "Kappa Muscl", + "type": "number" + }, + "numerical_dissipation_factor": { + "default": 1, + "maximum": 1.0, + "minimum": 0.01, + "title": "Numerical Dissipation Factor", + "type": "number" + }, + "limit_velocity": { + "default": false, + "title": "Limit Velocity", + "type": "boolean" + }, + "limit_pressure_density": { + "default": false, + "title": "Limit Pressure Density", + "type": "boolean" + }, + "type_name": { + "const": "Compressible", + "default": "Compressible", + "enum": [ + "Compressible" + ], + "title": "Type Name", + "type": "string" + }, + "low_mach_preconditioner": { + "default": false, + "title": "Low Mach Preconditioner", + "type": "boolean" + }, + "low_mach_preconditioner_threshold": { + "anyOf": [ + { + "minimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Low Mach Preconditioner Threshold" + } + }, + "title": "NavierStokesSolver", + "type": "object" + }, + "NoneSolver": { + "additionalProperties": false, + "description": ":class:`SolverNone` class\n\nParameters\n----------\ntype_name : typing.Literal['None'] = None\n ", + "properties": { + "type_name": { + "const": "None", + "default": "None", + "enum": [ + "None" + ], + "title": "Type Name", + "type": "string" + } + }, + "title": "NoneSolver", + "type": "object" + }, + "SpalartAllmaras": { + "additionalProperties": false, + "description": ":class:`SpalartAllmaras` class\n\nParameters\n----------\nabsolute_tolerance : = 1e-08\n relative_tolerance : = 0\n order_of_accuracy : typing.Literal[1, 2] = 2\n equation_eval_frequency : = 4\n update_jacobian_frequency : = 4\n max_force_jac_update_physical_steps : = 0\n linear_solver : = LinearSolver(max_iterations=20, absolute_tolerance=None, relative_tolerance=None)\n CFL_multiplier : = 2.0\n type_name : typing.Literal['SpalartAllmaras'] = SpalartAllmaras\n DDES : = False\n grid_size_for_LES : typing.Literal['maxEdgeLength', 'meanEdgeLength'] = maxEdgeLength\n reconstruction_gradient_limiter : typing.Optional[typing.Annotated[float, None, Interval(gt=None, ge=0, lt=None, le=2), None, None]] = 0.5\n quadratic_constitutive_relation : = False\n modeling_constants : typing.Optional[flow360.component.simulation.models.solver_numerics.SpalartAllmarasModelConstants] = SpalartAllmarasModelConstants(type_name='SpalartAllmarasConsts', C_DES=0.72, C_d=8.0)\n rotation_correction : = False\n ", + "properties": { + "absolute_tolerance": { + "default": 1e-08, + "exclusiveMinimum": 0.0, + "title": "Absolute Tolerance", + "type": "number" + }, + "relative_tolerance": { + "default": 0, + "minimum": 0.0, + "title": "Relative Tolerance", + "type": "number" + }, + "order_of_accuracy": { + "default": 2, + "enum": [ + 1, + 2 + ], + "title": "Order Of Accuracy", + "type": "integer" + }, + "equation_eval_frequency": { + "default": 4, + "exclusiveMinimum": 0, + "title": "Equation Eval Frequency", + "type": "integer" + }, + "update_jacobian_frequency": { + "default": 4, + "exclusiveMinimum": 0, + "title": "Update Jacobian Frequency", + "type": "integer" + }, + "max_force_jac_update_physical_steps": { + "default": 0, + "minimum": 0, + "title": "Max Force Jac Update Physical Steps", + "type": "integer" + }, + "linear_solver": { + "allOf": [ + { + "$ref": "#/$defs/LinearSolver" + } + ], + "default": { + "maxIterations": 20, + "absoluteTolerance": null, + "relativeTolerance": null + } + }, + "CFL_multiplier": { + "default": 2.0, + "exclusiveMinimum": 0.0, + "title": "Cfl Multiplier", + "type": "number" + }, + "type_name": { + "const": "SpalartAllmaras", + "default": "SpalartAllmaras", + "enum": [ + "SpalartAllmaras" + ], + "title": "Type Name", + "type": "string" + }, + "DDES": { + "default": false, + "title": "Ddes", + "type": "boolean" + }, + "grid_size_for_LES": { + "default": "maxEdgeLength", + "enum": [ + "maxEdgeLength", + "meanEdgeLength" + ], + "title": "Grid Size For Les", + "type": "string" + }, + "reconstruction_gradient_limiter": { + "anyOf": [ + { + "maximum": 2.0, + "minimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": 0.5, + "title": "Reconstruction Gradient Limiter" + }, + "quadratic_constitutive_relation": { + "default": false, + "title": "Quadratic Constitutive Relation", + "type": "boolean" + }, + "modeling_constants": { + "anyOf": [ + { + "$ref": "#/$defs/SpalartAllmarasModelConstants" + }, + { + "type": "null" + } + ], + "default": { + "typeName": "SpalartAllmarasConsts", + "CDES": 0.72, + "CD": 8.0 + } + }, + "rotation_correction": { + "default": false, + "title": "Rotation Correction", + "type": "boolean" + } + }, + "title": "SpalartAllmaras", + "type": "object" + }, + "SpalartAllmarasModelConstants": { + "additionalProperties": false, + "description": ":class:`SpalartAllmarasModelConstants` class\n\nParameters\n----------\ntype_name : typing.Literal['SpalartAllmarasConsts'] = SpalartAllmarasConsts\n C_DES : = 0.72\n C_d : = 8.0\n ", + "properties": { + "type_name": { + "const": "SpalartAllmarasConsts", + "default": "SpalartAllmarasConsts", + "enum": [ + "SpalartAllmarasConsts" + ], + "title": "Type Name", + "type": "string" + }, + "C_DES": { + "default": 0.72, + "minimum": 0.0, + "title": "C Des", + "type": "number" + }, + "C_d": { + "default": 8.0, + "minimum": 0.0, + "title": "C D", + "type": "number" + } + }, + "title": "SpalartAllmarasModelConstants", + "type": "object" + }, + "Sutherland": { + "additionalProperties": false, + "description": "Parameters\n----------\nreference_viscosity : \n reference_temperature : \n effective_temperature : \n ", + "properties": { + "reference_viscosity": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "viscosity", + "enum": [ + "Pa*s", + "dyn*s/cm**2", + "lbf*s/ft**2" + ], + "type": "string" + } + }, + "title": "Reference Viscosity" + }, + "reference_temperature": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + }, + "title": "Reference Temperature" + }, + "effective_temperature": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + }, + "title": "Effective Temperature" + } + }, + "required": [ + "reference_viscosity", + "reference_temperature", + "effective_temperature" + ], + "title": "Sutherland", + "type": "object" + }, + "TransitionModelSolver": { + "additionalProperties": false, + "description": ":class:`TransitionModelSolver` class for setting up transition model solver\n\nParameters\n----------\nabsolute_tolerance : = 1e-07\n relative_tolerance : = 0\n order_of_accuracy : typing.Literal[1, 2] = 2\n equation_eval_frequency : = 4\n update_jacobian_frequency : = 4\n max_force_jac_update_physical_steps : = 0\n linear_solver : = LinearSolver(max_iterations=20, absolute_tolerance=None, relative_tolerance=None)\n type_name : typing.Literal['AmplificationFactorTransport'] = AmplificationFactorTransport\n turbulence_intensity_percent : = 1.0\n N_crit : = 8.15\n \nParameters\n----------\n\n(...)\n\nReturns\n-------\n:class:`TransitionModelSolver`\n An instance of the component class TransitionModelSolver.\n\nExample\n-------\n>>> ts = TransitionModelSolver(absolute_tolerance=1e-10)", + "properties": { + "absolute_tolerance": { + "default": 1e-07, + "exclusiveMinimum": 0.0, + "title": "Absolute Tolerance", + "type": "number" + }, + "relative_tolerance": { + "default": 0, + "minimum": 0.0, + "title": "Relative Tolerance", + "type": "number" + }, + "order_of_accuracy": { + "default": 2, + "enum": [ + 1, + 2 + ], + "title": "Order Of Accuracy", + "type": "integer" + }, + "equation_eval_frequency": { + "default": 4, + "exclusiveMinimum": 0, + "title": "Equation Eval Frequency", + "type": "integer" + }, + "update_jacobian_frequency": { + "default": 4, + "exclusiveMinimum": 0, + "title": "Update Jacobian Frequency", + "type": "integer" + }, + "max_force_jac_update_physical_steps": { + "default": 0, + "minimum": 0, + "title": "Max Force Jac Update Physical Steps", + "type": "integer" + }, + "linear_solver": { + "allOf": [ + { + "$ref": "#/$defs/LinearSolver" + } + ], + "default": { + "maxIterations": 20, + "absoluteTolerance": null, + "relativeTolerance": null + } + }, + "type_name": { + "const": "AmplificationFactorTransport", + "default": "AmplificationFactorTransport", + "enum": [ + "AmplificationFactorTransport" + ], + "title": "Type Name", + "type": "string" + }, + "turbulence_intensity_percent": { + "default": 1.0, + "maximum": 2.5, + "minimum": 0.03, + "title": "Turbulence Intensity Percent", + "type": "number" + }, + "N_crit": { + "default": 8.15, + "maximum": 11.0, + "minimum": 1.0, + "title": "N Crit", + "type": "number" + } + }, + "title": "TransitionModelSolver", + "type": "object" + } + }, + "additionalProperties": false, + "description": "General FluidDynamics volume model that contains all the common fields every fluid dynamics zone should have.\n\n\nParameters\n----------\nmaterial : = Air(type='air', name='air', dynamic_viscosity=Sutherland(reference_viscosity=unyt_quantity(1.716e-05,, 'Pa*s'),, reference_temperature=unyt_quantity(273.15,, 'K'),, effective_temperature=unyt_quantity(110.4,, 'K')))\n initial_condition : typing.Union[flow360.component.simulation.models.volume_models.NavierStokesModifiedRestartSolution, flow360.component.simulation.models.volume_models.NavierStokesInitialCondition, NoneType] = None\n navier_stokes_solver : = NavierStokesSolver(absolute_tolerance=1e-10, relative_tolerance=0.0, order_of_accuracy=2, equation_eval_frequency=1, update_jacobian_frequency=4, max_force_jac_update_physical_steps=0, linear_solver=LinearSolver(max_iterations=30,, absolute_tolerance=None,, relative_tolerance=None), CFL_multiplier=1.0, kappa_MUSCL=-1.0, numerical_dissipation_factor=1.0, limit_velocity=False, limit_pressure_density=False, type_name='Compressible', low_mach_preconditioner=False, low_mach_preconditioner_threshold=None)\n turbulence_model_solver : typing.Union[flow360.component.simulation.models.solver_numerics.NoneSolver, flow360.component.simulation.models.solver_numerics.SpalartAllmaras, flow360.component.simulation.models.solver_numerics.KOmegaSST] = SpalartAllmaras(absolute_tolerance=1e-08, relative_tolerance=0.0, order_of_accuracy=2, equation_eval_frequency=4, update_jacobian_frequency=4, max_force_jac_update_physical_steps=0, linear_solver=LinearSolver(max_iterations=20,, absolute_tolerance=None,, relative_tolerance=None), CFL_multiplier=2.0, type_name='SpalartAllmaras', DDES=False, grid_size_for_LES='maxEdgeLength', reconstruction_gradient_limiter=0.5, quadratic_constitutive_relation=False, modeling_constants=SpalartAllmarasModelConstants(type_name='SpalartAllmarasConsts',, C_DES=0.72,, C_d=8.0), rotation_correction=False)\n transition_model_solver : typing.Optional[flow360.component.simulation.models.solver_numerics.TransitionModelSolver] = None\n ", + "properties": { + "material": { + "allOf": [ + { + "$ref": "#/$defs/Air" + } + ], + "default": { + "type": "air", + "name": "air", + "dynamicViscosity": { + "effectiveTemperature": { + "units": "K", + "value": 110.4 + }, + "referenceTemperature": { + "units": "K", + "value": 273.15 + }, + "referenceViscosity": { + "units": "Pa*s", + "value": 1.716e-05 + } + } + } + }, + "initial_condition": { + "anyOf": [ + { + "$ref": "#/$defs/NavierStokesModifiedRestartSolution" + }, + { + "$ref": "#/$defs/NavierStokesInitialCondition" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Initial Condition" + }, + "navier_stokes_solver": { + "allOf": [ + { + "$ref": "#/$defs/NavierStokesSolver" + } + ], + "default": { + "absoluteTolerance": 1e-10, + "relativeTolerance": 0.0, + "orderOfAccuracy": 2, + "equationEvalFrequency": 1, + "updateJacobianFrequency": 4, + "maxForceJacUpdatePhysicalSteps": 0, + "linearSolver": { + "absoluteTolerance": null, + "maxIterations": 30, + "relativeTolerance": null + }, + "CFLMultiplier": 1.0, + "kappaMUSCL": -1.0, + "numericalDissipationFactor": 1.0, + "limitVelocity": false, + "limitPressureDensity": false, + "typeName": "Compressible", + "lowMachPreconditioner": false, + "lowMachPreconditionerThreshold": null + } + }, + "turbulence_model_solver": { + "anyOf": [ + { + "$ref": "#/$defs/NoneSolver" + }, + { + "$ref": "#/$defs/SpalartAllmaras" + }, + { + "$ref": "#/$defs/KOmegaSST" + } + ], + "default": { + "absoluteTolerance": 1e-08, + "relativeTolerance": 0.0, + "orderOfAccuracy": 2, + "equationEvalFrequency": 4, + "updateJacobianFrequency": 4, + "maxForceJacUpdatePhysicalSteps": 0, + "linearSolver": { + "absoluteTolerance": null, + "maxIterations": 20, + "relativeTolerance": null + }, + "CFLMultiplier": 2.0, + "typeName": "SpalartAllmaras", + "DDES": false, + "gridSizeForLES": "maxEdgeLength", + "reconstructionGradientLimiter": 0.5, + "quadraticConstitutiveRelation": false, + "modelingConstants": { + "CD": 8.0, + "CDES": 0.72, + "typeName": "SpalartAllmarasConsts" + }, + "rotationCorrection": false + }, + "title": "Turbulence Model Solver" + }, + "transition_model_solver": { + "anyOf": [ + { + "$ref": "#/$defs/TransitionModelSolver" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "Fluid", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-freestream.json b/tools/integrations/data_v2/models/json-schema-release-24.6-freestream.json new file mode 100644 index 000000000..407580303 --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-freestream.json @@ -0,0 +1,801 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "ModifiedTurbulentViscosity": { + "additionalProperties": false, + "description": "modifiedTurbulentViscosity : non-dimensional [`C_inf*L_gridUnit`]\n The modified turbulent eddy viscosity (SA). Applicable only when using SA model.\n\n\nParameters\n----------\ntype_name : typing.Literal['ModifiedTurbulentViscosity'] = ModifiedTurbulentViscosity\n modified_turbulent_viscosity : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]]\n ", + "properties": { + "type_name": { + "const": "ModifiedTurbulentViscosity", + "default": "ModifiedTurbulentViscosity", + "enum": [ + "ModifiedTurbulentViscosity" + ], + "title": "Type Name", + "type": "string" + }, + "modified_turbulent_viscosity": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "viscosity", + "enum": [ + "Pa*s", + "dyn*s/cm**2", + "lbf*s/ft**2" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "title": "Modified Turbulent Viscosity" + } + }, + "required": [ + "modified_turbulent_viscosity" + ], + "title": "ModifiedTurbulentViscosity", + "type": "object" + }, + "ModifiedTurbulentViscosityRatio": { + "additionalProperties": false, + "description": "modifiedTurbulentViscosityRatio : non-dimensional [`-`]\n The ratio of modified turbulent eddy viscosity (SA) over the freestream viscosity.\n Applicable only when using SA model.\n\n\nParameters\n----------\ntype_name : typing.Literal['ModifiedTurbulentViscosityRatio'] = ModifiedTurbulentViscosityRatio\n modified_turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "ModifiedTurbulentViscosityRatio", + "default": "ModifiedTurbulentViscosityRatio", + "enum": [ + "ModifiedTurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "modified_turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Modified Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "modified_turbulent_viscosity_ratio" + ], + "title": "ModifiedTurbulentViscosityRatio", + "type": "object" + }, + "SpecificDissipationRateAndTurbulentKineticEnergy": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['SpecificDissipationRateAndTurbulentKineticEnergy'] = SpecificDissipationRateAndTurbulentKineticEnergy\n turbulent_kinetic_energy : \n specific_dissipation_rate : \n ", + "properties": { + "type_name": { + "const": "SpecificDissipationRateAndTurbulentKineticEnergy", + "default": "SpecificDissipationRateAndTurbulentKineticEnergy", + "enum": [ + "SpecificDissipationRateAndTurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + } + }, + "required": [ + "turbulent_kinetic_energy", + "specific_dissipation_rate" + ], + "title": "SpecificDissipationRateAndTurbulentKineticEnergy", + "type": "object" + }, + "SpecificDissipationRateAndTurbulentLengthScale": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['SpecificDissipationRateAndTurbulentLengthScale'] = SpecificDissipationRateAndTurbulentLengthScale\n turbulent_length_scale : \n specific_dissipation_rate : \n ", + "properties": { + "type_name": { + "const": "SpecificDissipationRateAndTurbulentLengthScale", + "default": "SpecificDissipationRateAndTurbulentLengthScale", + "enum": [ + "SpecificDissipationRateAndTurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + } + }, + "required": [ + "turbulent_length_scale", + "specific_dissipation_rate" + ], + "title": "SpecificDissipationRateAndTurbulentLengthScale", + "type": "object" + }, + "SpecificDissipationRateAndTurbulentViscosityRatio": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['SpecificDissipationRateAndTurbulentViscosityRatio'] = SpecificDissipationRateAndTurbulentViscosityRatio\n turbulent_viscosity_ratio : \n specific_dissipation_rate : \n ", + "properties": { + "type_name": { + "const": "SpecificDissipationRateAndTurbulentViscosityRatio", + "default": "SpecificDissipationRateAndTurbulentViscosityRatio", + "enum": [ + "SpecificDissipationRateAndTurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + } + }, + "required": [ + "turbulent_viscosity_ratio", + "specific_dissipation_rate" + ], + "title": "SpecificDissipationRateAndTurbulentViscosityRatio", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "TurbulentIntensity": { + "additionalProperties": false, + "description": "turbulentIntensity : non-dimensional [`-`]\n Turbulent intensity. Applicable only when using SST model.\n This is related to turbulent kinetic energy as:\n `turbulentKineticEnergy = 1.5*pow(U_ref * turbulentIntensity, 2)`.\n Note the use of the freestream velocity U_ref instead of C_inf.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentIntensity'] = TurbulentIntensity\n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensity", + "default": "TurbulentIntensity", + "enum": [ + "TurbulentIntensity" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "turbulent_intensity" + ], + "title": "TurbulentIntensity", + "type": "object" + }, + "TurbulentIntensityAndSpecificDissipationRate": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentIntensityAndSpecificDissipationRate'] = TurbulentIntensityAndSpecificDissipationRate\n specific_dissipation_rate : \n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensityAndSpecificDissipationRate", + "default": "TurbulentIntensityAndSpecificDissipationRate", + "enum": [ + "TurbulentIntensityAndSpecificDissipationRate" + ], + "title": "Type Name", + "type": "string" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "specific_dissipation_rate", + "turbulent_intensity" + ], + "title": "TurbulentIntensityAndSpecificDissipationRate", + "type": "object" + }, + "TurbulentIntensityAndTurbulentLengthScale": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentIntensityAndTurbulentLengthScale'] = TurbulentIntensityAndTurbulentLengthScale\n turbulent_length_scale : \n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensityAndTurbulentLengthScale", + "default": "TurbulentIntensityAndTurbulentLengthScale", + "enum": [ + "TurbulentIntensityAndTurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "turbulent_length_scale", + "turbulent_intensity" + ], + "title": "TurbulentIntensityAndTurbulentLengthScale", + "type": "object" + }, + "TurbulentIntensityAndTurbulentViscosityRatio": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentIntensityAndTurbulentViscosityRatio'] = TurbulentIntensityAndTurbulentViscosityRatio\n turbulent_viscosity_ratio : \n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensityAndTurbulentViscosityRatio", + "default": "TurbulentIntensityAndTurbulentViscosityRatio", + "enum": [ + "TurbulentIntensityAndTurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "turbulent_viscosity_ratio", + "turbulent_intensity" + ], + "title": "TurbulentIntensityAndTurbulentViscosityRatio", + "type": "object" + }, + "TurbulentKineticEnergy": { + "additionalProperties": false, + "description": "turbulentKineticEnergy : non-dimensional [`C_inf^2`]\n Turbulent kinetic energy. Applicable only when using SST model.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentKineticEnergy'] = TurbulentKineticEnergy\n turbulent_kinetic_energy : \n ", + "properties": { + "type_name": { + "const": "TurbulentKineticEnergy", + "default": "TurbulentKineticEnergy", + "enum": [ + "TurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + } + }, + "required": [ + "turbulent_kinetic_energy" + ], + "title": "TurbulentKineticEnergy", + "type": "object" + }, + "TurbulentLengthScale": { + "additionalProperties": false, + "description": "turbulentLengthScale : non-dimensional [`L_gridUnit`]\n The turbulent length scale is an estimation of the size of the eddies that are modeled/not resolved.\n Applicable only when using SST model. This is related to the turbulent kinetic energy and turbulent\n specific dissipation rate as: `L_T = sqrt(k)/(pow(beta_0^*, 0.25)*w)` where `L_T` is turbulent length scale,\n `k` is turbulent kinetic energy, `beta_0^*` is 0.09 and `w` is turbulent specific dissipation rate.\n Applicable only when using SST model.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentLengthScale'] = TurbulentLengthScale\n turbulent_length_scale : \n ", + "properties": { + "type_name": { + "const": "TurbulentLengthScale", + "default": "TurbulentLengthScale", + "enum": [ + "TurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + } + }, + "required": [ + "turbulent_length_scale" + ], + "title": "TurbulentLengthScale", + "type": "object" + }, + "TurbulentLengthScaleAndTurbulentKineticEnergy": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentLengthScaleAndTurbulentKineticEnergy'] = TurbulentLengthScaleAndTurbulentKineticEnergy\n turbulent_kinetic_energy : \n turbulent_length_scale : \n ", + "properties": { + "type_name": { + "const": "TurbulentLengthScaleAndTurbulentKineticEnergy", + "default": "TurbulentLengthScaleAndTurbulentKineticEnergy", + "enum": [ + "TurbulentLengthScaleAndTurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + } + }, + "required": [ + "turbulent_kinetic_energy", + "turbulent_length_scale" + ], + "title": "TurbulentLengthScaleAndTurbulentKineticEnergy", + "type": "object" + }, + "TurbulentViscosityRatio": { + "additionalProperties": false, + "description": "turbulentViscosityRatio : non-dimensional [`-`]\n The ratio of turbulent eddy viscosity over the freestream viscosity. Applicable for both SA and SST model.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentViscosityRatio'] = TurbulentViscosityRatio\n turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "TurbulentViscosityRatio", + "default": "TurbulentViscosityRatio", + "enum": [ + "TurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "turbulent_viscosity_ratio" + ], + "title": "TurbulentViscosityRatio", + "type": "object" + }, + "TurbulentViscosityRatioAndTurbulentKineticEnergy": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentViscosityRatioAndTurbulentKineticEnergy'] = TurbulentViscosityRatioAndTurbulentKineticEnergy\n turbulent_kinetic_energy : \n turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "TurbulentViscosityRatioAndTurbulentKineticEnergy", + "default": "TurbulentViscosityRatioAndTurbulentKineticEnergy", + "enum": [ + "TurbulentViscosityRatioAndTurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "turbulent_kinetic_energy", + "turbulent_viscosity_ratio" + ], + "title": "TurbulentViscosityRatioAndTurbulentKineticEnergy", + "type": "object" + }, + "TurbulentViscosityRatioAndTurbulentLengthScale": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentViscosityRatioAndTurbulentLengthScale'] = TurbulentViscosityRatioAndTurbulentLengthScale\n turbulent_length_scale : \n turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "TurbulentViscosityRatioAndTurbulentLengthScale", + "default": "TurbulentViscosityRatioAndTurbulentLengthScale", + "enum": [ + "TurbulentViscosityRatioAndTurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "turbulent_length_scale", + "turbulent_viscosity_ratio" + ], + "title": "TurbulentViscosityRatioAndTurbulentLengthScale", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['Freestream'] = Freestream\n entities : \n turbulence_quantities : typing.Union[flow360.component.simulation.models.turbulence_quantities.TurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.TurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensity, flow360.component.simulation.models.turbulence_quantities.TurbulentLengthScale, flow360.component.simulation.models.turbulence_quantities.ModifiedTurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.ModifiedTurbulentViscosity, flow360.component.simulation.models.turbulence_quantities.SpecificDissipationRateAndTurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentViscosityRatioAndTurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentLengthScaleAndTurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensityAndSpecificDissipationRate, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensityAndTurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensityAndTurbulentLengthScale, flow360.component.simulation.models.turbulence_quantities.SpecificDissipationRateAndTurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.SpecificDissipationRateAndTurbulentLengthScale, flow360.component.simulation.models.turbulence_quantities.TurbulentViscosityRatioAndTurbulentLengthScale, NoneType] = None\n velocity : typing.Union[typing.Tuple[typing.Annotated[str, Strict(strict=True)], typing.Annotated[str, Strict(strict=True)], typing.Annotated[str, Strict(strict=True)]], typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], NoneType] = None\n velocity_type : typing.Literal['absolute', 'relative'] = relative\n ", + "properties": { + "type": { + "const": "Freestream", + "default": "Freestream", + "enum": [ + "Freestream" + ], + "title": "Type", + "type": "string" + }, + "surfaces": { + "$ref": "#/$defs/EntityList_Surface_" + }, + "turbulence_quantities": { + "anyOf": [ + { + "$ref": "#/$defs/TurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/TurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentIntensity" + }, + { + "$ref": "#/$defs/TurbulentLengthScale" + }, + { + "$ref": "#/$defs/ModifiedTurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/ModifiedTurbulentViscosity" + }, + { + "$ref": "#/$defs/SpecificDissipationRateAndTurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentViscosityRatioAndTurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentLengthScaleAndTurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentIntensityAndSpecificDissipationRate" + }, + { + "$ref": "#/$defs/TurbulentIntensityAndTurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/TurbulentIntensityAndTurbulentLengthScale" + }, + { + "$ref": "#/$defs/SpecificDissipationRateAndTurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/SpecificDissipationRateAndTurbulentLengthScale" + }, + { + "$ref": "#/$defs/TurbulentViscosityRatioAndTurbulentLengthScale" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Turbulence Quantities" + }, + "velocity": { + "anyOf": [ + { + "maxItems": 3, + "minItems": 3, + "prefixItems": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ], + "type": "array" + }, + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "velocity", + "enum": [ + "m/s", + "cm/s", + "ft/s" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Velocity" + }, + "velocity_type": { + "default": "relative", + "enum": [ + "absolute", + "relative" + ], + "title": "Velocity Type", + "type": "string" + } + }, + "required": [ + "surfaces" + ], + "title": "Freestream", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-inflow.json b/tools/integrations/data_v2/models/json-schema-release-24.6-inflow.json new file mode 100644 index 000000000..88bbe36ce --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-inflow.json @@ -0,0 +1,853 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "MassFlowRate": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : \n ", + "properties": { + "value": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "mass_flow_rate", + "enum": [ + "kg/s", + "g/s", + "lb/s" + ], + "type": "string" + } + }, + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "MassFlowRate", + "type": "object" + }, + "ModifiedTurbulentViscosity": { + "additionalProperties": false, + "description": "modifiedTurbulentViscosity : non-dimensional [`C_inf*L_gridUnit`]\n The modified turbulent eddy viscosity (SA). Applicable only when using SA model.\n\n\nParameters\n----------\ntype_name : typing.Literal['ModifiedTurbulentViscosity'] = ModifiedTurbulentViscosity\n modified_turbulent_viscosity : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]]\n ", + "properties": { + "type_name": { + "const": "ModifiedTurbulentViscosity", + "default": "ModifiedTurbulentViscosity", + "enum": [ + "ModifiedTurbulentViscosity" + ], + "title": "Type Name", + "type": "string" + }, + "modified_turbulent_viscosity": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "viscosity", + "enum": [ + "Pa*s", + "dyn*s/cm**2", + "lbf*s/ft**2" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "title": "Modified Turbulent Viscosity" + } + }, + "required": [ + "modified_turbulent_viscosity" + ], + "title": "ModifiedTurbulentViscosity", + "type": "object" + }, + "ModifiedTurbulentViscosityRatio": { + "additionalProperties": false, + "description": "modifiedTurbulentViscosityRatio : non-dimensional [`-`]\n The ratio of modified turbulent eddy viscosity (SA) over the freestream viscosity.\n Applicable only when using SA model.\n\n\nParameters\n----------\ntype_name : typing.Literal['ModifiedTurbulentViscosityRatio'] = ModifiedTurbulentViscosityRatio\n modified_turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "ModifiedTurbulentViscosityRatio", + "default": "ModifiedTurbulentViscosityRatio", + "enum": [ + "ModifiedTurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "modified_turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Modified Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "modified_turbulent_viscosity_ratio" + ], + "title": "ModifiedTurbulentViscosityRatio", + "type": "object" + }, + "SpecificDissipationRateAndTurbulentKineticEnergy": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['SpecificDissipationRateAndTurbulentKineticEnergy'] = SpecificDissipationRateAndTurbulentKineticEnergy\n turbulent_kinetic_energy : \n specific_dissipation_rate : \n ", + "properties": { + "type_name": { + "const": "SpecificDissipationRateAndTurbulentKineticEnergy", + "default": "SpecificDissipationRateAndTurbulentKineticEnergy", + "enum": [ + "SpecificDissipationRateAndTurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + } + }, + "required": [ + "turbulent_kinetic_energy", + "specific_dissipation_rate" + ], + "title": "SpecificDissipationRateAndTurbulentKineticEnergy", + "type": "object" + }, + "SpecificDissipationRateAndTurbulentLengthScale": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['SpecificDissipationRateAndTurbulentLengthScale'] = SpecificDissipationRateAndTurbulentLengthScale\n turbulent_length_scale : \n specific_dissipation_rate : \n ", + "properties": { + "type_name": { + "const": "SpecificDissipationRateAndTurbulentLengthScale", + "default": "SpecificDissipationRateAndTurbulentLengthScale", + "enum": [ + "SpecificDissipationRateAndTurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + } + }, + "required": [ + "turbulent_length_scale", + "specific_dissipation_rate" + ], + "title": "SpecificDissipationRateAndTurbulentLengthScale", + "type": "object" + }, + "SpecificDissipationRateAndTurbulentViscosityRatio": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['SpecificDissipationRateAndTurbulentViscosityRatio'] = SpecificDissipationRateAndTurbulentViscosityRatio\n turbulent_viscosity_ratio : \n specific_dissipation_rate : \n ", + "properties": { + "type_name": { + "const": "SpecificDissipationRateAndTurbulentViscosityRatio", + "default": "SpecificDissipationRateAndTurbulentViscosityRatio", + "enum": [ + "SpecificDissipationRateAndTurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + } + }, + "required": [ + "turbulent_viscosity_ratio", + "specific_dissipation_rate" + ], + "title": "SpecificDissipationRateAndTurbulentViscosityRatio", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "TotalPressure": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : \n ", + "properties": { + "value": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "pressure", + "enum": [ + "Pa", + "dyn/cm**2", + "lbf/ft**2" + ], + "type": "string" + } + }, + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "TotalPressure", + "type": "object" + }, + "TurbulentIntensity": { + "additionalProperties": false, + "description": "turbulentIntensity : non-dimensional [`-`]\n Turbulent intensity. Applicable only when using SST model.\n This is related to turbulent kinetic energy as:\n `turbulentKineticEnergy = 1.5*pow(U_ref * turbulentIntensity, 2)`.\n Note the use of the freestream velocity U_ref instead of C_inf.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentIntensity'] = TurbulentIntensity\n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensity", + "default": "TurbulentIntensity", + "enum": [ + "TurbulentIntensity" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "turbulent_intensity" + ], + "title": "TurbulentIntensity", + "type": "object" + }, + "TurbulentIntensityAndSpecificDissipationRate": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentIntensityAndSpecificDissipationRate'] = TurbulentIntensityAndSpecificDissipationRate\n specific_dissipation_rate : \n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensityAndSpecificDissipationRate", + "default": "TurbulentIntensityAndSpecificDissipationRate", + "enum": [ + "TurbulentIntensityAndSpecificDissipationRate" + ], + "title": "Type Name", + "type": "string" + }, + "specific_dissipation_rate": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "frequency", + "enum": [ + "Hz", + "1/s" + ], + "type": "string" + } + }, + "title": "Specific Dissipation Rate" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "specific_dissipation_rate", + "turbulent_intensity" + ], + "title": "TurbulentIntensityAndSpecificDissipationRate", + "type": "object" + }, + "TurbulentIntensityAndTurbulentLengthScale": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentIntensityAndTurbulentLengthScale'] = TurbulentIntensityAndTurbulentLengthScale\n turbulent_length_scale : \n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensityAndTurbulentLengthScale", + "default": "TurbulentIntensityAndTurbulentLengthScale", + "enum": [ + "TurbulentIntensityAndTurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "turbulent_length_scale", + "turbulent_intensity" + ], + "title": "TurbulentIntensityAndTurbulentLengthScale", + "type": "object" + }, + "TurbulentIntensityAndTurbulentViscosityRatio": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentIntensityAndTurbulentViscosityRatio'] = TurbulentIntensityAndTurbulentViscosityRatio\n turbulent_viscosity_ratio : \n turbulent_intensity : \n ", + "properties": { + "type_name": { + "const": "TurbulentIntensityAndTurbulentViscosityRatio", + "default": "TurbulentIntensityAndTurbulentViscosityRatio", + "enum": [ + "TurbulentIntensityAndTurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + }, + "turbulent_intensity": { + "minimum": 0.0, + "title": "Turbulent Intensity", + "type": "number" + } + }, + "required": [ + "turbulent_viscosity_ratio", + "turbulent_intensity" + ], + "title": "TurbulentIntensityAndTurbulentViscosityRatio", + "type": "object" + }, + "TurbulentKineticEnergy": { + "additionalProperties": false, + "description": "turbulentKineticEnergy : non-dimensional [`C_inf^2`]\n Turbulent kinetic energy. Applicable only when using SST model.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentKineticEnergy'] = TurbulentKineticEnergy\n turbulent_kinetic_energy : \n ", + "properties": { + "type_name": { + "const": "TurbulentKineticEnergy", + "default": "TurbulentKineticEnergy", + "enum": [ + "TurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + } + }, + "required": [ + "turbulent_kinetic_energy" + ], + "title": "TurbulentKineticEnergy", + "type": "object" + }, + "TurbulentLengthScale": { + "additionalProperties": false, + "description": "turbulentLengthScale : non-dimensional [`L_gridUnit`]\n The turbulent length scale is an estimation of the size of the eddies that are modeled/not resolved.\n Applicable only when using SST model. This is related to the turbulent kinetic energy and turbulent\n specific dissipation rate as: `L_T = sqrt(k)/(pow(beta_0^*, 0.25)*w)` where `L_T` is turbulent length scale,\n `k` is turbulent kinetic energy, `beta_0^*` is 0.09 and `w` is turbulent specific dissipation rate.\n Applicable only when using SST model.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentLengthScale'] = TurbulentLengthScale\n turbulent_length_scale : \n ", + "properties": { + "type_name": { + "const": "TurbulentLengthScale", + "default": "TurbulentLengthScale", + "enum": [ + "TurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + } + }, + "required": [ + "turbulent_length_scale" + ], + "title": "TurbulentLengthScale", + "type": "object" + }, + "TurbulentLengthScaleAndTurbulentKineticEnergy": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentLengthScaleAndTurbulentKineticEnergy'] = TurbulentLengthScaleAndTurbulentKineticEnergy\n turbulent_kinetic_energy : \n turbulent_length_scale : \n ", + "properties": { + "type_name": { + "const": "TurbulentLengthScaleAndTurbulentKineticEnergy", + "default": "TurbulentLengthScaleAndTurbulentKineticEnergy", + "enum": [ + "TurbulentLengthScaleAndTurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + } + }, + "required": [ + "turbulent_kinetic_energy", + "turbulent_length_scale" + ], + "title": "TurbulentLengthScaleAndTurbulentKineticEnergy", + "type": "object" + }, + "TurbulentViscosityRatio": { + "additionalProperties": false, + "description": "turbulentViscosityRatio : non-dimensional [`-`]\n The ratio of turbulent eddy viscosity over the freestream viscosity. Applicable for both SA and SST model.\n\n\nParameters\n----------\ntype_name : typing.Literal['TurbulentViscosityRatio'] = TurbulentViscosityRatio\n turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "TurbulentViscosityRatio", + "default": "TurbulentViscosityRatio", + "enum": [ + "TurbulentViscosityRatio" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "turbulent_viscosity_ratio" + ], + "title": "TurbulentViscosityRatio", + "type": "object" + }, + "TurbulentViscosityRatioAndTurbulentKineticEnergy": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentViscosityRatioAndTurbulentKineticEnergy'] = TurbulentViscosityRatioAndTurbulentKineticEnergy\n turbulent_kinetic_energy : \n turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "TurbulentViscosityRatioAndTurbulentKineticEnergy", + "default": "TurbulentViscosityRatioAndTurbulentKineticEnergy", + "enum": [ + "TurbulentViscosityRatioAndTurbulentKineticEnergy" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_kinetic_energy": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_energy", + "enum": [ + "J/kg", + "erg/g", + "ft**2/s**2" + ], + "type": "string" + } + }, + "title": "Turbulent Kinetic Energy" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "turbulent_kinetic_energy", + "turbulent_viscosity_ratio" + ], + "title": "TurbulentViscosityRatioAndTurbulentKineticEnergy", + "type": "object" + }, + "TurbulentViscosityRatioAndTurbulentLengthScale": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype_name : typing.Literal['TurbulentViscosityRatioAndTurbulentLengthScale'] = TurbulentViscosityRatioAndTurbulentLengthScale\n turbulent_length_scale : \n turbulent_viscosity_ratio : \n ", + "properties": { + "type_name": { + "const": "TurbulentViscosityRatioAndTurbulentLengthScale", + "default": "TurbulentViscosityRatioAndTurbulentLengthScale", + "enum": [ + "TurbulentViscosityRatioAndTurbulentLengthScale" + ], + "title": "Type Name", + "type": "string" + }, + "turbulent_length_scale": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Turbulent Length Scale" + }, + "turbulent_viscosity_ratio": { + "exclusiveMinimum": 0.0, + "title": "Turbulent Viscosity Ratio", + "type": "number" + } + }, + "required": [ + "turbulent_length_scale", + "turbulent_viscosity_ratio" + ], + "title": "TurbulentViscosityRatioAndTurbulentLengthScale", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Replace Flow360Param:\n- SubsonicInflow\n- MassInflow\n\n\nParameters\n----------\ntype : typing.Literal['Inflow'] = Inflow\n entities : \n turbulence_quantities : typing.Union[flow360.component.simulation.models.turbulence_quantities.TurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.TurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensity, flow360.component.simulation.models.turbulence_quantities.TurbulentLengthScale, flow360.component.simulation.models.turbulence_quantities.ModifiedTurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.ModifiedTurbulentViscosity, flow360.component.simulation.models.turbulence_quantities.SpecificDissipationRateAndTurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentViscosityRatioAndTurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentLengthScaleAndTurbulentKineticEnergy, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensityAndSpecificDissipationRate, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensityAndTurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.TurbulentIntensityAndTurbulentLengthScale, flow360.component.simulation.models.turbulence_quantities.SpecificDissipationRateAndTurbulentViscosityRatio, flow360.component.simulation.models.turbulence_quantities.SpecificDissipationRateAndTurbulentLengthScale, flow360.component.simulation.models.turbulence_quantities.TurbulentViscosityRatioAndTurbulentLengthScale, NoneType] = None\n total_temperature : \n velocity_direction : typing.Optional[flow360.component.types.Axis] = None\n spec : typing.Union[flow360.component.simulation.models.surface_models.TotalPressure, flow360.component.simulation.models.surface_models.MassFlowRate]\n ", + "properties": { + "type": { + "const": "Inflow", + "default": "Inflow", + "enum": [ + "Inflow" + ], + "title": "Type", + "type": "string" + }, + "surfaces": { + "$ref": "#/$defs/EntityList_Surface_" + }, + "turbulence_quantities": { + "anyOf": [ + { + "$ref": "#/$defs/TurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/TurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentIntensity" + }, + { + "$ref": "#/$defs/TurbulentLengthScale" + }, + { + "$ref": "#/$defs/ModifiedTurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/ModifiedTurbulentViscosity" + }, + { + "$ref": "#/$defs/SpecificDissipationRateAndTurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentViscosityRatioAndTurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentLengthScaleAndTurbulentKineticEnergy" + }, + { + "$ref": "#/$defs/TurbulentIntensityAndSpecificDissipationRate" + }, + { + "$ref": "#/$defs/TurbulentIntensityAndTurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/TurbulentIntensityAndTurbulentLengthScale" + }, + { + "$ref": "#/$defs/SpecificDissipationRateAndTurbulentViscosityRatio" + }, + { + "$ref": "#/$defs/SpecificDissipationRateAndTurbulentLengthScale" + }, + { + "$ref": "#/$defs/TurbulentViscosityRatioAndTurbulentLengthScale" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Turbulence Quantities" + }, + "total_temperature": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + }, + "title": "Total Temperature" + }, + "velocity_direction": { + "anyOf": [ + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Velocity Direction" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/$defs/TotalPressure" + }, + { + "$ref": "#/$defs/MassFlowRate" + } + ], + "title": "Spec" + } + }, + "required": [ + "surfaces", + "total_temperature", + "spec" + ], + "title": "Inflow", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-outflow.json b/tools/integrations/data_v2/models/json-schema-release-24.6-outflow.json new file mode 100644 index 000000000..3b58fc83b --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-outflow.json @@ -0,0 +1,154 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "Mach": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : \n ", + "properties": { + "value": { + "minimum": 0.0, + "title": "Value", + "type": "number" + } + }, + "required": [ + "value" + ], + "title": "Mach", + "type": "object" + }, + "MassFlowRate": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : \n ", + "properties": { + "value": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "mass_flow_rate", + "enum": [ + "kg/s", + "g/s", + "lb/s" + ], + "type": "string" + } + }, + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "MassFlowRate", + "type": "object" + }, + "Pressure": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : \n ", + "properties": { + "value": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "pressure", + "enum": [ + "Pa", + "dyn/cm**2", + "lbf/ft**2" + ], + "type": "string" + } + }, + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "Pressure", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Replace Flow360Param:\n- SubsonicOutflowPressure\n- SubsonicOutflowMach\n- MassOutflow\n\n\nParameters\n----------\ntype : typing.Literal['Outflow'] = Outflow\n entities : \n spec : typing.Union[flow360.component.simulation.models.surface_models.Pressure, flow360.component.simulation.models.surface_models.MassFlowRate, flow360.component.simulation.models.surface_models.Mach]\n ", + "properties": { + "type": { + "const": "Outflow", + "default": "Outflow", + "enum": [ + "Outflow" + ], + "title": "Type", + "type": "string" + }, + "surfaces": { + "$ref": "#/$defs/EntityList_Surface_" + }, + "spec": { + "anyOf": [ + { + "$ref": "#/$defs/Pressure" + }, + { + "$ref": "#/$defs/MassFlowRate" + }, + { + "$ref": "#/$defs/Mach" + } + ], + "title": "Spec" + } + }, + "required": [ + "surfaces", + "spec" + ], + "title": "Outflow", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-periodic.json b/tools/integrations/data_v2/models/json-schema-release-24.6-periodic.json new file mode 100644 index 000000000..39b2d4a5d --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-periodic.json @@ -0,0 +1,158 @@ +{ + "$defs": { + "Rotational": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['Rotational'] = Rotational\n axis_of_rotation : typing.Optional[flow360.component.types.Axis] = None\n ", + "properties": { + "type": { + "const": "Rotational", + "default": "Rotational", + "enum": [ + "Rotational" + ], + "title": "Type", + "type": "string" + }, + "axis_of_rotation": { + "anyOf": [ + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Axis Of Rotation" + } + }, + "title": "Rotational", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "SurfacePair": { + "additionalProperties": false, + "description": "Represents a pair of surfaces.\n\nParameters\n----------\npair : typing.Tuple[flow360.component.simulation.primitives.Surface, flow360.component.simulation.primitives.Surface]\n \nAttributes:\n pair (Tuple[Surface, Surface]): A tuple containing two Surface objects representing the pair.", + "properties": { + "pair": { + "maxItems": 2, + "minItems": 2, + "prefixItems": [ + { + "$ref": "#/$defs/Surface" + }, + { + "$ref": "#/$defs/Surface" + } + ], + "title": "Pair", + "type": "array" + } + }, + "required": [ + "pair" + ], + "title": "SurfacePair", + "type": "object" + }, + "Translational": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['Translational'] = Translational\n ", + "properties": { + "type": { + "const": "Translational", + "default": "Translational", + "enum": [ + "Translational" + ], + "title": "Type", + "type": "string" + } + }, + "title": "Translational", + "type": "object" + }, + "UniqueItemList_SurfacePair_": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[flow360.component.simulation.primitives.SurfacePair]\n ", + "properties": { + "items": { + "items": { + "$ref": "#/$defs/SurfacePair" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueItemList[SurfacePair]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['Periodic'] = Periodic\n entity_pairs : \n spec : typing.Union[flow360.component.simulation.models.surface_models.Translational, flow360.component.simulation.models.surface_models.Rotational]\n ", + "properties": { + "type": { + "const": "Periodic", + "default": "Periodic", + "enum": [ + "Periodic" + ], + "title": "Type", + "type": "string" + }, + "surface_pairs": { + "$ref": "#/$defs/UniqueItemList_SurfacePair_" + }, + "spec": { + "discriminator": { + "mapping": { + "Rotational": "#/$defs/Rotational", + "Translational": "#/$defs/Translational" + }, + "propertyName": "type" + }, + "oneOf": [ + { + "$ref": "#/$defs/Translational" + }, + { + "$ref": "#/$defs/Rotational" + } + ], + "title": "Spec" + } + }, + "required": [ + "surface_pairs", + "spec" + ], + "title": "Periodic", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-porouse_medium.json b/tools/integrations/data_v2/models/json-schema-release-24.6-porouse_medium.json new file mode 100644 index 000000000..9161b9cfa --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-porouse_medium.json @@ -0,0 +1,259 @@ +{ + "$defs": { + "Box": { + "additionalProperties": false, + "description": "Represents a box in three-dimensional space.\n\nParameters\n----------\nname : \n center : \n size : \n axes : typing.Tuple[flow360.component.types.Axis, flow360.component.types.Axis]\n \nAttributes:\n center (LengthType.Point): The coordinates of the center of the box.\n size (LengthType.Point): The dimensions of the box (length, width, height).\n axes (Tuple[Axis, Axis]]): The axes of the box.", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "center": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Center" + }, + "size": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Size" + }, + "axes": { + "maxItems": 2, + "minItems": 2, + "prefixItems": [ + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + } + }, + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + } + } + ], + "title": "Axes", + "type": "array" + } + }, + "required": [ + "name", + "center", + "size", + "axes" + ], + "title": "Box", + "type": "object" + }, + "EntityList_GenericVolume_Box_str_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[typing.Union[flow360.component.simulation.primitives.GenericVolume, flow360.component.simulation.primitives.Box, str]]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/GenericVolume" + }, + { + "$ref": "#/$defs/Box" + }, + { + "type": "string" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[GenericVolume,Box,str]", + "type": "object" + }, + "GenericVolume": { + "additionalProperties": false, + "description": "Do not expose.\nThis type of entity will get auto-constructed by assets when loading metadata.\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "GenericVolume", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Constains Flow360Param PorousMediumBox and PorousMediumVolumeZone\n\nParameters\n----------\nentities : typing.Optional[abc.EntityList[GenericVolume,Box,str]] = None\n darcy_coefficient : \n forchheimer_coefficient : \n volumetric_heat_source : typing.Union[typing.Annotated[flow360.component.simulation.unit_system._HeatSourceType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], typing.Annotated[str, Strict(strict=True)], NoneType] = None\n ", + "properties": { + "volumes": { + "anyOf": [ + { + "$ref": "#/$defs/EntityList_GenericVolume_Box_str_" + }, + { + "type": "null" + } + ], + "default": null + }, + "darcy_coefficient": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "inverse_area", + "enum": [ + "m**(-2)", + "cm**(-2)", + "ft**(-2)" + ], + "type": "string" + } + }, + "title": "Darcy Coefficient" + }, + "forchheimer_coefficient": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "inverse_length", + "enum": [ + "1/m", + "1/cm", + "1/ft" + ], + "type": "string" + } + }, + "title": "Forchheimer Coefficient" + }, + "volumetric_heat_source": { + "anyOf": [ + { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "heat_source", + "enum": [ + "kg/(m*s**3)", + "g/(cm*s**3)", + "lb/(ft*s**3)" + ], + "type": "string" + } + } + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Volumetric Heat Source" + } + }, + "required": [ + "darcy_coefficient", + "forchheimer_coefficient" + ], + "title": "PorousMedium", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-rotating_reference_frame.json b/tools/integrations/data_v2/models/json-schema-release-24.6-rotating_reference_frame.json new file mode 100644 index 000000000..05e19f992 --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-rotating_reference_frame.json @@ -0,0 +1,261 @@ +{ + "$defs": { + "AngularVelocity": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : \n ", + "properties": { + "value": { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "angular_velocity", + "enum": [ + "rad/s" + ], + "type": "string" + } + }, + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "AngularVelocity", + "type": "object" + }, + "Cylinder": { + "additionalProperties": false, + "description": "Represents a cylinder in three-dimensional space.\n\nParameters\n----------\nname : \n axis : \n center : \n height : \n inner_radius : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n outer_radius : \n \nAttributes:\n axis (Axis): The axis of the cylinder.\n center (LengthType.Point): The center point of the cylinder.\n height (LengthType.Postive): The height of the cylinder.\n inner_radius (LengthType.Positive): The inner radius of the cylinder.\n outer_radius (LengthType.Positive): The outer radius of the cylinder.", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "axis": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + }, + "title": "Axis" + }, + "center": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Center" + }, + "height": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Height" + }, + "inner_radius": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Inner Radius" + }, + "outer_radius": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Outer Radius" + } + }, + "required": [ + "name", + "axis", + "center", + "height", + "outer_radius" + ], + "title": "Cylinder", + "type": "object" + }, + "EntityList_GenericVolume_Cylinder_str_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[typing.Union[flow360.component.simulation.primitives.GenericVolume, flow360.component.simulation.primitives.Cylinder, str]]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/GenericVolume" + }, + { + "$ref": "#/$defs/Cylinder" + }, + { + "type": "string" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[GenericVolume,Cylinder,str]", + "type": "object" + }, + "GenericVolume": { + "additionalProperties": false, + "description": "Do not expose.\nThis type of entity will get auto-constructed by assets when loading metadata.\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "GenericVolume", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Similar to Flow360Param ReferenceFrame.\nNote that `center`, `axis` can be acquired from `entity` so they are not required anymore.\nNote: Should use the unit system to convert degree or degree per second to radian and radian per second\n\n\nParameters\n----------\nentities : \n rotation : typing.Union[flow360.component.simulation.models.volume_models.AngularVelocity, typing.Annotated[flow360.component.simulation.unit_system._AngleType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]]\n parent_volume : typing.Union[flow360.component.simulation.primitives.GenericVolume, flow360.component.simulation.primitives.Cylinder, str, NoneType] = None\n ", + "properties": { + "volumes": { + "$ref": "#/$defs/EntityList_GenericVolume_Cylinder_str_" + }, + "rotation": { + "anyOf": [ + { + "$ref": "#/$defs/AngularVelocity" + }, + { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "angle", + "enum": [ + "rad" + ], + "type": "string" + } + } + } + ], + "title": "Rotation" + }, + "parent_volume": { + "anyOf": [ + { + "$ref": "#/$defs/GenericVolume" + }, + { + "$ref": "#/$defs/Cylinder" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Parent Volume" + } + }, + "required": [ + "volumes", + "rotation" + ], + "title": "RotatingReferenceFrame", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-slip_wall.json b/tools/integrations/data_v2/models/json-schema-release-24.6-slip_wall.json new file mode 100644 index 000000000..b84e7bc17 --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-slip_wall.json @@ -0,0 +1,65 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['SlipWall'] = SlipWall\n entities : \n ", + "properties": { + "type": { + "const": "SlipWall", + "default": "SlipWall", + "enum": [ + "SlipWall" + ], + "title": "Type", + "type": "string" + }, + "surfaces": { + "$ref": "#/$defs/EntityList_Surface_" + } + }, + "required": [ + "surfaces" + ], + "title": "SlipWall", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-solid.json b/tools/integrations/data_v2/models/json-schema-release-24.6-solid.json new file mode 100644 index 000000000..8ed389783 --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-solid.json @@ -0,0 +1,366 @@ +{ + "$defs": { + "EntityList_GenericVolume_str_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[typing.Union[flow360.component.simulation.primitives.GenericVolume, str]]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/GenericVolume" + }, + { + "type": "string" + } + ] + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[GenericVolume,str]", + "type": "object" + }, + "GenericVolume": { + "additionalProperties": false, + "description": "Do not expose.\nThis type of entity will get auto-constructed by assets when loading metadata.\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "GenericVolume", + "type": "object" + }, + "HeatEquationInitialCondition": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['expression'] = expression\n constants : typing.Optional[typing.Dict[str, str]] = None\n temperature : \n ", + "properties": { + "type": { + "const": "expression", + "default": "expression", + "enum": [ + "expression" + ], + "title": "Type", + "type": "string" + }, + "constants": { + "anyOf": [ + { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Constants" + }, + "temperature": { + "title": "Temperature", + "type": "string" + } + }, + "required": [ + "temperature" + ], + "title": "HeatEquationInitialCondition", + "type": "object" + }, + "HeatEquationSolver": { + "additionalProperties": false, + "description": ":class:`HeatEquationSolver` class for setting up heat equation solver.\n\nParameters\n----------\nabsolute_tolerance : = 1e-09\n relative_tolerance : = 0\n order_of_accuracy : typing.Literal[1, 2] = 2\n equation_eval_frequency : = 10\n update_jacobian_frequency : = 1\n max_force_jac_update_physical_steps : = 0\n linear_solver : = LinearSolver(max_iterations=50, absolute_tolerance=1e-10, relative_tolerance=None)\n type_name : typing.Literal['HeatEquation'] = HeatEquation\n \n\nParameters\n----------\n\nequation_eval_frequency : PositiveInt, optional\n Frequency at which to solve the heat equation in conjugate heat transfer simulations\n\n\nlinear_solver_config : LinearSolver, optional\n Linear solver settings, see LinearSolver documentation.\n\nReturns\n-------\n:class:`HeatEquationSolver`\n An instance of the component class HeatEquationSolver.\n\n\nExample\n-------\n>>> he = HeatEquationSolver(\n equation_eval_frequency=10,\n linear_solver_config=LinearSolver(\n max_iterations=50,\n absoluteTolerance=1e-10\n )\n )", + "properties": { + "absolute_tolerance": { + "default": 1e-09, + "exclusiveMinimum": 0.0, + "title": "Absolute Tolerance", + "type": "number" + }, + "relative_tolerance": { + "default": 0, + "minimum": 0.0, + "title": "Relative Tolerance", + "type": "number" + }, + "order_of_accuracy": { + "default": 2, + "enum": [ + 1, + 2 + ], + "title": "Order Of Accuracy", + "type": "integer" + }, + "equation_eval_frequency": { + "default": 10, + "exclusiveMinimum": 0, + "title": "Equation Eval Frequency", + "type": "integer" + }, + "update_jacobian_frequency": { + "default": 1, + "exclusiveMinimum": 0, + "title": "Update Jacobian Frequency", + "type": "integer" + }, + "max_force_jac_update_physical_steps": { + "default": 0, + "minimum": 0, + "title": "Max Force Jac Update Physical Steps", + "type": "integer" + }, + "linear_solver": { + "allOf": [ + { + "$ref": "#/$defs/LinearSolver" + } + ], + "default": { + "maxIterations": 50, + "absoluteTolerance": 1e-10, + "relativeTolerance": null + } + }, + "type_name": { + "const": "HeatEquation", + "default": "HeatEquation", + "enum": [ + "HeatEquation" + ], + "title": "Type Name", + "type": "string" + } + }, + "title": "HeatEquationSolver", + "type": "object" + }, + "LinearSolver": { + "additionalProperties": false, + "description": ":class:`LinearSolver` class for setting up linear solver for heat equation\n\nParameters\n----------\nmax_iterations : = 30\n absolute_tolerance : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n relative_tolerance : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n \n\nParameters\n----------\n\nmax_iterations : PositiveInt, optional\n Maximum number of linear solver iterations, by default 50\n\nabsolute_tolerance : PositiveFloat, optional\n The linear solver converges when the final residual of the pseudo steps below this value. Either absolute\n tolerance or relative tolerance can be used to determine convergence, by default 1e-10\n\nrelative_tolerance :\n The linear solver converges when the ratio of the final residual and the initial\n residual of the pseudo step is below this value.\n\nvalidation: tolerance settings only available to HeatEquationSolver\n\nReturns\n-------\n:class:`LinearSolver`\n An instance of the component class LinearSolver.\n\n\nExample\n-------\n>>> ls = LinearSolver(\n max_iterations=50,\n absoluteTolerance=1e-10\n )", + "properties": { + "max_iterations": { + "default": 30, + "exclusiveMinimum": 0, + "title": "Max Iterations", + "type": "integer" + }, + "absolute_tolerance": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Absolute Tolerance" + }, + "relative_tolerance": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Relative Tolerance" + } + }, + "title": "LinearSolver", + "type": "object" + }, + "SolidMaterial": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['solid'] = solid\n name : \n thermal_conductivity : \n density : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n specific_heat_capacity : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n ", + "properties": { + "type": { + "const": "solid", + "default": "solid", + "enum": [ + "solid" + ], + "title": "Type", + "type": "string" + }, + "name": { + "title": "Name", + "type": "string" + }, + "thermal_conductivity": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "thermal_conductivity", + "enum": [ + "kg*m/(K*s**3)", + "cm*g/(K*s**3)", + "ft*lb/(K*s**3)" + ], + "type": "string" + } + }, + "title": "Thermal Conductivity" + }, + "density": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "density", + "enum": [ + "kg/m**3", + "g/cm**3", + "lb/ft**3" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Density" + }, + "specific_heat_capacity": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "specific_heat_capacity", + "enum": [ + "m**2/(K*s**2)", + "cm**2/(K*s**2)", + "ft**2/(K*s**2)" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Specific Heat Capacity" + } + }, + "required": [ + "name", + "thermal_conductivity" + ], + "title": "SolidMaterial", + "type": "object" + } + }, + "additionalProperties": false, + "description": "General HeatTransfer volume model that contains all the common fields every heat transfer zone should have.\n\n\nParameters\n----------\nmaterial : \n initial_condition : typing.Optional[flow360.component.simulation.models.volume_models.HeatEquationInitialCondition] = None\n entities : \n heat_equation_solver : = HeatEquationSolver(absolute_tolerance=1e-09, relative_tolerance=0.0, order_of_accuracy=2, equation_eval_frequency=10, update_jacobian_frequency=1, max_force_jac_update_physical_steps=0, linear_solver=LinearSolver(max_iterations=50,, absolute_tolerance=1e-10,, relative_tolerance=None), type_name='HeatEquation')\n volumetric_heat_source : typing.Union[typing.Annotated[flow360.component.simulation.unit_system._HeatSourceType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], typing.Annotated[str, Strict(strict=True)]] = 0\n ", + "properties": { + "material": { + "$ref": "#/$defs/SolidMaterial" + }, + "initial_condition": { + "anyOf": [ + { + "$ref": "#/$defs/HeatEquationInitialCondition" + }, + { + "type": "null" + } + ], + "default": null + }, + "volumes": { + "$ref": "#/$defs/EntityList_GenericVolume_str_" + }, + "heat_equation_solver": { + "allOf": [ + { + "$ref": "#/$defs/HeatEquationSolver" + } + ], + "default": { + "absoluteTolerance": 1e-09, + "relativeTolerance": 0.0, + "orderOfAccuracy": 2, + "equationEvalFrequency": 10, + "updateJacobianFrequency": 1, + "maxForceJacUpdatePhysicalSteps": 0, + "linearSolver": { + "absoluteTolerance": 1e-10, + "maxIterations": 50, + "relativeTolerance": null + }, + "typeName": "HeatEquation" + } + }, + "volumetric_heat_source": { + "anyOf": [ + { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "heat_source", + "enum": [ + "kg/(m*s**3)", + "g/(cm*s**3)", + "lb/(ft*s**3)" + ], + "type": "string" + } + } + }, + { + "type": "string" + } + ], + "default": 0, + "title": "Volumetric Heat Source" + } + }, + "required": [ + "material", + "volumes" + ], + "title": "Solid", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-symmetry_plane.json b/tools/integrations/data_v2/models/json-schema-release-24.6-symmetry_plane.json new file mode 100644 index 000000000..33eb27319 --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-symmetry_plane.json @@ -0,0 +1,65 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['SymmetryPlane'] = SymmetryPlane\n entities : \n ", + "properties": { + "type": { + "const": "SymmetryPlane", + "default": "SymmetryPlane", + "enum": [ + "SymmetryPlane" + ], + "title": "Type", + "type": "string" + }, + "surfaces": { + "$ref": "#/$defs/EntityList_Surface_" + } + }, + "required": [ + "surfaces" + ], + "title": "SymmetryPlane", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/json-schema-release-24.6-wall.json b/tools/integrations/data_v2/models/json-schema-release-24.6-wall.json new file mode 100644 index 000000000..f6863f7f2 --- /dev/null +++ b/tools/integrations/data_v2/models/json-schema-release-24.6-wall.json @@ -0,0 +1,213 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "HeatFlux": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : typing.Union[typing.Annotated[flow360.component.simulation.unit_system._HeatFluxType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], typing.Annotated[str, Strict(strict=True)]]\n ", + "properties": { + "value": { + "anyOf": [ + { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "heat_flux", + "enum": [ + "kg/s**3", + "g/s**3", + "lb/s**3" + ], + "type": "string" + } + } + }, + { + "type": "string" + } + ], + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "HeatFlux", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "Temperature": { + "additionalProperties": false, + "description": "Parameters\n----------\nvalue : typing.Union[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], typing.Annotated[str, Strict(strict=True)]]\n ", + "properties": { + "value": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + } + }, + { + "type": "string" + } + ], + "title": "Value" + } + }, + "required": [ + "value" + ], + "title": "Temperature", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Replace Flow360Param:\n- NoSlipWall\n- IsothermalWall\n- HeatFluxWall\n- WallFunction\n- SolidIsothermalWall\n- SolidAdiabaticWall\n\n\nParameters\n----------\ntype : typing.Literal['Wall'] = Wall\n entities : \n use_wall_function : = False\n velocity : typing.Union[typing.Tuple[typing.Annotated[str, Strict(strict=True)], typing.Annotated[str, Strict(strict=True)], typing.Annotated[str, Strict(strict=True)]], typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], NoneType] = None\n velocity_type : typing.Literal['absolute', 'relative'] = relative\n heat_spec : typing.Union[flow360.component.simulation.models.surface_models.HeatFlux, flow360.component.simulation.models.surface_models.Temperature, NoneType] = None\n ", + "properties": { + "type": { + "const": "Wall", + "default": "Wall", + "enum": [ + "Wall" + ], + "title": "Type", + "type": "string" + }, + "surfaces": { + "$ref": "#/$defs/EntityList_Surface_" + }, + "use_wall_function": { + "default": false, + "title": "Use Wall Function", + "type": "boolean" + }, + "velocity": { + "anyOf": [ + { + "maxItems": 3, + "minItems": 3, + "prefixItems": [ + { + "type": "string" + }, + { + "type": "string" + }, + { + "type": "string" + } + ], + "type": "array" + }, + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "velocity", + "enum": [ + "m/s", + "cm/s", + "ft/s" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Velocity" + }, + "velocity_type": { + "default": "relative", + "enum": [ + "absolute", + "relative" + ], + "title": "Velocity Type", + "type": "string" + }, + "heat_spec": { + "anyOf": [ + { + "$ref": "#/$defs/HeatFlux" + }, + { + "$ref": "#/$defs/Temperature" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Heat Spec" + } + }, + "required": [ + "surfaces" + ], + "title": "Wall", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/outflow-Mach-release-24.6.json b/tools/integrations/data_v2/models/outflow-Mach-release-24.6.json new file mode 100644 index 000000000..37c0fd413 --- /dev/null +++ b/tools/integrations/data_v2/models/outflow-Mach-release-24.6.json @@ -0,0 +1,13 @@ +{ + "type": "Outflow", + "entities": { + "stored_entities": [ + { + "name": "my_outflow" + } + ] + }, + "spec": { + "value": 1.0 + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/outflow-MassFlowRate-release-24.6.json b/tools/integrations/data_v2/models/outflow-MassFlowRate-release-24.6.json new file mode 100644 index 000000000..db8a19051 --- /dev/null +++ b/tools/integrations/data_v2/models/outflow-MassFlowRate-release-24.6.json @@ -0,0 +1,16 @@ +{ + "type": "Outflow", + "entities": { + "stored_entities": [ + { + "name": "my_outflow" + } + ] + }, + "spec": { + "value": { + "value": 1.0, + "units": "lb/s" + } + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/outflow-Pressure-release-24.6.json b/tools/integrations/data_v2/models/outflow-Pressure-release-24.6.json new file mode 100644 index 000000000..903f881f3 --- /dev/null +++ b/tools/integrations/data_v2/models/outflow-Pressure-release-24.6.json @@ -0,0 +1,16 @@ +{ + "type": "Outflow", + "entities": { + "stored_entities": [ + { + "name": "my_outflow" + } + ] + }, + "spec": { + "value": { + "value": 1.0, + "units": "lbf/ft**2" + } + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/periodic-Rotational-release-24.6.json b/tools/integrations/data_v2/models/periodic-Rotational-release-24.6.json new file mode 100644 index 000000000..948e26f72 --- /dev/null +++ b/tools/integrations/data_v2/models/periodic-Rotational-release-24.6.json @@ -0,0 +1,25 @@ +{ + "type": "Periodic", + "entity_pairs": { + "items": [ + { + "pair": [ + { + "name": "my_wall" + }, + { + "name": "my_slip_wall" + } + ] + } + ] + }, + "spec": { + "type": "Rotational", + "axis_of_rotation": [ + 0.0, + 1.0, + 0.0 + ] + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/periodic-Translational-release-24.6.json b/tools/integrations/data_v2/models/periodic-Translational-release-24.6.json new file mode 100644 index 000000000..1446f71a5 --- /dev/null +++ b/tools/integrations/data_v2/models/periodic-Translational-release-24.6.json @@ -0,0 +1,20 @@ +{ + "type": "Periodic", + "entity_pairs": { + "items": [ + { + "pair": [ + { + "name": "my_wall" + }, + { + "name": "my_slip_wall" + } + ] + } + ] + }, + "spec": { + "type": "Translational" + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/porouse_medium-release-24.6.json b/tools/integrations/data_v2/models/porouse_medium-release-24.6.json new file mode 100644 index 000000000..b726eb397 --- /dev/null +++ b/tools/integrations/data_v2/models/porouse_medium-release-24.6.json @@ -0,0 +1,57 @@ +{ + "entities": { + "stored_entities": [ + { + "name": "my_box", + "center": { + "value": [ + 1.2, + 2.3, + 3.4 + ], + "units": "m" + }, + "size": { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "m" + }, + "axes": [ + [ + 0.6, + 0.8, + 0.0 + ], + [ + 1.0, + 0.0, + 0.0 + ] + ] + } + ] + }, + "darcy_coefficient": { + "value": [ + 0.1, + 2.0, + 1.0 + ], + "units": "1/(cm*m)" + }, + "forchheimer_coefficient": { + "value": [ + 0.1, + 2.0, + 1.0 + ], + "units": "1/ft" + }, + "volumetric_heat_source": { + "value": 123.0, + "units": "lb/(ft*s**3)" + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/rotating_reference_frame-release-24.6.json b/tools/integrations/data_v2/models/rotating_reference_frame-release-24.6.json new file mode 100644 index 000000000..a4ddfc5cd --- /dev/null +++ b/tools/integrations/data_v2/models/rotating_reference_frame-release-24.6.json @@ -0,0 +1,43 @@ +{ + "entities": { + "stored_entities": [ + { + "name": "my_cylinder-1", + "axis": [ + 1.0, + 0.0, + 0.0 + ], + "center": { + "value": [ + 1.2, + 2.3, + 3.4 + ], + "units": "m" + }, + "height": { + "value": 3.0, + "units": "m" + }, + "inner_radius": { + "value": 3.0, + "units": "m" + }, + "outer_radius": { + "value": 5.0, + "units": "m" + } + } + ] + }, + "rotation": { + "value": { + "value": 0.45, + "units": "degree/s" + } + }, + "parent_volume": { + "name": "outter_volume" + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/slip_wall-release-24.6.json b/tools/integrations/data_v2/models/slip_wall-release-24.6.json new file mode 100644 index 000000000..729c53722 --- /dev/null +++ b/tools/integrations/data_v2/models/slip_wall-release-24.6.json @@ -0,0 +1,10 @@ +{ + "type": "SlipWall", + "entities": { + "stored_entities": [ + { + "name": "my_slip_wall" + } + ] + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/solid-release-24.6.json b/tools/integrations/data_v2/models/solid-release-24.6.json new file mode 100644 index 000000000..2f5a15c99 --- /dev/null +++ b/tools/integrations/data_v2/models/solid-release-24.6.json @@ -0,0 +1,44 @@ +{ + "material": { + "type": "solid", + "name": "abc", + "thermal_conductivity": { + "value": 1.0, + "units": "W/(K*m)" + }, + "density": { + "value": 1.0, + "units": "kg/m**3" + }, + "specific_heat_capacity": { + "value": 1.0, + "units": "J/(K*kg)" + } + }, + "initial_condition": null, + "entities": { + "stored_entities": [ + { + "name": "my_cylinder-2" + } + ] + }, + "heat_equation_solver": { + "absolute_tolerance": 1e-09, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 10, + "update_jacobian_frequency": 1, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 50, + "absolute_tolerance": 1e-10, + "relative_tolerance": null + }, + "type_name": "HeatEquation" + }, + "volumetric_heat_source": { + "value": 123.0, + "units": "lb/(ft*s**3)" + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/symmetry_plane-release-24.6.json b/tools/integrations/data_v2/models/symmetry_plane-release-24.6.json new file mode 100644 index 000000000..2fcd3d1f3 --- /dev/null +++ b/tools/integrations/data_v2/models/symmetry_plane-release-24.6.json @@ -0,0 +1,10 @@ +{ + "type": "SymmetryPlane", + "entities": { + "stored_entities": [ + { + "name": "my_symmetry_plane" + } + ] + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/models/wall-release-24.6.json b/tools/integrations/data_v2/models/wall-release-24.6.json new file mode 100644 index 000000000..80f0ae1c1 --- /dev/null +++ b/tools/integrations/data_v2/models/wall-release-24.6.json @@ -0,0 +1,26 @@ +{ + "type": "Wall", + "entities": { + "stored_entities": [ + { + "name": "my_wall" + } + ] + }, + "use_wall_function": true, + "velocity": { + "value": [ + 1.0, + 1.2, + 2.4 + ], + "units": "ft/s" + }, + "velocity_type": "relative", + "heat_spec": { + "value": { + "value": 1.0, + "units": "W/m**2" + } + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/operating_condition/example-1-release-24.6.json b/tools/integrations/data_v2/operating_condition/example-1-release-24.6.json new file mode 100644 index 000000000..b72855fae --- /dev/null +++ b/tools/integrations/data_v2/operating_condition/example-1-release-24.6.json @@ -0,0 +1,22 @@ +{ + "alpha": { + "value": 1.0, + "units": "degree" + }, + "velocity_magnitude": { + "value": 1.0, + "units": "m/s" + }, + "thermal_state": { + "temperature": { + "value": 100.0, + "units": "K" + }, + "density": { + "value": 2.0, + "units": "kg/m**3" + }, + "type_name": "ThermalState" + }, + "type_name": "AerospaceCondition" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/operating_condition/example-2-release-24.6.json b/tools/integrations/data_v2/operating_condition/example-2-release-24.6.json new file mode 100644 index 000000000..1874018bc --- /dev/null +++ b/tools/integrations/data_v2/operating_condition/example-2-release-24.6.json @@ -0,0 +1,21 @@ +{ + "velocity_magnitude": { + "value": 1.0, + "units": "m/s" + }, + "thermal_state": { + "private_attribute_constructor": "from_standard_atmosphere", + "private_attribute_input_cache": { + "altitude": { + "value": 1000.0, + "units": "m" + }, + "temperature_offset": { + "value": -1.0, + "units": "K" + } + }, + "type_name": "ThermalState" + }, + "type_name": "AerospaceCondition" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/operating_condition/example-3-release-24.6.json b/tools/integrations/data_v2/operating_condition/example-3-release-24.6.json new file mode 100644 index 000000000..fe7515552 --- /dev/null +++ b/tools/integrations/data_v2/operating_condition/example-3-release-24.6.json @@ -0,0 +1,30 @@ +{ + "private_attribute_constructor": "from_mach", + "private_attribute_input_cache": { + "alpha": { + "value": 1.0, + "units": "degree" + }, + "beta": { + "value": 0.0, + "units": "degree" + }, + "mach": 0.8 + }, + "alpha": { + "value": 1.0, + "units": "degree" + }, + "thermal_state": { + "temperature": { + "value": 100.0, + "units": "K" + }, + "density": { + "value": 2.0, + "units": "kg/m**3" + }, + "type_name": "ThermalState" + }, + "type_name": "AerospaceCondition" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/operating_condition/example-4-release-24.6.json b/tools/integrations/data_v2/operating_condition/example-4-release-24.6.json new file mode 100644 index 000000000..4382223e0 --- /dev/null +++ b/tools/integrations/data_v2/operating_condition/example-4-release-24.6.json @@ -0,0 +1,33 @@ +{ + "private_attribute_constructor": "from_mach", + "private_attribute_input_cache": { + "alpha": { + "value": 1.0, + "units": "degree" + }, + "beta": { + "value": 0.0, + "units": "degree" + }, + "mach": 0.8 + }, + "alpha": { + "value": 1.0, + "units": "degree" + }, + "thermal_state": { + "private_attribute_constructor": "from_standard_atmosphere", + "private_attribute_input_cache": { + "altitude": { + "value": 1000.0, + "units": "m" + }, + "temperature_offset": { + "value": -1.0, + "units": "K" + } + }, + "type_name": "ThermalState" + }, + "type_name": "AerospaceCondition" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/operating_condition/json-schema-release-24.6.json b/tools/integrations/data_v2/operating_condition/json-schema-release-24.6.json new file mode 100644 index 000000000..23f55376e --- /dev/null +++ b/tools/integrations/data_v2/operating_condition/json-schema-release-24.6.json @@ -0,0 +1,648 @@ +{ + "$defs": { + "AerospaceConditionCache": { + "additionalProperties": false, + "description": "[INTERNAL] Cache for AerospaceCondition inputs\n\nParameters\n----------\nalpha : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._AngleType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n beta : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._AngleType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n reference_velocity_magnitude : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n velocity_magnitude : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n thermal_state : typing.Optional[flow360.component.simulation.operating_condition.ThermalState] = None\n mach : typing.Optional[typing.Annotated[float, Ge(ge=0)]] = None\n reference_mach : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n ", + "properties": { + "alpha": { + "anyOf": [ + { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "angle", + "enum": [ + "rad" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Alpha" + }, + "beta": { + "anyOf": [ + { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "angle", + "enum": [ + "rad" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Beta" + }, + "reference_velocity_magnitude": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "velocity", + "enum": [ + "m/s", + "cm/s", + "ft/s" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reference Velocity Magnitude" + }, + "velocity_magnitude": { + "anyOf": [ + { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "velocity", + "enum": [ + "m/s", + "cm/s", + "ft/s" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Velocity Magnitude" + }, + "atmosphere": { + "anyOf": [ + { + "$ref": "#/$defs/ThermalState" + }, + { + "type": "null" + } + ], + "default": null + }, + "mach": { + "anyOf": [ + { + "minimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Mach" + }, + "reference_mach": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reference Mach" + } + }, + "title": "AerospaceConditionCache", + "type": "object" + }, + "Air": { + "additionalProperties": false, + "description": "Parameters\n----------\ntype : typing.Literal['air'] = air\n name : = air\n dynamic_viscosity : typing.Union[flow360.component.simulation.models.material.Sutherland, typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = Sutherland(reference_viscosity=unyt_quantity(1.716e-05,, 'Pa*s'), reference_temperature=unyt_quantity(273.15,, 'K'), effective_temperature=unyt_quantity(110.4,, 'K'))\n ", + "properties": { + "type": { + "const": "air", + "default": "air", + "enum": [ + "air" + ], + "title": "Type", + "type": "string" + }, + "name": { + "default": "air", + "title": "Name", + "type": "string" + }, + "dynamic_viscosity": { + "anyOf": [ + { + "$ref": "#/$defs/Sutherland" + }, + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "viscosity", + "enum": [ + "Pa*s", + "dyn*s/cm**2", + "lbf*s/ft**2" + ], + "type": "string" + } + } + } + ], + "default": { + "referenceViscosity": { + "units": "Pa*s", + "value": 1.716e-05 + }, + "referenceTemperature": { + "units": "K", + "value": 273.15 + }, + "effectiveTemperature": { + "units": "K", + "value": 110.4 + } + }, + "title": "Dynamic Viscosity" + } + }, + "title": "Air", + "type": "object" + }, + "Sutherland": { + "additionalProperties": false, + "description": "Parameters\n----------\nreference_viscosity : \n reference_temperature : \n effective_temperature : \n ", + "properties": { + "reference_viscosity": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "viscosity", + "enum": [ + "Pa*s", + "dyn*s/cm**2", + "lbf*s/ft**2" + ], + "type": "string" + } + }, + "title": "Reference Viscosity" + }, + "reference_temperature": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + }, + "title": "Reference Temperature" + }, + "effective_temperature": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + }, + "title": "Effective Temperature" + } + }, + "required": [ + "reference_viscosity", + "reference_temperature", + "effective_temperature" + ], + "title": "Sutherland", + "type": "object" + }, + "ThermalState": { + "additionalProperties": false, + "description": "Represents the thermal state of a fluid with specific properties.\n\nParameters\n----------\ntype_name : typing.Literal['ThermalState'] = ThermalState\n private_attribute_constructor : = default\n private_attribute_input_cache : = ThermalStateCache(altitude=None, temperature_offset=None, temperature=None, density=None, material=None)\n temperature : = 288.15 K\n density : = 1.225 kg/m**3\n material : = Air(type='air', name='air', dynamic_viscosity=Sutherland(reference_viscosity=unyt_quantity(1.716e-05,, 'Pa*s'),, reference_temperature=unyt_quantity(273.15,, 'K'),, effective_temperature=unyt_quantity(110.4,, 'K')))\n \nAttributes:\n-----------\ntemperature : TemperatureType.Positive\n The temperature of the fluid, initialized to 288.15 K. This field is frozen and should not be modified after\n construction.\ndensity : DensityType.Positive\n The density of the fluid, initialized to 1.225 kg/m^3. This field is frozen and should not be modified after\n construction.\nmaterial : FluidMaterialTypes\n The type of fluid material, initialized to Air(). This field is frozen and should not be modified after\n construction.", + "properties": { + "type_name": { + "const": "ThermalState", + "default": "ThermalState", + "enum": [ + "ThermalState" + ], + "title": "Type Name", + "type": "string" + }, + "private_attribute_constructor": { + "default": "default", + "title": "Private Attribute Constructor", + "type": "string" + }, + "private_attribute_input_cache": { + "allOf": [ + { + "$ref": "#/$defs/ThermalStateCache" + } + ], + "default": { + "altitude": null, + "temperatureOffset": null, + "temperature": null, + "density": null, + "material": null + } + }, + "temperature": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + }, + "title": "Temperature" + }, + "density": { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "density", + "enum": [ + "kg/m**3", + "g/cm**3", + "lb/ft**3" + ], + "type": "string" + } + }, + "title": "Density" + }, + "material": { + "allOf": [ + { + "$ref": "#/$defs/Air" + } + ], + "default": { + "type": "air", + "name": "air", + "dynamicViscosity": { + "effectiveTemperature": { + "units": "K", + "value": 110.4 + }, + "referenceTemperature": { + "units": "K", + "value": 273.15 + }, + "referenceViscosity": { + "units": "Pa*s", + "value": 1.716e-05 + } + } + } + } + }, + "title": "ThermalState", + "type": "object" + }, + "ThermalStateCache": { + "additionalProperties": false, + "description": "[INTERNAL] Cache for thermal state inputs\n\nParameters\n----------\naltitude : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n temperature_offset : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._TemperatureType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n temperature : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n density : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n material : typing.Optional[flow360.component.simulation.models.material.Air] = None\n ", + "properties": { + "altitude": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Altitude" + }, + "temperature_offset": { + "anyOf": [ + { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Temperature Offset" + }, + "temperature": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "temperature", + "enum": [ + "K", + "R" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Temperature" + }, + "density": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "density", + "enum": [ + "kg/m**3", + "g/cm**3", + "lb/ft**3" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Density" + }, + "material": { + "anyOf": [ + { + "$ref": "#/$defs/Air" + }, + { + "type": "null" + } + ], + "default": null + } + }, + "title": "ThermalStateCache", + "type": "object" + } + }, + "additionalProperties": false, + "description": "A specialized GenericReferenceCondition for aerospace applications.\n\nParameters\n----------\ntype_name : typing.Literal['AerospaceCondition'] = AerospaceCondition\n private_attribute_constructor : = default\n private_attribute_input_cache : = AerospaceConditionCache(alpha=None, beta=None, reference_velocity_magnitude=None, velocity_magnitude=None, thermal_state=None, mach=None, reference_mach=None)\n alpha : = 0 degree\n beta : = 0 degree\n velocity_magnitude : \n thermal_state : = ThermalState(type_name='ThermalState', private_attribute_constructor='default', private_attribute_input_cache=ThermalStateCache(altitude=None,, temperature_offset=None,, temperature=None,, density=None,, material=None), temperature=unyt_quantity(288.15,, 'K'), density=unyt_quantity(1.225,, 'kg/m**3'), material=Air(type='air',, name='air',, dynamic_viscosity=Sutherland(reference_viscosity=unyt_quantity(1.716e-05,, 'Pa*s'),, reference_temperature=unyt_quantity(273.15,, 'K'),, effective_temperature=unyt_quantity(110.4,, 'K'))))\n reference_velocity_magnitude : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n ", + "properties": { + "type_name": { + "const": "AerospaceCondition", + "default": "AerospaceCondition", + "enum": [ + "AerospaceCondition" + ], + "title": "Type Name", + "type": "string" + }, + "private_attribute_constructor": { + "default": "default", + "title": "Private Attribute Constructor", + "type": "string" + }, + "private_attribute_input_cache": { + "allOf": [ + { + "$ref": "#/$defs/AerospaceConditionCache" + } + ], + "default": { + "alpha": null, + "beta": null, + "referenceVelocityMagnitude": null, + "velocityMagnitude": null, + "atmosphere": null, + "mach": null, + "referenceMach": null + } + }, + "alpha": { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "angle", + "enum": [ + "rad" + ], + "type": "string" + } + }, + "title": "Alpha" + }, + "beta": { + "properties": { + "value": { + "type": "number" + }, + "units": { + "dimension": "angle", + "enum": [ + "rad" + ], + "type": "string" + } + }, + "title": "Beta" + }, + "velocity_magnitude": { + "properties": { + "value": { + "minimum": 0, + "type": "number" + }, + "units": { + "dimension": "velocity", + "enum": [ + "m/s", + "cm/s", + "ft/s" + ], + "type": "string" + } + }, + "title": "Velocity Magnitude" + }, + "atmosphere": { + "allOf": [ + { + "$ref": "#/$defs/ThermalState" + } + ], + "default": { + "typeName": "ThermalState", + "privateAttributeConstructor": "default", + "privateAttributeInputCache": { + "altitude": null, + "density": null, + "material": null, + "temperature": null, + "temperatureOffset": null + }, + "temperature": { + "units": "K", + "value": 288.15 + }, + "density": { + "units": "kg/m**3", + "value": 1.225 + }, + "material": { + "dynamicViscosity": { + "effectiveTemperature": { + "units": "K", + "value": 110.4 + }, + "referenceTemperature": { + "units": "K", + "value": 273.15 + }, + "referenceViscosity": { + "units": "Pa*s", + "value": 1.716e-05 + } + }, + "name": "air", + "type": "air" + } + } + }, + "reference_velocity_magnitude": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "velocity", + "enum": [ + "m/s", + "cm/s", + "ft/s" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Reference Velocity Magnitude" + } + }, + "required": [ + "velocity_magnitude" + ], + "title": "AerospaceCondition", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/AeroAcousticOutput-release-24.6.json b/tools/integrations/data_v2/outputs/AeroAcousticOutput-release-24.6.json new file mode 100644 index 000000000..2639eda15 --- /dev/null +++ b/tools/integrations/data_v2/outputs/AeroAcousticOutput-release-24.6.json @@ -0,0 +1,23 @@ +{ + "patch_type": "solid", + "observers": [ + { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "ft" + }, + { + "value": [ + 2.0, + 4.0, + 6.0 + ], + "units": "ft" + } + ], + "write_per_surface_output": true, + "output_type": "AeroAcousticOutput" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/IsosurfaceOutput-release-24.6.json b/tools/integrations/data_v2/outputs/IsosurfaceOutput-release-24.6.json new file mode 100644 index 000000000..c5e2ea37c --- /dev/null +++ b/tools/integrations/data_v2/outputs/IsosurfaceOutput-release-24.6.json @@ -0,0 +1,26 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "output_format": "tecplot", + "entities": { + "items": [ + { + "name": "my_first_iso", + "field": "qcriterion", + "iso_value": 1234.0 + }, + { + "name": "my_second_iso", + "field": "Cp", + "iso_value": 12.0 + } + ] + }, + "output_fields": { + "items": [ + "primitiveVars", + "vorticity" + ] + }, + "output_type": "IsosurfaceOutput" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/ProbeOutput-release-24.6.json b/tools/integrations/data_v2/outputs/ProbeOutput-release-24.6.json new file mode 100644 index 000000000..11eb95b60 --- /dev/null +++ b/tools/integrations/data_v2/outputs/ProbeOutput-release-24.6.json @@ -0,0 +1,57 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "entities": { + "items": [ + { + "name": "the_name1", + "locations": [ + { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "ft" + }, + { + "value": [ + 4.0, + 5.0, + 6.0 + ], + "units": "ft" + } + ] + }, + { + "name": "the_name2", + "locations": [ + { + "value": [ + 1.0, + 3.0, + 5.0 + ], + "units": "ft" + }, + { + "value": [ + 2.0, + 4.0, + 6.0 + ], + "units": "ft" + } + ] + } + ] + }, + "output_fields": { + "items": [ + "primitiveVars", + "vorticity" + ] + }, + "output_type": "ProbeOutput" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/SliceOutput-release-24.6.json b/tools/integrations/data_v2/outputs/SliceOutput-release-24.6.json new file mode 100644 index 000000000..371b6549f --- /dev/null +++ b/tools/integrations/data_v2/outputs/SliceOutput-release-24.6.json @@ -0,0 +1,47 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "output_format": "tecplot", + "entities": { + "items": [ + { + "name": "my_first_slice", + "slice_normal": [ + 1.0, + 0.0, + 0.0 + ], + "slice_origin": { + "value": [ + 4.0, + 4.0, + 2.0 + ], + "units": "ft" + } + }, + { + "name": "my_second_slice", + "slice_normal": [ + 0.7071067811865475, + 0.0, + 0.7071067811865475 + ], + "slice_origin": { + "value": [ + 41.0, + 14.0, + 12.0 + ], + "units": "ft" + } + } + ] + }, + "output_fields": { + "items": [ + "Cp" + ] + }, + "output_type": "SliceOutput" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/SurfaceIntegralOutput-release-24.6.json b/tools/integrations/data_v2/outputs/SurfaceIntegralOutput-release-24.6.json new file mode 100644 index 000000000..020a056d4 --- /dev/null +++ b/tools/integrations/data_v2/outputs/SurfaceIntegralOutput-release-24.6.json @@ -0,0 +1,38 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "entities": { + "items": [ + { + "name": "inflow_integral", + "entities": { + "stored_entities": [ + { + "name": "my_inflow1" + }, + { + "name": "my_inflow2" + } + ] + } + }, + { + "name": "outflow_integral", + "entities": { + "stored_entities": [ + { + "name": "my_outflow" + } + ] + } + } + ] + }, + "output_fields": { + "items": [ + "primitiveVars", + "vorticity" + ] + }, + "output_type": "SurfaceIntegralOutput" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/SurfaceOutput-release-24.6.json b/tools/integrations/data_v2/outputs/SurfaceOutput-release-24.6.json new file mode 100644 index 000000000..e7a918748 --- /dev/null +++ b/tools/integrations/data_v2/outputs/SurfaceOutput-release-24.6.json @@ -0,0 +1,23 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "output_format": "paraview", + "entities": { + "stored_entities": [ + { + "name": "my_wall" + }, + { + "name": "my_inflow1" + } + ] + }, + "write_single_file": false, + "output_fields": { + "items": [ + "nodeNormals", + "yPlus" + ] + }, + "output_type": "SurfaceOutput" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/TimeAverageSurfaceOutput-release-24.6.json b/tools/integrations/data_v2/outputs/TimeAverageSurfaceOutput-release-24.6.json new file mode 100644 index 000000000..5a678881b --- /dev/null +++ b/tools/integrations/data_v2/outputs/TimeAverageSurfaceOutput-release-24.6.json @@ -0,0 +1,24 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "output_format": "tecplot", + "entities": { + "stored_entities": [ + { + "name": "my_wall" + }, + { + "name": "my_inflow1" + } + ] + }, + "write_single_file": true, + "output_fields": { + "items": [ + "nodeNormals", + "yPlus" + ] + }, + "output_type": "TimeAverageSurfaceOutput", + "start_step": 10 +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/TimeAverageVolumeOutput-release-24.6.json b/tools/integrations/data_v2/outputs/TimeAverageVolumeOutput-release-24.6.json new file mode 100644 index 000000000..716890648 --- /dev/null +++ b/tools/integrations/data_v2/outputs/TimeAverageVolumeOutput-release-24.6.json @@ -0,0 +1,12 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "output_format": "tecplot", + "output_fields": { + "items": [ + "Cp" + ] + }, + "output_type": "TimeAverageVolumeOutput", + "start_step": 0 +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/VolumeOutput-release-24.6.json b/tools/integrations/data_v2/outputs/VolumeOutput-release-24.6.json new file mode 100644 index 000000000..72f82e598 --- /dev/null +++ b/tools/integrations/data_v2/outputs/VolumeOutput-release-24.6.json @@ -0,0 +1,11 @@ +{ + "frequency": 12, + "frequency_offset": 1, + "output_format": "tecplot", + "output_fields": { + "items": [ + "Cp" + ] + }, + "output_type": "VolumeOutput" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-AeroAcousticOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-AeroAcousticOutput.json new file mode 100644 index 000000000..8f7a93ac9 --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-AeroAcousticOutput.json @@ -0,0 +1,60 @@ +{ + "additionalProperties": false, + "description": "Parameters\n----------\npatch_type : = solid\n observers : typing.List[typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]]\n write_per_surface_output : = False\n output_type : typing.Literal['AeroAcousticOutput'] = AeroAcousticOutput\n ", + "properties": { + "patch_type": { + "default": "solid", + "title": "Patch Type", + "type": "string" + }, + "observers": { + "items": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + "title": "Observers", + "type": "array" + }, + "write_per_surface_output": { + "default": false, + "title": "Write Per Surface Output", + "type": "boolean" + }, + "output_type": { + "const": "AeroAcousticOutput", + "default": "AeroAcousticOutput", + "enum": [ + "AeroAcousticOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "observers" + ], + "title": "AeroAcousticOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-IsosurfaceOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-IsosurfaceOutput.json new file mode 100644 index 000000000..f67f2d954 --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-IsosurfaceOutput.json @@ -0,0 +1,192 @@ +{ + "$defs": { + "Isosurface": { + "additionalProperties": false, + "description": "Parameters\n----------\nname : \n field : typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'p', 'rho', 'Coefficient of pressure', 'Gradient of primitive solution', 'k and omega', 'Mach number', 'Turbulent viscosity', 'Turbulent viscosity and freestream dynamic viscosity ratio', 'Spalart-Almaras variable', 'rho, u, v, w, p (density, 3 velocities and pressure)', 'Q criterion', 'N-S residual', 'Transition residual', 'Turbulence residual', 'Entropy', 'N-S solution', 'Transition solution', 'Turbulence solution', 'Temperature', 'Vorticity', 'Wall distance', 'NumericalDissipationFactor sensor', 'Heat equation residual', 'Velocity with respect to non-inertial frame', 'Low-Mach preconditioner factor', 'Pressure', 'Density']\n iso_value : \n Expect non-dimensional value.", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "field": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor", + "p", + "rho", + "Coefficient of pressure", + "Gradient of primitive solution", + "k and omega", + "Mach number", + "Turbulent viscosity", + "Turbulent viscosity and freestream dynamic viscosity ratio", + "Spalart-Almaras variable", + "rho, u, v, w, p (density, 3 velocities and pressure)", + "Q criterion", + "N-S residual", + "Transition residual", + "Turbulence residual", + "Entropy", + "N-S solution", + "Transition solution", + "Turbulence solution", + "Temperature", + "Vorticity", + "Wall distance", + "NumericalDissipationFactor sensor", + "Heat equation residual", + "Velocity with respect to non-inertial frame", + "Low-Mach preconditioner factor", + "Pressure", + "Density" + ], + "title": "Field", + "type": "string" + }, + "iso_value": { + "description": "Expect non-dimensional value.", + "title": "Iso Value", + "type": "number" + } + }, + "required": [ + "name", + "field", + "iso_value" + ], + "title": "Isosurface", + "type": "object" + }, + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor']]", + "type": "object" + }, + "UniqueItemList_Isosurface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[flow360.component.simulation.outputs.output_entities.Isosurface]\n ", + "properties": { + "items": { + "items": { + "$ref": "#/$defs/Isosurface" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueItemList[Isosurface]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\noutput_format : typing.Literal['paraview', 'tecplot', 'both'] = paraview\n entities : \n output_fields : \n output_type : typing.Literal['IsosurfaceOutput'] = IsosurfaceOutput\n ", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "output_format": { + "default": "paraview", + "enum": [ + "paraview", + "tecplot", + "both" + ], + "title": "Output Format", + "type": "string" + }, + "isosurfaces": { + "$ref": "#/$defs/UniqueItemList_Isosurface_" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor___" + }, + "output_type": { + "const": "IsosurfaceOutput", + "default": "IsosurfaceOutput", + "enum": [ + "IsosurfaceOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "isosurfaces", + "output_fields" + ], + "title": "IsosurfaceOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-ProbeOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-ProbeOutput.json new file mode 100644 index 000000000..36d377e8d --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-ProbeOutput.json @@ -0,0 +1,150 @@ +{ + "$defs": { + "Probe": { + "additionalProperties": false, + "description": "Parameters\n----------\nname : \n locations : typing.List[typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]]\n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "locations": { + "items": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + "title": "Locations", + "type": "array" + } + }, + "required": [ + "name", + "locations" + ], + "title": "Probe", + "type": "object" + }, + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor']]", + "type": "object" + }, + "UniqueItemList_Probe_": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[flow360.component.simulation.outputs.output_entities.Probe]\n ", + "properties": { + "items": { + "items": { + "$ref": "#/$defs/Probe" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueItemList[Probe]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\nentities : \n output_fields : \n output_type : typing.Literal['ProbeOutput'] = ProbeOutput\n ", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "probes": { + "$ref": "#/$defs/UniqueItemList_Probe_" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor___" + }, + "output_type": { + "const": "ProbeOutput", + "default": "ProbeOutput", + "enum": [ + "ProbeOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "probes", + "output_fields" + ], + "title": "ProbeOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-SliceOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-SliceOutput.json new file mode 100644 index 000000000..f2b125c20 --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-SliceOutput.json @@ -0,0 +1,174 @@ +{ + "$defs": { + "Slice": { + "additionalProperties": false, + "description": "Parameters\n----------\nname : \n slice_normal : \n slice_origin : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "slice_normal": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "strictType": { + "type": "vector3" + }, + "type": "array" + } + }, + "title": "Slice Normal" + }, + "slice_origin": { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + }, + "title": "Slice Origin" + } + }, + "required": [ + "name", + "slice_normal", + "slice_origin" + ], + "title": "Slice", + "type": "object" + }, + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____betMetrics____betMetricsPerDisk___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'betMetrics', 'betMetricsPerDisk']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor", + "betMetrics", + "betMetricsPerDisk" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'betMetrics', 'betMetricsPerDisk']]", + "type": "object" + }, + "UniqueItemList_Slice_": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[flow360.component.simulation.outputs.output_entities.Slice]\n ", + "properties": { + "items": { + "items": { + "$ref": "#/$defs/Slice" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueItemList[Slice]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\noutput_format : typing.Literal['paraview', 'tecplot', 'both'] = paraview\n entities : \n output_fields : \n output_type : typing.Literal['SliceOutput'] = SliceOutput\n ", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "output_format": { + "default": "paraview", + "enum": [ + "paraview", + "tecplot", + "both" + ], + "title": "Output Format", + "type": "string" + }, + "slices": { + "$ref": "#/$defs/UniqueItemList_Slice_" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____betMetrics____betMetricsPerDisk___" + }, + "output_type": { + "const": "SliceOutput", + "default": "SliceOutput", + "enum": [ + "SliceOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "slices", + "output_fields" + ], + "title": "SliceOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceIntegralOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceIntegralOutput.json new file mode 100644 index 000000000..ecf08de1f --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceIntegralOutput.json @@ -0,0 +1,163 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "SurfaceList": { + "additionalProperties": false, + "description": "Parameters\n----------\nname : \n entities : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + }, + "surfaces": { + "$ref": "#/$defs/EntityList_Surface_" + } + }, + "required": [ + "name", + "surfaces" + ], + "title": "SurfaceList", + "type": "object" + }, + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor']]", + "type": "object" + }, + "UniqueItemList_SurfaceList_": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[flow360.component.simulation.outputs.output_entities.SurfaceList]\n ", + "properties": { + "items": { + "items": { + "$ref": "#/$defs/SurfaceList" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueItemList[SurfaceList]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\nentities : \n output_fields : \n output_type : typing.Literal['SurfaceIntegralOutput'] = SurfaceIntegralOutput\n ", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "monitors": { + "$ref": "#/$defs/UniqueItemList_SurfaceList_" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor___" + }, + "output_type": { + "const": "SurfaceIntegralOutput", + "default": "SurfaceIntegralOutput", + "enum": [ + "SurfaceIntegralOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "monitors", + "output_fields" + ], + "title": "SurfaceIntegralOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceOutput.json new file mode 100644 index 000000000..87df8e69d --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-SurfaceOutput.json @@ -0,0 +1,156 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____CfVec____Cf____heatFlux____nodeNormals____nodeForcesPerUnitArea____yPlus____wallFunctionMetric___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'CfVec', 'Cf', 'heatFlux', 'nodeNormals', 'nodeForcesPerUnitArea', 'yPlus', 'wallFunctionMetric']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor", + "CfVec", + "Cf", + "heatFlux", + "nodeNormals", + "nodeForcesPerUnitArea", + "yPlus", + "wallFunctionMetric" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'CfVec', 'Cf', 'heatFlux', 'nodeNormals', 'nodeForcesPerUnitArea', 'yPlus', 'wallFunctionMetric']]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\noutput_format : typing.Literal['paraview', 'tecplot', 'both'] = paraview\n entities : typing.Optional[abc.EntityList[Surface]] = None\n write_single_file : = False\n Enable writing all surface outputs into a single file instead of one file per surface. This option currently only supports Tecplot output format. Will choose the value of the last instance of this option of the same output type (SurfaceOutput or TimeAverageSurfaceOutput) in the `output` list.\noutput_fields : \n output_type : typing.Literal['SurfaceOutput'] = SurfaceOutput\n ", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "output_format": { + "default": "paraview", + "enum": [ + "paraview", + "tecplot", + "both" + ], + "title": "Output Format", + "type": "string" + }, + "surfaces": { + "anyOf": [ + { + "$ref": "#/$defs/EntityList_Surface_" + }, + { + "type": "null" + } + ], + "default": null + }, + "write_single_file": { + "default": false, + "description": "Enable writing all surface outputs into a single file instead of one file per surface. This option currently only supports Tecplot output format. Will choose the value of the last instance of this option of the same output type (SurfaceOutput or TimeAverageSurfaceOutput) in the `output` list.", + "title": "Write Single File", + "type": "boolean" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____CfVec____Cf____heatFlux____nodeNormals____nodeForcesPerUnitArea____yPlus____wallFunctionMetric___" + }, + "output_type": { + "const": "SurfaceOutput", + "default": "SurfaceOutput", + "enum": [ + "SurfaceOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "output_fields" + ], + "title": "SurfaceOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageSurfaceOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageSurfaceOutput.json new file mode 100644 index 000000000..87df8e69d --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageSurfaceOutput.json @@ -0,0 +1,156 @@ +{ + "$defs": { + "EntityList_Surface_": { + "additionalProperties": false, + "description": "Parameters\n----------\nstored_entities : typing.Optional[typing.List[flow360.component.simulation.primitives.Surface]]\n ", + "properties": { + "stored_entities": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/Surface" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Stored Entities" + } + }, + "required": [ + "stored_entities" + ], + "title": "EntityList[Surface]", + "type": "object" + }, + "Surface": { + "additionalProperties": false, + "description": "Represents a boudary surface in three-dimensional space.\n\n\nParameters\n----------\nname : \n ", + "properties": { + "name": { + "title": "Name", + "type": "string" + } + }, + "required": [ + "name" + ], + "title": "Surface", + "type": "object" + }, + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____CfVec____Cf____heatFlux____nodeNormals____nodeForcesPerUnitArea____yPlus____wallFunctionMetric___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'CfVec', 'Cf', 'heatFlux', 'nodeNormals', 'nodeForcesPerUnitArea', 'yPlus', 'wallFunctionMetric']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor", + "CfVec", + "Cf", + "heatFlux", + "nodeNormals", + "nodeForcesPerUnitArea", + "yPlus", + "wallFunctionMetric" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'CfVec', 'Cf', 'heatFlux', 'nodeNormals', 'nodeForcesPerUnitArea', 'yPlus', 'wallFunctionMetric']]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\noutput_format : typing.Literal['paraview', 'tecplot', 'both'] = paraview\n entities : typing.Optional[abc.EntityList[Surface]] = None\n write_single_file : = False\n Enable writing all surface outputs into a single file instead of one file per surface. This option currently only supports Tecplot output format. Will choose the value of the last instance of this option of the same output type (SurfaceOutput or TimeAverageSurfaceOutput) in the `output` list.\noutput_fields : \n output_type : typing.Literal['SurfaceOutput'] = SurfaceOutput\n ", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "output_format": { + "default": "paraview", + "enum": [ + "paraview", + "tecplot", + "both" + ], + "title": "Output Format", + "type": "string" + }, + "surfaces": { + "anyOf": [ + { + "$ref": "#/$defs/EntityList_Surface_" + }, + { + "type": "null" + } + ], + "default": null + }, + "write_single_file": { + "default": false, + "description": "Enable writing all surface outputs into a single file instead of one file per surface. This option currently only supports Tecplot output format. Will choose the value of the last instance of this option of the same output type (SurfaceOutput or TimeAverageSurfaceOutput) in the `output` list.", + "title": "Write Single File", + "type": "boolean" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____CfVec____Cf____heatFlux____nodeNormals____nodeForcesPerUnitArea____yPlus____wallFunctionMetric___" + }, + "output_type": { + "const": "SurfaceOutput", + "default": "SurfaceOutput", + "enum": [ + "SurfaceOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "output_fields" + ], + "title": "SurfaceOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageVolumeOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageVolumeOutput.json new file mode 100644 index 000000000..9f6e8679c --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-TimeAverageVolumeOutput.json @@ -0,0 +1,112 @@ +{ + "$defs": { + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____betMetrics____betMetricsPerDisk___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'betMetrics', 'betMetricsPerDisk']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor", + "betMetrics", + "betMetricsPerDisk" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'betMetrics', 'betMetricsPerDisk']]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Caveats:\nSolver side only accept exactly the same set of output_fields (is shared) between VolumeOutput and TimeAverageVolumeOutput.\nAlso let's not worry about allowing entities here as it is not supported by solver anyway.\n\nParameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\noutput_format : typing.Literal['paraview', 'tecplot', 'both'] = paraview\n output_fields : \n output_type : typing.Literal['TimeAverageVolumeOutput'] = TimeAverageVolumeOutput\n start_step : typing.Union[typing.Annotated[int, Ge(ge=0)], typing.Literal[-1]] = -1\n Physical time step to start calculating averaging\n\nNotes\n-----\n Old `computeTimeAverages` can be infered when user is explicitly using for example `TimeAverageSurfaceOutput`.", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "output_format": { + "default": "paraview", + "enum": [ + "paraview", + "tecplot", + "both" + ], + "title": "Output Format", + "type": "string" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____betMetrics____betMetricsPerDisk___" + }, + "output_type": { + "const": "TimeAverageVolumeOutput", + "default": "TimeAverageVolumeOutput", + "enum": [ + "TimeAverageVolumeOutput" + ], + "title": "Output Type", + "type": "string" + }, + "start_step": { + "anyOf": [ + { + "minimum": 0, + "type": "integer" + }, + { + "const": -1, + "enum": [ + -1 + ], + "type": "integer" + } + ], + "default": -1, + "description": "Physical time step to start calculating averaging", + "title": "Start Step" + } + }, + "required": [ + "output_fields" + ], + "title": "TimeAverageVolumeOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/outputs/json-schema-release-24.6-VolumeOutput.json b/tools/integrations/data_v2/outputs/json-schema-release-24.6-VolumeOutput.json new file mode 100644 index 000000000..a94e505a1 --- /dev/null +++ b/tools/integrations/data_v2/outputs/json-schema-release-24.6-VolumeOutput.json @@ -0,0 +1,94 @@ +{ + "$defs": { + "UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____betMetrics____betMetricsPerDisk___": { + "additionalProperties": false, + "description": "Parameters\n----------\nitems : typing.List[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'betMetrics', 'betMetricsPerDisk']]\n ", + "properties": { + "items": { + "items": { + "enum": [ + "Cp", + "gradW", + "kOmega", + "Mach", + "mut", + "mutRatio", + "nuHat", + "primitiveVars", + "qcriterion", + "residualNavierStokes", + "residualTransition", + "residualTurbulence", + "s", + "solutionNavierStokes", + "solutionTransition", + "solutionTurbulence", + "T", + "vorticity", + "wallDistance", + "numericalDissipationFactor", + "residualHeatSolver", + "VelocityRelative", + "lowMachPreconditionerSensor", + "betMetrics", + "betMetricsPerDisk" + ], + "type": "string" + }, + "title": "Items", + "type": "array" + } + }, + "required": [ + "items" + ], + "title": "UniqueAliasedStringList[typing.Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'betMetrics', 'betMetricsPerDisk']]", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Parameters\n----------\nfrequency : = -1\n Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.\nfrequency_offset : = 0\n Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.\noutput_format : typing.Literal['paraview', 'tecplot', 'both'] = paraview\n output_fields : \n output_type : typing.Literal['VolumeOutput'] = VolumeOutput\n ", + "properties": { + "frequency": { + "default": -1, + "description": "Frequency (in number of physical time steps) at which output is saved. -1 is at end of simulation.", + "minimum": -1, + "title": "Frequency", + "type": "integer" + }, + "frequency_offset": { + "default": 0, + "description": "Offset (in number of physical time steps) at which output animation is started. 0 is at beginning of simulation.", + "minimum": 0, + "title": "Frequency Offset", + "type": "integer" + }, + "output_format": { + "default": "paraview", + "enum": [ + "paraview", + "tecplot", + "both" + ], + "title": "Output Format", + "type": "string" + }, + "output_fields": { + "$ref": "#/$defs/UniqueAliasedStringList_Literal__Cp____gradW____kOmega____Mach____mut____mutRatio____nuHat____primitiveVars____qcriterion____residualNavierStokes____residualTransition____residualTurbulence____s____solutionNavierStokes____solutionTransition____solutionTurbulence____T____vorticity____wallDistance____numericalDissipationFactor____residualHeatSolver____VelocityRelative____lowMachPreconditionerSensor____betMetrics____betMetricsPerDisk___" + }, + "output_type": { + "const": "VolumeOutput", + "default": "VolumeOutput", + "enum": [ + "VolumeOutput" + ], + "title": "Output Type", + "type": "string" + } + }, + "required": [ + "output_fields" + ], + "title": "VolumeOutput", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/reference_geometry/example-1-release-24.6.json b/tools/integrations/data_v2/reference_geometry/example-1-release-24.6.json new file mode 100644 index 000000000..259d44db1 --- /dev/null +++ b/tools/integrations/data_v2/reference_geometry/example-1-release-24.6.json @@ -0,0 +1,22 @@ +{ + "moment_center": { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "m" + }, + "moment_length": { + "value": [ + 4.0, + 5.0, + 6.0 + ], + "units": "m" + }, + "area": { + "value": 10.0, + "units": "m**2" + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/reference_geometry/json-schema-release-24.6.json b/tools/integrations/data_v2/reference_geometry/json-schema-release-24.6.json new file mode 100644 index 000000000..37fa77481 --- /dev/null +++ b/tools/integrations/data_v2/reference_geometry/json-schema-release-24.6.json @@ -0,0 +1,123 @@ +{ + "additionalProperties": false, + "description": "Contains all geometrical related refrence values\nNote:\n- mesh_unit is removed from here and will be a property\nTODO:\n- Support expression for time-dependent axis etc?\n- What about force axis?\n\n\nParameters\n----------\nmoment_center : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n moment_length : typing.Union[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], typing.Annotated[flow360.component.simulation.unit_system._VectorType, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')], NoneType] = None\n area : typing.Optional[typing.Annotated[flow360.component.simulation.unit_system._Constrained, PlainSerializer(func=, return_type=PydanticUndefined, when_used='always')]] = None\n ", + "properties": { + "moment_center": { + "anyOf": [ + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Moment Center" + }, + "moment_length": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "properties": { + "value": { + "items": { + "type": "number" + }, + "maxItems": 3, + "minItems": 3, + "strictType": { + "type": "vector3" + }, + "type": "array" + }, + "units": { + "dimension": "length", + "enum": [ + "m", + "cm", + "ft", + "mm", + "inch" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Moment Length" + }, + "area": { + "anyOf": [ + { + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "area", + "enum": [ + "m**2", + "cm**2", + "ft**2" + ], + "type": "string" + } + } + }, + { + "type": "null" + } + ], + "default": null, + "title": "Area" + } + }, + "title": "ReferenceGeometry", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/simulation_params/example-1-release-24.6.json b/tools/integrations/data_v2/simulation_params/example-1-release-24.6.json new file mode 100644 index 000000000..94bc7455b --- /dev/null +++ b/tools/integrations/data_v2/simulation_params/example-1-release-24.6.json @@ -0,0 +1,584 @@ +{ + "unit_system": { + "name": "SI" + }, + "version": "24.3.0", + "meshing": { + "farfield": "auto", + "refinement_factor": 1.0, + "gap_treatment_strength": 0.5, + "surface_layer_growth_rate": 1.5, + "refinements": [ + { + "refinement_type": "UniformRefinement", + "entities": { + "stored_entities": [ + { + "name": "my_box", + "center": { + "value": [ + 1.2, + 2.3, + 3.4 + ], + "units": "m" + }, + "size": { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "m" + }, + "axes": [ + [ + 0.6, + 0.8, + 0.0 + ], + [ + 1.0, + 0.0, + 0.0 + ] + ] + } + ] + }, + "spacing": { + "value": 0.1, + "units": "m" + } + }, + { + "entities": { + "stored_entities": [ + { + "name": "edge1" + } + ] + }, + "growth_rate": null, + "refinement_type": "SurfaceEdgeRefinement", + "method": { + "type": "angle", + "value": { + "value": 1.0, + "units": "degree" + } + } + }, + { + "entities": { + "stored_entities": [ + { + "name": "edge1" + } + ] + }, + "growth_rate": null, + "refinement_type": "SurfaceEdgeRefinement", + "method": { + "type": "height", + "value": { + "value": 1.0, + "units": "m" + } + } + }, + { + "entities": { + "stored_entities": [ + { + "name": "edge1" + } + ] + }, + "growth_rate": null, + "refinement_type": "SurfaceEdgeRefinement", + "method": { + "type": "aspectRatio", + "value": 2.0 + } + } + ], + "volume_zones": [ + { + "refinement_type": "AxisymmetricRefinement", + "entities": { + "stored_entities": [ + { + "name": "my_cylinder-1", + "axis": [ + 1.0, + 0.0, + 0.0 + ], + "center": { + "value": [ + 1.2, + 2.3, + 3.4 + ], + "units": "m" + }, + "height": { + "value": 3.0, + "units": "m" + }, + "inner_radius": { + "value": 3.0, + "units": "m" + }, + "outer_radius": { + "value": 5.0, + "units": "m" + } + } + ] + }, + "spacing_axial": { + "value": 0.1, + "units": "m" + }, + "spacing_radial": { + "value": 0.12, + "units": "m" + }, + "spacing_circumferential": { + "value": 0.13, + "units": "m" + }, + "enclosed_objects": { + "stored_entities": [ + { + "name": "my_wall" + } + ] + } + } + ] + }, + "reference_geometry": { + "moment_center": { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "m" + }, + "moment_length": { + "value": 1.0, + "units": "m" + }, + "area": { + "value": 1.0, + "units": "cm**2" + } + }, + "operating_condition": { + "type_name": "AerospaceCondition", + "private_attribute_constructor": "default", + "private_attribute_input_cache": { + "alpha": null, + "beta": null, + "reference_velocity_magnitude": null, + "velocity_magnitude": null, + "thermal_state": null, + "mach": null, + "reference_mach": null + }, + "alpha": { + "value": 30.0, + "units": "degree" + }, + "beta": { + "value": 20.0, + "units": "degree" + }, + "velocity_magnitude": { + "value": 200.0, + "units": "m/s" + }, + "thermal_state": { + "type_name": "ThermalState", + "private_attribute_constructor": "default", + "private_attribute_input_cache": { + "altitude": null, + "temperature_offset": null, + "temperature": null, + "density": null, + "material": null + }, + "temperature": { + "value": 300.0, + "units": "K" + }, + "density": { + "value": 1.0, + "units": "g/cm**3" + }, + "material": { + "type": "air", + "name": "air", + "dynamic_viscosity": { + "reference_viscosity": { + "value": 1.716e-05, + "units": "Pa*s" + }, + "reference_temperature": { + "value": 273.15, + "units": "K" + }, + "effective_temperature": { + "value": 110.4, + "units": "K" + } + } + } + }, + "reference_velocity_magnitude": null + }, + "models": [ + { + "material": { + "type": "air", + "name": "air", + "dynamic_viscosity": { + "reference_viscosity": { + "value": 1.716e-05, + "units": "Pa*s" + }, + "reference_temperature": { + "value": 273.15, + "units": "K" + }, + "effective_temperature": { + "value": 110.4, + "units": "K" + } + } + }, + "initial_condition": null, + "navier_stokes_solver": { + "absolute_tolerance": 1e-10, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 1, + "update_jacobian_frequency": 4, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 30, + "absolute_tolerance": null, + "relative_tolerance": null + }, + "CFL_multiplier": 1.0, + "kappa_MUSCL": -1.0, + "numerical_dissipation_factor": 1.0, + "limit_velocity": false, + "limit_pressure_density": false, + "type_name": "Compressible", + "low_mach_preconditioner": false, + "low_mach_preconditioner_threshold": null + }, + "turbulence_model_solver": { + "absolute_tolerance": 1e-08, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 4, + "update_jacobian_frequency": 4, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 20, + "absolute_tolerance": null, + "relative_tolerance": null + }, + "CFL_multiplier": 2.0, + "type_name": "SpalartAllmaras", + "DDES": false, + "grid_size_for_LES": "maxEdgeLength", + "reconstruction_gradient_limiter": 0.5, + "quadratic_constitutive_relation": false, + "modeling_constants": { + "type_name": "SpalartAllmarasConsts", + "C_DES": 0.72, + "C_d": 8.0 + }, + "rotation_correction": false + }, + "transition_model_solver": null + }, + { + "type": "Wall", + "entities": { + "stored_entities": [ + { + "name": "my_wall" + } + ] + }, + "use_wall_function": true, + "velocity": { + "value": [ + 1.0, + 1.2, + 2.4 + ], + "units": "ft/s" + }, + "velocity_type": "relative", + "heat_spec": { + "value": { + "value": 1.0, + "units": "W/m**2" + } + } + }, + { + "type": "SlipWall", + "entities": { + "stored_entities": [ + { + "name": "my_slip_wall" + } + ] + } + }, + { + "entities": { + "stored_entities": [ + { + "name": "my_cylinder-1", + "axis": [ + 1.0, + 0.0, + 0.0 + ], + "center": { + "value": [ + 1.2, + 2.3, + 3.4 + ], + "units": "m" + }, + "height": { + "value": 3.0, + "units": "m" + }, + "inner_radius": { + "value": 3.0, + "units": "m" + }, + "outer_radius": { + "value": 5.0, + "units": "m" + } + } + ] + }, + "rotation": { + "value": { + "value": 0.45, + "units": "rad/s" + } + }, + "parent_volume": null + }, + { + "entities": { + "stored_entities": [ + { + "name": "my_box", + "center": { + "value": [ + 1.2, + 2.3, + 3.4 + ], + "units": "m" + }, + "size": { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "m" + }, + "axes": [ + [ + 0.6, + 0.8, + 0.0 + ], + [ + 1.0, + 0.0, + 0.0 + ] + ] + } + ] + }, + "darcy_coefficient": { + "value": [ + 0.1, + 2.0, + 1.0 + ], + "units": "1/(cm*m)" + }, + "forchheimer_coefficient": { + "value": [ + 0.1, + 2.0, + 1.0 + ], + "units": "1/ft" + }, + "volumetric_heat_source": { + "value": 123.0, + "units": "lb/(ft*s**3)" + } + }, + { + "material": { + "type": "solid", + "name": "abc", + "thermal_conductivity": { + "value": 1.0, + "units": "W/(K*m)" + }, + "density": { + "value": 1.0, + "units": "kg/m**3" + }, + "specific_heat_capacity": { + "value": 1.0, + "units": "J/(K*kg)" + } + }, + "initial_condition": null, + "entities": { + "stored_entities": [ + { + "name": "my_cylinder-2" + } + ] + }, + "heat_equation_solver": { + "absolute_tolerance": 1e-09, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 10, + "update_jacobian_frequency": 1, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 50, + "absolute_tolerance": 1e-10, + "relative_tolerance": null + }, + "type_name": "HeatEquation" + }, + "volumetric_heat_source": { + "value": 0.0, + "units": "kg/(m*s**3)" + } + }, + { + "type": "Inflow", + "entities": { + "stored_entities": [ + { + "name": "my_inflow1" + } + ] + }, + "turbulence_quantities": { + "type_name": "SpecificDissipationRateAndTurbulentKineticEnergy", + "turbulent_kinetic_energy": { + "value": 123.0, + "units": "J/kg" + }, + "specific_dissipation_rate": { + "value": 1000.0, + "units": "Hz" + } + }, + "total_temperature": { + "value": 300.0, + "units": "K" + }, + "velocity_direction": null, + "spec": { + "value": { + "value": 123.0, + "units": "Pa" + } + } + }, + { + "type": "Inflow", + "entities": { + "stored_entities": [ + { + "name": "my_inflow2" + } + ] + }, + "turbulence_quantities": null, + "total_temperature": { + "value": 300.0, + "units": "K" + }, + "velocity_direction": null, + "spec": { + "value": { + "value": 123.0, + "units": "lb/s" + } + } + } + ], + "time_stepping": { + "order_of_accuracy": 2, + "type_name": "Unsteady", + "max_pseudo_steps": 100, + "steps": 123, + "step_size": { + "value": 0.4, + "units": "s" + }, + "CFL": { + "type": "adaptive", + "min": 0.1, + "max": 1000000.0, + "max_relative_change": 50.0, + "convergence_limiting_factor": 1.0 + } + }, + "user_defined_dynamics": [ + { + "name": "fake", + "input_vars": [ + "fake" + ], + "constants": { + "ff": 123.0 + }, + "output_vars": null, + "state_vars_initial_value": [ + "fake;" + ], + "update_law": [ + "fake;" + ], + "input_boundary_patches": null, + "output_target": null + } + ], + "outputs": null +} \ No newline at end of file diff --git a/tools/integrations/data_v2/simulation_params/example-2-release-24.6.json b/tools/integrations/data_v2/simulation_params/example-2-release-24.6.json new file mode 100644 index 000000000..0c919820b --- /dev/null +++ b/tools/integrations/data_v2/simulation_params/example-2-release-24.6.json @@ -0,0 +1,241 @@ +{ + "unit_system": { + "name": "SI" + }, + "version": "24.3.0", + "meshing": { + "farfield": "auto", + "refinement_factor": 1.0, + "gap_treatment_strength": null, + "surface_layer_growth_rate": 1.5, + "refinements": [ + { + "refinement_type": "BoundaryLayer", + "type": "aniso", + "entities": null, + "first_layer_thickness": { + "value": 0.001, + "units": "m" + }, + "growth_rate": 1.2 + }, + { + "refinement_type": "SurfaceRefinement", + "entities": { + "stored_entities": [ + { + "name": "wing" + } + ] + }, + "max_edge_length": { + "value": 15.0, + "units": "cm" + }, + "curvature_resolution_angle": { + "value": 10.0, + "units": "degree" + } + } + ], + "volume_zones": [] + }, + "reference_geometry": { + "moment_center": { + "value": [ + 1.0, + 2.0, + 3.0 + ], + "units": "m" + }, + "moment_length": { + "value": 1.0, + "units": "m" + }, + "area": { + "value": 1.0, + "units": "cm**2" + } + }, + "operating_condition": { + "type_name": "AerospaceCondition", + "private_attribute_constructor": "default", + "private_attribute_input_cache": { + "alpha": null, + "beta": null, + "reference_velocity_magnitude": null, + "velocity_magnitude": null, + "thermal_state": null, + "mach": null, + "reference_mach": null + }, + "alpha": { + "value": 0.0, + "units": "degree" + }, + "beta": { + "value": 0.0, + "units": "degree" + }, + "velocity_magnitude": { + "value": 100.0, + "units": "m/s" + }, + "thermal_state": { + "type_name": "ThermalState", + "private_attribute_constructor": "default", + "private_attribute_input_cache": { + "altitude": null, + "temperature_offset": null, + "temperature": null, + "density": null, + "material": null + }, + "temperature": { + "value": 288.15, + "units": "K" + }, + "density": { + "value": 1.225, + "units": "kg/m**3" + }, + "material": { + "type": "air", + "name": "air", + "dynamic_viscosity": { + "reference_viscosity": { + "value": 1.716e-05, + "units": "Pa*s" + }, + "reference_temperature": { + "value": 273.15, + "units": "K" + }, + "effective_temperature": { + "value": 110.4, + "units": "K" + } + } + } + }, + "reference_velocity_magnitude": null + }, + "models": [ + { + "material": { + "type": "air", + "name": "air", + "dynamic_viscosity": { + "reference_viscosity": { + "value": 1.716e-05, + "units": "Pa*s" + }, + "reference_temperature": { + "value": 273.15, + "units": "K" + }, + "effective_temperature": { + "value": 110.4, + "units": "K" + } + } + }, + "initial_condition": null, + "navier_stokes_solver": { + "absolute_tolerance": 1e-10, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 1, + "update_jacobian_frequency": 4, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 30, + "absolute_tolerance": null, + "relative_tolerance": null + }, + "CFL_multiplier": 1.0, + "kappa_MUSCL": -1.0, + "numerical_dissipation_factor": 1.0, + "limit_velocity": false, + "limit_pressure_density": false, + "type_name": "Compressible", + "low_mach_preconditioner": false, + "low_mach_preconditioner_threshold": null + }, + "turbulence_model_solver": { + "absolute_tolerance": 1e-08, + "relative_tolerance": 0.0, + "order_of_accuracy": 2, + "equation_eval_frequency": 4, + "update_jacobian_frequency": 4, + "max_force_jac_update_physical_steps": 0, + "linear_solver": { + "max_iterations": 20, + "absolute_tolerance": null, + "relative_tolerance": null + }, + "CFL_multiplier": 2.0, + "type_name": "SpalartAllmaras", + "DDES": false, + "grid_size_for_LES": "maxEdgeLength", + "reconstruction_gradient_limiter": 0.5, + "quadratic_constitutive_relation": false, + "modeling_constants": { + "type_name": "SpalartAllmarasConsts", + "C_DES": 0.72, + "C_d": 8.0 + }, + "rotation_correction": false + }, + "transition_model_solver": null + }, + { + "type": "Wall", + "entities": { + "stored_entities": [ + { + "name": "fluid/rightWing" + }, + { + "name": "fluid/leftWing" + }, + { + "name": "fluid/fuselage" + } + ] + }, + "use_wall_function": false, + "velocity": null, + "velocity_type": "relative", + "heat_spec": null + }, + { + "type": "Freestream", + "entities": { + "stored_entities": [ + { + "name": "fluid/farfield" + } + ] + }, + "turbulence_quantities": null, + "velocity": null, + "velocity_type": "relative" + } + ], + "time_stepping": { + "order_of_accuracy": 2, + "type_name": "Steady", + "max_steps": 700, + "CFL": { + "type": "adaptive", + "min": 0.1, + "max": 10000.0, + "max_relative_change": 1.0, + "convergence_limiting_factor": 0.25 + } + }, + "user_defined_dynamics": null, + "outputs": null +} \ No newline at end of file diff --git a/tools/integrations/data_v2/time_stepping/json-schema-release-24.6-steady.json b/tools/integrations/data_v2/time_stepping/json-schema-release-24.6-steady.json new file mode 100644 index 000000000..a511fb111 --- /dev/null +++ b/tools/integrations/data_v2/time_stepping/json-schema-release-24.6-steady.json @@ -0,0 +1,172 @@ +{ + "$defs": { + "AdaptiveCFL": { + "additionalProperties": false, + "description": "Adaptive CFL for time stepping component\n\n\nParameters\n----------\ntype : typing.Literal['adaptive'] = adaptive\n min : = 0.1\n max : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n max_relative_change : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n convergence_limiting_factor : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n ", + "properties": { + "type": { + "const": "adaptive", + "default": "adaptive", + "enum": [ + "adaptive" + ], + "title": "Type", + "type": "string" + }, + "min": { + "default": 0.1, + "exclusiveMinimum": 0.0, + "title": "Min", + "type": "number" + }, + "max": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Max" + }, + "max_relative_change": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Max Relative Change" + }, + "convergence_limiting_factor": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Convergence Limiting Factor" + } + }, + "title": "AdaptiveCFL", + "type": "object" + }, + "RampCFL": { + "additionalProperties": false, + "description": "Ramp CFL for time stepping component\n\n\nParameters\n----------\ntype : typing.Literal['ramp'] = ramp\n initial : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n final : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n ramp_steps : typing.Optional[typing.Annotated[int, Gt(gt=0)]] = None\n ", + "properties": { + "type": { + "const": "ramp", + "default": "ramp", + "enum": [ + "ramp" + ], + "title": "Type", + "type": "string" + }, + "initial": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Initial" + }, + "final": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Final" + }, + "ramp_steps": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Ramp Steps" + } + }, + "title": "RampCFL", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Steady time stepping component\n\n\nParameters\n----------\norder_of_accuracy : typing.Literal[1, 2] = 2\n type_name : typing.Literal['Steady'] = Steady\n max_steps : = 2000\n Maximum number of pseudo steps.\nCFL : typing.Union[flow360.component.simulation.time_stepping.time_stepping.RampCFL, flow360.component.simulation.time_stepping.time_stepping.AdaptiveCFL] = AdaptiveCFL(type='adaptive', min=0.1, max=10000.0, max_relative_change=1.0, convergence_limiting_factor=0.25)\n ", + "properties": { + "order_of_accuracy": { + "default": 2, + "enum": [ + 1, + 2 + ], + "title": "Order Of Accuracy", + "type": "integer" + }, + "type_name": { + "const": "Steady", + "default": "Steady", + "enum": [ + "Steady" + ], + "title": "Type Name", + "type": "string" + }, + "max_steps": { + "default": 2000, + "description": "Maximum number of pseudo steps.", + "exclusiveMinimum": 0, + "maximum": 100000, + "title": "Max Steps", + "type": "integer" + }, + "CFL": { + "anyOf": [ + { + "$ref": "#/$defs/RampCFL" + }, + { + "$ref": "#/$defs/AdaptiveCFL" + } + ], + "default": { + "type": "adaptive", + "min": 0.1, + "max": 10000.0, + "maxRelativeChange": 1.0, + "convergenceLimitingFactor": 0.25 + }, + "title": "Cfl" + } + }, + "title": "Steady", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/time_stepping/json-schema-release-24.6-unsteady.json b/tools/integrations/data_v2/time_stepping/json-schema-release-24.6-unsteady.json new file mode 100644 index 000000000..b6c6a00fd --- /dev/null +++ b/tools/integrations/data_v2/time_stepping/json-schema-release-24.6-unsteady.json @@ -0,0 +1,199 @@ +{ + "$defs": { + "AdaptiveCFL": { + "additionalProperties": false, + "description": "Adaptive CFL for time stepping component\n\n\nParameters\n----------\ntype : typing.Literal['adaptive'] = adaptive\n min : = 0.1\n max : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n max_relative_change : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n convergence_limiting_factor : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n ", + "properties": { + "type": { + "const": "adaptive", + "default": "adaptive", + "enum": [ + "adaptive" + ], + "title": "Type", + "type": "string" + }, + "min": { + "default": 0.1, + "exclusiveMinimum": 0.0, + "title": "Min", + "type": "number" + }, + "max": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Max" + }, + "max_relative_change": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Max Relative Change" + }, + "convergence_limiting_factor": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Convergence Limiting Factor" + } + }, + "title": "AdaptiveCFL", + "type": "object" + }, + "RampCFL": { + "additionalProperties": false, + "description": "Ramp CFL for time stepping component\n\n\nParameters\n----------\ntype : typing.Literal['ramp'] = ramp\n initial : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n final : typing.Optional[typing.Annotated[float, Gt(gt=0)]] = None\n ramp_steps : typing.Optional[typing.Annotated[int, Gt(gt=0)]] = None\n ", + "properties": { + "type": { + "const": "ramp", + "default": "ramp", + "enum": [ + "ramp" + ], + "title": "Type", + "type": "string" + }, + "initial": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Initial" + }, + "final": { + "anyOf": [ + { + "exclusiveMinimum": 0.0, + "type": "number" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Final" + }, + "ramp_steps": { + "anyOf": [ + { + "exclusiveMinimum": 0, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "title": "Ramp Steps" + } + }, + "title": "RampCFL", + "type": "object" + } + }, + "additionalProperties": false, + "description": "Unsteady time stepping component\n\n\nParameters\n----------\norder_of_accuracy : typing.Literal[1, 2] = 2\n type_name : typing.Literal['Unsteady'] = Unsteady\n max_pseudo_steps : = 100\n Maximum pseudo steps within one physical step.\nsteps : \n Number of physical steps.\nstep_size : \n Time step size in physical step marching,\nCFL : typing.Union[flow360.component.simulation.time_stepping.time_stepping.RampCFL, flow360.component.simulation.time_stepping.time_stepping.AdaptiveCFL] = AdaptiveCFL(type='adaptive', min=0.1, max=1000000.0, max_relative_change=50.0, convergence_limiting_factor=1.0)\n ", + "properties": { + "order_of_accuracy": { + "default": 2, + "enum": [ + 1, + 2 + ], + "title": "Order Of Accuracy", + "type": "integer" + }, + "type_name": { + "const": "Unsteady", + "default": "Unsteady", + "enum": [ + "Unsteady" + ], + "title": "Type Name", + "type": "string" + }, + "max_pseudo_steps": { + "default": 100, + "description": "Maximum pseudo steps within one physical step.", + "exclusiveMinimum": 0, + "maximum": 100000, + "title": "Max Pseudo Steps", + "type": "integer" + }, + "steps": { + "description": "Number of physical steps.", + "exclusiveMinimum": 0, + "title": "Steps", + "type": "integer" + }, + "step_size": { + "description": "Time step size in physical step marching,", + "properties": { + "value": { + "exclusiveMinimum": 0, + "type": "number" + }, + "units": { + "dimension": "time", + "enum": [ + "s" + ], + "type": "string" + } + }, + "title": "Step Size" + }, + "CFL": { + "anyOf": [ + { + "$ref": "#/$defs/RampCFL" + }, + { + "$ref": "#/$defs/AdaptiveCFL" + } + ], + "default": { + "type": "adaptive", + "min": 0.1, + "max": 1000000.0, + "maxRelativeChange": 50.0, + "convergenceLimitingFactor": 1.0 + }, + "title": "Cfl" + } + }, + "required": [ + "steps", + "step_size" + ], + "title": "Unsteady", + "type": "object" +} \ No newline at end of file diff --git a/tools/integrations/data_v2/time_stepping/steady-release-24.6.json b/tools/integrations/data_v2/time_stepping/steady-release-24.6.json new file mode 100644 index 000000000..9a4d46720 --- /dev/null +++ b/tools/integrations/data_v2/time_stepping/steady-release-24.6.json @@ -0,0 +1,11 @@ +{ + "order_of_accuracy": 2, + "type_name": "Steady", + "max_steps": 123, + "CFL": { + "type": "ramp", + "initial": 0.0001, + "final": 123.0, + "ramp_steps": 21 + } +} \ No newline at end of file diff --git a/tools/integrations/data_v2/time_stepping/unsteady-release-24.6.json b/tools/integrations/data_v2/time_stepping/unsteady-release-24.6.json new file mode 100644 index 000000000..0dd926f2c --- /dev/null +++ b/tools/integrations/data_v2/time_stepping/unsteady-release-24.6.json @@ -0,0 +1,17 @@ +{ + "order_of_accuracy": 2, + "type_name": "Unsteady", + "max_pseudo_steps": 123, + "steps": 456, + "step_size": { + "value": 0.4, + "units": "s" + }, + "CFL": { + "type": "adaptive", + "min": 0.1, + "max": 1000000.0, + "max_relative_change": 50.0, + "convergence_limiting_factor": 1.0 + } +} \ No newline at end of file diff --git a/tools/integrations/schema_generation_v2.py b/tools/integrations/schema_generation_v2.py new file mode 100644 index 000000000..204e4a0fe --- /dev/null +++ b/tools/integrations/schema_generation_v2.py @@ -0,0 +1,650 @@ +import json +import os +from typing import Annotated, List, Type, Union + +import pydantic as pd + +from flow360.component.simulation.framework.base_model import Flow360BaseModel +from flow360.component.simulation.meshing_param.edge_params import ( + AngleBasedRefinement, + AspectRatioBasedRefinement, + HeightBasedRefinement, + ProjectAnisoSpacing, +) +from flow360.component.simulation.meshing_param.face_params import ( + BoundaryLayer, + SurfaceRefinement, +) +from flow360.component.simulation.meshing_param.params import ( + MeshingParams, + SurfaceEdgeRefinement, +) +from flow360.component.simulation.meshing_param.volume_params import ( + RotationCylinder, + UniformRefinement, +) +from flow360.component.simulation.models.material import SolidMaterial +from flow360.component.simulation.models.solver_numerics import TransitionModelSolver +from flow360.component.simulation.models.surface_models import ( + Freestream, + HeatFlux, + Inflow, + Mach, + MassFlowRate, + Outflow, + Periodic, + Pressure, + Rotational, + SlipWall, + SymmetryPlane, + TotalPressure, + Translational, + Wall, +) +from flow360.component.simulation.models.turbulence_quantities import ( + TurbulenceQuantities, +) +from flow360.component.simulation.models.volume_models import ( + AngularVelocity, + Fluid, + NavierStokesInitialCondition, + PorousMedium, + Rotation, + Solid, +) +from flow360.component.simulation.operating_condition import ( + AerospaceCondition, + ThermalState, +) +from flow360.component.simulation.outputs.outputs import ( + AeroAcousticOutput, + Isosurface, + IsosurfaceOutput, + Probe, + ProbeOutput, + Slice, + SliceOutput, + SurfaceIntegralOutput, + SurfaceList, + SurfaceOutput, + TimeAverageSurfaceOutput, + TimeAverageVolumeOutput, + VolumeOutput, +) +from flow360.component.simulation.primitives import ( + Box, + Cylinder, + Edge, + GenericVolume, + ReferenceGeometry, + Surface, + SurfacePair, +) +from flow360.component.simulation.simulation_params import SimulationParams +from flow360.component.simulation.time_stepping.time_stepping import ( + RampCFL, + Steady, + Unsteady, +) +from flow360.component.simulation.unit_system import ( + SI_unit_system, + imperial_unit_system, + u, +) +from flow360.component.simulation.user_defined_dynamics.user_defined_dynamics import ( + UserDefinedDynamic, +) + +here = os.path.dirname(os.path.abspath(__file__)) +version_postfix = "release-24.6" + + +data_folder = "data_v2" + + +def merge_dicts_recursively(dict1, dict2): + """ + Recursively merges dict2 into dict1 with overwriting existing keys. + + Parameters + ---------- + dict1 : dict + The dictionary to be updated. + dict2 : dict + The dictionary to merge into dict1. + + Returns + ------- + dict + The merged dictionary. + """ + for key, value in dict2.items(): + if key in dict1: + if isinstance(dict1[key], dict) and isinstance(value, dict): + merge_dicts_recursively(dict1[key], value) + else: + dict1[key] = value + else: + dict1[key] = value + return dict1 + + +def write_to_file(name, content): + with open(name, "w") as outfile: + outfile.write(content) + + +def write_schemas(type_obj: Type[Flow360BaseModel], folder_name, file_suffix=""): + data = type_obj.model_json_schema() + schema = json.dumps(data, indent=2) + name = type_obj.__name__ + if name.startswith("_"): + name = name[1:] + os.makedirs(os.path.join(here, data_folder, folder_name), exist_ok=True) + file_suffix_part = f"-{file_suffix}" if file_suffix else "" + write_to_file( + os.path.join( + here, data_folder, folder_name, f"json-schema-{version_postfix}{file_suffix_part}.json" + ), + schema, + ) + + +def write_example( + obj: Flow360BaseModel, + folder_name, + example_name, + exclude_defaults=False, + additional_fields: dict = {}, + exclude=None, +): + data = obj.model_dump(exclude_defaults=exclude_defaults, exclude=exclude) + data = merge_dicts_recursively(data, additional_fields) + data_json = json.dumps(data, indent=2) + os.makedirs(os.path.join(here, data_folder, folder_name), exist_ok=True) + write_to_file( + os.path.join(here, data_folder, folder_name, f"{example_name}-{version_postfix}.json"), + data_json, + ) + + +my_wall_surface = Surface(name="my_wall") +my_symm_plane = Surface(name="my_symmetry_plane") +my_slip_wall_surface = Surface(name="my_slip_wall") +my_inflow1 = Surface(name="my_inflow1") +my_inflow2 = Surface(name="my_inflow2") +my_outflow = Surface(name="my_outflow") +my_fs = Surface(name="my_free_stream") +edge = Edge(name="edge1") + +my_surface_pair = SurfacePair(pair=(my_wall_surface, my_slip_wall_surface)) + + +with SI_unit_system: + my_box = Box( + name="my_box", + center=(1.2, 2.3, 3.4) * u.m, + size=(1.0, 2.0, 3.0) * u.m, + axes=((3, 4, 0), (1, 0, 0)), + ) + my_cylinder_1 = Cylinder( + name="my_cylinder-1", + axis=(5, 0, 0), + center=(1.2, 2.3, 3.4) * u.m, + height=3.0 * u.m, + inner_radius=3.0 * u.m, + outer_radius=5.0 * u.m, + ) + my_solid_zone = GenericVolume( + name="my_cylinder-2", + ) + meshing = MeshingParams( + farfield="auto", + refinement_factor=1.0, + gap_treatment_strength=0.5, + surface_layer_growth_rate=1.5, + refinements=[ + UniformRefinement(entities=[my_box], spacing=0.1 * u.m), + SurfaceEdgeRefinement(edges=[edge], method=AngleBasedRefinement(value=1 * u.deg)), + SurfaceEdgeRefinement(edges=[edge], method=HeightBasedRefinement(value=1 * u.m)), + SurfaceEdgeRefinement(edges=[edge], method=AspectRatioBasedRefinement(value=2)), + ], + volume_zones=[ + RotationCylinder( + entities=[my_cylinder_1], + spacing_axial=0.1 * u.m, + spacing_radial=0.12 * u.m, + spacing_circumferential=0.13 * u.m, + enclosed_objects=[my_wall_surface], + ) + ], + ) + param = SimulationParams( + meshing=meshing, + reference_geometry=ReferenceGeometry( + moment_center=(1, 2, 3), moment_length=1.0 * u.m, area=1.0 * u.cm**2 + ), + operating_condition=AerospaceCondition( + velocity_magnitude=200, + alpha=30 * u.deg, + beta=20 * u.deg, + thermal_state=ThermalState(temperature=300 * u.K, density=1 * u.g / u.cm**3), + ), + models=[ + Fluid(), + Wall( + entities=[my_wall_surface], + use_wall_function=True, + velocity=(1.0, 1.2, 2.4) * u.ft / u.s, + heat_spec=HeatFlux(1.0 * u.W / u.m**2), + ), + SlipWall(entities=[my_slip_wall_surface]), + Rotation(volumes=[my_cylinder_1], rotation=AngularVelocity(0.45 * u.rad / u.s)), + PorousMedium( + volumes=[my_box], + darcy_coefficient=(0.1, 2, 1.0) / u.cm / u.m, + forchheimer_coefficient=(0.1, 2, 1.0) / u.ft, + volumetric_heat_source=123 * u.lb / u.s**3 / u.ft, + ), + Solid( + volumes=[my_solid_zone], + material=SolidMaterial( + name="abc", + thermal_conductivity=1.0 * u.W / u.m / u.K, + specific_heat_capacity=1.0 * u.J / u.kg / u.K, + density=1.0 * u.kg / u.m**3, + ), + ), + Inflow( + surfaces=[my_inflow1], + total_temperature=300 * u.K, + spec=TotalPressure(123 * u.Pa), + turbulence_quantities=TurbulenceQuantities( + turbulent_kinetic_energy=123, specific_dissipation_rate=1e3 + ), + ), + Inflow( + surfaces=[my_inflow2], + total_temperature=300 * u.K, + spec=MassFlowRate(123 * u.lb / u.s), + ), + ], + time_stepping=Unsteady(step_size=2 * 0.2 * u.s, steps=123), + user_defined_dynamics=[ + UserDefinedDynamic( + name="fake", + input_vars=["fake"], + constants={"ff": 123}, + state_vars_initial_value=["fake"], + update_law=["fake"], + ) + ], + ) + +write_example(param, "simulation_params", "example-1") + +with SI_unit_system: + meshing = MeshingParams( + surface_layer_growth_rate=1.5, + refinements=[ + BoundaryLayer(first_layer_thickness=0.001), + SurfaceRefinement( + entities=[Surface(name="wing")], + max_edge_length=15 * u.cm, + curvature_resolution_angle=10 * u.deg, + ), + ], + ) + param = SimulationParams( + meshing=meshing, + reference_geometry=ReferenceGeometry( + moment_center=(1, 2, 3), moment_length=1.0 * u.m, area=1.0 * u.cm**2 + ), + operating_condition=AerospaceCondition(velocity_magnitude=100), + models=[ + Fluid(), + Wall( + entities=[ + Surface(name="fluid/rightWing"), + Surface(name="fluid/leftWing"), + Surface(name="fluid/fuselage"), + ], + ), + Freestream(entities=[Surface(name="fluid/farfield")]), + ], + time_stepping=Steady(max_steps=700), + ) + +write_example(param, "simulation_params", "example-2") + + +###################### reference_geometry ###################### +write_schemas(ReferenceGeometry, "reference_geometry") +with SI_unit_system: + g = ReferenceGeometry(moment_center=(1, 2, 3), moment_length=(4, 5, 6), area=10) + write_example(g, "reference_geometry", "example-1") + + +###################### meshing ###################### +write_schemas(MeshingParams, "meshing") +with SI_unit_system: + write_example(meshing, "meshing", "example-1") + + +###################### operating_condition ###################### +write_schemas(AerospaceCondition, "operating_condition") +with SI_unit_system: + ac = AerospaceCondition( + velocity_magnitude=1 * u.m / u.s, + alpha=1 * u.deg, + thermal_state=ThermalState(temperature=100 * u.K, density=2), + ) +write_example( + ac, + "operating_condition", + "example-1", + exclude_defaults=True, + additional_fields=dict( + type_name="AerospaceCondition", thermal_state=dict(type_name="ThermalState") + ), +) + +with SI_unit_system: + ac = AerospaceCondition( + velocity_magnitude=1 * u.m / u.s, + thermal_state=ThermalState.from_standard_atmosphere(altitude=1000, temperature_offset=-1), + ) +write_example( + ac, + "operating_condition", + "example-2", + exclude_defaults=True, + additional_fields=dict( + type_name="AerospaceCondition", thermal_state=dict(type_name="ThermalState") + ), +) + +with SI_unit_system: + ac = AerospaceCondition.from_mach( + mach=0.8, alpha=1 * u.deg, thermal_state=ThermalState(temperature=100 * u.K, density=2) + ) +write_example( + ac, + "operating_condition", + "example-3", + exclude_defaults=True, + exclude=dict(velocity_magnitude=True, private_attribute_input_cache=dict(thermal_state=True)), + additional_fields=dict( + type_name="AerospaceCondition", thermal_state=dict(type_name="ThermalState") + ), +) + +with SI_unit_system: + ac = AerospaceCondition.from_mach( + mach=0.8, + alpha=1 * u.deg, + thermal_state=ThermalState.from_standard_atmosphere(altitude=1000, temperature_offset=-1), + ) +write_example( + ac, + "operating_condition", + "example-4", + exclude_defaults=True, + exclude=dict(velocity_magnitude=True, private_attribute_input_cache=dict(thermal_state=True)), + additional_fields=dict( + type_name="AerospaceCondition", thermal_state=dict(type_name="ThermalState") + ), +) + +###################### models ###################### +write_schemas(Fluid, "models", "fluid") +with imperial_unit_system: + fluid_model = Fluid( + transition_model_solver=TransitionModelSolver(), + initial_condition=NavierStokesInitialCondition(rho="1;", u="1;", v="1;", w="1;", p="1;"), + ) +write_example(fluid_model, "models", "fluid") + + +write_schemas(Solid, "models", "solid") +with imperial_unit_system: + solid_model = Solid( + volumes=[my_solid_zone], + material=SolidMaterial( + name="abc", + thermal_conductivity=1.0 * u.W / u.m / u.K, + specific_heat_capacity=1.0 * u.J / u.kg / u.K, + density=1.0 * u.kg / u.m**3, + ), + volumetric_heat_source=123 * u.lb / u.s**3 / u.ft, + ) +write_example(solid_model, "models", "solid") + +write_schemas(Rotation, "models", "rotation") +rotation_model = Rotation( + volumes=[my_cylinder_1], + rotation=AngularVelocity(0.45 * u.deg / u.s), + parent_volume=GenericVolume(name="outter_volume"), +) +write_example(rotation_model, "models", "rotation") + + +write_schemas(PorousMedium, "models", "porouse_medium") +porous_model = PorousMedium( + volumes=[my_box], + darcy_coefficient=(0.1, 2, 1.0) / u.cm / u.m, + forchheimer_coefficient=(0.1, 2, 1.0) / u.ft, + volumetric_heat_source=123 * u.lb / u.s**3 / u.ft, +) +write_example(porous_model, "models", "porouse_medium") + + +write_schemas(Wall, "models", "wall") +my_wall = Wall( + entities=[my_wall_surface], + use_wall_function=True, + velocity=(1.0, 1.2, 2.4) * u.ft / u.s, + heat_spec=HeatFlux(1.0 * u.W / u.m**2), +) +write_example(my_wall, "models", "wall") + +write_schemas(SlipWall, "models", "slip_wall") +my_wall = SlipWall(entities=[my_slip_wall_surface]) +write_example(my_wall, "models", "slip_wall") + + +write_schemas(Freestream, "models", "freestream") +my_fs_surface = Freestream(entities=[my_fs], velocity=("1", "2", "0"), velocity_type="absolute") +write_example(my_fs_surface, "models", "freestream") + + +write_schemas(Outflow, "models", "outflow") +with imperial_unit_system: + my_outflow_obj = Outflow(entities=[my_outflow], spec=Pressure(1)) +write_example(my_outflow_obj, "models", "outflow-Pressure") + +with imperial_unit_system: + my_outflow_obj = Outflow(entities=[my_outflow], spec=MassFlowRate(1)) +write_example(my_outflow_obj, "models", "outflow-MassFlowRate") + +my_outflow_obj = Outflow(entities=[my_outflow], spec=Mach(1)) +write_example(my_outflow_obj, "models", "outflow-Mach") + + +write_schemas(Inflow, "models", "inflow") +with imperial_unit_system: + my_inflow_surface_1 = Inflow( + surfaces=[my_inflow1], + total_temperature=300 * u.K, + spec=TotalPressure(123 * u.Pa), + turbulence_quantities=TurbulenceQuantities( + turbulent_kinetic_energy=123, specific_dissipation_rate=1e3 + ), + ) +write_example(my_inflow_surface_1, "models", "inflow-TotalPressure") + +with imperial_unit_system: + my_inflow_surface_1 = Inflow( + surfaces=[my_inflow1], + total_temperature=300 * u.K, + spec=MassFlowRate(123), + turbulence_quantities=TurbulenceQuantities( + turbulent_kinetic_energy=123, specific_dissipation_rate=1e3 + ), + ) +write_example(my_inflow_surface_1, "models", "inflow-MassFlowRate") + + +write_schemas(Periodic, "models", "periodic") +with imperial_unit_system: + my_pbc = Periodic(entity_pairs=[my_surface_pair], spec=Translational()) +write_example(my_pbc, "models", "periodic-Translational") + +with imperial_unit_system: + my_pbc = Periodic(entity_pairs=[my_surface_pair], spec=Rotational(axis_of_rotation=(0, 2, 0))) +write_example(my_pbc, "models", "periodic-Rotational") + + +write_schemas(SymmetryPlane, "models", "symmetry_plane") +with imperial_unit_system: + my_symm = SymmetryPlane(entities=[my_symm_plane]) +write_example(my_symm, "models", "symmetry_plane") + + +###################### time stepping ###################### +write_schemas(Unsteady, "time_stepping", file_suffix="unsteady") +with imperial_unit_system: + unsteady_setting = Unsteady( + max_pseudo_steps=123, + steps=456, + step_size=2 * 0.2, + ) +write_example(unsteady_setting, "time_stepping", "unsteady") + +write_schemas(Steady, "time_stepping", file_suffix="steady") +with imperial_unit_system: + steady_setting = Steady(max_steps=123, CFL=RampCFL(initial=1e-4, final=123, ramp_steps=21)) +write_example(steady_setting, "time_stepping", "steady") + +###################### outputs ###################### +write_schemas(SurfaceOutput, "outputs", file_suffix="SurfaceOutput") +with imperial_unit_system: + setting = SurfaceOutput( + entities=[my_wall_surface, my_inflow1], + frequency=12, + frequency_offset=1, + output_format="paraview", + output_fields=["nodeNormals", "yPlus"], + ) +write_example(setting, "outputs", "SurfaceOutput") + +write_schemas(SurfaceOutput, "outputs", file_suffix="TimeAverageSurfaceOutput") +with imperial_unit_system: + setting = TimeAverageSurfaceOutput( + entities=[my_wall_surface, my_inflow1], + frequency=12, + frequency_offset=1, + start_step=10, + output_format="tecplot", + write_single_file=True, + output_fields=["nodeNormals", "yPlus"], + ) +write_example(setting, "outputs", "TimeAverageSurfaceOutput") + +write_schemas(VolumeOutput, "outputs", file_suffix="VolumeOutput") +with imperial_unit_system: + setting = VolumeOutput( + frequency=12, + frequency_offset=1, + output_format="tecplot", + output_fields=["Cp"], + ) +write_example(setting, "outputs", "VolumeOutput") + +write_schemas(TimeAverageVolumeOutput, "outputs", file_suffix="TimeAverageVolumeOutput") +with imperial_unit_system: + setting = TimeAverageVolumeOutput( + frequency=12, + frequency_offset=1, + output_format="tecplot", + output_fields=["Cp"], + start_step=0, + ) +write_example(setting, "outputs", "TimeAverageVolumeOutput") + +write_schemas(SliceOutput, "outputs", file_suffix="SliceOutput") +with imperial_unit_system: + setting = SliceOutput( + frequency=12, + frequency_offset=1, + output_format="tecplot", + output_fields=["Cp"], + slices=[ + Slice(name="my_first_slice", slice_normal=(1, 0, 0), slice_origin=(4, 4, 2)), + Slice(name="my_second_slice", slice_normal=(1, 0, 1), slice_origin=(41, 14, 12)), + ], + ) +write_example(setting, "outputs", "SliceOutput") + +write_schemas(IsosurfaceOutput, "outputs", file_suffix="IsosurfaceOutput") +with imperial_unit_system: + setting = IsosurfaceOutput( + frequency=12, + frequency_offset=1, + output_format="tecplot", + output_fields=["primitiveVars", "vorticity"], + isosurfaces=[ + Isosurface(name="my_first_iso", field="qcriterion", iso_value=1234.0), + Isosurface(name="my_second_iso", field="Cp", iso_value=12.0), + ], + ) +write_example(setting, "outputs", "IsosurfaceOutput") + +write_schemas(SurfaceIntegralOutput, "outputs", file_suffix="SurfaceIntegralOutput") +with imperial_unit_system: + setting = SurfaceIntegralOutput( + frequency=12, + frequency_offset=1, + output_fields=["primitiveVars", "vorticity"], + entities=[ + SurfaceList(name="inflow_integral", surfaces=[my_inflow1, my_inflow2]), + SurfaceList(name="outflow_integral", surfaces=[my_outflow]), + ], + ) +write_example(setting, "outputs", "SurfaceIntegralOutput") + +write_schemas(ProbeOutput, "outputs", file_suffix="ProbeOutput") +with imperial_unit_system: + setting = ProbeOutput( + frequency=12, + frequency_offset=1, + output_fields=["primitiveVars", "vorticity"], + entities=[ + Probe(name="the_name1", locations=[(1, 2, 3), (4, 5, 6)]), + Probe(name="the_name2", locations=[(1, 3, 5), (2, 4, 6)]), + ], + ) +write_example(setting, "outputs", "ProbeOutput") + +write_schemas(AeroAcousticOutput, "outputs", file_suffix="AeroAcousticOutput") +with imperial_unit_system: + setting = AeroAcousticOutput( + write_per_surface_output=True, + observers=[(1, 2, 3), (2, 4, 6)], + ) +write_example(setting, "outputs", "AeroAcousticOutput") + + +###################### UDD ###################### +write_schemas(UserDefinedDynamic, "UDD", file_suffix="UserDefinedDynamic") +user_defined_dynamic = UserDefinedDynamic( + name="fake", + input_vars=["fake"], + constants={"ff": 123}, + output_vars={"fake_out": "1+1"}, + state_vars_initial_value=["0+0"], + update_law=["1-2"], + input_boundary_patches=[my_wall_surface], + output_target=my_cylinder_1, +) +write_example(user_defined_dynamic, "UDD", "UserDefinedDynamic") From 62895fc7218fc35d5481d882bf53b178235059dc Mon Sep 17 00:00:00 2001 From: benflexcompute Date: Mon, 24 Jun 2024 18:57:41 +0000 Subject: [PATCH 2/3] Format --- flow360/component/simulation/translator/solver_translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow360/component/simulation/translator/solver_translator.py b/flow360/component/simulation/translator/solver_translator.py index 0b8eb5972..3a668ba7f 100644 --- a/flow360/component/simulation/translator/solver_translator.py +++ b/flow360/component/simulation/translator/solver_translator.py @@ -16,8 +16,8 @@ TimeAverageVolumeOutput, VolumeOutput, ) -from flow360.component.simulation.time_stepping.time_stepping import Steady, Unsteady from flow360.component.simulation.simulation_params import SimulationParams +from flow360.component.simulation.time_stepping.time_stepping import Steady, Unsteady from flow360.component.simulation.translator.utils import ( convert_tuples_to_lists, get_attribute_from_first_instance, From 2f6092391393525b3573af58329c0a86fef81cde Mon Sep 17 00:00:00 2001 From: benflexcompute Date: Mon, 24 Jun 2024 20:13:06 +0000 Subject: [PATCH 3/3] Address comments --- .../framework/multi_constructor_model_base.py | 15 +++++-- .../simulation/operating_condition.py | 39 +++++++------------ .../framework/test_multi_constructor_model.py | 2 +- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/flow360/component/simulation/framework/multi_constructor_model_base.py b/flow360/component/simulation/framework/multi_constructor_model_base.py index e052b0974..5bb7031c7 100644 --- a/flow360/component/simulation/framework/multi_constructor_model_base.py +++ b/flow360/component/simulation/framework/multi_constructor_model_base.py @@ -30,10 +30,19 @@ def _model_attribute_unlock(model, attr: str): model.model_fields[attr].frozen = True -class _MultiConstructorModelBase(Flow360BaseModel, metaclass=abc.ABCMeta): +class MultiConstructorBaseModel(Flow360BaseModel, metaclass=abc.ABCMeta): + """ + [INTERNAL] + + Base class for models with multiple constructors. + + This class provides a mechanism to create models with multiple constructors, each having its own set + of parameters and default values. It stores the constructor name and input cache so the class instance + can be constructed from front end input. + """ - type_name: Literal["_MultiConstructorModelBase"] = pd.Field( - "_MultiConstructorModelBase", frozen=True + type_name: Literal["MultiConstructorBaseModel"] = pd.Field( + "MultiConstructorBaseModel", frozen=True ) private_attribute_constructor: str = pd.Field("default", frozen=True) private_attribute_input_cache: Optional[Any] = pd.Field(None, frozen=True) diff --git a/flow360/component/simulation/operating_condition.py b/flow360/component/simulation/operating_condition.py index ae50b0aa6..e11dca91e 100644 --- a/flow360/component/simulation/operating_condition.py +++ b/flow360/component/simulation/operating_condition.py @@ -10,7 +10,7 @@ import flow360.component.simulation.units as u from flow360.component.simulation.framework.base_model import Flow360BaseModel from flow360.component.simulation.framework.multi_constructor_model_base import ( - _MultiConstructorModelBase, + MultiConstructorBaseModel, ) from flow360.component.simulation.models.material import Air, FluidMaterialTypes from flow360.component.simulation.unit_system import ( @@ -39,7 +39,7 @@ class ThermalStateCache(Flow360BaseModel): material: Optional[FluidMaterialTypes] = None -class ThermalState(_MultiConstructorModelBase): +class ThermalState(MultiConstructorBaseModel): """ Represents the thermal state of a fluid with specific properties. @@ -65,7 +65,7 @@ class ThermalState(_MultiConstructorModelBase): private_attribute_input_cache: ThermalStateCache = ThermalStateCache() # pylint: disable=no-self-argument, not-callable, unused-argument - @_MultiConstructorModelBase.model_constructor + @MultiConstructorBaseModel.model_constructor @pd.validate_call def from_standard_atmosphere( cls, @@ -146,7 +146,7 @@ class AerospaceConditionCache(Flow360BaseModel): reference_mach: Optional[pd.PositiveFloat] = None -class GenericReferenceCondition(_MultiConstructorModelBase): +class GenericReferenceCondition(MultiConstructorBaseModel): """ Operating condition defines the physical (non-geometrical) reference values for the problem. """ @@ -159,7 +159,7 @@ class GenericReferenceCondition(_MultiConstructorModelBase): private_attribute_input_cache: GenericReferenceConditionCache = GenericReferenceConditionCache() # pylint: disable=no-self-argument, not-callable - @_MultiConstructorModelBase.model_constructor + @MultiConstructorBaseModel.model_constructor @pd.validate_call def from_mach( cls, @@ -176,7 +176,7 @@ def mach(self) -> pd.PositiveFloat: return self.velocity_magnitude / self.thermal_state.speed_of_sound -class AerospaceCondition(_MultiConstructorModelBase): +class AerospaceCondition(MultiConstructorBaseModel): """A specialized GenericReferenceCondition for aerospace applications.""" # pylint: disable=fixme @@ -190,7 +190,7 @@ class AerospaceCondition(_MultiConstructorModelBase): private_attribute_input_cache: AerospaceConditionCache = AerospaceConditionCache() # pylint: disable=too-many-arguments, no-self-argument, not-callable - @_MultiConstructorModelBase.model_constructor + @MultiConstructorBaseModel.model_constructor @pd.validate_call def from_mach( cls, @@ -200,7 +200,13 @@ def from_mach( thermal_state: ThermalState = ThermalState(), reference_mach: Optional[pd.PositiveFloat] = None, ): - """Constructs a `AerospaceCondition` from Mach number and thermal state.""" + """ + Constructs a `AerospaceCondition` from Mach number and thermal state. + + Note: + Decided to move `velocity==0 ref_velocity is not None` check to dedicated validator because user can + still construct by just calling AerospaceCondition() + """ velocity_magnitude = mach * thermal_state.speed_of_sound @@ -225,23 +231,6 @@ def check_valid_reference_velocity(self) -> Self: ) return self - # Note: Decided to move `velocity==0 ref_velocity is not None` check to dedicated validator because user can - # Note: still construct by just calling AerospaceCondition() - # pylint: disable=no-self-argument, not-callable - # @_MultiConstructorModelBase.model_constructor - # @pd.validate_call - # def from_stationary( - # cls, - # reference_velocity_magnitude: VelocityType.Positive, - # thermal_state: ThermalState = ThermalState(), - # ): - # """Constructs a `AerospaceCondition` for stationary conditions.""" - # return cls( - # velocity_magnitude=0 * u.m / u.s, - # thermal_state=thermal_state, - # reference_velocity_magnitude=reference_velocity_magnitude, - # ) - @property def mach(self) -> pd.PositiveFloat: """Computes Mach number.""" diff --git a/tests/simulation/framework/test_multi_constructor_model.py b/tests/simulation/framework/test_multi_constructor_model.py index 391d4d9fd..3d4a87420 100644 --- a/tests/simulation/framework/test_multi_constructor_model.py +++ b/tests/simulation/framework/test_multi_constructor_model.py @@ -8,7 +8,7 @@ import flow360.component.simulation.units as u from flow360.component.simulation.framework.multi_constructor_model_base import ( - _MultiConstructorModelBase, + MultiConstructorBaseModel, parse_model_dict, ) from flow360.component.simulation.operating_condition import (