{"id":19657753,"url":"https://github.com/esss/multi-phase-checks","last_synced_at":"2026-06-17T07:31:23.987Z","repository":{"id":147478346,"uuid":"451563352","full_name":"ESSS/multi-phase-checks","owner":"ESSS","description":"UDF and case definitions to check the usage of multi-phase related internal Fluent variables.","archived":false,"fork":false,"pushed_at":"2022-01-24T17:37:05.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-22T07:05:44.936Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ESSS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-24T17:26:14.000Z","updated_at":"2024-11-29T18:53:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7cae2a1-f9cc-4194-bd6b-19d33b7d14a8","html_url":"https://github.com/ESSS/multi-phase-checks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ESSS/multi-phase-checks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fmulti-phase-checks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fmulti-phase-checks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fmulti-phase-checks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fmulti-phase-checks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ESSS","download_url":"https://codeload.github.com/ESSS/multi-phase-checks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESSS%2Fmulti-phase-checks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34439294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T15:33:35.138Z","updated_at":"2026-06-17T07:31:23.970Z","avatar_url":"https://github.com/ESSS.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Checks for multi-phase variables available on ANSYS Fluent UDFs\n\nWe use a lot of different approaches to consult the case multi-phase configuration and\nmulti-phase setup details. Here I show and test a few more direct options available at\nthe `sg_mphase.h` header file.\n\nThe main entrance point to these new variables is the `sg_mphase` variable, its value is\ndefined by an enumeration defined at the `sg_mphase.h` header file as:\n\n```c\ntypedef enum\n{\n  MP_OFF = 0,       /* same as FALSE */\n  MP_VOF,           /* corresponds to boolean mp_vof    */\n  MP_HOMOGENEOUS,   /*                        mp_hom    */\n  MP_DRIFT_FLUX,    /*                        mp_drift  */\n  MP_MULTI_FLUID,   /*                        mp_mfluid */\n  MP_MODEL_MAX\n} MP_Model;\n\nextern FLUENT_EXPORT MP_Model sg_mphase;\n```\n\nSo, the `sg_mphase` variable indicates the current case multi-phase approach being used.\n\nAdditional variables listed on the same file (not in this order, but all are defined at\nthe same block) are:\n\n```c\nextern FLUENT_EXPORT cxboolean mp_vof;\nextern FLUENT_EXPORT cxboolean mp_mixture;\nextern FLUENT_EXPORT cxboolean mp_hom;\nextern FLUENT_EXPORT cxboolean mp_drift;\nextern FLUENT_EXPORT cxboolean mp_mfluid;\n```\n\nAll these variables are (threated as) Boolean flags for:\n\n- `mp_vof` - Volume of Fluid\n- `mp_mixture` - multiphase approach with a mixture (main) velocity field being used\n- `mp_hom` - mixture model without slip-velocity\n- `mp_drift` - mixture with slip-velocity\n- `mp_mfluid` - Eulerian multi-fluid\n\nAnother interesting variable is the `mp_n` defined at the same header file. This variable has an integer value and is used to store the number of phases being used in\nthe current setup.\n\n```c\nextern FLUENT_EXPORT int mp_n;\n```\n\nBelow are the outputs of the test UDF showing the usage and contents of these variables.\n\n## Single-phase\n\n```scheme\n...multi-phase option via the `sg_mphase` variable:\n     ...single-phase setup.\n\n...multi-phase Boolean variables:\n     ...`mp_vof` variable = 0\n     ...`mp_mixture` variable = 0\n     ...`mp_hom` variable = 0\n     ...`mp_drift` variable = 0\n     ...`mp_mfluid` variable = 0\n     ...`mp_n` variable = 0\n```\n\n## VOF (volume-of-fluid)\n\n```scheme\n...multi-phase option via the `sg_mphase` variable:\n    ...VOF multi-phase setup.\n\n...multi-phase Boolean variables:\n    ...`mp_vof` variable = 1\n    ...`mp_mixture` variable = 1\n    ...`mp_hom` variable = 0\n    ...`mp_drift` variable = 0\n    ...`mp_mfluid` variable = 0\n    ...`mp_n` variable = 2\n```\n\n## Eulerian\n\n```scheme\n...multi-phase option via the `sg_mphase` variable:\n    ...Eulerian multi-fluid multi-phase setup.\n\n...multi-phase Boolean variables:\n    ...`mp_vof` variable = 0\n    ...`mp_mixture` variable = 0\n    ...`mp_hom` variable = 0\n    ...`mp_drift` variable = 0\n    ...`mp_mfluid` variable = 1\n    ...`mp_n` variable = 3\n```\n\n## Mixture\n\n```scheme\n...multi-phase option via the `sg_mphase` variable;\n    ...Mixture homogeneous multi-phase setup.\n\n...multi-phase Boolean variables;\n    ...`mp_vof` variable = 0\n    ...`mp_mixture` variable = 1\n    ...`mp_hom` variable = 1\n    ...`mp_drift` variable = 0\n    ...`mp_mfluid` variable = 0\n    ...`mp_n` variable = 4\n```\n\n## Mixture + slip velocity\n\n```scheme\n...multi-phase option via the `sg_mphase` variable:\n    ...Mixture drift-flux multi-phase setup.\n\n...multi-phase Boolean variables:\n    ...`mp_vof` variable = 0\n    ...`mp_mixture` variable = 1\n    ...`mp_hom` variable = 0\n    ...`mp_drift` variable = 1\n    ...`mp_mfluid` variable = 0\n    ...`mp_n` variable = 4\n```\n\nSo we can use these variables and the enumeration with confidence that they will contain\nthe expected (correct) values.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesss%2Fmulti-phase-checks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesss%2Fmulti-phase-checks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesss%2Fmulti-phase-checks/lists"}