diff --git a/.gitignore b/.gitignore index 15fbafe3..d66ec8e4 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ venv *.v12.suo *.ods error_* +*.msh diff --git a/AUTHORS b/AUTHORS index b1310aff..b222aff6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,4 @@ -ECOGEN is under GPLv3 or later license. Here is the name and contact information of contributors of the project. - -Contributors : S. Le Martelot, F. Petitpas, K. Schmidmayer, E. Daniel, B. Dorschner, J. Caze +ECOGEN is under GPLv3 or later license. Here is the name and contact information of contributors of the project (from first to last to join). F. Petitpas ----------- @@ -13,8 +11,8 @@ Expert enginneer turbopumps at CNES, France. K. Schmidmayer -------------- -Permanent researcher at Inria Sud Ouest, France. -e-mail adress: kevin.schmidmayer@gmail.com +Permanent researcher at Inria Center of the University of Bordeaux, France. Teaching at Université de Pau et des Pays de l'Adour. +e-mail adress: kevin.schmidmayer@inria.fr Personal web page: https://kevinschmidmayer.github.io/ E. Daniel @@ -29,5 +27,14 @@ Personal web page: https://benedikt-dorschner.com/ J. Caze ------- -Phd student at CNES / Aix Marseille Universite, France. -Personal web page: https://joriscaze.github.io/website/ +Senior developer at SII group. Was PhD student and postdoc at CNES / Aix Marseille Universite, France. +Personal web page: https://joriscaze.github.io/ + +F. Gadiri +--------- +Was a Master student at Aix Marseille Universite, France. + +S. Schropff +----------- +PhD student at Aix Marseille Universite, France. +e-mail adress: solene.schropff@univ-amu.fr diff --git a/COPYRIGHT b/COPYRIGHT index 7cef35d4..0766330a 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -5,4 +5,6 @@ Copyright © 2016-2017 Fabien Petitpas, Kevin Schmidmayer Copyright © 2018 Fabien Petitpas, Kevin Schmidmayer, Eric Daniel Copyright © 2019 Fabien Petitpas, Kevin Schmidmayer, Eric Daniel, Benedikt Dorschner Copyright © 2020 Fabien Petitpas, Kevin Schmidmayer, Eric Daniel, Benedikt Dorschner, Joris Caze -Copyright © 2021-2022 Fabien Petitpas, Kevin Schmidmayer, Eric Daniel, Joris Caze +Copyright © 2021 Fabien Petitpas, Kevin Schmidmayer, Eric Daniel, Joris Caze, Fatima Gadiri +Copyright © 2022 Fabien Petitpas, Kevin Schmidmayer, Eric Daniel, Joris Caze +Copyright © 2023 Fabien Petitpas, Kevin Schmidmayer, Eric Daniel, Joris Caze, Solene Schropff \ No newline at end of file diff --git a/ECOGEN.xml b/ECOGEN.xml index 6e3f7bae..4aeadb89 100644 --- a/ECOGEN.xml +++ b/ECOGEN.xml @@ -14,18 +14,28 @@ + + + - - + + + + + + + + + @@ -34,22 +44,33 @@ + + + + + + + - + + - + + + + @@ -58,6 +79,7 @@ + @@ -66,11 +88,14 @@ - + + + - + + @@ -80,14 +105,18 @@ + + - + + + diff --git a/coverage_and_profile/README_coverage.md b/coverage_and_profile/README_coverage.md index b2e5b4c8..f98a7bde 100644 --- a/coverage_and_profile/README_coverage.md +++ b/coverage_and_profile/README_coverage.md @@ -11,12 +11,12 @@ Here is described how to compute a code coverage for ECOGEN. ./scripts/run.sh ./nonreg/ECOGEN_nonReg_full.list This will generate .gcda files in the sources. -5. Install lcov if not already done and execute the following command to interprete the gcda files. Note that the "--capture" option may be "--coverage" on some systems. - lcov --capture --directory . --output-file coverage/coverage.info +5. Install lcov if not already done and execute the following command to interprete the gcda files. Note that the "--capture" option may be "--coverage" on some systems. You may also add the following options "--ignore-errors inconsistent,inconsistent,gcov,gcov --filter range". + lcov --capture --directory . --output-file coverage_and_profile/coverage.info -6. Execute the following command to generate html files from the previous coverage files. - genhtml coverage/coverage.info --output-directory coverage/html +6. Execute the following command to generate html files from the previous coverage files. You may also add the following options "--ignore-errors inconsistent". + genhtml coverage_and_profile/coverage.info --output-directory coverage_and_profile/html -7. Open coverage/html/index.html with your browser to have a look at the report. +7. Open coverage_and_profile/html/index.html with your browser to have a look at the report. Note that the .gcno and .gcda files are voluntarily not added in the .gitignore to remind you to delete them after the analysis (and obviously if you do not want to keep them). \ No newline at end of file diff --git a/docs/doxygen_docs/doxygen.conf b/docs/doxygen_docs/doxygen.conf index a3dbb6a6..1737c97c 100644 --- a/docs/doxygen_docs/doxygen.conf +++ b/docs/doxygen_docs/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = ECOGEN # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.0 +PROJECT_NUMBER = 4.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/docs/sphinx_docs/Dockerfile b/docs/sphinx_docs/Dockerfile new file mode 100644 index 00000000..09290c39 --- /dev/null +++ b/docs/sphinx_docs/Dockerfile @@ -0,0 +1,42 @@ +# -- Dockerfile -- +# This Dockerfile provides a simple way to build documentation +# without requiring to install all dependencies locally + +# Pull Ubuntu latest version +FROM ubuntu:20.04 + +# Minimal Python installation +RUN apt-get update +RUN apt-get upgrade -y +RUN apt-get install -y python3 \ + python3-pip + +# Install Sphinx +RUN pip3 install sphinx sphinx_rtd_theme sphinx-numfig sphinxcontrib-bibtex + +# # Install LaTeX (to build PDF version of the doc) +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get install -y texlive \ + texlive-latex-extra \ + latexmk + +WORKDIR /home +ENTRYPOINT ["make"] +CMD ["html"] + +# -- User guide -- + +# To build the container image using this Dockerfile +# docker image build -t ecogen/sphinx-doc . + +# To run the container +# For HTML output +# docker container run --mount type=bind,source=${PWD},target=/home ecogen/sphinx-doc +# Or +# docker container run --mount type=bind,source=${PWD},target=/home ecogen/sphinx-doc html +# For PDF output +# docker container run --mount type=bind,source=${PWD},target=/home ecogen/sphinx-doc pdf + +# To troubleshoot any bug it is also possible to run the container interactively +# docker container run --mount type=bind,source=${PWD},target=/home -it -w /home --entrypoint /bin/bash ecogen/sphinx-doc +# make html \ No newline at end of file diff --git a/docs/sphinx_docs/source/Biblio.bib b/docs/sphinx_docs/source/Biblio.bib index 8849d29a..358720ed 100644 --- a/docs/sphinx_docs/source/Biblio.bib +++ b/docs/sphinx_docs/source/Biblio.bib @@ -1,5 +1,15 @@ % Encoding: UTF-8 +@article{chiapolino2017sharpening, + title={Sharpening diffuse interfaces with compressible fluids on unstructured meshes}, + author={Chiapolino, Alexandre and Saurel, Richard and Nkonga, Boniface}, + journal={Journal of Computational Physics}, + volume={340}, + pages={389--417}, + year={2017}, + publisher={Elsevier} +} + @article{schmidmayer2021UEq, title={Modelling interactions between waves and diffused interfaces}, author={Schmidmayer, K. and Caz{\'e}, J. and Petitpas, F. and Daniel, E. and Favrie, N.}, diff --git a/docs/sphinx_docs/source/Chap3_1_1main.rst b/docs/sphinx_docs/source/Chap3_1_1main.rst index a67f6192..04a70852 100644 --- a/docs/sphinx_docs/source/Chap3_1_1main.rst +++ b/docs/sphinx_docs/source/Chap3_1_1main.rst @@ -3,10 +3,10 @@ .. _Sec:input:main: -MainV5.xml +Main.xml ========== -*mainV5.xml* is the main input file needed to define the test case. It **must be** in the current test case folder. Its minimal structure is: +*main.xml* is the main input file needed to define the test case. It **must be** in the current test case folder. Its minimal structure is: .. code-block:: xml @@ -99,7 +99,15 @@ The :xml:`` markup is mandatory. It specifies the value of t Global accuracy order of the numerical scheme --------------------------------------------- -When it is possible, according to the mesh or to the flow model, ECOGEN can use a second-order scheme (based on MUSCL approach with a TVD slope limiter; see :cite:`schmidmayer2020ecogen` for details). In this case, the optional markup :xml:`` can be inserted in the *mainV5.xml* input file as in the following example: + +By default, the numerical scheme of the hydrodynamic solver is first order in time and space. +ECOGEN can use a second-order scheme in time and space using the MUSCL method with TVD limiters (see :cite:`toro2013riemann` for example for an overview of the method). +Depending on whether the mesh is **Cartesian** (with/without AMR) or **unstructured**, the MUSCL method used and its parameters are different. + +Cartesian mesh (with/without AMR) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +For a cartesian mesh (with/without AMR), second-order scheme is based on a TVD slope limiter; see :cite:`schmidmayer2020ecogen` for details. +In this case, the optional markup :xml:`` can be inserted in the *main.xml* input file as in the following example: .. code-block:: xml @@ -117,9 +125,34 @@ The :xml:`` markup must contain the node :xml:``. Th - :xml:``: Applied everywhere but only on the volume-fraction and transport equations (THINC is only applied on the volume fraction) unless it is overwritten by the interface volume-fraction limiter. By default is equal to the global limiter. - :xml:``: Applied only at the interface location and on the volume-fraction and transport equations (THINC is only applied on the volume fraction). By default is equal to the interface limiter. +Unstructured mesh +~~~~~~~~~~~~~~~~~ +The second-order method for unstructured meshes is not yet released because of known bugs. + +Gradient method +--------------- + +In ECOGEN, to compute gradients, it is possible to use: + +- finite-difference-like gradient on **cartesian** mesh (with/without AMR) (:xml:`finite-difference`) +- Green-Gauss gradient on **cartesian** and **unstructured** mesh (:xml:`green-gauss`). + +By default (without the XML markup :xml:``), the gradients will be computed using the finite-difference scheme. +To define explicitly the gradient method, one can use: + +.. code-block:: xml + + + finite-difference + + +.. note:: + + On unstructured meshes, in case second-order scheme is set and/or additional physics are used (see Section :ref:`Sec:input:additionalPhysic`), the gradient method must be set to Green-Gauss. + Probes ------ -It is possible to record over time flow variables at given locations in the computational domain. This is done by including to the *mainV5.xml* input file the optional :xml:`` markup. +It is possible to record over time flow variables at given locations in the computational domain. This is done by including to the *main.xml* input file the optional :xml:`` markup. .. code-block:: xml @@ -137,7 +170,7 @@ Probe output-result files will be placed in the specific subfolder **ECOGEN/resu **Remarks:** 1. Recording probes with a high frequency could have a significant impact on computation performances due to the computer memory time access. To prevent that, one should fix a reasonable acquisition frequency. -2. Several probes can be added simultaneously. For that, place as many as wanted :xml:`` markups in the *mainV5.xml* input files. +2. Several probes can be added simultaneously. For that, place as many as wanted :xml:`` markups in the *main.xml* input files. Simulation restart option ------------------------- diff --git a/docs/sphinx_docs/source/Chap3_1_2model.rst b/docs/sphinx_docs/source/Chap3_1_2model.rst index 0123a886..564e31b9 100644 --- a/docs/sphinx_docs/source/Chap3_1_2model.rst +++ b/docs/sphinx_docs/source/Chap3_1_2model.rst @@ -3,10 +3,10 @@ .. _Sec:input:model: -ModelV4.xml +Model.xml =========== -Fluid mechanics models used in the computation are specified in the *modelv4.xml* file. It is **mandatory** located in the folder of the current case. A typical form of this file is: +Fluid mechanics models used in the computation are specified in the *model.xml* file. It is **mandatory** located in the folder of the current case. A typical form of this file is: .. code-block:: xml @@ -61,7 +61,7 @@ Equations of state (EOS) -The *modelV4.xml* input file **must contain** as many :xml:`` markups as number of phases specified in the :ref:`Sec:input:FlowModel` markup. Each phase is described thanks to relations and parameters. The values of these parameters are specified in a separate file: The attribute name contains the name of this file that must be placed in the folder **ECOGEN/libEOS/**. Some fluid files are already present in the ECOGEN package. +The *model.xml* input file **must contain** as many :xml:`` markups as number of phases specified in the :ref:`Sec:input:FlowModel` markup. Each phase is described thanks to relations and parameters (see Section :ref:`Sec:IO:materials` for more details). The values of these parameters are specified in a separate file: the name attribute contains the name of this file which must be placed in the **ECOGEN/libEOS/** folder. Some fluid files are already present in the ECOGEN package. .. _Sec:input:Transport: @@ -72,7 +72,7 @@ Advected additional variables -The *modelV4.xml* input fle **must contain** as many :xml:`` markups as number of transports specified in the :ref:`Sec:input:FlowModel` markup. Each transported variable is described by its name. The default number of advected variable is 0. +The *model.xml* input fle **must contain** as many :xml:`` markups as number of transports specified in the :ref:`Sec:input:FlowModel` markup. Each transported variable is described by its name. The default number of advected variable is 0. Relaxation procedures --------------------- @@ -161,8 +161,10 @@ Both cylindrical (2D) and spherical (1D) symmetries are implemented. The additio -Additional physics (dev) ------------------------- +.. _Sec:input:additionalPhysic: + +Additional physics +------------------ Depending on the model chosen in section :ref:`Sec:input:FlowModel`, additional physical effects can be added. This is the case for surface tension, viscosity and conductive heat transfers. These additional physical effects are obtained thanks to the additional markup :xml:`additionalPhysics` with the attribute :xml:`type` that can take different value according to the chosen effect. @@ -190,4 +192,36 @@ This physical effect is obtained by using the type *viscosity* and it needs the Others ~~~~~~ -In dev... \ No newline at end of file +In dev... + +Low-Mach preconditioning +------------------------ + +In case of low-speed flows, a low-Mach preconditioning can be applied to the selected flow model. +The method is detailed in :cite:`lemartelot2013lowmach`. +Currently this option is compatible with the flow models: Euler, UEq and PUEq. + +.. code-block:: xml + + + +Note that the minimum reference Mach number can be chosen if required (default is 0.01). +When the local Mach number of the flow is lower than this threshold, it is replaced by the threshold value in order to keep a reasonable computation time. + +.. code-block:: xml + + + +For an example of use, see the test case presented in the Section :ref:`Sec:tests:euler:2d:nozzleLowMach`. + +1D geometry with smooth cross section variation +----------------------------------------------- +In case of a 2D geometry with smooth cross section variation, it is possible to use a 1D geometry and reproduce 2D effects with this attribute as detailed in the first appendix of :cite:`lemartelot2013lowmach`. +This option is only compatible with unstructured meshes defined with flow direction along the X-axis. +Boundary condition contributions in other directions than the X-axis should use *nullFlux* boundary condition (see :ref:`Sec:input:InitialConditions`). +Note that this option is available for the flow models: Euler, UEq, PUEq and EulerHomogeneous. +For an example of use, see the test case presented in the Section :ref:`Sec:tests:euler:2d:nozzleLowMach`. + +.. code-block:: xml + + \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap3_1_3mesh.rst b/docs/sphinx_docs/source/Chap3_1_3mesh.rst index 70b0686c..e72bfd04 100644 --- a/docs/sphinx_docs/source/Chap3_1_3mesh.rst +++ b/docs/sphinx_docs/source/Chap3_1_3mesh.rst @@ -3,10 +3,10 @@ .. _Sec:input:mesh: -MeshV5.xml +Mesh.xml ========== -Input file *meshV5.xml* is necessary to specify the geometrical characteristics of the computational domain and the type of mesh used. This file is **mandatory** and must be present in the folder of the current case. The minimalist content of this file is: +Input file *mesh.xml* is necessary to specify the geometrical characteristics of the computational domain and the type of mesh used. This file is **mandatory** and must be present in the folder of the current case. The minimalist content of this file is: .. code-block:: xml @@ -73,7 +73,7 @@ Optional AMR -An efficient Adaptive Mesh refinement (AMR) technology is embedded in ECOGEN :cite:`schmidmayer2019adaptive`. To use it, the *meshV5.xml* file must contain the optional node :xml:`` of the :xml:`` markup and define the following attributes: +An efficient Adaptive Mesh refinement (AMR) technology is embedded in ECOGEN :cite:`schmidmayer2019adaptive`. To use it, the *mesh.xml* file must contain the optional node :xml:`` of the :xml:`` markup and define the following attributes: - :xml:`lvlMax`: Integer to define the maximal number of refinements (levels). - :xml:`criteriaVar`: Real number controlling the detection of gradients for the locations of refinement. @@ -96,10 +96,10 @@ Unstructured mesh -When dealing with unstructured meshes, the :xml:`` markup **must be** present in the *meshV5.xml* input file and it contains the following nodes: +When dealing with unstructured meshes, the :xml:`` markup **must be** present in the *mesh.xml* input file and it contains the following nodes: - :xml:``: This **mandatory** node specifies the path of the mesh file via the attribute :xml:`name`. The file must be located in the folder **ECOGEN/libMeshes/**. -- :xml:``: This node is required only if the mesh file is a multi-core file. The attribute :xml:`GMSHPretraitement` can take the following values: +- :xml:``: This node is required only if the mesh file is a multi-core file. The attribute :xml:`GMSHPretraitement` can take the following values: - *true*: ECOGEN automatically splits the given mesh file in as many as necessary files according to the number of available cores. - *false*: Do not redo the split of the given mesh (which has already been split in a previous simulation). @@ -107,8 +107,28 @@ When dealing with unstructured meshes, the :xml:`` markup **mu **Remarks:** 1. The attribute :xml:`GMSHPretraitement` must be set as *true* if this is the first run with the given mesh file. -2. In the current version |version| of ECOGEN, only mesh files generated with the opensource Gmsh_ software :cite:`geuzaine2009gmsh` under file format *version 2* can be used. +2. In the current version |version| of ECOGEN, only mesh files generated with the open-source Gmsh_ software :cite:`geuzaine2009gmsh` under file format *version 2* can be used. To export your mesh file to this version, see the tutorial :ref:`Sec:tuto:exportGmshFile`. Please refer to the section :ref:`Sec:tuto:generatingMeshes` to learn how to generate a mesh adapted for ECOGEN. -.. _Gmsh: http://gmsh.info/ \ No newline at end of file +.. _Gmsh: http://gmsh.info/ + +Optionnal restart with mesh mapping +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +ECOGEN offers the possibility to initialize a simulation with the result of a previous simulation performed on a different mesh and/or a different number of CPU. +One of the most common use case would be to run a simulation on a rough mesh until steady state is reached and use the result to initialize the flow field on a fine mesh to fasten the convergence to steady state. +Assuming a previous simulation with a rough mesh under the name *euler2DHPUnstructuredRough* has been previously run, the simulation with the fine mesh must have :xml:`` node as follows: + +.. code-block:: xml + + + + + + +For more details on how to use this feature, refer to the tutorial :ref:`Sec:tuto:restartMeshMapping`. \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap3_1_4initialConditions.rst b/docs/sphinx_docs/source/Chap3_1_4initialConditions.rst index 95eefd05..562eddb8 100644 --- a/docs/sphinx_docs/source/Chap3_1_4initialConditions.rst +++ b/docs/sphinx_docs/source/Chap3_1_4initialConditions.rst @@ -3,10 +3,10 @@ .. _Sec:input:InitialConditions: -InitialConditionsV4.xml +InitialConditions.xml ======================= - The *initialConditionsV4.xml* input file includes the initial conditions and the boundary conditions of the flow simulation. It is **mandatory** located in the folder of the current case. The typical structure of this file is: + The *initialConditions.xml* input file includes the initial conditions and the boundary conditions of the flow simulation. It is **mandatory** located in the folder of the current case. The typical structure of this file is: .. code-block:: xml @@ -220,12 +220,34 @@ In this example, the entire computation domain will be initialized accordingly t .. _Sec:input:boundaryConditions: +Initializing immersed boundaries +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +When dealing with Cartesian meshes, it is possible to intialize a domain as immersed boundaries by setting the :xml:`physicalIdentity` number to -1 value. + +Example: + +.. code-block:: xml + + + + + + + +In this typical example, a square is considered as walls for the air flow. + +.. figure:: ./_static/IO/immBound.gif + :scale: 30% + :align: center + + Example with immersed boundaries. + Boundary conditions ------------------- The :xml:`` markup is mandatory. The boundary conditions are specified at the boundary of the computational domain. This markup must contain as many nodes :xml:`` as necessary to cover the entire boundary. Each :xml:`` node contains the following attributes: - :xml:`name`: A name for the boundary condition. This name has no influence on the choices remaining in this file. -- :xml:`type`: The type of boundary condition, to choose among :ref:`Sec:input:NonReflecting`, :ref:`Sec:input:Symmetry`, :ref:`Sec:input:Wall`, :ref:`Sec:input:Injection`, :ref:`Sec:input:Outflow` and :ref:`Sec:input:Tank`. +- :xml:`type`: The type of boundary condition, to choose among :ref:`Sec:input:NonReflecting`, :ref:`Sec:input:Symmetry`, :ref:`Sec:input:Wall`, :ref:`Sec:input:InletTank`, :ref:`Sec:input:InletInjStagState`, :ref:`Sec:input:InletInjTemp` and :ref:`Sec:input:OutletPressure`. - :xml:`number`: Integer corresponding to the identifier of the boundary. Depending on the :xml:``, additional information is required through the use of the following nodes. @@ -238,7 +260,7 @@ The numerical treatment corresponds to an in- or out-going flow without any wave .. code-block:: xml - + .. _Sec:input:Symmetry: @@ -260,71 +282,92 @@ The numerical treatment corresponds to a wall boundary condition. No more inform -.. _Sec:input:Injection: +.. _Sec:input:InletTank: -Injection -~~~~~~~~~ -The numerical treatment corresponds to the link between the boundary with a inflow. The inflow is characterized by an incoming mass-flow rate at a given thermodynamical state. :xml:`injection` requires the :xml:`` node with the following attributes: +Inlet tank +~~~~~~~~~~ +The numerical treatment corresponds to the link between the boundary with an infinite tank. An infinite tank is characterized by a null velocity while pressure and temperature are constant. :xml:`tank` requires the :xml:`` node with the following attributes: + +- :xml:`p0`: Stagnation pressure, real number (unit: Pa (SI)). +- :xml:`T0`: Stagnation temperature, real number (unit: K (SI)). +- Node :xml:``: Necessary to define the presence of each phase in the tank. It must contain as many nodes :xml:`` as the number of phases in the flow simulation and each contains the attributes: + + - :xml:`EOS`: The name of the file corresponding to the choice of the EOS for the phase in the tank. This file must correspond to the one specified in *model.xml* input file for every fluid. + - :xml:`alpha`: The volume fraction of the fluid in the tank, real number in the range ]0.,1.[. + +.. code-block:: xml + + + + + + + + + +.. _Sec:input:InletInjStagState: + +Inlet injection using stagnation state +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The numerical treatment corresponds to the link between the boundary with an injection defined using a stagnation state. The injection is characterized by an incoming mass-flow rate at a given thermodynamical state. :xml:`injection` requires the :xml:`` node with the following attributes: - :xml:`m0`: Incoming mass-flow rate, real number (unit: kg/s.m-2 (SI)). - Node :xml:`` for each phase: It must contain as many nodes :xml:`` as the number of phases in the flow simulation and each contains the attributes: - - :xml:`EOS`: The name of the file corresponding to the choice of the EOS for the phase in the tank. This file must correspond to the one specified in *modelV4.xml* input file for every fluid. + - :xml:`EOS`: The name of the file corresponding to the choice of the EOS for the phase in the tank. This file must correspond to the one specified in *model.xml* input file for every fluid. - :xml:`density`: The density of the fluid incoming, real number (unit: kg/m3 (SI)). - :xml:`pressure`: The pressure of the fluid incoming, real number (unit: Pa (SI)). - :xml:`alpha`: The volume fraction of the fluid incoming, real number in the range ]0.,1.[. .. code-block:: xml - - + + -.. _Sec:input:Outflow: +.. _Sec:input:InletInjTemp: -Outflow -~~~~~~~ -In the case of a subsonic flow, the pressure is set equal to the ambient (distant) pressure at the boundary. The additional :xml:`` node is required with the attributes: +Inlet injection using temperature +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The numerical treatment corresponds to the link between the boundary with an injection defined using temperature. The injection is characterized by an incoming mass-flow rate at a given thermodynamical state. :xml:`injection` requires the :xml:`` node with the following attributes: -- :xml:`p0`: Outside pressure, real number (unit: Pa (SI)). -- Node :xml:``: This node is also required for each transport equation used. +- :xml:`m0`: Incoming mass-flow rate, real number (unit: kg/s.m-2 (SI)). +- Node :xml:`` for each phase: It must contain as many nodes :xml:`` as the number of phases in the flow simulation and each contains the attributes: + + - :xml:`EOS`: The name of the file corresponding to the choice of the EOS for the phase in the tank. This file must correspond to the one specified in *model.xml* input file for every fluid. + - :xml:`temperature`: The temperature of the fluid incoming, real number (unit: Pa (SI)). + - :xml:`alpha`: The volume fraction of the fluid incoming, real number in the range ]0.,1.[. .. code-block:: xml - - - - + + + + -.. _Sec:input:Tank: +.. _Sec:input:OutletPressure: -Tank -~~~~ -The numerical treatment corresponds to the link between the boundary with an infinite tank. An infinite tank is characterized by a null velocity while pressure and temperature are constant. :xml:`tank` requires the :xml:`` node with the following attributes: +Outlet at imposed pressure +~~~~~~~~~~~~~~~~~~~~~~~~~~ +In the case of a subsonic flow, the pressure is set equal to the ambient (distant) pressure at the boundary. The additional :xml:`` node is required with the attributes: -- :xml:`p0`: Stagnation pressure, real number (unit: Pa (SI)). -- :xml:`T0`: Stagnation temperature, real number (unit: K (SI)). -- Node :xml:``: Necessary to define the presence of each phase in the tank. It must contain as many nodes :xml:`` as the number of phases in the flow simulation and each contains the attributes: - - - :xml:`EOS`: The name of the file corresponding to the choice of the EOS for the phase in the tank. This file must correspond to the one specified in *modelV4.xml* input file for every fluid. - - :xml:`alpha`: The volume fraction of the fluid in the tank, real number in the range ]0.,1.[. +- :xml:`p0`: Outside pressure, real number (unit: Pa (SI)). +- Node :xml:``: This node is also required for each transport equation used. .. code-block:: xml - - - - - - + + + + **Important remark** -The choice of the boundary-condition number is made according to the type of mesh given in *meshV5.xml* input file and it follows the rules: +The choice of the boundary-condition number is made according to the type of mesh given in *mesh.xml* input file and it follows the rules: - Cartesian: The boundaries are ordered and labeled from 1 to 6 (in 3D) according to: @@ -339,7 +382,7 @@ The choice of the boundary-condition number is made according to the type of mes **Remark** -The boundary conditions are dependent on the flow model specified in *modelV4.xml* input file. Some boundary conditions may be not available for the flow model considered. +The boundary conditions are dependent on the flow model specified in *model.xml* input file. Some boundary conditions may be not available for the flow model considered. Mechanical and thermodynamical states of the fluid @@ -352,7 +395,7 @@ For each physical domain in the :xml:`` markup, a fluid state m Each :xml:`` node corresponds to a phase and contains the following attributes or nodes: - Attribute :xml:`type`: Only the value *fluid* is available in the current ECOGEN version. -- Attribute :xml:`EOS`: The name of the file corresponding to the fluid equation-of-state parameters. This file must correspond to the one specified in *modelV4.xml* input file for each phase (see section :ref:`Sec:input:FlowModel`). +- Attribute :xml:`EOS`: The name of the file corresponding to the fluid equation-of-state parameters. This file must correspond to the one specified in *model.xml* input file for each phase (see section :ref:`Sec:input:FlowModel`). - Node :xml:``: Contain data related to the considered state of the fluid in the current phase. This last node :xml:`` as well as the :xml:`` node are dependent on the flow model according to: @@ -382,7 +425,7 @@ UEq (previously named MultiP) or UEqTotE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Multiphase flow at velocity equilibrium (same velocity for every phase within each cell). Each :xml:`` node corresponds to a phase with the following attributes: -- :xml:`alpha`: Volume fraction of the phase, real number in the range ]0.,1.[. The range can be increased to [0.;1.] if the option *alphaNull* is turned on (*true*) in the *modelV4.xml* input file. +- :xml:`alpha`: Volume fraction of the phase, real number in the range ]0.,1.[. The range can be increased to [0.;1.] if the option *alphaNull* is turned on (*true*) in the *model.xml* input file. - :xml:`density` or :xml:`temperature`: Initial density or temperature of the fluid, real number (unit: kg/m3 or K (SI)), respectively. - :xml:`pressure`: Initial pressure of the fluid, real number (unit: Pa (SI)). @@ -408,7 +451,7 @@ PUEq (previously named Kapila) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Multiphase flow at pressure and velocity equilibrium (same velocity and pressure for every phase within each cell). Each :xml:`` node corresponds to a phase with the following attributes: -- :xml:`alpha`: Volume fraction of the phase, real number in the range ]0.,1.[. The range can be increased to [0.;1.] if the option *alphaNull* is turned on (*true*) in the *modelV4.xml* input file. +- :xml:`alpha`: Volume fraction of the phase, real number in the range ]0.,1.[. The range can be increased to [0.;1.] if the option *alphaNull* is turned on (*true*) in the *model.xml* input file. - :xml:`density` or :xml:`temperature`: Initial density or temperature of the fluid, real number (unit: kg/m3 or K (SI)), respectively. Moreover, in this case, the :xml:`` node contains: diff --git a/docs/sphinx_docs/source/Chap3_1inputFiles.rst b/docs/sphinx_docs/source/Chap3_1inputFiles.rst index 12451ebf..ad278f94 100644 --- a/docs/sphinx_docs/source/Chap3_1inputFiles.rst +++ b/docs/sphinx_docs/source/Chap3_1inputFiles.rst @@ -22,10 +22,10 @@ ECOGEN package includes a sample of test cases. Each of them is independent, rea In this file, the :xml:`` markup indicates the folder containing the test case to be run. It is then possible to run successively several cases by adding as many :xml:`` markups as necessary. Each folder indicated in a :xml:`` markup must contain 4 input files: -- *mainV5.xml* -- *meshV5.xml* -- *modelV4.xml* -- *initialConditionsV4.xml* +- *main.xml* +- *mesh.xml* +- *model.xml* +- *initialConditions.xml* Additional input files depending on the test case are necessary. They are placed in the following folders: @@ -34,10 +34,10 @@ Additional input files depending on the test case are necessary. They are placed In this section, the structure of each input file is detailed. This information is also provided in a condensed form in the "handbook" files at the root folder of the test-case library **ECOGEN/libTests/**. These files constitute quick-reference manuals and are named as follow: -- *manualMainV5.xml* -- *manualMeshV5.xml* -- *manualModelV4.xml* -- *manualInitialConditionsV4.xml* +- *manualMain.xml* +- *manualMesh.xml* +- *manualModel.xml* +- *manualInitialConditions.xml* .. _`TinyXML-2`: http://www.grinninglizard.com/tinyxml2/ diff --git a/docs/sphinx_docs/source/Chap3_2materials.rst b/docs/sphinx_docs/source/Chap3_2materials.rst index 74291afa..c7c7d60b 100644 --- a/docs/sphinx_docs/source/Chap3_2materials.rst +++ b/docs/sphinx_docs/source/Chap3_2materials.rst @@ -6,8 +6,8 @@ Materials For each phase, an equation of state is required. The data for a given phase are gathered in a file. Every file must be in the folder **ECOGEN/libEOS/** and must follow rules depending on the EOS. Five equations of state are implemented in ECOGEN: - :ref:`Sec:input:IdealGas`: For gaseous phase only. -- :ref:`Sec:input:StiffenedGas`: For condensed matter (liquid, solid) in a pressure range where the compressible assumption is reasonable. -- :ref:`Sec:input:NobleAbelStiffenedGas`: For condensed matter (liquid, solid) subject to phase change. +- :ref:`Sec:input:StiffenedGas`: For condensed matter (liquid) in a pressure range where the compressible assumption is reasonable. +- :ref:`Sec:input:NobleAbelStiffenedGas`: For condensed matter (liquid) subject to phase change. - Van der Waals and Polynomial: Experimental work on non-convex EOS therefore not detailed in the following. .. _Sec:input:IdealGas: diff --git a/docs/sphinx_docs/source/Chap3_3outputFiles.rst b/docs/sphinx_docs/source/Chap3_3outputFiles.rst index 139d7303..9eda8ba0 100644 --- a/docs/sphinx_docs/source/Chap3_3outputFiles.rst +++ b/docs/sphinx_docs/source/Chap3_3outputFiles.rst @@ -3,7 +3,7 @@ Output Files ============ -Writing the result files is done according to the user’s choice in *mainV5.xml* input file of the current test (see section :ref:`Sec:input:main`). For each run, the results are recorded in the specified folder **ECOGEN/results/XXX/** where XXX is the test case *name*. +Writing the result files is done according to the user’s choice in *main.xml* input file of the current test (see section :ref:`Sec:input:main`). For each run, the results are recorded in the specified folder **ECOGEN/results/XXX/** where XXX is the test case *name*. One can select the following format: - *GNU*: Format in ASCII, results are given in column. @@ -43,7 +43,7 @@ All the output files linked to the probes and cuts of the simulation are placed Mesh information ---------------- -When using AMR, mesh information is saved at a frequency specified in the *mainV5.xml* file to allow a restart of the simulation and the corresponding files are placed within the subfolders **ECOGEN/results/XXX/infoMesh/**. +When using AMR, mesh information is saved at a frequency specified in the *main.xml* file to allow a restart of the simulation and the corresponding files are placed within the subfolders **ECOGEN/results/XXX/infoMesh/**. Screen output ------------- diff --git a/docs/sphinx_docs/source/Chap3_4featuresModels.rst b/docs/sphinx_docs/source/Chap3_4featuresModels.rst index dd9d6eaa..4e1e120d 100644 --- a/docs/sphinx_docs/source/Chap3_4featuresModels.rst +++ b/docs/sphinx_docs/source/Chap3_4featuresModels.rst @@ -6,70 +6,72 @@ Feature compatibility ECOGEN provides the ability to use several features according to the flow model. Below is summarized the feature compatibility according to each flow model. -.. Comment: the table was generated with https://www.tablesgenerator.com/text_tables using "paste table from spreadsheet file" +.. Comment: the table was generated with https://www.tablesgenerator.com/text_tables using "paste table from spreadsheet file" and using the spreadsheet file ECOGEN/docs/sphinx_docs/source/_static/IO/modelsFeatures.ods. -+--------------------------------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Feature / Model | Euler | PressureVelocityEq | VelocityEq | VelocityEqTotEnergy | TemperaturePressureVelocityEq | EulerHomogeneous | NonLinearSchrodinger | EulerKorteweg | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Geometry | Cartesian mesh | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Adaptive Mesh Refinement (AMR) | Yes | Yes | Yes | No | Yes | Yes | Yes | Yes | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Unstructured mesh | Yes | Yes | Yes | Yes | Yes | Yes | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Symmetry (cylindrical/spherical) | Yes | Yes | Yes | No | No | No | No | No | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Numerical scheme | 1st order | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | 2nd order | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Relaxation | Pressure | x | Default | Yes (finite and infinite) | Yes (finite and infinite) | x | x | x | x | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Pressure-Temperature | x | Yes | Yes | No | x | x | x | x | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Pressure-Temperature-Chemical Potential | x | Yes | Yes | No | No | No | x | x | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Source | Gravity | Yes | Yes | Yes | No | No | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Heat source | Yes | Yes | Yes | No | Yes | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Moving Reference Frame | Yes | Yes | Yes | No | No | No | No | No | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Additionnal physic | Surface tension | x | Yes | Yes | No | No | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Viscosity | Yes | Yes | Yes | No | No | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Conduction | Yes | Yes | Yes | No | No | No | No | No | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Gradient | Finite difference | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | x | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Green-Gauss | Yes | Yes | Yes | Yes | Yes | x | Yes | Yes | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Boundary condition | Non-reflecting | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Wall | Yes | Yes | Yes | No | Yes | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Tank | Yes | Yes | Yes | No | Yes | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Inj | Yes | Yes | Yes | No | No | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Outflow | Yes | Yes | Yes | No | Yes | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | SubInj | Yes | x | x | x | x | No | No | No | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Symmetry | Yes | Yes | Yes | No | Yes | No | No | No | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| Equation of state | Ideal Gas | Yes | Yes | Yes | Yes | Yes | Yes | x | x | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Stiffened Gas | Yes | Yes | Yes | Yes | Yes | Yes | x | x | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Noble-Abel Stiffened Gas | Yes | Yes | Yes | Yes | Yes | Yes | x | x | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Van der Waals | No | No | No | No | No | No | x | Yes | -| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ -| | Polynomial | No | No | No | No | No | No | x | Yes | -+--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+ ++--------------------------------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| Feature / Model | Euler | PressureVelocityEq | VelocityEq | VelocityEqTotEnergy | TemperaturePressureVelocityEq | EulerHomogeneous | NonLinearSchrodinger | EulerKorteweg | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Cartesian mesh | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Adaptive Mesh Refinement (AMR) | Yes | Yes | Yes | No | Yes | Yes | Yes | Yes | +| Geometry +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Unstructured mesh | Yes | Yes | Yes | Yes | Yes | Yes | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Symmetry (cylindrical/spherical) | Yes | Yes | Yes | No | No | No | No | No | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | 1st order | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | +| Numerical scheme +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | 2nd order (\*) | Yes | Yes | Yes | Yes (Cartesian/AMR mesh only) | Yes | No | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Pressure | x | Default | Yes (finite and infinite) | Yes (finite and infinite) | x | x | x | x | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| Relaxation | Pressure-Temperature | x | Yes | Yes | No | x | x | x | x | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Pressure-Temperature-Chemical Potential | x | Yes | Yes | No | No | No | x | x | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Gravity | Yes | Yes | Yes | No | No | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| Source | Heat source | Yes | Yes | Yes | No | Yes | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Moving Reference Frame | Yes | Yes | Yes | No | No | No | No | No | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Surface tension | x | Yes | No | No | No | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| Additionnal physic | Viscosity | Yes | Yes | Yes | No | No | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Conduction | Yes | Yes | Yes | No | No | No | No | No | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Finite difference | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | x | Yes (Cartesian/AMR mesh only) | Yes (Cartesian/AMR mesh only) | +| Gradient +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Green-Gauss | Yes | Yes | Yes | Yes | Yes | x | Yes | Yes | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Non-reflecting | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Wall | Yes | Yes | Yes | No | Yes | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Tank | Yes | Yes | Yes | No | Yes | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| Boundary condition | Inj | Yes | Yes | Yes | No | No | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Outflow | Yes | Yes | Yes | No | Yes | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | SubInj | Yes | x | x | x | x | No | No | No | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Symmetry | Yes | Yes | Yes | No | Yes | No | No | No | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Ideal Gas | Yes | Yes | Yes | Yes | Yes | Yes | x | x | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Stiffened Gas | Yes | Yes | Yes | Yes | Yes | Yes | x | x | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| Equation of state | Noble-Abel Stiffened Gas | Yes | Yes | Yes | Yes | Yes | Yes | x | x | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Van der Waals | No | No | No | No | No | No | x | Yes | +| +-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ +| | Polynomial | No | No | No | No | No | No | x | Yes | ++--------------------+-----------------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+-------------------------------+------------------+-------------------------------+-------------------------------+ *x* denotes a feature not relevant to the model. -If the table does not render properly, hit the button *View page source*. \ No newline at end of file +If the table does not render properly, hit the button *View page source*. + +\* Some limiters are only available depending on the mesh type (see :ref:`Sec:input:main`). \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap4_1startWithECOGEN.rst b/docs/sphinx_docs/source/Chap4_1startWithECOGEN.rst index 705d97c3..af454719 100644 --- a/docs/sphinx_docs/source/Chap4_1startWithECOGEN.rst +++ b/docs/sphinx_docs/source/Chap4_1startWithECOGEN.rst @@ -135,7 +135,7 @@ Input files for this test case are located in the following folder: *./libTests/ Computation parameters are easily modified according to the input file description of section :ref:`Chap:input`. -For example, one can prefer to visualize results under *gnu* file format. For that, simply turn the *XML* option in the XML file *\libTests\referenceTestCases\euler\1D\transport\positiveVelocity\mainV5.xml* into *gnu* and re-run the test case: +For example, one can prefer to visualize results under *gnu* file format. For that, simply turn the *XML* option in the XML file *\libTests\referenceTestCases\euler\1D\transport\positiveVelocity\main.xml* into *gnu* and re-run the test case: .. code-block:: xml diff --git a/docs/sphinx_docs/source/Chap4_2generatingMeshes.rst b/docs/sphinx_docs/source/Chap4_2generatingMeshes.rst index 5bbfeb31..294ad1ac 100644 --- a/docs/sphinx_docs/source/Chap4_2generatingMeshes.rst +++ b/docs/sphinx_docs/source/Chap4_2generatingMeshes.rst @@ -10,12 +10,15 @@ Mesh files with Gmsh ECOGEN can use mesh files for single- or multi-core computations generated with the open-source Gmsh_ software :cite:`geuzaine2009gmsh` with some specific precautions when editing the geometry file (*.geo*). Only the `MSH file format version 2`_ can be used in the current released version |version| of ECOGEN. -Download binaries of Gmsh in version 3.0.6 or lower : http://gmsh.info/bin/. +To export your mesh to the version 2, either: + +- Download older Gmsh_ binaries before the new mesh file format was introduced, such as version 3.0.6 or lower: http://gmsh.info/bin/. +- Use latest version of Gmsh but export your mesh file to the version 2, for more information see the tutorial :ref:`Sec:tuto:exportGmshFile`. Here are the restrictions that should be used when generating a geometry with Gmsh_: - Each part of the domain occupied by the fluid should correspond to a physical surface or a physical volume which is attributed to the value *10*. -- Each boundary condition must correspond to a physical line or a physical surface. The values are successively taken from *1* to maximum *9*. This is an important point that will be used to define boundary conditions with physical treatment in the *initialConditionsV4.xml* input file described in section :ref:`Sec:input:InitialConditions`. +- Each boundary condition must correspond to a physical line or a physical surface. The values are successively taken from *1* to maximum *9*. This is an important point that will be used to define boundary conditions with physical treatment in the *initialConditions.xml* input file described in section :ref:`Sec:input:InitialConditions`. Below is presented an example. @@ -28,18 +31,18 @@ Consider the geometry file of a simple nozzle depicted below: .. figure:: ./_static/tutos/gmsh/simpleNozzle.png - Example of geometrical data file -- nozzle2D_simple2.geo –- for generating a mesh file with *.msh* format using Gmsh software and usable with ECOGEN. + Example of geometrical data file -- nozzle2D_example.geo –- for generating a mesh file with *.msh* format using Gmsh software and usable with ECOGEN. -This correponds to the geometry file available in `ECOGEN/libMeshes/nozzles/nozzle2D_simple2.geo`_. +This correponds to the geometry file available in `ECOGEN/libMeshes/nozzles/nozzle2D_example.geo`_. The computational domain is a nozzle, the mesh is unstructured with quadrangles. In that case, one should take care that the fluid surface is defined by the value *10* and that 4 boundary conditions are set with the following numbering: -- Symmetrical axis: 1 (*condLimAxe = 1*) -- Wall: 2 (*condLimParoi = 2*) -- Inflow: 3 (*condLimEntree = 3*) -- Outflow: 4 (*condLimSortie = 4*) +- Symmetrical axis: 1 (*boundAxis = 1*) +- Wall: 2 (*boundWall = 2*) +- Injection using stagnation state: 3 (*boundInlet = 3*) +- Imposed pressure: 4 (*boundOutlet = 4*) -The corresponding *initialConditionV4.xml* file should then contains for example the following markups: +The corresponding *initialCondition.xml* file should then contains for example the following markups: .. code-block:: xml @@ -47,11 +50,11 @@ The corresponding *initialConditionV4.xml* file should then contains for example - - + + - - + + @@ -59,4 +62,4 @@ This correponds to initialization of a nozzle connected to a tank on the left an .. _Gmsh: http://gmsh.info/ .. _`MSH file format version 2`: http://gmsh.info/doc/texinfo/gmsh.html#MSH-file-format-version-2-_0028Legacy_0029 -.. _`ECOGEN/libMeshes/nozzles/nozzle2D_simple2.geo`: https://github.com/code-mphi/ECOGEN/blob/master/libMeshes/nozzles/nozzle2D_simple2.geo \ No newline at end of file +.. _`ECOGEN/libMeshes/nozzles/nozzle2D_example.geo`: https://github.com/code-mphi/ECOGEN/blob/master/libMeshes/nozzles/nozzle2D_example.geo \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap4_3restartRun.rst b/docs/sphinx_docs/source/Chap4_3restartRun.rst index 8e99367a..04361033 100644 --- a/docs/sphinx_docs/source/Chap4_3restartRun.rst +++ b/docs/sphinx_docs/source/Chap4_3restartRun.rst @@ -20,7 +20,7 @@ Setup of the test case For the purpose of this tutorial we have to do some slight modifications of the test case presented above. We advise you to make a copy of the test case **./libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/** into a new path such as **./libTests/myTests/restartRun/**. -For the sake of simplicity, we edit the *mainV5.xml* file as following: +For the sake of simplicity, we edit the *main.xml* file as following: .. code-block:: xml @@ -41,7 +41,7 @@ For the sake of simplicity, we edit the *mainV5.xml* file as following: We removed the probe section and changed the time control mode to iterations with a printing of data each 50 iterations for a total of 500 iterations. -Following the same idea of simpler test case we edit the file *meshV5.xml* by commenting the AMR feature and add more cells: +Following the same idea of simpler test case we edit the file *mesh.xml* by commenting the AMR feature and add more cells: .. code-block:: xml @@ -79,14 +79,14 @@ Once started, the output on the console looks like: Console screenshot of the initial run. -Once the simulation is done, we can check in the result folder **./results/restartRun/datasets/** the total number of iterations extracted. The last file has the name *results_CPUxx_TIME10.vtr* which indicates that the number of extracted files is indeed 10 as specified in the *mainV5.xml* file (500 physical iterations, results printed every 50 interations giving a total of 500/50 = 10 output files). This number corresponds to the *restartFileNumber* of the the block :xml:``. +Once the simulation is done, we can check in the result folder **./results/restartRun/datasets/** the total number of iterations extracted. The last file has the name *results_CPUxx_TIME10.vtr* which indicates that the number of extracted files is indeed 10 as specified in the *main.xml* file (500 physical iterations, results printed every 50 interations giving a total of 500/50 = 10 output files). This number corresponds to the *restartFileNumber* of the the block :xml:``. Obviously, in this case we know the total number of time iterations extracted because we waited the end of the simulation. However, it could be useful to get this number if the simulation stopped suddenly, or if the time control mode used was time. Resume run ========== -Now that we know the last time iteration, we can resume this simulation to add 500 additionnal time iterations. To this end, we modify the block :xml:`` of the *mainV5.xml* file to specify the last file number: +Now that we know the last time iteration, we can resume this simulation to add 500 additionnal time iterations. To this end, we modify the block :xml:`` of the *main.xml* file to specify the last file number: .. code-block:: xml diff --git a/docs/sphinx_docs/source/Chap4_4splitPhysicalDomainsNS.rst b/docs/sphinx_docs/source/Chap4_4splitPhysicalDomainsNS.rst index 93aa4f54..21225946 100644 --- a/docs/sphinx_docs/source/Chap4_4splitPhysicalDomainsNS.rst +++ b/docs/sphinx_docs/source/Chap4_4splitPhysicalDomainsNS.rst @@ -68,7 +68,7 @@ The complete geometry configuration file (*.geo*) is the following: Setup of the test case ====================== -Let's start with the *mainV5.xml* file. We use an *XML* output mode with time control set to *iterations* and a *CFL* number of *0.8*: +Let's start with the *main.xml* file. We use an *XML* output mode with time control set to *iterations* and a *CFL* number of *0.8*: .. code-block:: xml @@ -83,7 +83,7 @@ Let's start with the *mainV5.xml* file. We use an *XML* output mode with time co -To solve this flow we use the model *Euler* with air considered as ideal gas. Thus, the *modelV4.xml* file is: +To solve this flow we use the model *Euler* with air considered as ideal gas. Thus, the *model.xml* file is: .. code-block:: xml @@ -93,7 +93,7 @@ To solve this flow we use the model *Euler* with air considered as ideal gas. Th -Reading of the unstructured mesh is done throught the *meshV5.xml* file: +Reading of the unstructured mesh is done throught the *mesh.xml* file: .. code-block:: xml @@ -105,7 +105,7 @@ Reading of the unstructured mesh is done throught the *meshV5.xml* file: -All that remains to be done is to initialize the chambers with the corresponding fluid states. To this end, we define two :xml:`physicalDomains` of type *entireDomain*, one for each chamber. The link between the physical domains of the geometry file *.geo* and ECOGEN is made by the attribute :xml:`physicalEntity`. As given above on the *.geo* file, the left chamber has the physical entity number 2 and the right chamber has the number 3. Therefore, the *initialConditionsV4.xml* file is: +All that remains to be done is to initialize the chambers with the corresponding fluid states. To this end, we define two :xml:`physicalDomains` of type *entireDomain*, one for each chamber. The link between the physical domains of the geometry file *.geo* and ECOGEN is made by the attribute :xml:`physicalEntity`. As given above on the *.geo* file, the left chamber has the physical entity number 2 and the right chamber has the number 3. Therefore, the *initialConditions.xml* file is: .. code-block:: xml @@ -151,7 +151,7 @@ Run the test case simulation with **XX** cores: .. important:: - Be aware to partition the mesh file with the corresponding number of cores used for the simulation if parallel computation is desired. Gmsh pre-treatment attribute :xml:`GMSHPretraitement` of the *meshV5.xml* file might be set to *true* in this case. + Be aware to partition the mesh file with the corresponding number of cores used for the simulation if parallel computation is desired. Gmsh pre-treatment attribute :xml:`GMSHPretraitement` of the *mesh.xml* file might be set to *true* in this case. Results ======= @@ -172,7 +172,7 @@ It is clearly visible that the addition of the line along the interface makes it Pressure visualization at the initial time. Visualization using Paraview_ software. -Of course, for this test case configuration, it is possible to obtain an equivalent result without declaring two physical domains in the geometry file. By keeping the middle line of the geometry file, the straight separation is ensured and it is therefore possible to define in the *initialConditionsV4.xml* file an :xml:`entireDomain` domain for the left chamber and a :xml:`halfSpace` domain located at :math:`x = 0.5 \, m` with a positive direction for the right chamber. +Of course, for this test case configuration, it is possible to obtain an equivalent result without declaring two physical domains in the geometry file. By keeping the middle line of the geometry file, the straight separation is ensured and it is therefore possible to define in the *initialConditions.xml* file an :xml:`entireDomain` domain for the left chamber and a :xml:`halfSpace` domain located at :math:`x = 0.5 \, m` with a positive direction for the right chamber. However, it can be particularly interesting to use an initialization of the fluid states with the definition of the physical domains from the geometry, in case the fluid regions are too complex to define with the predefined ECOGEN domains. diff --git a/docs/sphinx_docs/source/Chap4_6extractMassflowWithParaview.rst b/docs/sphinx_docs/source/Chap4_6extractMassflowWithParaview.rst index d355983e..7aed0e7e 100644 --- a/docs/sphinx_docs/source/Chap4_6extractMassflowWithParaview.rst +++ b/docs/sphinx_docs/source/Chap4_6extractMassflowWithParaview.rst @@ -31,6 +31,8 @@ Generate .msh file * Finally, still on the :xml:`Mesh` tab, click on :xml:`Save`. The .msh files will be in the *./libMeshes* folder. +In case you are using latest version of **Gmsh**, you might need to export your mesh file to the previous mesh file format, for more information see the tutorial :ref:`Sec:tuto:exportGmshFile`. + Cylinder Test case ================== @@ -151,7 +153,7 @@ ParaView Comparison with gnuplot ======================= -* To make sure these values are correct, we can compare them with other ones. In *mainV5.xml*, one can record the mass flow at both boundaries with the lines: +* To make sure these values are correct, we can compare them with other ones. In *main.xml*, one can record the mass flow at both boundaries with the lines: .. code-block:: console diff --git a/docs/sphinx_docs/source/Chap4_8restartMeshMapping.rst b/docs/sphinx_docs/source/Chap4_8restartMeshMapping.rst new file mode 100644 index 00000000..399fcd81 --- /dev/null +++ b/docs/sphinx_docs/source/Chap4_8restartMeshMapping.rst @@ -0,0 +1,146 @@ +.. role:: xml(code) + :language: xml + +.. _Sec:tuto:restartMeshMapping: + +************************************** +Restart a simulation with mesh mapping +************************************** + +In ECOGEN it is possible to initialize a simulation with the result of a previous simulation performed on a different mesh and/or a different number of cores. +The main use case is to accelerate the convergence to the steady state by using a previous simulation performed on a coarse mesh, but it can also be used to restart a simulation on a different number of cores. + +Overview +======== + +In this tutorial, this mesh mapping method is used to fasten convergence towards steady state of a subsonic flow in a convergent-divergent nozzle. +To build our test case, we consider the following reference test case in the *ECOGEN.xml* file: + +.. code-block:: xml + + libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/ + +In this test case, originally from :cite:`lemartelot2013lowmach`, a subsonic flow of liquid water is injected into the nozzle as shown in :numref:`Fig:tutos:restartMeshMapping:nozzle`. +At the inlet, the mass flow rate is imposed as well as the total stagnation enthalpy using the pressure and density. +At the outlet, the pressure is fixed. These boundary conditions lead to a subsonic flow in the whole nozzle. + +.. _Fig:tutos:restartMeshMapping:nozzle: + +.. figure:: ./_static/tutos/restartMeshMapping/nozzle.png + :scale: 70% + :align: center + + Setup for the subsonic flow within the convergent-divergent nozzle. + +Since the cross-section variation along the nozzle is smooth, a 1D mesh is considered and the numerical scheme is adapted to include the impact on the flow of the upper and lower walls of the nozzle using the method described in :cite:`lemartelot2013lowmach`. + +This can be done by adding the following node to the *model.xml* file: + +.. code-block:: xml + + + +Note that by default a low-Mach preconditioning technique (see :cite:`lemartelot2013lowmach`) is defined in this test case to properly capture the flow at the throat. +Since the same effect can be obtained with a very fine mesh and our goal is to provide a configuration demonstrating the interest of the mesh mapping, this option is disabled: + +.. code-block:: xml + + + +In this tutorial, we will first run a simulation on a coarse mesh until the steady state is reached. +Then, this simulation will be used to initialize another simulation on a finer mesh. +The proper behavior of the mesh mapping will be checked and a discussion of the time saved with the mapping is provided. + +Run a simulation on a coarse mesh +================================= + +.. note:: + + In the following, in order to demonstrate that steady state solution obtained with the mesh mapping method corresponds to the exact solution, a coarse mesh of *Nx = 1 000* and a fine one of *Nx = 10 000* cells are used. + Simulations with these meshes can be quite long, therefore for testing purpose the reader is advised to test with *Nx = 100* and *Nx = 1 000* cells. + +To run the simulation on two cores, use: + +.. code-block:: console + + mpirun -np 2 ECOGEN + +To check that steady state is reached, flow quantities can be checked using a visualization software such as Paraview. +Note that it might be useful to compare the massflow between the inlet and outlet of the nozzle to make sure steady state is reached. +Massflow rate can be recorded with the :xml:`` node in the *main.xml* file, for more information about this, see the tutorial :ref:`Sec:tuto:extractMassflow`. + +Setup the restart with mesh mapping +=================================== + +Now that we have a steady state result obtained on a coarse mesh, we will use it to initialize our simulation on a fine mesh of about *Nx = 10 000* cells. +First, make sure to change the name of the result folder to avoid erasing the simulation on the coarse mesh. +This can be done by changing the following line in *main.xml*: + +.. code-block:: xml + + euler2DnozzleLowMachSmoothCrossSection_fine + +Now we need to change the mesh to the fine one and add the mesh mapping option with the adequate parameters. +It needs to be provided with the results folder of the previous coarse mesh simulation, the file to restart to and the mesh file used before. +Taking into consideration these remarks, the *mesh.xml* file is modified as follow: + +.. code-block:: xml + + + + + + + + + + + + + + +The simulation is ready to be run, in this case the mesh is partitionned on 10 cores. +Therefore ECOGEN must be executed using: + +.. code-block:: console + + mpirun -np 10 ECOGEN + +Results +======= + +To determine how much time is saved thanks to the mesh mapping, one can also run the simulation on the fine mesh *Nx = 10 000* using basic initial conditions, this run corresponds to test number 3 in the table below. +The initial run on the coarse mesh corresponds to test number 1 and the run with the mesh mapping is the run number 2. + ++------+-------------------+--------------+------------+----------------------------+----------------------------+ +| Test | Description | Mesh (Nx) | Nb of CPUs | Simulation time (h:m:s) | Cumulative time (h:m:s) | ++======+===================+==============+============+============================+============================+ +| 1 | Direct run | 1000 | 1 | 0:36:29 | 0:36:29 | ++------+-------------------+--------------+------------+----------------------------+----------------------------+ +| 2 | Mapping on test 1 | 10000 | 10 | 4:54:15 | 5:30:44 | ++------+-------------------+--------------+------------+----------------------------+----------------------------+ +| 3 | Direct run | 10000 | 10 | 9:23:36 | 9:23:36 | ++------+-------------------+--------------+------------+----------------------------+----------------------------+ + +In :numref:`Fig:tutos:restartMeshMapping:p` and :numref:`Fig:tutos:restartMeshMapping:ux`, we can clearly see that that the same steady state is reached whether the mesh mapping is used or not (see Test 2 and 3) and that an excellent agreement with the exact solution is observed. +From the cumulative simulation time reported in table above, it can be noticed that the mesh mapping method reduces the simulation time to steady state by more than 50% compared to the direct run when no mesh mapping is used (Test 3) and this even if the initial solution obtained on the coarse mesh is still far from the exact solution. + +.. _Fig:tutos:restartMeshMapping:p: + +.. figure:: ./_static/tutos/restartMeshMapping/p.png + :scale: 50% + :align: center + + Pressure distribution along the nozzle length + +.. _Fig:tutos:restartMeshMapping:ux: + +.. figure:: ./_static/tutos/restartMeshMapping/ux.png + :scale: 50% + :align: center + + Velocity distribution along the nozzle length \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap4_9exportGmshFile.rst b/docs/sphinx_docs/source/Chap4_9exportGmshFile.rst new file mode 100644 index 00000000..6b0d52aa --- /dev/null +++ b/docs/sphinx_docs/source/Chap4_9exportGmshFile.rst @@ -0,0 +1,33 @@ +.. role:: xml(code) + :language: xml + +.. _Sec:tuto:exportGmshFile: + +***************************************** +Export Gmsh mesh to version 2 file format +***************************************** + +Since ECOGEN mainly supports Gmsh_ [GR09] :cite:`geuzaine2009gmsh` **version 2** mesh files, and the latest Gmsh software currently uses **version 4** by default, we recommend exporting the mesh file to **version 2**. + +To do so, use `File -> Export`, choose `Gmsh version 2 ASCII` format and make sure additionnal options **are not** checked. + +.. _Fig:tutos:exportGmshFile:export: + +.. figure:: ./_static/tutos/exportGmshFile/export.png + :scale: 80% + :align: center + + Gmsh export window. + +If the mesh has to be partitionned, check also the option `Create ghost` cells to have a mesh file fully compatible with ECOGEN. + +.. _Fig:tutos:exportGmshFile:partition: + +.. figure:: ./_static/tutos/exportGmshFile/partition.png + :scale: 80% + :align: center + + Gmsh partition window. + + +.. _Gmsh: http://gmsh.info/ \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap4_tutorials_Chapter.rst b/docs/sphinx_docs/source/Chap4_tutorials_Chapter.rst index 925ad7e4..e79d88c1 100644 --- a/docs/sphinx_docs/source/Chap4_tutorials_Chapter.rst +++ b/docs/sphinx_docs/source/Chap4_tutorials_Chapter.rst @@ -15,4 +15,6 @@ Here are presented a collection of tutorials to help you use ECOGEN efficiently. Chap4_4splitPhysicalDomainsNS Chap4_5paraviewServer Chap4_6extractMassflowWithParaview - Chap4_7runningATestInAnotherFolder \ No newline at end of file + Chap4_7runningATestInAnotherFolder + Chap4_8restartMeshMapping + Chap4_9exportGmshFile \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap5_1Euler_2D_3nozzles.rst b/docs/sphinx_docs/source/Chap5_1Euler_2D_3nozzles.rst index aad11b39..189a5b5f 100644 --- a/docs/sphinx_docs/source/Chap5_1Euler_2D_3nozzles.rst +++ b/docs/sphinx_docs/source/Chap5_1Euler_2D_3nozzles.rst @@ -10,8 +10,8 @@ Nozzles are pipes or tubes of variable cross sections. It can control the direct Here, tests are divided into 3 categories: - Tank with shock. -- Supersonic injection. -- Subsonic injection. +- Injection at imposed temperature. +- Low-mach subsonic flow. Tank with shock --------------- @@ -30,19 +30,19 @@ It means that there is a shock in the tank which is placed before the nozzle. In Initial helium conditions before the nozzle. -+-----------------------------+-------------------------------+ -| Characteristic | Value | -+=============================+===============================+ -| Dimension | L=1m, Øa=0.20m, Ømin=0.17m | -+-----------------------------+-------------------------------+ -| Initial mesh structure : | unstructured | -+-----------------------------+-------------------------------+ -| Boundary conditions | tank, wall, outflow, wall | -+-----------------------------+-------------------------------+ -| Final solution time | 1.44e-2 s | -+-----------------------------+-------------------------------+ -| Solution printing frequency | 7.2e-4 s | -+-----------------------------+-------------------------------+ ++-----------------------------+----------------------------------------+ +| Characteristic | Value | ++=============================+========================================+ +| Dimension | L=1m, Øa=0.20m, Ømin=0.17m | ++-----------------------------+----------------------------------------+ +| Initial mesh structure | unstructured | ++-----------------------------+----------------------------------------+ +| Boundary conditions | inletTank, wall, outletPressure, wall | ++-----------------------------+----------------------------------------+ +| Final solution time | 1.44e-2 s | ++-----------------------------+----------------------------------------+ +| Solution printing frequency | 7.2e-4 s | ++-----------------------------+----------------------------------------+ Results are shown in :numref:`Fig:testCases:Euler:TankwithShockAnim`. When helium arrives in the minimal section, there is a sonic flow. So, at the divergent section, one observes a shock wave, and then, pressure becomes stationary. @@ -79,41 +79,34 @@ Pressure differences are shown in :numref:`Fig:testCases:Euler:TankwithShockE`. Maximum pressure differences are located at the ends of the nozzle and the minimum pressure difference is located at the minimum section. +Injection at imposed temperature +-------------------------------- -Supersonic injection --------------------- - -Before the nozzle, one injects helium with Mach > 1. Therefore, helium flow is supersonic and will cross the nozzle. This test is referenced in *./libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/*. The corresponding uncommented line in *ECOGEN.xml* is: +Before the nozzle, one injects air with Mach < 1. Therefore, air flow is subsonic and will cross the nozzle. Initial conditions are described on figures :numref:`Fig:testCases:Euler:subsonicIni` and :numref:`Fig:testCases:Euler:subsupersonicIni`. This test is referenced in *./libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/*. The corresponding uncommented line in *ECOGEN.xml* is: .. code-block:: xml - ./libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/ - -........ - - -Subsonic injection ------------------- + ./libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/ -Before the nozzle, one injects air with Mach < 1. Therefore, air flow is subsonic and will cross the nozzle. Initial conditions are described on figures :numref:`Fig:testCases:Euler:subsonicIni` and :numref:`Fig:testCases:Euler:subsupersonicIni`. This test is referenced in *./libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/*. The corresponding uncommented line in *ECOGEN.xml* is: +Note that a variation of this test case is available where the inlet boundary is defined using a stagnation state, see test case: .. code-block:: xml - ./libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/ - -+-----------------------------+---------------------------------+ -| Characteristic | Value | -+=============================+=================================+ -| Dimension | L=1m, Øa=0.2m, Ømin=0.17m | -+-----------------------------+---------------------------------+ -| Initial mesh structure : | unstructured | -+-----------------------------+---------------------------------+ -| Boundary conditions |subinjection, wall, outflow, wall| -+-----------------------------+---------------------------------+ -| Final solution time | 1s | -+-----------------------------+---------------------------------+ -| Solution printing frequency | 0.25s | -+-----------------------------+---------------------------------+ + libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/ + ++-----------------------------+------------------------------------------+ +| Characteristic | Value | ++=============================+==========================================+ +| Dimension | L=1m, Øa=0.2m, Ømin=0.17m | ++-----------------------------+------------------------------------------+ +| Initial mesh structure | unstructured | ++-----------------------------+------------------------------------------+ +| Boundary conditions | inletInjTemp, wall, outletPressure, wall | ++-----------------------------+------------------------------------------+ +| Final solution time | 1s | ++-----------------------------+------------------------------------------+ +| Solution printing frequency | 0.25s | ++-----------------------------+------------------------------------------+ .. _Fig:testCases:Euler:subsonicIni: @@ -167,6 +160,56 @@ This is the other case, when the flow is subsonic at the exit (:numref:`Fig:test Because of a subsonic flow over the whole nozzle, it is not primed at the throat. Thus, one notices that the fluid accelerates when the section is reduced, then slows down when the section is enlarged. This is due to the conservation of the mass flow. +.. _Sec:tests:euler:2d:nozzleLowMach: + +Low-Mach subsonic flow +---------------------- + +In the test case provided below, a subsonic flow at really low speeds is studied: + +.. code-block:: xml + + libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/ + +In this configuration, liquid water flows through a smooth varying cross section nozzle. +Due to the considered velocity range, the flow is nearly incompressible. +To guarantee the convergence of the compressible solver to the exact solution, a low-Mach preconditionning technique is used. +Section variation is modeled using a 1D scheme with smooth varying cross section. +With this scheme, upper and lower boundary conditions are directly taken into consideration. +For that reason, *nullFlux* boundary condition must be set at these boundaries (otherwise wall effects are counted twice). + ++-----------------------------+---------------------------------------------+ +| Characteristic | Value | ++=============================+=============================================+ +| Dimension | L=1m, Øa=0.14657m, Ømin=0.06406m | ++-----------------------------+---------------------------------------------+ +| Initial mesh structure | unstructured | ++-----------------------------+---------------------------------------------+ +| Boundary conditions | inletInjStagState, nullFlux, outletPressure | ++-----------------------------+---------------------------------------------+ +| Final solution time | 2s | ++-----------------------------+---------------------------------------------+ +| Solution printing frequency | 0.1s | ++-----------------------------+---------------------------------------------+ + +Pressure and velocity fields in the nozzle are presented below. +One can notice that the low-Mach preconditionning technique (called *Mref* or *local Mref*) is required for the solution to convergence to the exact solution. +Be aware that, to address a wider range of applications, *local Mref* is the only preconditionning method available in ECOGEN. + +.. figure:: ./_static/testCases/Euler/Nozzles/pLowMach.png + :scale: 40% + :align: center + + Pressure field in the nozzle at steady state. + +.. figure:: ./_static/testCases/Euler/Nozzles/pLowMach.png + :scale: 40% + :align: center + + Velocity field in the nozzle at steady state. + +For more information on this test case and the numerical procedure, see the reference :cite:`lemartelot2013lowmach`. + .. _Paraview: https://www.paraview.org/ .. _gnuplot: http://www.gnuplot.info/ .. _Python: https://www.python.org/ diff --git a/docs/sphinx_docs/source/Chap5_2.rst b/docs/sphinx_docs/source/Chap5_2.rst index 6be5f2c6..3436e7e1 100644 --- a/docs/sphinx_docs/source/Chap5_2.rst +++ b/docs/sphinx_docs/source/Chap5_2.rst @@ -22,7 +22,11 @@ Other tests are provided with ECOGEN package and may be described in details lat .. code-block:: xml - ./libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/ + libTests/referenceTestCases/PUEq/2D/foil/noCavitation/ + libTests/referenceTestCases/PUEq/2D/foil/cavitation/ + libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/ + libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/ + libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/ ./libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/ ./libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/ ./libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/ diff --git a/docs/sphinx_docs/source/Chap5_2PUEq_2D_3richtmyerMeshkov.rst b/docs/sphinx_docs/source/Chap5_2PUEq_2D_3richtmyerMeshkov.rst index e5de779f..f88767d5 100644 --- a/docs/sphinx_docs/source/Chap5_2PUEq_2D_3richtmyerMeshkov.rst +++ b/docs/sphinx_docs/source/Chap5_2PUEq_2D_3richtmyerMeshkov.rst @@ -43,7 +43,7 @@ The initial characteristics of the run are: Results are shown in :numref:`Fig:testCases:PUEq:richtmyerMeshkovAnim`. Both GIFs are animations which represents on the one hand (upper half) the evolution of the mesh (AMR), that is to say its refinement for the computation of the simulation. -For example, when the density variations are low or non-existent, the mesh will be as coarse as possible (within the conditions given in meshV5.xml). +For example, when the density variations are low or non-existent, the mesh will be as coarse as possible (within the conditions given in mesh.xml). On the contrary when the variations become significant, the mesh will become refined. .. _Fig:testCases:PUEq:richtmyerMeshkovAnim: diff --git a/docs/sphinx_docs/source/Chap5_2PUEq_2D_4rayleighTaylor.rst b/docs/sphinx_docs/source/Chap5_2PUEq_2D_4rayleighTaylor.rst index 04b0bcd4..02668851 100644 --- a/docs/sphinx_docs/source/Chap5_2PUEq_2D_4rayleighTaylor.rst +++ b/docs/sphinx_docs/source/Chap5_2PUEq_2D_4rayleighTaylor.rst @@ -103,7 +103,7 @@ One remarks that initially the interface between the two fluids is slightly curv RT instabilities ; mixture density (left) and density gradient (right) over time. Visualization using Paraview_ software. -When the density variations are low or non-existent, the mesh is as coarse as possible (within the conditions given in meshV5.xml) as shown in :numref:`Fig:testCases:PUEq:rayleighTaylorAnim2`. On the contrary, when the variations become significant, the mesh is refined. +When the density variations are low or non-existent, the mesh is as coarse as possible (within the conditions given in mesh.xml) as shown in :numref:`Fig:testCases:PUEq:rayleighTaylorAnim2`. On the contrary, when the variations become significant, the mesh is refined. .. _Fig:testCases:PUEq:rayleighTaylorAnim2: diff --git a/docs/sphinx_docs/source/Chap5_2PUEq_2D_7squareToCircleSymmetry.rst b/docs/sphinx_docs/source/Chap5_2PUEq_2D_7squareToCircleSymmetry.rst index 7f9c8671..271739aa 100644 --- a/docs/sphinx_docs/source/Chap5_2PUEq_2D_7squareToCircleSymmetry.rst +++ b/docs/sphinx_docs/source/Chap5_2PUEq_2D_7squareToCircleSymmetry.rst @@ -44,7 +44,7 @@ The initial characteristics of the run are: Results are shown in :numref:`Fig:testCases:PUEq:squareToCircleSymmetryAnim`. When the interface between the blue and the white regions disapears, because of surface tension, the region that was initially square is deformed and tends to become circular with time. Note that it is necessary to have a stationary solution to obtain this circle and this requires a relatively long final solution time. -One can observe the distribution of computation on the CPUs (here 12) divided into different regions, according to AMR evolution. When the density variations are low or non-existent, the mesh is as coarse as possible (within the conditions given in meshV5.xml). On the contrary when the variations become significant, the mesh is refined. So, to distribute the work equally between the CPUs, highly refined regions are relatively small compared to coarse regions. +One can observe the distribution of computation on the CPUs (here 12) divided into different regions, according to AMR evolution. When the density variations are low or non-existent, the mesh is as coarse as possible (within the conditions given in mesh.xml). On the contrary when the variations become significant, the mesh is refined. So, to distribute the work equally between the CPUs, highly refined regions are relatively small compared to coarse regions. .. _Fig:testCases:PUEq:squareToCircleSymmetryAnim: diff --git a/docs/sphinx_docs/source/Chap6_1buildingSphinxDoc.rst b/docs/sphinx_docs/source/Chap6_1buildingSphinxDoc.rst index e44adb46..039501f3 100644 --- a/docs/sphinx_docs/source/Chap6_1buildingSphinxDoc.rst +++ b/docs/sphinx_docs/source/Chap6_1buildingSphinxDoc.rst @@ -3,7 +3,14 @@ Building Sphinx Doc Prerequisites ------------- -This documentation uses Sphinx third-party Python package. To generate it locally from the **docs/sphinx_docs/** folder, you need to install additional components. +This documentation uses Sphinx third-party Python package. +To generate it locally from the **docs/sphinx_docs/** folder, you need to install additional components as described in the Section :ref:`Sec:dev:sphinx:system`. +Alternatively you can use `Docker`_ to setup the required environment into a container to build the documentation, see Section :ref:`Sec:dev:sphinx:docker`. + +.. _Sec:dev:sphinx:system: + +System-wide configuration +------------------------- Install Python ~~~~~~~~~~~~~~ @@ -37,15 +44,17 @@ If you want to build PDF, you will need *LaTeX* installed: apt-get install latexmk Building html doc ------------------ +~~~~~~~~~~~~~~~~~ To build the documentation as a webpage (as shown on ECOGEN_ website), move to the *docs* folder and run under prompt: .. code-block:: console make html +This will generate a folder *docs/build/html* containing html source files, open any file with a browser to see generated content. + Building PDF doc ----------------- +~~~~~~~~~~~~~~~~ To build the documentation as a PDF, move to the *docs* folder and run under prompt: .. code-block:: console @@ -54,14 +63,30 @@ To build the documentation as a PDF, move to the *docs* folder and run under pro This will generate a folder *docs/build/latex* containing source files in *LaTeX* that can be used to generate a PDF. +.. _Sec:dev:sphinx:docker: + +Docker configuration +-------------------- + +.. code-block:: console + + cd docs/sphinx-docs/ + # Build the container image using the Dockerfile + docker image build -t sphinx-doc . + # To generate html ouput run + docker container run --mount type=bind,source=${PWD},target=/home sphinx-doc html + # To generate PDF ouput run + docker container run --mount type=bind,source=${PWD},target=/home sphinx-doc pdf + Learning Sphinx --------------- -To learn how to develop a documentation using Sphinx, here are some usefull links: +To learn how to develop a documentation using Sphinx, here are some useful links: - `Sphinx documentation`_, - Hosting documentation and read the docs theme: `Read the docs website`_. +.. _`Docker`: https://www.docker.com/ .. _`Anaconda package`: https://www.anaconda.com/distribution/ .. _`python offical package` : https://www.python.org/ .. _`Sphinx documentation`: https://www.sphinx-doc.org/en/master/contents.html diff --git a/docs/sphinx_docs/source/Chap7_license.rst b/docs/sphinx_docs/source/Chap7_license.rst index 0a793fe4..8b4dea5b 100644 --- a/docs/sphinx_docs/source/Chap7_license.rst +++ b/docs/sphinx_docs/source/Chap7_license.rst @@ -5,14 +5,16 @@ License |License| -ECOGEN is the legal property of its developers, whose names are listed in the copyright file included with the source distribution. Contributors’ names for version |version| are listed below: +ECOGEN is the legal property of its developers, whose names are listed in the copyright file included with the source distribution. Contributors’ names for version |version| are listed below (from first to last to join): - - Sébastien Le Martelot, - Fabien Petitpas, + - Sébastien Le Martelot, - Kevin Schmidmayer, - Eric Daniel, - Benedikt Dorschner, - Joris Caze, + - Fatima Gadiri, + - Solène Schropff. ECOGEN is a free software: You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ECOGEN is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details available at the following address: http://www.gnu.org/licenses. @@ -45,7 +47,7 @@ Aknowledgments A special thanks is also adressed to Tim Colonius and Nicolas Favrie for their advising and fundings. -They helped to improve ECOGEN software through their valuable feedbacks: Luc Biasiori-Poulanges, Spencer Bryngelson, Theresa Trummler, Mathieu Brasseur. +They helped to improve ECOGEN software through their valuable feedbacks: Luc Biasiori-Poulanges, Spencer Bryngelson, Theresa Trummler, Mathieu Brasseur, Guillaume Bokman, Vincent Perrier. They also contributed to the evolution of ECOGEN software through their scholar internships: -Paul Jeanney, Adrien Besse, Estefani Cardoso Aires, Guillaume Chavet. \ No newline at end of file +Pierre Cottigny, Titouan Bonnaure, Paul Jeanney, Adrien Besse, Estefani Cardoso Aires, Guillaume Chavet. \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap8_1Overview.rst b/docs/sphinx_docs/source/Chap8_1Overview.rst new file mode 100644 index 00000000..391d758d --- /dev/null +++ b/docs/sphinx_docs/source/Chap8_1Overview.rst @@ -0,0 +1,229 @@ +.. role:: xml(code) + :language: xml + +.. _Sec:GUI:overview: + +******** +Overview +******** + +Editing a test case requires deep understanding of input-file structure. To simplify this editing, a beta version of graphical user interface ECOGEN_GUI is proposed. + +Possible actions are: + + * Open, edit and save existing test cases. + * Create new test cases. + * Generate the main input file *ECOGEN.xml* to prepare runs. + * Edit essential settings for one or several test cases: Output format, flow model, fluid models, mesh dimensions (or mesh file choice), initial conditions and boundary conditions. + * Visualize equation-of-state parameter library (editing these parameters is possible directely through the interface). + +.. admonition:: Limitations + + Since this is a beta version of ECOGEN_GUI, only essential computation settings appear. Specific settings are thus not available but can be edited directly via the input files. Please refer to section :ref:`Chap:input` for details. + +************ +Installation +************ + +From self-extracting files +========================== + +ECOGEN_GUI can be installed automatically under Windows 10 (64 bits) from the precompiled binary installer *ECOGEN_GUI_Setup.exe*. + +To install the application, simply follow the installer's instructions (:numref:`Fig:GUI:install`). + +.. _Fig:GUI:install: + +.. figure:: ./_static/GUI/install.png + :scale: 70% + :align: center + + ECOGEN_GUI installation window under Windows 10. + +It is preferable to install ECOGEN_GUI in a user folder (by default) so that the application can save its configuration files. + +Source compilation +================== + +The source files of the ECOGEN_GUI application can also be compiled. The compilation nevertheless requires an environment able to compile C++ code using the `Qt`_ library. + +.. _`Qt`: https://www.qt.io/ + +******************** +General presentation +******************** + +First-time running +================== + +The first time you run ECOGEN_GUI, the configuration window appears (:numref:`Fig:GUI:config`.)). Afterwards, this window will be accessible via the menu bar of the main application window. + +.. _Fig:GUI:config: + +.. figure:: ./_static/GUI/config.png + :scale: 70% + :align: center + + Configuration window of the ECOGEN_GUI application. + +Before being able to use ECOGEN_GUI, it is necessary to specify the directory in which the ECOGEN code is located, in order to make the association between the application and the code input files. + +.. Caution:: + + The ECOGEN simulation tool must be installed independently. Please refer to the corresponding section :ref:`Chap:Start` for detailed instructions on ECOGEN installation. + +The other fields (*Mesh software*, *Text editor software*, etc.) can be filled in optionally. They will then allow the launching of these applications directly from the ECOGEN_GUI interface. + +Main window +=========== + +The main window of ECOGEN_GUI is presented, as visible at the launch of the application, in :numref:`Fig:GUI:mainWindow`. + +.. _Fig:GUI:mainWindow: + +.. figure:: ./_static/GUI/mainWindow.png + :scale: 30% + :align: center + + ECOGEN_GUI application main window. + +It consists of several areas: + + 1. Menu bar, + 2. **Run controls** dock, + 3. **Models** dock, + 4. **Mesh properties** dock, + 5. **Boundary conditions** dock, + 6. **Physical domains** dock, + 7. **Equations of state** dock. + +Apart from the **Boundary conditions** dock, the other docks are greyed out when the application is launched and will only be activated when a test case is opened. To start editing a test case, choose *File* :math:`\rightarrow` *Open test case* (Ctrl+O) or *File* :math:`\rightarrow` *New test case* (Ctrl+N) from the menu bar (1). + +A first example +--------------- +As an example, open the reference test case located in *./libTests/referenceTestCases/euler/1D/transport/positiveVelocity*. The application then loads the parameters from the ECOGEN input files corresponding to the requested test case (:numref:`Fig:GUI:casTestRef`). + +.. _Fig:GUI:casTestRef: + +.. figure:: ./_static/GUI/casTestRef.png + :scale: 30% + :align: center + + Opening the reference test case located in *./libTests/referenceTestCases/euler/1D/transport/positiveVelocity*. + +Loading the test case causes a new tab to appear in the central part of the window (8): + + * The tab title corresponds to the name of the test case being edited. It is also the name of the folder that will contain the results of the corresponding ECOGEN simulation (see section :ref:`Sec:input:main:runName` for more details). + * The white zone of the tab will record all the operations performed on this test case (log). + * If the test case parameters are modified, the tab title will be followed by a star which means that the modifications must be recorded to be applied to the ECOGEN code input files. To do this, select *File* :math:`\rightarrow` *Save test case* (Ctrl+S). + +Multiple test case downloads and preparation of ECOGEN +------------------------------------------------------ +It is possible to open multiple test cases simultaneously. In this case, as many tabs will be present in the central area (:numref:`Fig:GUI:zoomOnglets`). + +.. _Fig:GUI:zoomOnglets: + +.. figure:: ./_static/GUI/zoomOnglets.png + :scale: 70% + :align: center + + Here, 3 test cases are opened simultaneously. The test case being edited *pressureVelocityEq2DrichtmyerMeshkov* has been modified and not saved. + +Once the test cases have been loaded into ECOGEN_GUI and all saved, it is possible to generate the main input file of the ECOGEN code from the menu bar (*Run* :math:`\rightarrow` *Prepare* or Ctrl+E). The simulations are ready to run (refer to section :ref:`Sec:installation:compileAndExecute`). + +Reloading a test case +--------------------- +At any time, the input files can be reloaded again within the ECOGEN_GUI interface via the menu command (*View* :math:`\rightarrow` *Refresh* or Ctrl+R). This command is particularly useful to cancel unsaved modifications of the parameters of a test case or during a "manual" modification of the input files. + +******************* +Desription of docks +******************* + +The main window of ECOGEN_GUI consists of docks that can be arranged according to the user's preferences. These different docks gather the settings of a test case by "family". A help on each parameter can be obtained via the appearance of a tooltip on mouse over. + +Any change to a setting of a test case is accompanied by a line in the *log* field (central white area (8)) of the corresponding tab. This allows you to keep a history of the work performed on each test case. + +.. Caution:: + + Some parameters are not yet implemented within ECOGEN_GUI. The specific requirements for these parameters can nevertheless be edited manually within the input files. In this case, refer to section :ref:`Chap:UserGuide`. + +**Run Controls** dock +===================== +The dock **Run controls** (2) gathers all the computation settings initially contained in the input file *main.xml* of the considered test case. +The details of the parameters are presented in section :ref:`Sec:input:main`. + +**Models** dock +=============== +The dock **Models** (3) gathers all the parameters of the mathematical flow model initially contained in the input file *model.xml* of the considered test case. +The details of the parameters are presented in section :ref:`Sec:input:model`. This dock allows, among other things, to: + + * Change the model on the fly. + * Change the number of phases. + * Select for each phase an equation of state present in the ECOGEN directory. + +An interesting feature of ECOGEN_GUI is that any modification linked to the model will automatically be reported on the other docks (**Boundary conditions** and **Physical domains**) and consequently on the input files of the test case during saving. + +**Mesh properties** dock +======================== +The dock **Mesh properties** (4) gathers all the settings related to the mesh. These parameters are initially contained in the input file *mesh.xml* of the considered test case. +The details of the parameters are presented in section :ref:`Sec:input:mesh`. + +The appearance of this dock depends on the type of mesh considered (Cartesian or unstructured). The two possible aspects of the dock **Mesh properties** are presented in :numref:`Fig:GUI:meshDock`. + +.. _Fig:GUI:meshDock: + +.. figure:: ./_static/GUI/meshDock.png + :scale: 70% + :align: center + + Two different aspects of the dock **Mesh properties**. Left: The standalone Cartesian mesh version is fully adaptable. Right: The unstructured version which requires to specify a mesh file from a third-party application. + +It is not possible to change the nature of the mesh on the fly. To change the mesh type, a new test case with the correct initial mesh structure must be created. + +Cartesian mesh +-------------- +When the mesh is Cartesian (:numref:`Fig:GUI:meshDock`, left), it is fully adaptable via ECOGEN_GUI (dimensions, number of computation cells, use of AMR for adaptative mesh refinement of discontinuities). + +Unstructured mesh +----------------- +When the mesh is unstructured (:numref:`Fig:GUI:meshDock`, right), the mesh must first be prepared using a third-party mesh application. The resulting mesh file must be specified here. Details on the mesh files accepted by ECOGEN are available in section :ref:`Sec:tuto:generatingMeshes`. + +.. Caution:: + + In case of modification of the mesh file, it may be necessary to edit the boundary conditions of the input file *initialConditions.xml* manually, these boundary conditions being dependent on the mesh file. This will be recalled in the *log* area of the test case if needed. + +**Boundary conditions** dock +============================ +The dock **Boundary conditions** (5) gathers all the settings related to the boundary conditions. These parameters are initially contained in the input file *initialConditions.xml* of the considered test case. +The details of the parameters are presented in section :ref:`Sec:input:boundaryConditions`. + +The dock will automatically adjust to the parameters of the other docks (**Mesh properties** and **Models**). +The different boundary conditions available are selectable within the dock list. Once the condition is selected within the list, its parameters can be modified. + +**Physical domains** dock +========================= +The dock **Physical domains** (6) gathers all the settings related to the physical domains to initialize (initial conditions of the computation). These parameters are initially contained in the input file *initialConditions.xml* of the considered test case. +The details of the parameters are presented in section :ref:`Sec:input:physicalDomains`. + +In ECOGEN_GUI, the dock **Physical domains** will automatically adapt to the parameters present in the dock **Models**. + +The **Physical domains** dock is used to define different initialization regions for the thermo-mechanical variables of fluids within the computational domain. These regions operate by accumulation and can therefore overlap each other. It is then possible to create a base region initializing the whole domain and then add as many domains as desired using the :math:`+` button. +Once added, the geometric domains can be removed using the :math:`-` button or moved up or down (the domain at the top of the list being the first initialized, the following ones will be overlapped in order). + +**Equations of state** dock +=========================== +This dock is independent. It indexes all the files of thermodynamic parameters of the fluids available in the directory of ECOGEN. These parameters can be directly modified within the ECOGEN interface by checking the box within the dock (used as a lock). Information on the equations of state can be found in section :ref:`Sec:IO:materials`. + +********************************* +Modify ECOGEN_GUI's configuration +********************************* + +At any time, ECOGEN_GUI can be reconfigured via the menu bar *Edit* :math:`\rightarrow` *Configure*). In this case, the user has access to the configuration window again (:numref:`Fig:GUI:config`). + +ECOGEN's working directory +========================== +In this window, the path to ECOGEN's working directory must be correctly specified to ensure the operation of the ECOGEN_GUI interface. At the time of validation, if the chosen directory does not contain the main input file of the code *ECOGEN.xml*, an error message will appear and the user will again be prompted to modify the directory (see section :ref:`Sec:tuto:mainXML` for details on the main input file *ECOGEN.xml*). + +Links to external tools +======================= +It is an option you can use in ECOGEN_GUI. It is possible to specify the link to external application executables which can be frequently used during a simulation session via ECOGEN. Once these links are effective, it will be possible to call the corresponding applications via the menu (1) of the main window (*Tools*). \ No newline at end of file diff --git a/docs/sphinx_docs/source/Chap8_GUI.rst b/docs/sphinx_docs/source/Chap8_GUI.rst new file mode 100644 index 00000000..a3b4ffe6 --- /dev/null +++ b/docs/sphinx_docs/source/Chap8_GUI.rst @@ -0,0 +1,14 @@ +.. _Chap:GUI: + +Graphical User Interface +======================== + +A beta version of Graphical User Interface (GUI) is available on demand for editing input files of ECOGEN V2.0. + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + Chap8_1Overview + + \ No newline at end of file diff --git a/docs/sphinx_docs/source/_static/IO/immBound.gif b/docs/sphinx_docs/source/_static/IO/immBound.gif new file mode 100644 index 00000000..a17bec71 Binary files /dev/null and b/docs/sphinx_docs/source/_static/IO/immBound.gif differ diff --git a/docs/sphinx_docs/source/_static/IO/modelsFeatures.ods b/docs/sphinx_docs/source/_static/IO/modelsFeatures.ods index 5d4e22a2..c17b4508 100644 Binary files a/docs/sphinx_docs/source/_static/IO/modelsFeatures.ods and b/docs/sphinx_docs/source/_static/IO/modelsFeatures.ods differ diff --git a/docs/sphinx_docs/source/_static/testCases/Euler/Nozzles/pLowMach.png b/docs/sphinx_docs/source/_static/testCases/Euler/Nozzles/pLowMach.png new file mode 100644 index 00000000..dec1f5e9 Binary files /dev/null and b/docs/sphinx_docs/source/_static/testCases/Euler/Nozzles/pLowMach.png differ diff --git a/docs/sphinx_docs/source/_static/testCases/Euler/Nozzles/vLowMach.png b/docs/sphinx_docs/source/_static/testCases/Euler/Nozzles/vLowMach.png new file mode 100644 index 00000000..785e149d Binary files /dev/null and b/docs/sphinx_docs/source/_static/testCases/Euler/Nozzles/vLowMach.png differ diff --git a/docs/sphinx_docs/source/_static/tutos/exportGmshFile/export.png b/docs/sphinx_docs/source/_static/tutos/exportGmshFile/export.png new file mode 100644 index 00000000..f692082c Binary files /dev/null and b/docs/sphinx_docs/source/_static/tutos/exportGmshFile/export.png differ diff --git a/docs/sphinx_docs/source/_static/tutos/exportGmshFile/partition.png b/docs/sphinx_docs/source/_static/tutos/exportGmshFile/partition.png new file mode 100644 index 00000000..a4a063cd Binary files /dev/null and b/docs/sphinx_docs/source/_static/tutos/exportGmshFile/partition.png differ diff --git a/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/nozzle.png b/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/nozzle.png new file mode 100644 index 00000000..b0e0a057 Binary files /dev/null and b/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/nozzle.png differ diff --git a/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/p.png b/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/p.png new file mode 100644 index 00000000..0e6511ed Binary files /dev/null and b/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/p.png differ diff --git a/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/ux.png b/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/ux.png new file mode 100644 index 00000000..f297b746 Binary files /dev/null and b/docs/sphinx_docs/source/_static/tutos/restartMeshMapping/ux.png differ diff --git a/docs/sphinx_docs/source/conf.py b/docs/sphinx_docs/source/conf.py index 65b8edd8..94d922d9 100644 --- a/docs/sphinx_docs/source/conf.py +++ b/docs/sphinx_docs/source/conf.py @@ -23,13 +23,13 @@ # -- Project information ----------------------------------------------------- project = 'ECOGEN' -copyright = '2022, code-mphi' +copyright = '2023, code-mphi' author = 'code-mphi' # The short X.Y version -version = '3.1' +version = '4.0' # The full version, including alpha/beta/rc tags -release = '3.1' +release = '4.0' # -- General configuration --------------------------------------------------- @@ -81,7 +81,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = 'en' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/docs/sphinx_docs/source/index.rst b/docs/sphinx_docs/source/index.rst index f418b40b..5fb15b3d 100644 --- a/docs/sphinx_docs/source/index.rst +++ b/docs/sphinx_docs/source/index.rst @@ -31,6 +31,7 @@ Interested developers are encouraged to contribute in the project using the "pul Chap5_testCases_Chapter Chap6_developersGuide_Chapter Chap7_license + Chap8_GUI zBibliography diff --git a/libEOS/IG_RT_dynamicViscosity.xml b/libEOS/IG_RT_dynamicViscosity.xml index 9728d981..1e05d789 100644 --- a/libEOS/IG_RT_dynamicViscosity.xml +++ b/libEOS/IG_RT_dynamicViscosity.xml @@ -1,6 +1,6 @@ - + - + - + - + - + - + - + diff --git a/libEOS/IG_dodVap_cavitation.xml b/libEOS/IG_dodVap_cavitation.xml new file mode 100644 index 00000000..24ce0a53 --- /dev/null +++ b/libEOS/IG_dodVap_cavitation.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/libEOS/IG_gaz1.xml b/libEOS/IG_gaz1.xml index 2531dc33..8680aa03 100644 --- a/libEOS/IG_gaz1.xml +++ b/libEOS/IG_gaz1.xml @@ -1,6 +1,6 @@ - + - + - + - + - + - + - + - + diff --git a/libEOS/IG_waterVap_298_474.xml b/libEOS/IG_waterVap_298_474.xml index bc807726..f79c7a1e 100644 --- a/libEOS/IG_waterVap_298_474.xml +++ b/libEOS/IG_waterVap_298_474.xml @@ -1,6 +1,6 @@ - + diff --git a/libEOS/IG_waterVap_300_500.xml b/libEOS/IG_waterVap_300_500.xml index db0c2e19..ee0f9a24 100644 --- a/libEOS/IG_waterVap_300_500.xml +++ b/libEOS/IG_waterVap_300_500.xml @@ -1,6 +1,6 @@ - + diff --git a/libEOS/IG_waterVap_ApplaudMedical.xml b/libEOS/IG_waterVap_ApplaudMedical.xml new file mode 100644 index 00000000..c06be1cd --- /dev/null +++ b/libEOS/IG_waterVap_ApplaudMedical.xml @@ -0,0 +1,14 @@ + + + + + + + + \ No newline at end of file diff --git a/libEOS/IG_waterVap_cavitation.xml b/libEOS/IG_waterVap_cavitation.xml new file mode 100644 index 00000000..ee9c18b3 --- /dev/null +++ b/libEOS/IG_waterVap_cavitation.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/libEOS/IG_waterVap_venturi.xml b/libEOS/IG_waterVap_venturi.xml new file mode 100644 index 00000000..55bae31d --- /dev/null +++ b/libEOS/IG_waterVap_venturi.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/libEOS/NASG_dodLiq.xml b/libEOS/NASG_dodLiq.xml index 3236f6f3..5ff610ee 100644 --- a/libEOS/NASG_dodLiq.xml +++ b/libEOS/NASG_dodLiq.xml @@ -1,6 +1,6 @@ - + diff --git a/libEOS/NASG_waterLiq.xml b/libEOS/NASG_waterLiq.xml index a175e9a9..b8042b47 100644 --- a/libEOS/NASG_waterLiq.xml +++ b/libEOS/NASG_waterLiq.xml @@ -1,6 +1,6 @@ - + - + diff --git a/libEOS/Polynomial_arbitrary.xml b/libEOS/Polynomial_arbitrary.xml index 7159a6d3..de680188 100644 --- a/libEOS/Polynomial_arbitrary.xml +++ b/libEOS/Polynomial_arbitrary.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/libEOS/SG_HMX.xml b/libEOS/SG_HMX.xml new file mode 100644 index 00000000..fd8aea17 --- /dev/null +++ b/libEOS/SG_HMX.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/libEOS/SG_dodLiq.xml b/libEOS/SG_dodLiq.xml index 086fa894..a21c1d64 100644 --- a/libEOS/SG_dodLiq.xml +++ b/libEOS/SG_dodLiq.xml @@ -1,6 +1,6 @@ - + diff --git a/libEOS/SG_dodLiq_cavitation.xml b/libEOS/SG_dodLiq_cavitation.xml new file mode 100644 index 00000000..81eb05fe --- /dev/null +++ b/libEOS/SG_dodLiq_cavitation.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/libEOS/SG_epoxy.xml b/libEOS/SG_epoxy.xml index 6b48b970..e9da2f8c 100644 --- a/libEOS/SG_epoxy.xml +++ b/libEOS/SG_epoxy.xml @@ -1,6 +1,6 @@ - + - + - + - + + + + + + + + diff --git a/libEOS/SG_water.xml b/libEOS/SG_water.xml index acdab0a4..6e9a3d3e 100644 --- a/libEOS/SG_water.xml +++ b/libEOS/SG_water.xml @@ -1,6 +1,6 @@ - + - + - + - + - + - + diff --git a/libEOS/SG_waterLiq_300_500.xml b/libEOS/SG_waterLiq_300_500.xml index 97025685..95aa8444 100644 --- a/libEOS/SG_waterLiq_300_500.xml +++ b/libEOS/SG_waterLiq_300_500.xml @@ -1,6 +1,6 @@ - + diff --git a/libEOS/SG_waterLiq_cavitation.xml b/libEOS/SG_waterLiq_cavitation.xml new file mode 100644 index 00000000..7a099576 --- /dev/null +++ b/libEOS/SG_waterLiq_cavitation.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + diff --git a/libEOS/SG_waterLiq_venturi.xml b/libEOS/SG_waterLiq_venturi.xml new file mode 100644 index 00000000..775691a8 --- /dev/null +++ b/libEOS/SG_waterLiq_venturi.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/libEOS/SG_water_ApplaudMedical.xml b/libEOS/SG_water_ApplaudMedical.xml new file mode 100644 index 00000000..302af744 --- /dev/null +++ b/libEOS/SG_water_ApplaudMedical.xml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/libEOS/SG_water_cavitation.xml b/libEOS/SG_water_cavitation.xml index ff0b702a..b2af1ff3 100644 --- a/libEOS/SG_water_cavitation.xml +++ b/libEOS/SG_water_cavitation.xml @@ -1,6 +1,6 @@ - + - + \ No newline at end of file diff --git a/libMeshes/cylinder/cylinderStructured.geo b/libMeshes/cylinder/cylinderStructured.geo index 0eab47c9..7a8a4714 100644 --- a/libMeshes/cylinder/cylinderStructured.geo +++ b/libMeshes/cylinder/cylinderStructured.geo @@ -8,7 +8,7 @@ refZ = 0; // --- Mesh parameters --- Nr = 10; // Nb of cell along the radius Ntheta = 5; // Nb of cells along the azimuth -Nz = 25; // Nb of cells along cylinder height +Nz = 100; // Nb of cells along cylinder height // Design parameters r = 0.2; @@ -75,14 +75,147 @@ Line Loop(5) = {5, 6, 7, 8}; Plane Surface(5) = {5}; Transfinite Surface{5}; Recombine Surface{5}; -// Extend in z-direction to get cylinder -Extrude{0,0,h} { Surface{1:5}; Layers{Nz}; Recombine; } +// ------- + +// Outflow circle center +posZOutflow = refZ+h; +Point(10) = {refX, refY, posZOutflow}; + +// Outflow circle +Point(11) = {refX+r, refY, posZOutflow}; +Point(12) = {refX, refY+r, posZOutflow}; +Point(13) = {refX-r, refY, posZOutflow}; +Point(14) = {refX, refY-r, posZOutflow}; + +Circle(13) = {11,10,12}; +Circle(14) = {12,10,13}; +Circle(15) = {13,10,14}; +Circle(16) = {14,10,11}; + +// O-grid +Point(15) = {refX+rOgrid, refY, posZOutflow}; +Point(16) = {refX, refY+rOgrid, posZOutflow}; +Point(17) = {refX-rOgrid, refY, posZOutflow}; +Point(18) = {refX, refY-rOgrid, posZOutflow}; + +Line(17) = {15, 16}; +Line(18) = {16, 17}; +Line(19) = {17,18}; +Line(20) = {18, 15}; + +// Linking outflow circle and O-grid +Line(21) = {11, 15}; +Line(22) = {12, 16}; +Line(23) = {13, 17}; +Line(24) = {14, 18}; + +// Structured mesh definition outside O-grid +Transfinite Line{13:16} = Ntheta; // Nb of cells for each circle azimuth +Transfinite Line{17:20} = Ntheta; // Nb of cells for each O-grid side +Transfinite Line{21:24} = Nr; // Nb of cells along the radius + +// Cross surface outflow outside O-grid +Line Loop(6) = {17, -22, -13, 21}; Plane Surface(6) = {6}; +Line Loop(7) = {18, -23, -14, 22}; Plane Surface(7) = {7}; +Line Loop(8) = {19, -24, -15, 23}; Plane Surface(8) = {8}; +Line Loop(9) = {20, -21, -16, 24}; Plane Surface(9) = {9}; + +// Structured outflow surface outside O-grid +Transfinite Surface{6:9}; +Recombine Surface{6:9}; + +// Structured mesh definition inside O-grid +Line Loop(10) = {17, 18, 19, 20}; Plane Surface(10) = {10}; +Transfinite Surface{10}; +Recombine Surface{10}; + +// ------- + +// Links inflow to outflow + +Line(25) = {2, 11}; +Line(26) = {3, 12}; +Line(27) = {4, 13}; +Line(28) = {5, 14}; + +// Links inflow O-grid to outflow O-grid + +Line(29) = {6, 15}; +Line(30) = {7, 16}; +Line(31) = {8, 17}; +Line(32) = {9, 18}; + +Transfinite Line{25:32} = Nz; // Nb of cells along the cylinder length + +// ------- + +// Plane surfaces outside O-grid linking inflow/outflow +Line Loop(11) = {29, -21, -25, 9}; Plane Surface(11) = {11}; +Line Loop(12) = {30, -22, -26, 10}; Plane Surface(12) = {12}; +Line Loop(13) = {31, -23, -27, 11}; Plane Surface(13) = {13}; +Line Loop(14) = {32, -24, -28, 12}; Plane Surface(14) = {14}; + +// Structured surfaces +Transfinite Surface{11:14}; +Recombine Surface{11:14}; + +// Plane surfaces O-grid linking inflow/outflow +Line Loop(15) = {29, 17, -30, -5}; Plane Surface(15) = {15}; +Line Loop(16) = {30, 18, -31, -6}; Plane Surface(16) = {16}; +Line Loop(17) = {31, 19, -32, -7}; Plane Surface(17) = {17}; +Line Loop(18) = {32, 20, -29, -8}; Plane Surface(18) = {18}; + +// Structured surfaces +Transfinite Surface{15:18}; +Recombine Surface{15:18}; + +// ------- + +// Curved surfaces cylinder linking inflow/outflow +Line Loop(19) = {25, 13, -26, -1}; Surface(19) = {19}; +Line Loop(20) = {26, 14, -27, -2}; Surface(20) = {20}; +Line Loop(21) = {27, 15, -28, -3}; Surface(21) = {21}; +Line Loop(22) = {28, 16, -25, -4}; Surface(22) = {22}; + +// Structured surfaces +Transfinite Surface{19:22}; +Recombine Surface{19:22}; + +// ------- + +// Volume between O-grids +Surface Loop(1) = {5, 15, 16, 17, 18, 10}; +Volume(1) = {1}; +Transfinite Volume{1}; +Recombine Volume{1}; + +// Volume 1/4 cylinder +Surface Loop(2) = {1, 11, 12, 15, 19, 6}; +Volume(2) = {2}; +Transfinite Volume{2}; +Recombine Volume{2}; + +// Volume 2/4 cylinder +Surface Loop(3) = {2, 12, 13, 16, 20, 7}; +Volume(3) = {3}; +Transfinite Volume{3}; +Recombine Volume{3}; + +// Volume 3/4 cylinder +Surface Loop(4) = {3, 13, 14, 17, 21, 8}; +Volume(4) = {4}; +Transfinite Volume{4}; +Recombine Volume{4}; + +// Volume 4/4 cylinder +Surface Loop(5) = {4, 11, 14, 18, 22, 9}; +Volume(5) = {5}; +Transfinite Volume{5}; +Recombine Volume{5}; // Physical boundaries/volume -Physical Surface(boundCondInflow) = {1,2,3,4,5}; -Physical Surface(boundCondOutflow) = {34,56,78,100,122}; -Physical Surface(boundCondWalls) = {29,51,73,95}; +Physical Surface(boundCondInflow) = {1:5}; +Physical Surface(boundCondOutflow) = {6:10}; +Physical Surface(boundCondWalls) = {19:22}; -Surface Loop(6) = {1,2,3,4,5, 29,51,95,73, 34,56,78,100,122}; -Volume(10) = {6}; -Physical Volume(fluidVolume) = {10}; \ No newline at end of file +Physical Volume(fluidVolume) = {1:5}; \ No newline at end of file diff --git a/libMeshes/disc/discStructTwoRegions.geo b/libMeshes/disc/discStructTwoRegions.geo index 581e7eae..f43463a4 100644 --- a/libMeshes/disc/discStructTwoRegions.geo +++ b/libMeshes/disc/discStructTwoRegions.geo @@ -6,19 +6,19 @@ refY = 0; refZ = 0; // --- Mesh parameters --- -NrExt = 10; // Nb of cell along the radius on external zone -NrInt = 10; // Nb of cell along the radius on internal zone -Ntheta = 5; // Nb of cells along the azimuth +NrExt = 15; // Nb of cell along the radius on external zone +NrInt = 25; // Nb of cell along the radius on internal zone +Ntheta = 10; // Nb of cells along the azimuth // --- Design parameters --- rExt = 0.2; // External radius of the disc -rInt = rExt/3.; // Internal radius for fluid domain interface +rInt = rExt/1.5; // Internal radius for fluid domain interface rMin = rInt/10.; // Minimum radius for O-grid construction // --- Boundary conditions --- boundCondWalls = 1; -fluidInt = 10; -fluidExt = 11; +fluidInt = 11; +fluidExt = 10; // --- Geometry --- diff --git a/libMeshes/disc/discUnstructTwoRegions.geo b/libMeshes/disc/discUnstructTwoRegions.geo new file mode 100644 index 00000000..63eebc1d --- /dev/null +++ b/libMeshes/disc/discUnstructTwoRegions.geo @@ -0,0 +1,114 @@ +// --- 2D structured disc with O-grid and two fluid domains --- + +// --- Reference frame --- +refX = 0; +refY = 0; +refZ = 0; + +// --- Mesh parameters --- +NrExt = 15; // Nb of cell along the radius on external zone +NrInt = 25; // Nb of cell along the radius on internal zone +Ntheta = 10; // Nb of cells along the azimuth +dx = 0.015; + +// --- Design parameters --- +rExt = 0.2; // External radius of the disc +rInt = rExt/1.5; // Internal radius for fluid domain interface +rMin = rInt/10.; // Minimum radius for O-grid construction + +// --- Boundary conditions --- +boundCondWalls = 1; +fluidInt = 11; +fluidExt = 10; + +// --- Geometry --- + +// Center of all circles +Point(1) = {refX, refY, refZ, dx}; + +// External circle +Point(2) = {refX+rExt, refY, refZ, dx}; +Point(3) = {refX, refY+rExt, refZ, dx}; +Point(4) = {refX-rExt, refY, refZ, dx}; +Point(5) = {refX, refY-rExt, refZ, dx}; + +Circle(1) = {2,1,3}; +Circle(2) = {3,1,4}; +Circle(3) = {4,1,5}; +Circle(4) = {5,1,2}; + +// Internal circle +Point(6) = {refX+rInt, refY, refZ, dx}; +Point(7) = {refX, refY+rInt, refZ, dx}; +Point(8) = {refX-rInt, refY, refZ, dx}; +Point(9) = {refX, refY-rInt, refZ, dx}; + +Circle(5) = {6,1,7}; +Circle(6) = {7,1,8}; +Circle(7) = {8,1,9}; +Circle(8) = {9,1,6}; + +// Linking external/internal circle's +/* Line(9) = {2, 6}; +Line(10) = {3, 7}; +Line(11) = {4, 8}; +Line(12) = {5, 9}; */ + +// Structured mesh definition outside rInt +/* Transfinite Line{1:4} = Ntheta; // Nb of cells for each circle azimuth +Transfinite Line{5:8} = Ntheta; // Nb of cells for outside rInt +Transfinite Line{9:12} = NrExt; // Nb of cells along the radius + */ +// Surface outside rInt +Line Loop(1) = {1, 2, 3, 4}; +Line Loop(2) = {5, 6, 7, 8}; +Plane Surface(1) = {1,2}; +/* Line Loop(1) = {5, -10, -1, 9}; Plane Surface(1) = {1}; +Line Loop(2) = {6, -11, -2, 10}; Plane Surface(2) = {2}; +Line Loop(3) = {7, -12, -3, 11}; Plane Surface(3) = {3}; +Line Loop(4) = {8, -9, -4, 12}; Plane Surface(4) = {4}; + */ +// Structured surface outside rInt +/* Transfinite Surface{1:4}; +Recombine Surface{1:4}; */ + +// Structured mesh definition inside rInt +//O-grid +/* Point(10) = {refX+rMin, refY, refZ}; +Point(11) = {refX, refY+rMin, refZ}; +Point(12) = {refX-rMin, refY, refZ}; +Point(13) = {refX, refY-rMin, refZ}; +Line(13) = {10, 11}; +Line(14) = {11, 12}; +Line(15) = {12, 13}; +Line(16) = {13, 10}; +// Linking internal circle and O-grid +Line(17) = {6, 10}; +Line(18) = {7, 11}; +Line(19) = {8, 12}; +Line(20) = {9, 13}; */ +// Structured mesh +/* Transfinite Line{5:8} = Ntheta; // Nb of cells for inside rInt +Transfinite Line{13:16} = Ntheta; // Nb of cells for O-grid +Transfinite Line{17:20} = NrInt; // Nb of cells along the radius */ +// Surface definition between rInt and rMin +//Line Loop(5) = {5, 6, 7, 8}; +Plane Surface(2) = {2}; +/* Line Loop(5) = {5, 18, -13, -17}; Plane Surface(5) = {5}; +Line Loop(6) = {6, 19, -14, -18}; Plane Surface(6) = {6}; +Line Loop(7) = {7, 20, -15, -19}; Plane Surface(7) = {7}; +Line Loop(8) = {8, 17, -16, -20}; Plane Surface(8) = {8}; */ +// Structured surface between rInt and rMin +/* Transfinite Surface{5:8}; +Recombine Surface{5:8}; */ +// Structured mesh inside rMin +//Line Loop(9) = {13, 14, 15, 16}; Plane Surface(9) = {9}; +/* Transfinite Surface{9}; +Recombine Surface{9}; */ + +// --- Physical boundaries/volume --- +Physical Line(boundCondWalls) = {1, 2, 3, 4}; +/* Physical Surface(fluidInt) = {5, 6, 7, 8, 9}; +Physical Surface(fluidExt) = {1, 2, 3, 4}; */ +Physical Surface(fluidInt) = {2}; +Physical Surface(fluidExt) = {1}; \ No newline at end of file diff --git a/libMeshes/foil/naca66-312_unstruct_aoa6d.geo b/libMeshes/foil/naca66-312_unstruct_aoa6d.geo index 3e5080e4..a7b161cd 100644 --- a/libMeshes/foil/naca66-312_unstruct_aoa6d.geo +++ b/libMeshes/foil/naca66-312_unstruct_aoa6d.geo @@ -8,11 +8,11 @@ chord = 150.e-3; // Length from leading edge to trailing edge lx = 1.95; // Lenght of the domain ly = 192.e-3; // Height of the domain -// dx1 = 0.0025; // 3k4 -// dx2 = 0.025; +dx1 = 0.0025; // 3k4 +dx2 = 0.025; -dx1 = 0.0015; // 8k9 -dx2 = 0.015; +// dx1 = 0.0015; // 8k9 +// dx2 = 0.015; // dx1 = 0.00125; // 12k // dx2 = 0.0125; @@ -20,6 +20,15 @@ dx2 = 0.015; // dx1 = 0.001; // 19k // dx2 = 0.01; +// dx1 = 0.0004; // 30k +// dx2 = 0.01; + +// dx1 = 0.0001; // 70k + 277k with refine by splitting +// dx2 = 0.012; + +// dx1 = 0.000075; // 140k +// dx2 = 0.008; + // --- Boundary conditions --- boundCondInflow = 1; boundCondOutflow = 2; diff --git a/libMeshes/nozzles/nozzle2D_example.geo b/libMeshes/nozzles/nozzle2D_example.geo new file mode 100644 index 00000000..851fb977 --- /dev/null +++ b/libMeshes/nozzles/nozzle2D_example.geo @@ -0,0 +1,89 @@ +// 2D mesh of a half nozzle + +// rE _ +// rS _ |\__ _ _ _ _ _ +// | \__ ___/| +// | \__ ___/ | +// rC _ | _ _ _ \ / | +// 0 _ |__________|_________| +// +// <---------><--------> +// lConv lDiv + +// Geometry details + +// rE _ 4 +// |\__ +// | \__ +// rS _ | _ _ \__ (3)_ _ _ _ _ _ _ 6 +// | \__ (7)____/| +// |(4) \__ ____/ | +// | \__ ____/ | +// rC _ | _ _ _ _ _ _ \3/ | +// | |(6) +// | "1" (2)| "2" | +// | | +// 0 _ |___________________|________________| +// 1 (1) 2 (5) 5 +// <-------------------><-------------> +// lConv lDiv + +//----------------- DATA ----------------- + +// Geo parameters +rE = 0.3; +rC = 0.1; +rS = 0.3; +lConv = 5.; +lDiv = 5.; + +// Number of cells x-dir. +nbxLConv = 100; +nbxLDiv = 100; + +// Number of cells y-dir. +nby = 1; + +// Boundary condition numbers +bcAxis = 1; +bcWall = 2; +bcInlet = 3; +bcOutlet = 4; +surfFluid = 10; + +//----------------- GEO ----------------- + +// Geometry convergent +Point(1) = {0, 0, 0}; +Point(2) = {lConv, 0, 0}; +Point(3) = {lConv, rC, 0}; +Point(4) = {0, rE, 0}; +Line(1) = {1,2}; +Line(2) = {2,3}; +Line(3) = {3,4}; +Line(4) = {4,1}; +Line Loop(1) = {1,2,3,4}; +Plane Surface(1) = {1}; + +// Geometry divergent +Point(5) = {lConv+lDiv, 0, 0}; +Point(6) = {lConv+lDiv, rS, 0}; +Line(5) = {2,5}; +Line(6) = {5,6}; +Line(7) = {6,3}; +Line Loop(2) = {5,6,7,-2}; +Plane Surface(2) = {2}; + +// Structured mesh +Transfinite Line {1,3} = nbxLConv; +Transfinite Line {5,7} = nbxLDiv; +Transfinite Line {2,4,6} = nby; +Transfinite Surface "*"; +Recombine Surface "*"; + +// Boundary conditions and fluid domain +Physical Line(bcAxis) = {1,5}; +Physical Line(bcWall) = {3,7}; +Physical Line(bcInlet) = {4}; +Physical Line(bcOutlet) = {6}; +Physical Surface(surfFluid) = {1,2}; diff --git a/libMeshes/nozzles/nozzle2D_longThroat_par.geo b/libMeshes/nozzles/nozzle2D_longThroat_par.geo new file mode 100644 index 00000000..483e9451 --- /dev/null +++ b/libMeshes/nozzles/nozzle2D_longThroat_par.geo @@ -0,0 +1,120 @@ +// 2D mesh of a half nozzle with long throat + +// rE _ _________________ +// rS _ | _ _ _ _ _ _|\__ _ _ _ _ _ _ _ _ _ _______ +// | | \__ ___/| | +// | | \__ ___/ | | +// rC _ | _ _ _ _ _ _| _ _ _ \ ___________ / | | +// 0 _ |_________________|__________|___________|_________|_______| +// +// <-----------------><---------><----------><--------><------> +// lE lConv lCol lDiv lS + + +// Geometry details + +// rE _ 4__________(3)_________3 +// | |\__ +// | \__ +// rS _ | _ _ _ _ _ _ _ | _ _ \__ (7)_ _ _ _ _ _ _ _ _ _ _ _ _ _ 10_______(16)_______12 +// | \__ ____/ | +// |(4) (2)| \__ (13)____/ | | +// | "1" \__ ____/ | +// rC _ | _ _ _ _ _ _ _ | _ _ _ _ _ _ \6_______(10)_______8/ |(12) "5" |(15) +// | | +// | | (6)| |(9) | | +// | "2" "3" "4" | +// 0 _ |______________________|___________________|__________________| _______________|__________________| +// 1 (1) 2 (5) 5 (8) 7 (11) 9 (14) 11 +// <----------------------><------------------><-----------------><---------------><-----------------> +// lE lConv lCol lDiv lS + +//----------------- DATA ----------------- + +// Geo parameters +rE = 0.13; rC = 0.04; rS = 0.13; +lE = 0.05; lConv = 0.2; lCol = 0.05; lDiv = 0.2; lS = 0.05; + +// Cells x-direction +nbxLE = 5; +nbxLConv = 20; +nbxLCol = 5; +nbxLDiv = 20; +nbxLS = 5; + +// Cells y-direction +nby = 10; + +// Boundary condition numbers +bcAxis = 1; +bcWall = 2; +bcInlet = 3; +bcOutlet = 4; +surfFluid = 10; + +//----------------- GEO ----------------- + +// Geometry inlet +Point(1) = {0, 0, 0}; +Point(2) = {lE, 0, 0}; +Point(3) = {lE, rE, 0}; +Point(4) = {0, rE, 0}; +Line(1) = {1,2}; +Line(2) = {2,3}; +Line(3) = {3,4}; +Line(4) = {4,1}; +Line Loop(1) = {1,2,3,4}; +Plane Surface(1) = {1}; + +// Geometry convergent +Point(5) = {lE+lConv, 0, 0}; +Point(6) = {lE+lConv, rC, 0}; +Line(5) = {2,5}; +Line(6) = {5,6}; +Line(7) = {6,3}; +Line Loop(2) = {-2,5,6,7}; +Plane Surface(2) = {2}; + +// Geometry throat +Point(7) = {lE+lConv+lCol, 0, 0}; +Point(8) = {lE+lConv+lCol, rC, 0}; +Line(8) = {5,7}; +Line(9) = {7,8}; +Line(10) = {8,6}; +Line Loop(3) = {-6,8,9,10}; +Plane Surface(3) = {3}; + +// Geometry divergent +Point(9) = {lE+lConv+lCol+lDiv, 0, 0}; +Point(10) = {lE+lConv+lCol+lDiv, rS, 0}; +Line(11) = {7,9}; +Line(12) = {9,10}; +Line(13) = {10,8}; +Line Loop(4) = {-9,11,12,13}; +Plane Surface(4) = {4}; + +// Geometry outlet +Point(11) = {lE+lConv+lCol+lDiv+lS, 0, 0}; +Point(12) = {lE+lConv+lCol+lDiv+lS, rS, 0}; +Line(14) = {9,11}; +Line(15) = {11,12}; +Line(16) = {12,10}; +Line Loop(5) = {-12,14,15,16}; +Plane Surface(5) = {5}; + +// Structured mesh +Transfinite Line {1,3} = nbxLE; +Transfinite Line {5,7} = nbxLConv; +Transfinite Line {8,10} = nbxLCol; +Transfinite Line {11,13} = nbxLDiv; +Transfinite Line {14,16} = nbxLS; +Transfinite Line {2,4,6,9,12,15} = nby; +Transfinite Surface "*"; +Recombine Surface "*"; + +// Boundary conditions and fluid domain +Physical Line(bcAxis) = {1,5,8,11,14}; +Physical Line(bcWall) = {3,7,10,13,16}; +Physical Line(bcInlet) = {4}; +Physical Line(bcOutlet) = {15}; +Physical Surface(surfFluid) = {1,2,3,4,5}; diff --git a/libMeshes/nozzles/nozzle2D_longThroat_seq.geo b/libMeshes/nozzles/nozzle2D_longThroat_seq.geo new file mode 100644 index 00000000..483e9451 --- /dev/null +++ b/libMeshes/nozzles/nozzle2D_longThroat_seq.geo @@ -0,0 +1,120 @@ +// 2D mesh of a half nozzle with long throat + +// rE _ _________________ +// rS _ | _ _ _ _ _ _|\__ _ _ _ _ _ _ _ _ _ _______ +// | | \__ ___/| | +// | | \__ ___/ | | +// rC _ | _ _ _ _ _ _| _ _ _ \ ___________ / | | +// 0 _ |_________________|__________|___________|_________|_______| +// +// <-----------------><---------><----------><--------><------> +// lE lConv lCol lDiv lS + + +// Geometry details + +// rE _ 4__________(3)_________3 +// | |\__ +// | \__ +// rS _ | _ _ _ _ _ _ _ | _ _ \__ (7)_ _ _ _ _ _ _ _ _ _ _ _ _ _ 10_______(16)_______12 +// | \__ ____/ | +// |(4) (2)| \__ (13)____/ | | +// | "1" \__ ____/ | +// rC _ | _ _ _ _ _ _ _ | _ _ _ _ _ _ \6_______(10)_______8/ |(12) "5" |(15) +// | | +// | | (6)| |(9) | | +// | "2" "3" "4" | +// 0 _ |______________________|___________________|__________________| _______________|__________________| +// 1 (1) 2 (5) 5 (8) 7 (11) 9 (14) 11 +// <----------------------><------------------><-----------------><---------------><-----------------> +// lE lConv lCol lDiv lS + +//----------------- DATA ----------------- + +// Geo parameters +rE = 0.13; rC = 0.04; rS = 0.13; +lE = 0.05; lConv = 0.2; lCol = 0.05; lDiv = 0.2; lS = 0.05; + +// Cells x-direction +nbxLE = 5; +nbxLConv = 20; +nbxLCol = 5; +nbxLDiv = 20; +nbxLS = 5; + +// Cells y-direction +nby = 10; + +// Boundary condition numbers +bcAxis = 1; +bcWall = 2; +bcInlet = 3; +bcOutlet = 4; +surfFluid = 10; + +//----------------- GEO ----------------- + +// Geometry inlet +Point(1) = {0, 0, 0}; +Point(2) = {lE, 0, 0}; +Point(3) = {lE, rE, 0}; +Point(4) = {0, rE, 0}; +Line(1) = {1,2}; +Line(2) = {2,3}; +Line(3) = {3,4}; +Line(4) = {4,1}; +Line Loop(1) = {1,2,3,4}; +Plane Surface(1) = {1}; + +// Geometry convergent +Point(5) = {lE+lConv, 0, 0}; +Point(6) = {lE+lConv, rC, 0}; +Line(5) = {2,5}; +Line(6) = {5,6}; +Line(7) = {6,3}; +Line Loop(2) = {-2,5,6,7}; +Plane Surface(2) = {2}; + +// Geometry throat +Point(7) = {lE+lConv+lCol, 0, 0}; +Point(8) = {lE+lConv+lCol, rC, 0}; +Line(8) = {5,7}; +Line(9) = {7,8}; +Line(10) = {8,6}; +Line Loop(3) = {-6,8,9,10}; +Plane Surface(3) = {3}; + +// Geometry divergent +Point(9) = {lE+lConv+lCol+lDiv, 0, 0}; +Point(10) = {lE+lConv+lCol+lDiv, rS, 0}; +Line(11) = {7,9}; +Line(12) = {9,10}; +Line(13) = {10,8}; +Line Loop(4) = {-9,11,12,13}; +Plane Surface(4) = {4}; + +// Geometry outlet +Point(11) = {lE+lConv+lCol+lDiv+lS, 0, 0}; +Point(12) = {lE+lConv+lCol+lDiv+lS, rS, 0}; +Line(14) = {9,11}; +Line(15) = {11,12}; +Line(16) = {12,10}; +Line Loop(5) = {-12,14,15,16}; +Plane Surface(5) = {5}; + +// Structured mesh +Transfinite Line {1,3} = nbxLE; +Transfinite Line {5,7} = nbxLConv; +Transfinite Line {8,10} = nbxLCol; +Transfinite Line {11,13} = nbxLDiv; +Transfinite Line {14,16} = nbxLS; +Transfinite Line {2,4,6,9,12,15} = nby; +Transfinite Surface "*"; +Recombine Surface "*"; + +// Boundary conditions and fluid domain +Physical Line(bcAxis) = {1,5,8,11,14}; +Physical Line(bcWall) = {3,7,10,13,16}; +Physical Line(bcInlet) = {4}; +Physical Line(bcOutlet) = {15}; +Physical Surface(surfFluid) = {1,2,3,4,5}; diff --git a/libMeshes/nozzles/nozzle2D_nullFlux.geo b/libMeshes/nozzles/nozzle2D_nullFlux.geo new file mode 100644 index 00000000..040650d1 --- /dev/null +++ b/libMeshes/nozzles/nozzle2D_nullFlux.geo @@ -0,0 +1,89 @@ +// 2D mesh of a half nozzle + +// rE _ +// rS _ |\__ _ _ _ _ _ +// | \__ ___/| +// | \__ ___/ | +// rC _ | _ _ _ \ / | +// 0 _ |__________|_________| +// +// <---------><--------> +// lConv lDiv + +// Geometry details + +// rE _ 4 +// |\__ +// | \__ +// rS _ | _ _ \__ (3)_ _ _ _ _ _ _ 6 +// | \__ (7)____/| +// |(4) \__ ____/ | +// | \__ ____/ | +// rC _ | _ _ _ _ _ _ \3/ | +// | |(6) +// | "1" (2)| "2" | +// | | +// 0 _ |___________________|________________| +// 1 (1) 2 (5) 5 +// <-------------------><-------------> +// lConv lDiv + +//----------------- DATA ----------------- + +// Geo parameters +rE = 0.5; +rC = 0.4; +rS = 0.5; +lConv = 0.5; +lDiv = 0.5; + +// Number of cells x-dir. +nbxLConv = 20; +nbxLDiv = 20; + +// Number of cells y-dir. +nby = 1; + +// Boundary condition numbers +bcAxis = 1; +bcWall = 2; +bcInlet = 3; +bcOutlet = 4; +surfFluid = 10; + +//----------------- GEO ----------------- + +// Geometry convergent +Point(1) = {0, 0, 0}; +Point(2) = {lConv, 0, 0}; +Point(3) = {lConv, rC, 0}; +Point(4) = {0, rE, 0}; +Line(1) = {1,2}; +Line(2) = {2,3}; +Line(3) = {3,4}; +Line(4) = {4,1}; +Line Loop(1) = {1,2,3,4}; +Plane Surface(1) = {1}; + +// Geometry divergent +Point(5) = {lConv+lDiv, 0, 0}; +Point(6) = {lConv+lDiv, rS, 0}; +Line(5) = {2,5}; +Line(6) = {5,6}; +Line(7) = {6,3}; +Line Loop(2) = {5,6,7,-2}; +Plane Surface(2) = {2}; + +// Structured mesh +Transfinite Line {1,3} = nbxLConv; +Transfinite Line {5,7} = nbxLDiv; +Transfinite Line {2,4,6} = nby; +Transfinite Surface "*"; +Recombine Surface "*"; + +// Boundary conditions and fluid domain +Physical Line(bcAxis) = {1,5}; +Physical Line(bcWall) = {3,7}; +Physical Line(bcInlet) = {4}; +Physical Line(bcOutlet) = {6}; +Physical Surface(surfFluid) = {1,2}; diff --git a/libMeshes/nozzles/nozzle2D_par.geo b/libMeshes/nozzles/nozzle2D_par.geo deleted file mode 100644 index d963e3a7..00000000 --- a/libMeshes/nozzles/nozzle2D_par.geo +++ /dev/null @@ -1,110 +0,0 @@ -// Maillage Tuyere 2D -// -// rE _ _________________ -// rS _ | _ _ _ _ _ _|\__ _ _ _ _ _ _ _ _ _ _______ -// | | \__ ___/| | -// | | \__ ___/ | | -// rC _ | _ _ _ _ _ _| _ _ _ \ ___________ / | | -// 0 _ |_________________|__________|___________|_________|_______| -// -// <-----------------><---------><----------><--------><------> -// lE lConv lCol lDiv lS -// -// - -//Maillage Tuyere 2D - Details geometrie - - // rE _ 4__________(3)_________3 - // | |\__ - // | \__ - // rS _ | _ _ _ _ _ _ _ | _ _ \__ (7)_ _ _ _ _ _ _ _ _ _ _ _ _ _ 10_______(16)_______12 - // | \__ ____/ | - // |(4) (2)| \__ (13)____/ | | - // | "1" \__ ____/ | - // rC _ | _ _ _ _ _ _ _ | _ _ _ _ _ _ \6_______(10)_______8/ |(12) "5" |(15) - // | | - // | | (6)| |(9) | | - // | "2" "3" "4" | - // 0 _ |______________________|___________________|__________________| _______________|__________________| - // 1 (1) 2 (5) 5 (8) 7 (11) 9 (14) 11 - // <----------------------><------------------><-----------------><---------------><-----------------> - // lE lConv lCol lDiv lS - -//---------------------------------DONNEES------------------------------------ -//Dimensions principales -rE = 0.13; rC = 0.04; rS = 0.13; -lE = 0.05; lConv = 0.2; lCol = 0.05; lDiv = 0.2; lS = 0.05; -//Number de mailles selon X -nbxLE = 5; -nbxLConv = 20; -nbxLCol = 5; -nbxLDiv = 20; -nbxLS = 5; -//number de mailles selon Y -nby = 10; -//Numero des conditions aux limites -condLimAxe = 1; -condLimParoi = 2; -condLimEntree = 3; -condLimSortie = 4; -surfaceFluide = 10; -//---------------------------------------------------------------------------- - -//Geometrie Entree -Point(1) = {0, 0, 0}; -Point(2) = {lE, 0, 0}; -Point(3) = {lE, rE, 0}; -Point(4) = {0, rE, 0}; -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; -Line Loop(1) = {1,2,3,4}; -Plane Surface(1) = {1}; -//Geometrie Convergent -Point(5) = {lE+lConv, 0, 0}; -Point(6) = {lE+lConv, rC, 0}; -Line(5) = {2,5}; -Line(6) = {5,6}; -Line(7) = {6,3}; -Line Loop(2) = {-2,5,6,7}; -Plane Surface(2) = {2}; -//Geometrie Col -Point(7) = {lE+lConv+lCol, 0, 0}; -Point(8) = {lE+lConv+lCol, rC, 0}; -Line(8) = {5,7}; -Line(9) = {7,8}; -Line(10) = {8,6}; -Line Loop(3) = {-6,8,9,10}; -Plane Surface(3) = {3}; -//Geometrie Divergent -Point(9) = {lE+lConv+lCol+lDiv, 0, 0}; -Point(10) = {lE+lConv+lCol+lDiv, rS, 0}; -Line(11) = {7,9}; -Line(12) = {9,10}; -Line(13) = {10,8}; -Line Loop(4) = {-9,11,12,13}; -Plane Surface(4) = {4}; -//Geometrie Sortie -Point(11) = {lE+lConv+lCol+lDiv+lS, 0, 0}; -Point(12) = {lE+lConv+lCol+lDiv+lS, rS, 0}; -Line(14) = {9,11}; -Line(15) = {11,12}; -Line(16) = {12,10}; -Line Loop(5) = {-12,14,15,16}; -Plane Surface(5) = {5}; -//Maillages -Transfinite Line {1,3} = nbxLE; -Transfinite Line {5,7} = nbxLConv; -Transfinite Line {8,10} = nbxLCol; -Transfinite Line {11,13} = nbxLDiv; -Transfinite Line {14,16} = nbxLS; -Transfinite Line {2,4,6,9,12,15} = nby; -Transfinite Surface "*"; -Recombine Surface "*"; -//Domaines Physiques et CL -Physical Line(condLimAxe) = {1,5,8,11,14}; -Physical Line(condLimParoi) = {3,7,10,13,16}; -Physical Line(condLimEntree) = {4}; -Physical Line(condLimSortie) = {15}; -Physical Surface(surfaceFluide) = {1,2,3,4,5}; diff --git a/libMeshes/nozzles/nozzle2D_seq.geo b/libMeshes/nozzles/nozzle2D_seq.geo deleted file mode 100644 index d963e3a7..00000000 --- a/libMeshes/nozzles/nozzle2D_seq.geo +++ /dev/null @@ -1,110 +0,0 @@ -// Maillage Tuyere 2D -// -// rE _ _________________ -// rS _ | _ _ _ _ _ _|\__ _ _ _ _ _ _ _ _ _ _______ -// | | \__ ___/| | -// | | \__ ___/ | | -// rC _ | _ _ _ _ _ _| _ _ _ \ ___________ / | | -// 0 _ |_________________|__________|___________|_________|_______| -// -// <-----------------><---------><----------><--------><------> -// lE lConv lCol lDiv lS -// -// - -//Maillage Tuyere 2D - Details geometrie - - // rE _ 4__________(3)_________3 - // | |\__ - // | \__ - // rS _ | _ _ _ _ _ _ _ | _ _ \__ (7)_ _ _ _ _ _ _ _ _ _ _ _ _ _ 10_______(16)_______12 - // | \__ ____/ | - // |(4) (2)| \__ (13)____/ | | - // | "1" \__ ____/ | - // rC _ | _ _ _ _ _ _ _ | _ _ _ _ _ _ \6_______(10)_______8/ |(12) "5" |(15) - // | | - // | | (6)| |(9) | | - // | "2" "3" "4" | - // 0 _ |______________________|___________________|__________________| _______________|__________________| - // 1 (1) 2 (5) 5 (8) 7 (11) 9 (14) 11 - // <----------------------><------------------><-----------------><---------------><-----------------> - // lE lConv lCol lDiv lS - -//---------------------------------DONNEES------------------------------------ -//Dimensions principales -rE = 0.13; rC = 0.04; rS = 0.13; -lE = 0.05; lConv = 0.2; lCol = 0.05; lDiv = 0.2; lS = 0.05; -//Number de mailles selon X -nbxLE = 5; -nbxLConv = 20; -nbxLCol = 5; -nbxLDiv = 20; -nbxLS = 5; -//number de mailles selon Y -nby = 10; -//Numero des conditions aux limites -condLimAxe = 1; -condLimParoi = 2; -condLimEntree = 3; -condLimSortie = 4; -surfaceFluide = 10; -//---------------------------------------------------------------------------- - -//Geometrie Entree -Point(1) = {0, 0, 0}; -Point(2) = {lE, 0, 0}; -Point(3) = {lE, rE, 0}; -Point(4) = {0, rE, 0}; -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; -Line Loop(1) = {1,2,3,4}; -Plane Surface(1) = {1}; -//Geometrie Convergent -Point(5) = {lE+lConv, 0, 0}; -Point(6) = {lE+lConv, rC, 0}; -Line(5) = {2,5}; -Line(6) = {5,6}; -Line(7) = {6,3}; -Line Loop(2) = {-2,5,6,7}; -Plane Surface(2) = {2}; -//Geometrie Col -Point(7) = {lE+lConv+lCol, 0, 0}; -Point(8) = {lE+lConv+lCol, rC, 0}; -Line(8) = {5,7}; -Line(9) = {7,8}; -Line(10) = {8,6}; -Line Loop(3) = {-6,8,9,10}; -Plane Surface(3) = {3}; -//Geometrie Divergent -Point(9) = {lE+lConv+lCol+lDiv, 0, 0}; -Point(10) = {lE+lConv+lCol+lDiv, rS, 0}; -Line(11) = {7,9}; -Line(12) = {9,10}; -Line(13) = {10,8}; -Line Loop(4) = {-9,11,12,13}; -Plane Surface(4) = {4}; -//Geometrie Sortie -Point(11) = {lE+lConv+lCol+lDiv+lS, 0, 0}; -Point(12) = {lE+lConv+lCol+lDiv+lS, rS, 0}; -Line(14) = {9,11}; -Line(15) = {11,12}; -Line(16) = {12,10}; -Line Loop(5) = {-12,14,15,16}; -Plane Surface(5) = {5}; -//Maillages -Transfinite Line {1,3} = nbxLE; -Transfinite Line {5,7} = nbxLConv; -Transfinite Line {8,10} = nbxLCol; -Transfinite Line {11,13} = nbxLDiv; -Transfinite Line {14,16} = nbxLS; -Transfinite Line {2,4,6,9,12,15} = nby; -Transfinite Surface "*"; -Recombine Surface "*"; -//Domaines Physiques et CL -Physical Line(condLimAxe) = {1,5,8,11,14}; -Physical Line(condLimParoi) = {3,7,10,13,16}; -Physical Line(condLimEntree) = {4}; -Physical Line(condLimSortie) = {15}; -Physical Surface(surfaceFluide) = {1,2,3,4,5}; diff --git a/libMeshes/nozzles/nozzle2D_simple.geo b/libMeshes/nozzles/nozzle2D_simple.geo deleted file mode 100644 index b4dba81e..00000000 --- a/libMeshes/nozzles/nozzle2D_simple.geo +++ /dev/null @@ -1,80 +0,0 @@ -// Maillage Tuyere 2D simple -// -// rE _ -// rS _ |\__ _ _ _ _ _ -// | \__ ___/| -// | \__ ___/ | -// rC _ | _ _ _ \ / | -// 0 _ |__________|_________| -// -// <---------><--------> -// lConv lDiv -// -// - -//Maillage Tuyere 2D simple - Details geometrie - - // rE _ 4 - // |\__ - // | \__ - // rS _ | _ _ \__ (3)_ _ _ _ _ _ _ 6 - // | \__ (7)____/| - // |(4) \__ ____/ | - // | \__ ____/ | - // rC _ | _ _ _ _ _ _ \3/ | - // | |(6) - // | "1" (2)| "2" | - // | | - // 0 _ |___________________|________________| - // 1 (1) 2 (5) 5 - // <-------------------><-------------> - // lConv lDiv - -//---------------------------------DONNEES------------------------------------ -//Dimensions principales -rE = 0.14657; rC = 0.06406; rS = 0.14657; -lConv = 0.5; lDiv = 0.5; -//Number de mailles selon X -nbxLConv = 50; -nbxLDiv = 50; -//number de mailles selon Y -nby = 1; -//Numero des conditions aux limites -condLimAxe = 1; -condLimParoi = 2; -condLimEntree = 3; -condLimSortie = 4; -surfaceFluide = 10; -//---------------------------------------------------------------------------- - -//Geometrie Entree -Point(1) = {0, 0, 0}; -Point(2) = {lConv, 0, 0}; -Point(3) = {lConv, rC, 0}; -Point(4) = {0, rE, 0}; -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; -Line Loop(1) = {1,2,3,4}; -Plane Surface(1) = {1}; -//Geometrie Divergent -Point(5) = {lConv+lDiv, 0, 0}; -Point(6) = {lConv+lDiv, rS, 0}; -Line(5) = {2,5}; -Line(6) = {5,6}; -Line(7) = {6,3}; -Line Loop(2) = {5,6,7,-2}; -Plane Surface(2) = {2}; -//Maillages -Transfinite Line {1,3} = nbxLConv; -Transfinite Line {5,7} = nbxLDiv; -Transfinite Line {2,4,6} = nby; -Transfinite Surface "*"; -Recombine Surface "*"; -//Domaines Physiques et CL -Physical Line(condLimAxe) = {1,5}; -Physical Line(condLimParoi) = {3,7}; -Physical Line(condLimEntree) = {4}; -Physical Line(condLimSortie) = {6}; -Physical Surface(surfaceFluide) = {1,2}; diff --git a/libMeshes/nozzles/nozzle2D_simple2.geo b/libMeshes/nozzles/nozzle2D_simple2.geo deleted file mode 100644 index d69df8f9..00000000 --- a/libMeshes/nozzles/nozzle2D_simple2.geo +++ /dev/null @@ -1,80 +0,0 @@ -// Maillage Tuyere 2D simple -// -// rE _ -// rS _ |\__ _ _ _ _ _ -// | \__ ___/| -// | \__ ___/ | -// rC _ | _ _ _ \ / | -// 0 _ |__________|_________| -// -// <---------><--------> -// lConv lDiv -// -// - -//Maillage Tuyere 2D simple - Details geometrie - - // rE _ 4 - // |\__ - // | \__ - // rS _ | _ _ \__ (3)_ _ _ _ _ _ _ 6 - // | \__ (7)____/| - // |(4) \__ ____/ | - // | \__ ____/ | - // rC _ | _ _ _ _ _ _ \3/ | - // | |(6) - // | "1" (2)| "2" | - // | | - // 0 _ |___________________|________________| - // 1 (1) 2 (5) 5 - // <-------------------><-------------> - // lConv lDiv - -//---------------------------------DONNEES------------------------------------ -//Dimensions principales -rE = 0.3; rC = 0.1; rS = 0.3; -lConv = 5.; lDiv = 5.; -//Number de mailles selon X -nbxLConv = 100; -nbxLDiv = 100; -//number de mailles selon Y -nby = 1; -//Numero des conditions aux limites -condLimAxe = 1; -condLimParoi = 2; -condLimEntree = 3; -condLimSortie = 4; -surfaceFluide = 10; -//---------------------------------------------------------------------------- - -//Geometrie Entree -Point(1) = {0, 0, 0}; -Point(2) = {lConv, 0, 0}; -Point(3) = {lConv, rC, 0}; -Point(4) = {0, rE, 0}; -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; -Line Loop(1) = {1,2,3,4}; -Plane Surface(1) = {1}; -//Geometrie Divergent -Point(5) = {lConv+lDiv, 0, 0}; -Point(6) = {lConv+lDiv, rS, 0}; -Line(5) = {2,5}; -Line(6) = {5,6}; -Line(7) = {6,3}; -Line Loop(2) = {5,6,7,-2}; -Plane Surface(2) = {2}; -//Maillages -Transfinite Line {1,3} = nbxLConv; -Transfinite Line {5,7} = nbxLDiv; -Transfinite Line {2,4,6} = nby; -Transfinite Surface "*"; -Recombine Surface "*"; -//Domaines Physiques et CL -Physical Line(condLimAxe) = {1,5}; -Physical Line(condLimParoi) = {3,7}; -Physical Line(condLimEntree) = {4}; -Physical Line(condLimSortie) = {6}; -Physical Surface(surfaceFluide) = {1,2}; diff --git a/libMeshes/nozzles/smoothNozzle2D.geo b/libMeshes/nozzles/smoothNozzle2D.geo new file mode 100644 index 00000000..78aa3b33 --- /dev/null +++ b/libMeshes/nozzles/smoothNozzle2D.geo @@ -0,0 +1,88 @@ +// 2D mesh of a smooth cross section variation half nozzle + +// rE _ +// rS _ |\__ _ _ _ _ _ +// | \__ ___/| +// | \__ ___/ | +// rC _ | _ _ _ \ / | +// 0 _ |__________|_________| +// +// <---------><--------> +// lConv lDiv +// +// + +// Geometry details + +// rE _ 4 +// |\__ +// | \__ +// rS _ | _ _ \__ (3)_ _ _ _ _ _ _ 6 +// | \__ (7)____/| +// |(4) \__ ____/ | +// | \__ ____/ | +// rC _ | _ _ _ _ _ _ \3/ | +// | |(6) +// | "1" (2)| "2" | +// | | +// 0 _ |___________________|________________| +// 1 (1) 2 (5) 5 +// <-------------------><-------------> +// lConv lDiv + +//----------------- DATA ----------------- + +// Geo parameters +rE = 0.2; rC = 0.17; rS = 0.2; +lConv = 0.5; lDiv = 0.5; + +// Number of cells x-dir. +nbxLConv = 50; +nbxLDiv = 50; + +// Number of cells y-dir. +nby = 1; + +// Boundary condition numbers +bcAxis = 1; +bcWall = 2; +bcInlet = 3; +bcOutlet = 4; +surfFluid = 10; + +//----------------- GEO ----------------- + +// Geometry convergent +Point(1) = {0, 0, 0}; +Point(2) = {lConv, 0, 0}; +Point(3) = {lConv, rC, 0}; +Point(4) = {0, rE, 0}; +Line(1) = {1,2}; +Line(2) = {2,3}; +Line(3) = {3,4}; +Line(4) = {4,1}; +Line Loop(1) = {1,2,3,4}; +Plane Surface(1) = {1}; + +// Geometry divergent +Point(5) = {lConv+lDiv, 0, 0}; +Point(6) = {lConv+lDiv, rS, 0}; +Line(5) = {2,5}; +Line(6) = {5,6}; +Line(7) = {6,3}; +Line Loop(2) = {5,6,7,-2}; +Plane Surface(2) = {2}; + +// Structured mesh +Transfinite Line {1,3} = nbxLConv; +Transfinite Line {5,7} = nbxLDiv; +Transfinite Line {2,4,6} = nby; +Transfinite Surface "*"; +Recombine Surface "*"; + +// Boundary conditions and fluid domain +Physical Line(bcAxis) = {1,5}; +Physical Line(bcWall) = {3,7}; +Physical Line(bcInlet) = {4}; +Physical Line(bcOutlet) = {6}; +Physical Surface(surfFluid) = {1,2}; diff --git a/libMeshes/nozzles/smoothNozzle2D_par.geo b/libMeshes/nozzles/smoothNozzle2D_par.geo deleted file mode 100644 index 70203e57..00000000 --- a/libMeshes/nozzles/smoothNozzle2D_par.geo +++ /dev/null @@ -1,80 +0,0 @@ -// Maillage Tuyere 2D simple -// -// rE _ -// rS _ |\__ _ _ _ _ _ -// | \__ ___/| -// | \__ ___/ | -// rC _ | _ _ _ \ / | -// 0 _ |__________|_________| -// -// <---------><--------> -// lConv lDiv -// -// - -//Maillage Tuyere 2D simple - Details geometrie - - // rE _ 4 - // |\__ - // | \__ - // rS _ | _ _ \__ (3)_ _ _ _ _ _ _ 6 - // | \__ (7)____/| - // |(4) \__ ____/ | - // | \__ ____/ | - // rC _ | _ _ _ _ _ _ \3/ | - // | |(6) - // | "1" (2)| "2" | - // | | - // 0 _ |___________________|________________| - // 1 (1) 2 (5) 5 - // <-------------------><-------------> - // lConv lDiv - -//---------------------------------DONNEES------------------------------------ -//Dimensions principales -rE = 0.2; rC = 0.17; rS = 0.2; -lConv = 0.5; lDiv = 0.5; -//Number de mailles selon X -nbxLConv = 200; -nbxLDiv = 200; -//number de mailles selon Y -nby = 1; -//Numero des conditions aux limites -condLimAxe = 1; -condLimParoi = 2; -condLimEntree = 3; -condLimSortie = 4; -surfaceFluide = 10; -//---------------------------------------------------------------------------- - -//Geometrie Entree -Point(1) = {0, 0, 0}; -Point(2) = {lConv, 0, 0}; -Point(3) = {lConv, rC, 0}; -Point(4) = {0, rE, 0}; -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; -Line Loop(1) = {1,2,3,4}; -Plane Surface(1) = {1}; -//Geometrie Divergent -Point(5) = {lConv+lDiv, 0, 0}; -Point(6) = {lConv+lDiv, rS, 0}; -Line(5) = {2,5}; -Line(6) = {5,6}; -Line(7) = {6,3}; -Line Loop(2) = {5,6,7,-2}; -Plane Surface(2) = {2}; -//Maillages -Transfinite Line {1,3} = nbxLConv; -Transfinite Line {5,7} = nbxLDiv; -Transfinite Line {2,4,6} = nby; -Transfinite Surface "*"; -Recombine Surface "*"; -//Domaines Physiques et CL -Physical Line(condLimAxe) = {1,5}; -Physical Line(condLimParoi) = {3,7}; -Physical Line(condLimEntree) = {4}; -Physical Line(condLimSortie) = {6}; -Physical Surface(surfaceFluide) = {1,2}; diff --git a/libMeshes/nozzles/smoothNozzle2DforLowMach.geo b/libMeshes/nozzles/smoothNozzle2DforLowMach.geo new file mode 100644 index 00000000..ecb050e1 --- /dev/null +++ b/libMeshes/nozzles/smoothNozzle2DforLowMach.geo @@ -0,0 +1,94 @@ +// 2D mesh of a smooth cross section variation nozzle + +// rE _ 1 +// |\__ +// | \__ +// rS _ | _ _ \__ (4)_ _ _ _ _ _ _ 3 +// | \__ (5)____/| +// | \__ ____/ | +// | \__ ____/ | +// rC _ | _ _ _ _ _ _ \2/ | +// | | +// | "1" (2)| "2" | +// | | +// 0 _ |<-------lConv----->|<-----lDiv----->| +// | | +// | | | +// | (1) (2) | (3) +// | | | +// | __/5\____ | +// | __/ \____ | +// | __/ \____ | +// | __/ (7) \| +// | __/ (6) 6 +// | __/ +// |/ +// 4 + +//----------------- DATA ----------------- + +// Geo parameters +rE = 0.14657/2.; +rC = 0.06406/2.; +rS = 0.14657/2.; +lConv = 0.5; +lDiv = 0.5; + +// Cells x-direction +nbxLConv = 51; +nbxLDiv = 51; + +// Cells y-direction +nby = 1; + +// Boundary condition numbers +bcInlet = 1; +bcOutlet = 2; +bcWall = 3; +surfFluid = 10; + +//----------------- GEO ----------------- + +// Upper body +Point(1) = {0, rE, 0}; +Point(2) = {lConv, rC, 0}; +Point(3) = {lConv+lDiv, rS, 0}; + +// Lower body +Point(4) = {0, -rE, 0}; +Point(5) = {lConv, -rC, 0}; +Point(6) = {lConv+lDiv, -rS, 0}; + +// Vertical links +Line(1) = {1,4}; +Line(2) = {2,5}; +Line(3) = {3,6}; + +// Close upper body +Line(4) = {1,2}; +Line(5) = {2,3}; + +// Close lower body +Line(6) = {4,5}; +Line(7) = {5,6}; + +// Surface convergent +Line Loop(1) = {1, 6, -2, -4}; +Plane Surface (1) = {1}; + +// Surface divergent +Line Loop(2) = {2, 7, -3, -5}; +Plane Surface (2) = {2}; + +// Structured mesh +Transfinite Line {4,6} = nbxLConv; +Transfinite Line {5,7} = nbxLDiv; +Transfinite Line {1,2,3} = nby; +Transfinite Surface "*"; +Recombine Surface "*"; + +// Boundary conditions and fluid domain +Physical Line(bcInlet) = {1}; +Physical Line(bcOutlet) = {3}; +Physical Line(bcWall) = {4,5,6,7}; +Physical Surface(surfFluid) = {1,2}; \ No newline at end of file diff --git a/libMeshes/nozzles/smoothNozzle2DforLowMach_seq.geo b/libMeshes/nozzles/smoothNozzle2DforLowMach_seq.geo deleted file mode 100644 index 1bf6b036..00000000 --- a/libMeshes/nozzles/smoothNozzle2DforLowMach_seq.geo +++ /dev/null @@ -1,80 +0,0 @@ -// Maillage Tuyere 2D simple -// -// rE _ -// rS _ |\__ _ _ _ _ _ -// | \__ ___/| -// | \__ ___/ | -// rC _ | _ _ _ \ / | -// 0 _ |__________|_________| -// -// <---------><--------> -// lConv lDiv -// -// - -//Maillage Tuyere 2D simple - Details geometrie - - // rE _ 4 - // |\__ - // | \__ - // rS _ | _ _ \__ (3)_ _ _ _ _ _ _ 6 - // | \__ (7)____/| - // |(4) \__ ____/ | - // | \__ ____/ | - // rC _ | _ _ _ _ _ _ \3/ | - // | |(6) - // | "1" (2)| "2" | - // | | - // 0 _ |___________________|________________| - // 1 (1) 2 (5) 5 - // <-------------------><-------------> - // lConv lDiv - -//---------------------------------DONNEES------------------------------------ -//Dimensions principales -rE = 0.14657/2.; rC = 0.06406/2.; rS = 0.14657/2.; -lConv = 0.5; lDiv = 0.5; -//Number de mailles selon X -nbxLConv = 51; -nbxLDiv = 51; -//number de mailles selon Y -nby = 1; -//Numero des conditions aux limites -condLimAxe = 1; -condLimParoi = 2; -condLimEntree = 3; -condLimSortie = 4; -surfaceFluide = 10; -//---------------------------------------------------------------------------- - -//Geometrie Entree -Point(1) = {0, 0, 0}; -Point(2) = {lConv, 0, 0}; -Point(3) = {lConv, rC, 0}; -Point(4) = {0, rE, 0}; -Line(1) = {1,2}; -Line(2) = {2,3}; -Line(3) = {3,4}; -Line(4) = {4,1}; -Line Loop(1) = {1,2,3,4}; -Plane Surface(1) = {1}; -//Geometrie Divergent -Point(5) = {lConv+lDiv, 0, 0}; -Point(6) = {lConv+lDiv, rS, 0}; -Line(5) = {2,5}; -Line(6) = {5,6}; -Line(7) = {6,3}; -Line Loop(2) = {5,6,7,-2}; -Plane Surface(2) = {2}; -//Maillages -Transfinite Line {1,3} = nbxLConv; -Transfinite Line {5,7} = nbxLDiv; -Transfinite Line {2,4,6} = nby; -Transfinite Surface "*"; -Recombine Surface "*"; -//Domaines Physiques et CL -Physical Line(condLimAxe) = {1,5}; -Physical Line(condLimParoi) = {3,7}; -Physical Line(condLimEntree) = {4}; -Physical Line(condLimSortie) = {6}; -Physical Surface(surfaceFluide) = {1,2}; diff --git a/libMeshes/shockTube/tube2regionsUnstruct.geo b/libMeshes/shockTube/tube2regionsUnstruct.geo new file mode 100644 index 00000000..d1a3ab2f --- /dev/null +++ b/libMeshes/shockTube/tube2regionsUnstruct.geo @@ -0,0 +1,48 @@ +// Cartesian shock tube with two chambers + +// Parameters +lx = 1; +lxp = 0.5; +ly = 0.5; +NxL = 51; +NxR = 51; +Ny = 51; + +// Mesh +Point(1) = {0, 0, 0}; +Point(2) = {lxp, 0, 0}; +Point(3) = {lx, 0, 0}; +Point(4) = {lx, ly, 0}; +Point(5) = {lxp, ly, 0}; +Point(6) = {0, ly, 0}; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 5}; +Line(5) = {5, 6}; +Line(6) = {6, 1}; + +Line(7) = {2, 5}; + +Transfinite Line{1, 5} = NxL; +Transfinite Line{2, 4} = NxR; +Transfinite Line{3, 6, 7} = Ny; + +Line Loop(1) = {1, 7, 5, 6}; +Plane Surface(1) = {1}; + +Line Loop(2) = {2, 3, 4, -7}; +Plane Surface(2) = {2}; + +//Transfinite Surface{1}; +//Recombine Surface{1}; + +//Transfinite Surface{2}; +//Recombine Surface{2}; + +Physical Line(1) = {3, 6}; +Physical Line(2) = {1, 2, 4, 5}; + +Physical Surface(10) = {1}; // Left chamber +Physical Surface(11) = {2}; // Right chamber \ No newline at end of file diff --git a/libMeshes/shockTube/tubeCart.geo b/libMeshes/shockTube/tubeCart.geo new file mode 100644 index 00000000..cb75501d --- /dev/null +++ b/libMeshes/shockTube/tubeCart.geo @@ -0,0 +1,33 @@ +// Cartesian shock tube + +// Parameters +lx = 1; +ly = 0.2; +Nx = 11; +Ny = 1; + +// Mesh +Point(1) = {0, 0, 0}; +Point(2) = {lx, 0, 0}; +Point(3) = {lx, ly, 0}; +Point(4) = {0, ly, 0}; + +Line(1) = {1,2}; +Line(2) = {2,3}; +Line(3) = {3,4}; +Line(4) = {4,1}; + +Transfinite Line{1,3} = Nx; +Transfinite Line{2,4} = Ny; + +Line Loop(1) = {1, 2, 3, 4}; +Plane Surface(1) = {1}; + +Transfinite Surface{1}; +Recombine Surface{1}; + +Physical Line(1) = {1,3}; +Physical Line(2) = {4}; +Physical Line(3) = {2}; + +Physical Surface(10) = {1}; \ No newline at end of file diff --git a/libMeshes/shockTube/tubeCart2regions.geo b/libMeshes/shockTube/tubeCart2regions.geo new file mode 100644 index 00000000..6c8ec625 --- /dev/null +++ b/libMeshes/shockTube/tubeCart2regions.geo @@ -0,0 +1,48 @@ +// Cartesian shock tube with two chambers + +// Parameters +lx = 1; +lxp = 0.5; +ly = 0.5; +NxL = 51; +NxR = 51; +Ny = 51; + +// Mesh +Point(1) = {0, 0, 0}; +Point(2) = {lxp, 0, 0}; +Point(3) = {lx, 0, 0}; +Point(4) = {lx, ly, 0}; +Point(5) = {lxp, ly, 0}; +Point(6) = {0, ly, 0}; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 5}; +Line(5) = {5, 6}; +Line(6) = {6, 1}; + +Line(7) = {2, 5}; + +Transfinite Line{1, 5} = NxL; +Transfinite Line{2, 4} = NxR; +Transfinite Line{3, 6, 7} = Ny; + +Line Loop(1) = {1, 7, 5, 6}; +Plane Surface(1) = {1}; + +Line Loop(2) = {2, 3, 4, -7}; +Plane Surface(2) = {2}; + +Transfinite Surface{1}; +Recombine Surface{1}; + +Transfinite Surface{2}; +Recombine Surface{2}; + +Physical Line(1) = {3, 6}; +Physical Line(2) = {1, 2, 4, 5}; + +Physical Surface(10) = {1}; // Left chamber +Physical Surface(11) = {2}; // Right chamber \ No newline at end of file diff --git a/libMeshes/shockTube/tubeCart2regionsDiscontinuity0d3.geo b/libMeshes/shockTube/tubeCart2regionsDiscontinuity0d3.geo new file mode 100644 index 00000000..06ac9e00 --- /dev/null +++ b/libMeshes/shockTube/tubeCart2regionsDiscontinuity0d3.geo @@ -0,0 +1,48 @@ +// Cartesian shock tube with two chambers + +// Parameters +lx = 1; +lxp = 0.3; +ly = 0.1; +NxL = 301; +NxR = 701; +Ny = 101; + +// Mesh +Point(1) = {0, 0, 0}; +Point(2) = {lxp, 0, 0}; +Point(3) = {lx, 0, 0}; +Point(4) = {lx, ly, 0}; +Point(5) = {lxp, ly, 0}; +Point(6) = {0, ly, 0}; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 5}; +Line(5) = {5, 6}; +Line(6) = {6, 1}; + +Line(7) = {2, 5}; + +Transfinite Line{1, 5} = NxL; +Transfinite Line{2, 4} = NxR; +Transfinite Line{3, 6, 7} = Ny; + +Line Loop(1) = {1, 7, 5, 6}; +Plane Surface(1) = {1}; + +Line Loop(2) = {2, 3, 4, -7}; +Plane Surface(2) = {2}; + +Transfinite Surface{1}; +Recombine Surface{1}; + +Transfinite Surface{2}; +Recombine Surface{2}; + +Physical Line(1) = {3, 6}; +Physical Line(2) = {1, 2, 4, 5}; + +Physical Surface(10) = {1}; // Left chamber +Physical Surface(11) = {2}; // Right chamber \ No newline at end of file diff --git a/libMeshes/shockTube/tubeCart2regionsDiscontinuity0d75.geo b/libMeshes/shockTube/tubeCart2regionsDiscontinuity0d75.geo new file mode 100644 index 00000000..f1962b7c --- /dev/null +++ b/libMeshes/shockTube/tubeCart2regionsDiscontinuity0d75.geo @@ -0,0 +1,48 @@ +// Cartesian shock tube with two chambers + +// Parameters +lx = 1; +lxp = 0.75; +ly = 0.1; +NxL = 751; +NxR = 251; +Ny = 101; + +// Mesh +Point(1) = {0, 0, 0}; +Point(2) = {lxp, 0, 0}; +Point(3) = {lx, 0, 0}; +Point(4) = {lx, ly, 0}; +Point(5) = {lxp, ly, 0}; +Point(6) = {0, ly, 0}; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 5}; +Line(5) = {5, 6}; +Line(6) = {6, 1}; + +Line(7) = {2, 5}; + +Transfinite Line{1, 5} = NxL; +Transfinite Line{2, 4} = NxR; +Transfinite Line{3, 6, 7} = Ny; + +Line Loop(1) = {1, 7, 5, 6}; +Plane Surface(1) = {1}; + +Line Loop(2) = {2, 3, 4, -7}; +Plane Surface(2) = {2}; + +Transfinite Surface{1}; +Recombine Surface{1}; + +Transfinite Surface{2}; +Recombine Surface{2}; + +Physical Line(1) = {3, 6}; +Physical Line(2) = {1, 2, 4, 5}; + +Physical Surface(10) = {1}; // Left chamber +Physical Surface(11) = {2}; // Right chamber \ No newline at end of file diff --git a/libMeshes/shockTube/tubeCart2regionsRotated.geo b/libMeshes/shockTube/tubeCart2regionsRotated.geo new file mode 100644 index 00000000..610f0c07 --- /dev/null +++ b/libMeshes/shockTube/tubeCart2regionsRotated.geo @@ -0,0 +1,59 @@ +// Cartesian shock tube with two chambers + +// Parameters +lx = 1; +lxp = 0.5; +ly = 0.5; +theta = 45; +NxL = 51; +NxR = 51; +Ny = 21; +dx = 0.01; // Useful for triangles only + +// Mesh +// x' = x Cos(theta) - y Sin(theta) +// y' = x Sin(theta) + y Cos(theta) +theta = theta * Pi / 180; +Point(1) = {0, 0, 0, dx}; +// Point(2) = {lxp, 0, 0}; +Point(2) = {lxp * Cos(theta), lxp * Sin(theta), 0, dx}; +// Point(3) = {lx, 0, 0}; +Point(3) = {lx * Cos(theta), lx * Sin(theta), 0, dx}; +// Point(4) = {lx, ly, 0}; +Point(4) = {lx * Cos(theta) - ly * Sin(theta), lx * Sin(theta) + ly * Cos(theta), 0, dx}; +// Point(5) = {lxp, ly, 0}; +Point(5) = {lxp * Cos(theta) - ly * Sin(theta), lxp * Sin(theta) + ly * Cos(theta), 0, dx}; +// Point(6) = {0, ly, 0}; +Point(6) = {- ly * Sin(theta), ly * Cos(theta), 0, dx}; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 5}; +Line(5) = {5, 6}; +Line(6) = {6, 1}; + +Line(7) = {2, 5}; + +// Comment if you want unstructured triangles +Transfinite Line{1, 5} = NxL; +Transfinite Line{2, 4} = NxR; +Transfinite Line{3, 6, 7} = Ny; + +Line Loop(1) = {1, 7, 5, 6}; +Plane Surface(1) = {1}; + +Line Loop(2) = {2, 3, 4, -7}; +Plane Surface(2) = {2}; + +// Uncomment if you want unstructured triangles +Transfinite Surface{1}; +Recombine Surface{1}; +Transfinite Surface{2}; +Recombine Surface{2}; + +Physical Line(1) = {3, 6}; +Physical Line(2) = {1, 2, 4, 5}; + +Physical Surface(10) = {1}; // Left chamber +Physical Surface(11) = {2}; // Right chamber \ No newline at end of file diff --git a/libMeshes/square/square2.geo b/libMeshes/square/square2.geo deleted file mode 100644 index c4825da0..00000000 --- a/libMeshes/square/square2.geo +++ /dev/null @@ -1,15 +0,0 @@ -// Gmsh project created on Tue Nov 18 13:54:37 2014 -dx = 0.2; - -Point(1) = {0, 0, 0, dx}; -Point(2) = {2, 0, 0, dx}; -Point(3) = {2, 2, 0, dx}; -Point(4) = {0, 2, 0, dx}; -Line(1) = {4, 3}; -Line(2) = {2, 3}; -Line(3) = {2, 1}; -Line(4) = {1, 4}; -Line Loop(5) = {1, -2, 3, 4}; -Plane Surface(6) = {5}; -Physical Line(1) = {1, 2, 3, 4}; -Physical Surface(8) = {6}; diff --git a/libMeshes/square/squarePart.geo b/libMeshes/square/squarePart.geo new file mode 100644 index 00000000..6b6dc299 --- /dev/null +++ b/libMeshes/square/squarePart.geo @@ -0,0 +1,14 @@ +cl = 0.05; +Point(1) = {0, 0, 0, cl}; +Point(2) = {1, 0, 0, cl}; +Point(3) = {1, 1, 0, cl}; +Point(4) = {0, 1, 0, cl}; +Line(1) = {4, 3}; +Line(2) = {2, 3}; +Line(3) = {1, 2}; +Line(4) = {4, 1}; + +Physical Line(1) = {1, 3, 2, 4}; +Line Loop(6) = {4, 3, 2, -1}; +Plane Surface(7) = {6}; +Physical Surface(8) = {7}; diff --git a/libMeshes/square/squareRefined.geo b/libMeshes/square/squareRefined.geo new file mode 100644 index 00000000..8e682392 --- /dev/null +++ b/libMeshes/square/squareRefined.geo @@ -0,0 +1,14 @@ +cl = 0.035; +Point(1) = {0, 0, 0, cl}; +Point(2) = {1, 0, 0, cl}; +Point(3) = {1, 1, 0, cl}; +Point(4) = {0, 1, 0, cl}; +Line(1) = {4, 3}; +Line(2) = {2, 3}; +Line(3) = {1, 2}; +Line(4) = {4, 1}; + +Physical Line(1) = {1, 3, 2, 4}; +Line Loop(6) = {4, 3, 2, -1}; +Plane Surface(7) = {6}; +Physical Surface(8) = {7}; diff --git a/libMeshes/square/squareRefinedPart.geo b/libMeshes/square/squareRefinedPart.geo new file mode 100644 index 00000000..8e682392 --- /dev/null +++ b/libMeshes/square/squareRefinedPart.geo @@ -0,0 +1,14 @@ +cl = 0.035; +Point(1) = {0, 0, 0, cl}; +Point(2) = {1, 0, 0, cl}; +Point(3) = {1, 1, 0, cl}; +Point(4) = {0, 1, 0, cl}; +Line(1) = {4, 3}; +Line(2) = {2, 3}; +Line(3) = {1, 2}; +Line(4) = {4, 1}; + +Physical Line(1) = {1, 3, 2, 4}; +Line Loop(6) = {4, 3, 2, -1}; +Plane Surface(7) = {6}; +Physical Surface(8) = {7}; diff --git a/libMeshes/square/squareStruct.geo b/libMeshes/square/squareStruct.geo new file mode 100644 index 00000000..fd9f4db2 --- /dev/null +++ b/libMeshes/square/squareStruct.geo @@ -0,0 +1,41 @@ +// Geometry parameters +lx = 1.; +ly = 1.; + +// Mesh parameters +Nx = 51; +Ny = 51; +struct = 1; +structQuad = 0; + +// Geometry +Point(1) = {0, 0, 0}; +Point(2) = {1, 0, 0}; +Point(3) = {1, 1, 0}; +Point(4) = {0, 1, 0}; + +Line(1) = {1, 2}; +Line(2) = {2, 3}; +Line(3) = {3, 4}; +Line(4) = {4, 1}; + +If (struct == 1) +Transfinite Line{1, 3} = Nx; +Transfinite Line{2, 4} = Ny; +EndIf + +Line Loop(1) = {1:4}; +Plane Surface(1) = {1}; + +If (struct == 1) +Transfinite Surface{1}; +If (structQuad == 1) +Recombine Surface{1}; +EndIf +EndIf + +// Boundary conditions +Physical Line(1) = {1:4}; + +// Fluid +Physical Surface(10) = {1}; \ No newline at end of file diff --git a/libMeshes/venturi/venturi.geo b/libMeshes/venturi/venturi.geo new file mode 100644 index 00000000..0fa63c26 --- /dev/null +++ b/libMeshes/venturi/venturi.geo @@ -0,0 +1,74 @@ +// Geometry Venturi 8° +// Data from Le Martelot et al. 2013 + +// Geometry parameters (m) +xA = 0.; yA = 0.; +xB = 0.1; yB = 0.; +xC = 0.153; yC = 0.0157; +xD = 0.588; yD = -0.0517; +xE = 1.225; yE = -0.114; +xF = 0.; yF = 0.0488; +xG = 0.271; yG = 0.0488; +xH = 1.233; yH = -0.00845; + +// Mesh parameters +// 12k +// dsBig = 0.008; +// dsMid = 0.003; +// dsSmall = 0.003; +// 21k +// dsBig = 0.005; +// dsMid = 0.0025; +// dsSmall = 0.0025; +// 42k +dsBig = 0.005; +dsMid = 0.005; +dsSmall = 0.001; +// 95k +// dsBig = 0.0035; +// dsMid = 0.0035; +// dsSmall = 0.00065; +// 167k +// dsBig = 0.0025; +// dsMid = 0.0025; +// dsSmall = 0.0005; +// 387k +// dsBig = 0.002; +// dsMid = 0.002; +// dsSmall = 0.0003; + +// Boundary conditions +boundCondInflow = 1; +boundCondOutflow = 2; +boundCondWalls = 3; + +// Geometry +// Be aware that points ordering follows +// the convention used in the paper +Point(1) = {xA, yA, 0, dsSmall}; +Point(2) = {xB, yB, 0, dsSmall}; +Point(3) = {xC, yC, 0, dsSmall}; +Point(4) = {xD, yD, 0, dsMid}; +Point(5) = {xE, yE, 0, dsBig}; +Point(6) = {xF, yF, 0, dsSmall}; +Point(7) = {xG, yG, 0, dsSmall}; +Point(8) = {xH, yH, 0, dsBig}; + +// Line definition : A-B-C-D-E-H-G-F-A +For i In {1:4} + Line(newl) = {i, i+1}; +EndFor +Line(newl) = {5, 8}; +Line(newl) = {8, 7}; +Line(newl) = {7, 6}; +Line(newl) = {6, 1}; + +Line Loop(1) = {1:8}; +Plane Surface(1) = {1}; + +// Boundary conditions and physical surface +Physical Line(boundCondInflow) = {8}; +Physical Line(boundCondOutflow) = {5}; +Physical Line(boundCondWalls) = {1:4, 6, 7}; +Physical Surface(10) = {1}; + diff --git a/libTests/logoECOGEN/ECOGENFluide/initialConditionsV4.xml b/libTests/logoECOGEN/ECOGENFluide/initialConditions.xml similarity index 100% rename from libTests/logoECOGEN/ECOGENFluide/initialConditionsV4.xml rename to libTests/logoECOGEN/ECOGENFluide/initialConditions.xml diff --git a/libTests/logoECOGEN/ECOGENFluide/mainV5.xml b/libTests/logoECOGEN/ECOGENFluide/main.xml similarity index 100% rename from libTests/logoECOGEN/ECOGENFluide/mainV5.xml rename to libTests/logoECOGEN/ECOGENFluide/main.xml diff --git a/libTests/logoECOGEN/ECOGENFluide/meshV5.xml b/libTests/logoECOGEN/ECOGENFluide/mesh.xml similarity index 100% rename from libTests/logoECOGEN/ECOGENFluide/meshV5.xml rename to libTests/logoECOGEN/ECOGENFluide/mesh.xml diff --git a/libTests/logoECOGEN/ECOGENFluide/modelV4.xml b/libTests/logoECOGEN/ECOGENFluide/model.xml similarity index 100% rename from libTests/logoECOGEN/ECOGENFluide/modelV4.xml rename to libTests/logoECOGEN/ECOGENFluide/model.xml diff --git a/libTests/manualInitialConditionsV4.xml b/libTests/manualInitialConditions.xml similarity index 86% rename from libTests/manualInitialConditionsV4.xml rename to libTests/manualInitialConditions.xml index 58cfc638..1542ee91 100644 --- a/libTests/manualInitialConditionsV4.xml +++ b/libTests/manualInitialConditions.xml @@ -1,6 +1,6 @@ ----------------------------------------------------------------- -Typical example for initialConditions input file version 4 ----------------------------------------------------------------- +------------------------------------------------ +Typical example for initialConditions input file +------------------------------------------------ @@ -86,6 +86,16 @@ Example: In this example the entire computation domain will be initialize accordingly to the physicalEntity 10. +Immersed boundaries: +******************** +Immersed boundaries can also be set by using physicalEntity=-1. These domains are then filled by non deformable solids and treated as walls. +Example: + + + + + + 2) Boundary conditions ********************** Contains the list of needed boundary conditions. @@ -104,43 +114,47 @@ CLZm: boundary condition on Z minus side CLZp: boundary condition on Z plus side b) For unStrucutred meshes, the number is important and should be in agreement with physical conditions determined in the mesh file comming from GMSH. -Available boundary conditions are: nonReflecting, wall, symmetry, injection, tank, outflow, nullFlux, subInj. Some of them needs to refer to a material state. +Available boundary conditions are: nonReflecting, wall, symmetry, inletTank, inletInjStagState, inletInjTemp, outletPressure, outletMassflow, nullFlux. Some of them needs to refer to a material state. - + - - - - - - - - - - - - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + ****************** -One could use wall boundary condition with specific heat boundary condition such as imposed temperature, imposed flux or adiabatic (default). This option requires the conductivity additionnal physics (defined in modelVX.xml). +One could use wall boundary condition with specific heat boundary condition such as imposed temperature, imposed flux or adiabatic (default). This option requires the conductivity additionnal physics (defined in model.xml). Example: @@ -149,7 +163,7 @@ Example: For Moving Reference Frame computation with viscous additionnal physics it is possible to set a specific wall rotational velocity. The wall velocity is defined in the rotating frame. In case the wall is static in the absolute frame, the wall rotational velocity in the reference frame should be the opposite of the one given in the MRF source term. -Be aware that this option requires the MRF source term and the viscosity additionnal physics (see modelVX.xml) with Green-Gauss gradient method (see mainVX.xml). +Be aware that this option requires the MRF source term and the viscosity additionnal physics (see model.xml) with Green-Gauss gradient method (see main.xml). Example: @@ -159,7 +173,7 @@ Example: 3) Materials states list ************************ -The list of materials states used in domains and boundCond must be precised. Each state contains as much as needed materials and transports defined in the "modelVX.xml" input file. +The list of materials states used in domains and boundCond must be precised. Each state contains as much as needed materials and transports defined in the "model.xml" input file. %%%%%%%%%%%%%%%%%% << copy between these lines @@ -174,7 +188,7 @@ The list of materials states used in domains and boundCond must be precised. Eac %%%%%%%%%%%%%%%%%% << copy between these lines -Fluids and materials node structures depend on the flow model defined in the "modelVX.xml" input file. +Fluids and materials node structures depend on the flow model defined in the "model.xml" input file. a) For pressure-velocity-equilibrium multiphase model (Kapila) -------------------------------------------------------------- Volume fractions, densities (or temperatures), pressure and velocity components. Caution, pressure and velocity data are linked to the mixture. diff --git a/libTests/manualMainV5.xml b/libTests/manualMain.xml similarity index 89% rename from libTests/manualMainV5.xml rename to libTests/manualMain.xml index ee55a17b..48f1016a 100644 --- a/libTests/manualMainV5.xml +++ b/libTests/manualMain.xml @@ -1,6 +1,6 @@ -------------------------------------------------- -Typical example for main input file version 5 -------------------------------------------------- +----------------------------------- +Typical example for main input file +----------------------------------- @@ -54,14 +54,17 @@ Set a security marge accordingly to numerical scheme stability (real lower than %%%%%%%%%%%%%%%%%% << copy between these lines ----------------------------------- +----------------------------------- OPTIONNAL computationnal parameters ----------------------------------- +----------------------------------- *) Scheme precision order ************************* -Default (without this XML node), the scheme is first order in time and space. Possible using of a second-order scheme in time and space using MUSCL method with TVD limiters (currently only available for Cartesian mesh with/without AMR). -Available limiters are: minmod, vanleer, vanalbada, mc, superbee, thinc (only for volume-fraction limiter). +Default (without this XML node), the scheme is first order in time and space. +Possible using of a second-order scheme in time and space using MUSCL method with TVD limiters. +a) Second order for Cartesian mesh with/without AMR +--------------------------------------------------- +For Cartesian mesh with/without AMR the available limiters are: minmod, vanleer, vanalbada, mc, superbee, thinc (only for volume-fraction limiter). The choice of the limiters is divided into four parts: - global limiter: applied everywhere and on all variables unless it is overwrite by the following optional limiters. - interface limiter: applied on all variables but only at the interface location. By default is equal to the global limiter. @@ -80,6 +83,7 @@ The choice of the limiters is divided into four parts: ****************** To compute gradients, e.g. density gradient or viscous gradient, it is possible to use finite-difference-like gradient on Cartesian mesh (also with AMR) or Green-Gauss gradient on Cartesian and unstructured mesh. Default (without this XML node), the gradients will be computed using the finite-difference scheme (finite-difference). +In case second order scheme is set on unstructured mesh (see node ), the gradient method must be set to Green-Gauss. To define explicitly the gradient method or use the Green-Gauss one (green-gauss), one can use: %%%%%%%%%%%%%%%%%% << copy between these lines @@ -138,7 +142,8 @@ Adding probes at chosen location in the physical domain. Define a name, a vertex d) Boundaries ------------- -It is possible to extract data on a given boundary. It could be either a flux type (record="flux") or all quantities (record="all") following density, velocity, pressure and surface. +It is possible to extract data on a given boundary. +It could be either a flux type (record="flux") or all quantities (record="all") following density, velocity components, pressure, surface, pressure force, shear stress and normal components. This feature is only available on Cartesian grids without AMR and on unstructured meshes. It is mandatory to define the name, boundary number and time recording parameters. To record several information on the same boundary, it is necessary to set the boundary node for each information. diff --git a/libTests/manualMeshV5.xml b/libTests/manualMesh.xml similarity index 59% rename from libTests/manualMeshV5.xml rename to libTests/manualMesh.xml index bb177024..d5478c08 100644 --- a/libTests/manualMeshV5.xml +++ b/libTests/manualMesh.xml @@ -1,6 +1,6 @@ ------------------------------------------------------ -Typical example for mesh input file version 5 ------------------------------------------------------ +----------------------------------- +Typical example for mesh input file +----------------------------------- @@ -53,3 +53,27 @@ ECOGEN can read from single or multi-CPU mesh files coming from GMSH software (* %%%%%%%%%%%%%%%%%% << copy between these lines Caution: The optionnal node must be present if the multiCPU mesh file has not been used yet. Attribute GMSHPretraitement generates separated meshes accordingly to the CPU number from the global specified multiCPU mesh file. + +It is possible to record each cell reference length used in the CFL criteria to troubleshoot poor mesh quality (unstructured mesh only). +To do so the optionnal node must be set accordingly. +Obviously this option is not of interest during the course of the simulation to avoid unnecessary computations. +%%%%%%%%%%%%%%%%%% << copy between these lines + + + + +%%%%%%%%%%%%%%%%%% << copy between these lines + +ECOGEN offers the possibility to initialize a simulation with the result of a previous simulation performed on a different mesh and/or a different number of cpu. +One of the most common use case would be to run a simulation on a rough mesh until steady state is reached and use the result to initialize the flow field on a fine mesh to fasten the convergence to steady state. +Assuming a previous simulation with a rough mesh under the name "euler2DHPUnstructuredRough" has been previously run, the simulation with the fine mesh must have node as follows +%%%%%%%%%%%%%%%%%% << copy between these lines + + + + +%%%%%%%%%%%%%%%%%% << copy between these lines \ No newline at end of file diff --git a/libTests/manualModelV4.xml b/libTests/manualModel.xml similarity index 84% rename from libTests/manualModelV4.xml rename to libTests/manualModel.xml index 2eee23af..fd5cbd60 100644 --- a/libTests/manualModelV4.xml +++ b/libTests/manualModel.xml @@ -1,6 +1,6 @@ ---------------------------------------------------- -Typical example for model input file version 4 ---------------------------------------------------- +------------------------------------ +Typical example for model input file +------------------------------------ @@ -56,21 +56,28 @@ OPTIONNAL model parameters *************************** Apply low-Mach preconditioning to the selected model, useful for low-speed flows. %%%%%%%%%%%%%%%%%% << copy between these lines - + +%%%%%%%%%%%%%%%%%% << copy between these lines +Note that the minimum reference Mach number can be chosen if required (default is 1.e-2). +When the local Mach number of the flow is lower than this threshold, it is replaced by the threshold value in order to keep a reasonable computation time. +%%%%%%%%%%%%%%%%%% << copy between these lines + %%%%%%%%%%%%%%%%%% << copy between these lines +Currently this option is compatible with the flow models: Euler, UEq and PUEq. *) 1D geometry with smooth cross section variation ************************************************** In case of a 2D geometry with smooth cross section variation, it is possible to use a 1D geometry and reproduce 2D effects with this attribute. Only compatible with unstructured mesh defined with flow direction along the X-axis. -Boundary condition contributions in other directions than the X-axis should use nullFlux boundary condition (see initialConditionsVX.xml). +Boundary condition contributions in other directions than the X-axis should use nullFlux boundary condition (see initialConditions.xml). +Note that this option is available for the flow models: Euler, UEq, PUEq and EulerHomogeneous. %%%%%%%%%%%%%%%%%% << copy between these lines %%%%%%%%%%%%%%%%%% << copy between these lines *) Additionnal physics (in dev) ******************************* -Flow model can be augmented by additionnal physical effects as surface tension, viscosity and conductive heat transfer. +Flow model can be augmented by additionnal physical effects such as surface tension, viscosity and conductive heat transfer. a) Surface tension ------------------ This physical effect needs the name of advected variable used as color function for surface-tension terms as well as surface-tension coefficient in N/m. @@ -132,6 +139,13 @@ c) Moving Reference Frame %%%%%%%%%%%%%%%%%% << copy between these lines +In case only a specific region is rotating using the physicalEntity tag it is possible to set a better coupling of the interfaces between static and rotating regions as demonstrated below. +%%%%%%%%%%%%%%%%%% << copy between these lines + + + + +%%%%%%%%%%%%%%%%%% << copy between these lines d) Specific location for source term ------------------------------------ %%%%%%%%%%%%%%%%%% << copy between these lines diff --git a/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/initialConditions.xml b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/initialConditions.xml new file mode 100644 index 00000000..09d27581 --- /dev/null +++ b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/initialConditions.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/main.xml b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/main.xml new file mode 100644 index 00000000..1eb31528 --- /dev/null +++ b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/main.xml @@ -0,0 +1,10 @@ + + + pressureTemperatureVelocityEq1DheatedVapourAir + + + + + + + diff --git a/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/mesh.xml b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/mesh.xml new file mode 100644 index 00000000..639545bb --- /dev/null +++ b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/model.xml b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/model.xml new file mode 100644 index 00000000..b570cef4 --- /dev/null +++ b/libTests/referenceTestCases/PTUEq/heating/heatedVapourAir/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/initialConditionsV4.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/initialConditions.xml similarity index 87% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/initialConditionsV4.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/initialConditions.xml index 8adb1164..251581ee 100644 --- a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/initialConditions.xml @@ -2,8 +2,8 @@ - - + + @@ -15,7 +15,7 @@ - + @@ -28,7 +28,7 @@ - + diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/mainV5.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/main.xml similarity index 75% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/mainV5.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/main.xml index 95edb720..0eb54929 100644 --- a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/mainV5.xml +++ b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/main.xml @@ -1,6 +1,6 @@ - temperaturePressureVelocityEq1DShockTubeInterfaceDodecane + temperaturePressureVelocityEq1DShockTubeInterfaceDodecaneCartesian @@ -8,6 +8,6 @@ - vanleer + minmod diff --git a/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/mesh.xml diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/modelV4.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/model.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/modelV4.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/cartesian/model.xml diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/initialConditions.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/initialConditions.xml new file mode 100644 index 00000000..7c51c8ea --- /dev/null +++ b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/initialConditions.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/main.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/main.xml new file mode 100644 index 00000000..e2adb76e --- /dev/null +++ b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/main.xml @@ -0,0 +1,16 @@ + + + temperaturePressureVelocityEq1DShockTubeInterfaceDodecaneUnstructured + + + + + + + + + green-gauss + + diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/mesh.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/mesh.xml new file mode 100644 index 00000000..23165577 --- /dev/null +++ b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/modelV4.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/model.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/modelV4.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/unstructured/model.xml diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/PTUEq/shockTubes/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/initialConditionsV4.xml b/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/initialConditionsV4.xml rename to libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/initialConditions.xml diff --git a/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/mainV5.xml b/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/main.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/mainV5.xml rename to libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/main.xml diff --git a/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/meshV5.xml b/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/meshV5.xml rename to libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/mesh.xml diff --git a/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/modelV4.xml b/libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/model.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/modelV4.xml rename to libTests/referenceTestCases/PTUEq/transports/interfaceAirHelium/model.xml diff --git a/libTests/referenceTestCases/PUEq/1D/cavitation/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/1D/cavitation/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/cavitation/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/1D/cavitation/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/1D/cavitation/mainV5.xml b/libTests/referenceTestCases/PUEq/1D/cavitation/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/cavitation/mainV5.xml rename to libTests/referenceTestCases/PUEq/1D/cavitation/main.xml diff --git a/libTests/referenceTestCases/PUEq/1D/cavitation/meshV5.xml b/libTests/referenceTestCases/PUEq/1D/cavitation/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/cavitation/meshV5.xml rename to libTests/referenceTestCases/PUEq/1D/cavitation/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/1D/cavitation/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/cavitation/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/cavitation/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/cavitation/model.xml diff --git a/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/initialConditions.xml b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/initialConditions.xml new file mode 100644 index 00000000..77d192bb --- /dev/null +++ b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/initialConditions.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/main.xml b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/main.xml new file mode 100644 index 00000000..90778377 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/main.xml @@ -0,0 +1,10 @@ + + + pressureVelocityEq1DheatedVapourAir + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/mesh.xml b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/mesh.xml new file mode 100644 index 00000000..639545bb --- /dev/null +++ b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/model.xml similarity index 54% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/model.xml index 41164782..64ee138d 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/modelV4.xml +++ b/libTests/referenceTestCases/PUEq/1D/heating/heatedVapourAir/model.xml @@ -1,9 +1,9 @@ - - + - - - + + + + diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/mainV5.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/mainV5.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/main.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/meshV5.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/meshV5.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/epoxySpinel/model.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/main.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/shockTubes/interfaceWaterAirNASG/model.xml diff --git a/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/mainV5.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/mainV5.xml rename to libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/main.xml diff --git a/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/meshV5.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/meshV5.xml rename to libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio1427/model.xml diff --git a/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/initialConditions.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/initialConditions.xml new file mode 100644 index 00000000..ba6b0c87 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/main.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/main.xml new file mode 100644 index 00000000..14c274b7 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/main.xml @@ -0,0 +1,16 @@ + + + + pressureVelocityEq1DsphericalCollapse_Pratio353_50cellsPerD + + + + + + + + mc + thinc + thinc + + diff --git a/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/mesh.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/mesh.xml new file mode 100644 index 00000000..f84a644f --- /dev/null +++ b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/mesh.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/sphericalCollapse/Pratio353/model.xml diff --git a/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/PUEq/1D/transports/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameDynamicViscosity/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/RayleighTaylor/sameKinematicViscosity/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/initialConditions.xml new file mode 100644 index 00000000..084dc97c --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/initialConditions.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/main.xml similarity index 54% rename from libTests/referenceTestCases/PUEq/2D/foil/cavitation/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/main.xml index 8918ad8b..3694f343 100644 --- a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/mainV5.xml +++ b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/main.xml @@ -1,13 +1,13 @@ - pressureVelocityEq2DfoilCavitation + pressureVelocityEq2DdiscLimitSinglePhase - - + + - + green-gauss - \ No newline at end of file + diff --git a/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/mesh.xml b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/mesh.xml new file mode 100644 index 00000000..c7076cc4 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/model.xml b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/model.xml new file mode 100644 index 00000000..c42cf8b6 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/discLimitSinglePhase/model.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/foil/cavitation/initialConditions.xml similarity index 72% rename from libTests/referenceTestCases/PUEq/2D/foil/cavitation/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/foil/cavitation/initialConditions.xml index e9d5864f..af872c5e 100644 --- a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/2D/foil/cavitation/initialConditions.xml @@ -7,14 +7,14 @@ - - - - + + + + - - + + @@ -24,10 +24,10 @@ - + - + diff --git a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/main.xml b/libTests/referenceTestCases/PUEq/2D/foil/cavitation/main.xml new file mode 100644 index 00000000..6a30bc26 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/foil/cavitation/main.xml @@ -0,0 +1,30 @@ + + + pressureVelocityEq2DfoilCavitation + + + + + + + + green-gauss + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/foil/cavitation/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/foil/cavitation/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/foil/cavitation/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/model.xml b/libTests/referenceTestCases/PUEq/2D/foil/cavitation/model.xml new file mode 100644 index 00000000..ae95633a --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/foil/cavitation/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/initialConditions.xml similarity index 59% rename from libTests/referenceTestCases/PUEq/2D/foil/noCavitation/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/foil/noCavitation/initialConditions.xml index 826b5160..1adab15a 100644 --- a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/initialConditions.xml @@ -7,14 +7,14 @@ - - - - + + + + - - + + @@ -24,13 +24,13 @@ - + - + - + diff --git a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/main.xml b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/main.xml new file mode 100644 index 00000000..2e43d78a --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/main.xml @@ -0,0 +1,30 @@ + + + pressureVelocityEq2DfoilNoCavitation + + + + + + + + green-gauss + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/mainV5.xml deleted file mode 100644 index d0d05873..00000000 --- a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/mainV5.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - pressureVelocityEq2DfoilNoCavitation - - - - - - - - green-gauss - - - - - - - \ No newline at end of file diff --git a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/foil/noCavitation/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/foil/noCavitation/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/model.xml similarity index 95% rename from libTests/referenceTestCases/PUEq/2D/foil/noCavitation/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/foil/noCavitation/model.xml index fd3cf3b9..4d52fbe9 100644 --- a/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/modelV4.xml +++ b/libTests/referenceTestCases/PUEq/2D/foil/noCavitation/model.xml @@ -1,6 +1,6 @@ - + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/injection/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/injection/initialConditions.xml similarity index 83% rename from nonreg/nonregTests/PUEq/2D/nozzles/injection/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/injection/initialConditions.xml index 063784e5..9371bd28 100644 --- a/nonreg/nonregTests/PUEq/2D/nozzles/injection/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/injection/initialConditions.xml @@ -9,13 +9,13 @@ - - + + - - + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/injection/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/injection/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/nozzles/injection/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/injection/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/injection/mesh.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/injection/mesh.xml new file mode 100644 index 00000000..71d63263 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/injection/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/injection/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/injection/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/nozzles/injection/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/injection/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml similarity index 77% rename from nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml index 1e80db9a..a3f51dc7 100644 --- a/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml @@ -7,18 +7,20 @@ - - - - - - + + + - - + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/main.xml similarity index 91% rename from libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/main.xml index 80414031..6d587cbd 100644 --- a/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/main.xml @@ -6,5 +6,5 @@ - + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/mesh.xml similarity index 65% rename from nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/mesh.xml index be7e9eb9..f258467d 100644 --- a/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/mesh.xml @@ -2,6 +2,6 @@ - + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/initialConditions.xml new file mode 100644 index 00000000..ad70b445 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/initialConditions.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/main.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/main.xml new file mode 100644 index 00000000..9630ec24 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/main.xml @@ -0,0 +1,13 @@ + + + pressureVelocityEq2DnozzleSupersonicOutlet + + + + + + + + green-gauss + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/tank/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/mesh.xml similarity index 77% rename from libTests/referenceTestCases/PUEq/2D/nozzles/tank/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/mesh.xml index 77009fde..47f6fd0d 100644 --- a/libTests/referenceTestCases/PUEq/2D/nozzles/tank/meshV5.xml +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/model.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/model.xml new file mode 100644 index 00000000..1596380d --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/outletPressurePathological/model.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/tank/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/tank/initialConditions.xml similarity index 83% rename from nonreg/nonregTests/PUEq/2D/nozzles/tank/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/tank/initialConditions.xml index aa3bb0f8..0bec4f8c 100644 --- a/nonreg/nonregTests/PUEq/2D/nozzles/tank/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/tank/initialConditions.xml @@ -9,15 +9,15 @@ - - + + - - + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/tank/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/tank/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/nozzles/tank/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/tank/main.xml diff --git a/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/tank/mesh.xml similarity index 75% rename from libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/tank/mesh.xml index 062a4d58..4cd8b731 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/meshV5.xml +++ b/libTests/referenceTestCases/PUEq/2D/nozzles/tank/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/tank/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/nozzles/tank/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/nozzles/tank/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/nozzles/tank/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/initialConditions.xml new file mode 100644 index 00000000..3f2d889b --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/initialConditions.xml @@ -0,0 +1,63 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/main.xml b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/main.xml new file mode 100644 index 00000000..d14aec9e --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/main.xml @@ -0,0 +1,13 @@ + + + pressureVelocityEq2DrichtmyerMeshkov + + + + + + + + vanleer + + diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/mainV5.xml deleted file mode 100644 index faae3e01..00000000 --- a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/mainV5.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - pressureVelocityEq2DrichtmyerMeshkov - - - - - - - - mc - thinc - thinc - - diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/mesh.xml b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/mesh.xml new file mode 100644 index 00000000..19637f9a --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/meshV5.xml deleted file mode 100644 index eb1f5970..00000000 --- a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/meshV5.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/model.xml b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/model.xml new file mode 100644 index 00000000..c45abb32 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/shockBubble/heliumAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/shockTubeFreeSurface/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/initialConditions.xml new file mode 100644 index 00000000..86eb166e --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/main.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/main.xml new file mode 100644 index 00000000..d1504ae6 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/main.xml @@ -0,0 +1,18 @@ + + + pressureVelocityEq2DshockTubeUnstruct + + + + + + + + + + + green-gauss + + diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructured/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/mesh.xml similarity index 76% rename from libTests/referenceTestCases/euler/2D/HPUnstructured/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/mesh.xml index 706b073d..4ce61964 100644 --- a/libTests/referenceTestCases/euler/2D/HPUnstructured/meshV5.xml +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/model.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/model.xml new file mode 100644 index 00000000..15522da4 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstruct/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/initialConditions.xml new file mode 100644 index 00000000..86eb166e --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/main.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/main.xml new file mode 100644 index 00000000..8ae4acc7 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/main.xml @@ -0,0 +1,18 @@ + + + pressureVelocityEq2DshockTubeUnstructRotated + + + + + + + + + + + green-gauss + + diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/mesh.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/mesh.xml new file mode 100644 index 00000000..421d8dd4 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/model.xml b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/model.xml new file mode 100644 index 00000000..15522da4 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/shockTubeUnstructRotated/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio1427/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/initialConditions.xml new file mode 100644 index 00000000..526de56d --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/initialConditions.xml @@ -0,0 +1,48 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/main.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/main.xml new file mode 100644 index 00000000..0d1b5fb2 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/main.xml @@ -0,0 +1,15 @@ + + + pressureVelocityEq2DsphericalCollapse_Pratio353_50cellsPerD + + + + + + + + mc + thinc + thinc + + diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/mesh.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/mesh.xml new file mode 100644 index 00000000..806db420 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/mesh.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/model.xml b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/model.xml new file mode 100644 index 00000000..5c2ba2e8 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/sphericalCollapse/Pratio353/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/squareWaterExplosion/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/testUnstructured/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/testUnstructured/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/testUnstructured/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/testUnstructured/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/testUnstructured/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/testUnstructured/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/testUnstructured/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/testUnstructured/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/testUnstructured/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/testUnstructured/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/testUnstructured/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/testUnstructured/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/testUnstructured/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/testUnstructured/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/testUnstructured/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/testUnstructured/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/mainV5.xml b/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/mainV5.xml rename to libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/transportWaterSquareInAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/initialConditions.xml new file mode 100644 index 00000000..65c6893b --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/initialConditions.xml @@ -0,0 +1,63 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/main.xml b/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/main.xml new file mode 100644 index 00000000..448468ee --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/main.xml @@ -0,0 +1,15 @@ + + + pressureVelocityEq2DunderwaterExplosion + + + + + + + + mc + thinc + thinc + + diff --git a/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/mesh.xml b/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/mesh.xml new file mode 100644 index 00000000..50da4e82 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/3D/unstructured/modelV4.xml b/libTests/referenceTestCases/PUEq/2D/underwaterExplosion/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/unstructured/modelV4.xml rename to libTests/referenceTestCases/PUEq/2D/underwaterExplosion/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/venturi/initialConditions.xml b/libTests/referenceTestCases/PUEq/2D/venturi/initialConditions.xml new file mode 100644 index 00000000..8579cff1 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/venturi/initialConditions.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/venturi/main.xml b/libTests/referenceTestCases/PUEq/2D/venturi/main.xml new file mode 100644 index 00000000..8d8d9eee --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/venturi/main.xml @@ -0,0 +1,31 @@ + + + pressureVelocityEq2Dventuri + + + + + + + + + green-gauss + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/injection/meshV5.xml b/libTests/referenceTestCases/PUEq/2D/venturi/mesh.xml similarity index 76% rename from libTests/referenceTestCases/PUEq/2D/nozzles/injection/meshV5.xml rename to libTests/referenceTestCases/PUEq/2D/venturi/mesh.xml index 92c51113..cc433600 100644 --- a/libTests/referenceTestCases/PUEq/2D/nozzles/injection/meshV5.xml +++ b/libTests/referenceTestCases/PUEq/2D/venturi/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/PUEq/2D/venturi/model.xml b/libTests/referenceTestCases/PUEq/2D/venturi/model.xml new file mode 100644 index 00000000..94d6218f --- /dev/null +++ b/libTests/referenceTestCases/PUEq/2D/venturi/model.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/mainV5.xml b/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/mainV5.xml rename to libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/meshV5.xml b/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/meshV5.xml rename to libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/modelV4.xml b/libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/modelV4.xml rename to libTests/referenceTestCases/PUEq/3D/shockBubble/heliumAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/mainV5.xml b/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/mainV5.xml rename to libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/main.xml diff --git a/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/meshV5.xml b/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/meshV5.xml rename to libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/modelV4.xml b/libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/modelV4.xml rename to libTests/referenceTestCases/PUEq/3D/sphericalCollapse/Pratio1427/model.xml diff --git a/libTests/referenceTestCases/PUEq/3D/unstructured/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/3D/unstructured/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/unstructured/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/3D/unstructured/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/3D/unstructured/mainV5.xml b/libTests/referenceTestCases/PUEq/3D/unstructured/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/unstructured/mainV5.xml rename to libTests/referenceTestCases/PUEq/3D/unstructured/main.xml diff --git a/libTests/referenceTestCases/PUEq/3D/unstructured/meshV5.xml b/libTests/referenceTestCases/PUEq/3D/unstructured/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/3D/unstructured/meshV5.xml rename to libTests/referenceTestCases/PUEq/3D/unstructured/mesh.xml diff --git a/nonreg/nonregTests/PUEq/1D/cavitation/modelV4.xml b/libTests/referenceTestCases/PUEq/3D/unstructured/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/cavitation/modelV4.xml rename to libTests/referenceTestCases/PUEq/3D/unstructured/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/gravity/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/heatConduction/simple/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/initialConditions.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/initialConditions.xml new file mode 100644 index 00000000..64c89981 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/main.xml similarity index 53% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/main.xml index 7bd5abb3..9b2ff5db 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/mainV5.xml +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/main.xml @@ -1,15 +1,19 @@ - pressureVelocityEq1DshockTubeEvap - + pressureVelocityEq1Dcondensation + - - + + - + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/mesh.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/mesh.xml new file mode 100644 index 00000000..bb647377 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/model.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/model.xml new file mode 100644 index 00000000..e3a1b12a --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/condensation/model.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/initialConditions.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/initialConditions.xml new file mode 100644 index 00000000..ecf14179 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/initialConditions.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/main.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/main.xml new file mode 100644 index 00000000..d444ce8a --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/main.xml @@ -0,0 +1,14 @@ + + + pressureVelocityEq1DevapExpansionTubeEquilibrium + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/eulerHomogeneous/shockTubes/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/mesh.xml similarity index 82% rename from nonreg/nonregTests/eulerHomogeneous/shockTubes/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/mesh.xml index 69d29c3c..749e2306 100644 --- a/nonreg/nonregTests/eulerHomogeneous/shockTubes/meshV5.xml +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/mesh.xml @@ -3,6 +3,6 @@ - + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/model.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/model.xml new file mode 100644 index 00000000..bda43f43 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/initialConditions.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/initialConditions.xml new file mode 100644 index 00000000..7a3b4d8e --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/main.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/main.xml new file mode 100644 index 00000000..b25002a7 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/main.xml @@ -0,0 +1,19 @@ + + + pressureVelocityEq1Devaporation + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/mesh.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/mesh.xml new file mode 100644 index 00000000..bb647377 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/model.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/model.xml new file mode 100644 index 00000000..f13290a8 --- /dev/null +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/phaseChange/evaporation/model.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditions.xml similarity index 76% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditions.xml index 201ec21e..c9fcb1ee 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditions.xml @@ -12,25 +12,25 @@ - - + + - + - - + + - + - - + + - + - - + + - + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditions.xml similarity index 81% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditions.xml index 657b988e..4ef18457 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditions.xml @@ -12,21 +12,21 @@ - - + + - + - - + + - + - - + + - + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditions.xml similarity index 86% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditions.xml index 96bc3292..e2b2ef5d 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditions.xml @@ -13,16 +13,16 @@ - - + + - + - - + + - + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditions.xml similarity index 82% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditions.xml index 5f9f1544..9037ab48 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditionsV4.xml +++ b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditions.xml @@ -13,22 +13,22 @@ - - + + - + - - + + - + - - + + - + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditionsV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditionsV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditions.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mainV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/main.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mainV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/meshV5.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/meshV5.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/modelV4.xml b/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/modelV4.xml rename to libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/cavitation/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/cavitation/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/cavitation/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/cavitation/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/cavitation/mainV5.xml b/libTests/referenceTestCases/UEq/1D/cavitation/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/cavitation/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/cavitation/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/cavitation/meshV5.xml b/libTests/referenceTestCases/UEq/1D/cavitation/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/cavitation/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/cavitation/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/cavitation/modelV4.xml b/libTests/referenceTestCases/UEq/1D/cavitation/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/cavitation/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/cavitation/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/mixture/waterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/mixture/waterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/mixture/waterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/mixture/waterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/mixture/waterAir/mainV5.xml b/libTests/referenceTestCases/UEq/1D/mixture/waterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/mixture/waterAir/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/mixture/waterAir/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/mixture/waterAir/meshV5.xml b/libTests/referenceTestCases/UEq/1D/mixture/waterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/mixture/waterAir/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/mixture/waterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/mixture/waterAir/modelV4.xml b/libTests/referenceTestCases/UEq/1D/mixture/waterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/mixture/waterAir/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/mixture/waterAir/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/model.xml similarity index 74% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/model.xml index d1df53b5..d8c55cf1 100644 --- a/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/modelV4.xml +++ b/libTests/referenceTestCases/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/model.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/model.xml similarity index 74% rename from libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/model.xml index 8f96adb3..f064b214 100644 --- a/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/modelV4.xml +++ b/libTests/referenceTestCases/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/model.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/initialConditions.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/initialConditions.xml new file mode 100644 index 00000000..8b716d27 --- /dev/null +++ b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/initialConditions.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/main.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/main.xml new file mode 100644 index 00000000..b3e75e8f --- /dev/null +++ b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/main.xml @@ -0,0 +1,13 @@ + + + velocityEq1DshockTubeHMXWaterAir + + + + + + + + vanleer + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/mesh.xml similarity index 59% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/mesh.xml index fbb59304..db887ce5 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/meshV5.xml +++ b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/mesh.xml @@ -2,8 +2,8 @@ - - - + + + diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/model.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/model.xml new file mode 100644 index 00000000..e713663c --- /dev/null +++ b/libTests/referenceTestCases/UEq/1D/shockTubes/HMXWaterAir/model.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/mainV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/modelV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/epoxySpinel/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/mainV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/modelV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceAirHelium/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/interfaceWaterAirNASG/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/mainV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/meshV5.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/modelV4.xml b/libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/shockTubes/mixtures/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/mainV5.xml b/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/main.xml diff --git a/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/meshV5.xml b/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/modelV4.xml b/libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/sphericalCollapse/Pratio1427/model.xml diff --git a/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/UEq/1D/transports/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/initialConditions.xml b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/initialConditions.xml new file mode 100644 index 00000000..1189d27a --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/initialConditions.xml @@ -0,0 +1,60 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/main.xml b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/main.xml new file mode 100644 index 00000000..604cc5df --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/main.xml @@ -0,0 +1,13 @@ + + + velocityEq2DrichtmyerMeshkov + + + + + + + + vanleer + + diff --git a/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/mesh.xml b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/mesh.xml new file mode 100644 index 00000000..19637f9a --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/model.xml b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/model.xml new file mode 100644 index 00000000..98003a2b --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/RichtmyerMeshkov/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/initialConditions.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/initialConditions.xml new file mode 100644 index 00000000..519cb3fb --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/initialConditions.xml @@ -0,0 +1,64 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/main.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/main.xml new file mode 100644 index 00000000..5d3bd305 --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/main.xml @@ -0,0 +1,29 @@ + + + velocityEq2DdropletShockInducedCavitation_Mach2_4_mu3_5 + + + + + + + + mc + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/mesh.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/mesh.xml new file mode 100644 index 00000000..4a580068 --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/model.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/model.xml new file mode 100644 index 00000000..c2815708 --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4/model.xml @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/initialConditions.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/initialConditions.xml new file mode 100644 index 00000000..eba30776 --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/initialConditions.xml @@ -0,0 +1,63 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/main.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/main.xml new file mode 100644 index 00000000..beb8e8ca --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/main.xml @@ -0,0 +1,13 @@ + + + velocityEq2DdropletShockInducedCavitation_Mach2_4_mu3_5_pureWater + + + + + + + + mc + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/mesh.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/mesh.xml new file mode 100644 index 00000000..4a580068 --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/model.xml b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/model.xml new file mode 100644 index 00000000..ce625435 --- /dev/null +++ b/libTests/referenceTestCases/UEq/2D/dropletShockInducedCavitation/Mach2_4_pureWater/model.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/initialConditions.xml diff --git a/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/mainV5.xml b/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/mainV5.xml rename to libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/main.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/meshV5.xml b/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/mesh.xml similarity index 76% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/meshV5.xml rename to libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/mesh.xml index ced70ba7..0fe4f0ec 100644 --- a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/meshV5.xml +++ b/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/mesh.xml @@ -1,9 +1,9 @@ - - - - + + + + @@ -14,5 +14,5 @@ - + \ No newline at end of file diff --git a/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/modelV4.xml b/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/modelV4.xml rename to libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/model.xml diff --git a/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/initialConditionsV4.xml b/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/initialConditions.xml similarity index 90% rename from nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/initialConditionsV4.xml rename to libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/initialConditions.xml index cc37d3c8..68ff324b 100644 --- a/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/initialConditionsV4.xml +++ b/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/initialConditions.xml @@ -14,17 +14,17 @@ - - diff --git a/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/mainV5.xml b/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/main.xml similarity index 100% rename from libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/mainV5.xml rename to libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/main.xml diff --git a/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/meshV5.xml b/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/meshV5.xml rename to libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/mesh.xml diff --git a/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/modelV4.xml b/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/model.xml similarity index 100% rename from libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/modelV4.xml rename to libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/model.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditionsV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditionsV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditions.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/mainV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/main.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/mainV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/main.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/meshV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/meshV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/mesh.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/modelV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/model.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/modelV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/epoxySpinel/model.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditions.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mainV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/main.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mainV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/main.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/meshV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/meshV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mesh.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/modelV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/model.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/modelV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/model.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditionsV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditionsV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditions.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/mainV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/main.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/mainV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/meshV5.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/meshV5.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/mesh.xml diff --git a/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/modelV4.xml b/libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/model.xml similarity index 100% rename from libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/modelV4.xml rename to libTests/referenceTestCases/UEqTotEnergy/1D/transports/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/initialConditionsV4.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/mainV5.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/mainV5.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/main.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/meshV5.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/meshV5.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/mesh.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/modelV4.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/modelV4.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPLeft/model.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/initialConditionsV4.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPRight/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPRight/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/mainV5.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPRight/mainV5.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPRight/main.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/meshV5.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPRight/meshV5.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPRight/mesh.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/modelV4.xml b/libTests/referenceTestCases/euler/1D/shockTubes/HPRight/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/HPRight/modelV4.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/HPRight/model.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/spherical/initialConditionsV4.xml b/libTests/referenceTestCases/euler/1D/shockTubes/spherical/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/spherical/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/spherical/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/spherical/mainV5.xml b/libTests/referenceTestCases/euler/1D/shockTubes/spherical/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/spherical/mainV5.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/spherical/main.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/spherical/meshV5.xml b/libTests/referenceTestCases/euler/1D/shockTubes/spherical/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/spherical/meshV5.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/spherical/mesh.xml diff --git a/libTests/referenceTestCases/euler/1D/shockTubes/spherical/modelV4.xml b/libTests/referenceTestCases/euler/1D/shockTubes/spherical/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/shockTubes/spherical/modelV4.xml rename to libTests/referenceTestCases/euler/1D/shockTubes/spherical/model.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/initialConditionsV4.xml b/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/negativeVelocity/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/1D/transport/negativeVelocity/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/mainV5.xml b/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/negativeVelocity/mainV5.xml rename to libTests/referenceTestCases/euler/1D/transport/negativeVelocity/main.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/meshV5.xml b/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/negativeVelocity/meshV5.xml rename to libTests/referenceTestCases/euler/1D/transport/negativeVelocity/mesh.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/modelV4.xml b/libTests/referenceTestCases/euler/1D/transport/negativeVelocity/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/negativeVelocity/modelV4.xml rename to libTests/referenceTestCases/euler/1D/transport/negativeVelocity/model.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/initialConditionsV4.xml b/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/positiveVelocity/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/1D/transport/positiveVelocity/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/mainV5.xml b/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/positiveVelocity/mainV5.xml rename to libTests/referenceTestCases/euler/1D/transport/positiveVelocity/main.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/meshV5.xml b/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/positiveVelocity/meshV5.xml rename to libTests/referenceTestCases/euler/1D/transport/positiveVelocity/mesh.xml diff --git a/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/modelV4.xml b/libTests/referenceTestCases/euler/1D/transport/positiveVelocity/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/1D/transport/positiveVelocity/modelV4.xml rename to libTests/referenceTestCases/euler/1D/transport/positiveVelocity/model.xml diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/initialConditions.xml similarity index 56% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/initialConditions.xml index 7f68cdc0..8ae1fc4b 100644 --- a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/initialConditionsV4.xml +++ b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/initialConditions.xml @@ -2,13 +2,14 @@ - - + + - - + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/main.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/main.xml new file mode 100644 index 00000000..685381b3 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/main.xml @@ -0,0 +1,33 @@ + + + EulerBlasiusLEIS + + + + + + + + + + + + + green-gauss + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/mainV5.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/mainV5.xml deleted file mode 100644 index 0943cde3..00000000 --- a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/mainV5.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - EulerBlasiusLEIS - - - - - - - - - - - vanleer - - - - finite-difference - - - \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/meshV5.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/mesh.xml similarity index 59% rename from nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/meshV5.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/mesh.xml index c5e747e3..a2ea3f26 100644 --- a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/meshV5.xml +++ b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/mesh.xml @@ -1,7 +1,8 @@ - - + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/meshV5.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/meshV5.xml deleted file mode 100644 index 3e9be7ec..00000000 --- a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/meshV5.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/modelV4.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/modelV4.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusLEIS/model.xml diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/initialConditions.xml similarity index 70% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/initialConditions.xml index 14d327dc..80e31f64 100644 --- a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/initialConditionsV4.xml +++ b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/initialConditions.xml @@ -7,19 +7,19 @@ - - + + - - + + - - + + diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/mainV5.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/mainV5.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/main.xml diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/meshV5.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/meshV5.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/mesh.xml diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/modelV4.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/modelV4.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusLaminar/model.xml diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/initialConditions.xml similarity index 81% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/initialConditions.xml index d1c9ed3d..6158f7fc 100644 --- a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/initialConditionsV4.xml +++ b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/initialConditions.xml @@ -9,19 +9,19 @@ - - + + - - + + - - + + diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/mainV5.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/mainV5.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/main.xml diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/meshV5.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/meshV5.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/mesh.xml diff --git a/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/modelV4.xml b/libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/modelV4.xml rename to libTests/referenceTestCases/euler/2D/Blasius/BlasiusTurbulent/model.xml diff --git a/libTests/referenceTestCases/euler/2D/HPCenter/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/HPCenter/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/HPCenter/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/HPCenter/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/2D/HPCenter/mainV5.xml b/libTests/referenceTestCases/euler/2D/HPCenter/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/HPCenter/mainV5.xml rename to libTests/referenceTestCases/euler/2D/HPCenter/main.xml diff --git a/libTests/referenceTestCases/euler/2D/HPCenter/meshV5.xml b/libTests/referenceTestCases/euler/2D/HPCenter/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/HPCenter/meshV5.xml rename to libTests/referenceTestCases/euler/2D/HPCenter/mesh.xml diff --git a/libTests/referenceTestCases/euler/2D/HPCenter/modelV4.xml b/libTests/referenceTestCases/euler/2D/HPCenter/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/HPCenter/modelV4.xml rename to libTests/referenceTestCases/euler/2D/HPCenter/model.xml diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructured/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/HPUnstructured/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/HPUnstructured/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/HPUnstructured/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructured/mainV5.xml b/libTests/referenceTestCases/euler/2D/HPUnstructured/main.xml similarity index 92% rename from libTests/referenceTestCases/euler/2D/HPUnstructured/mainV5.xml rename to libTests/referenceTestCases/euler/2D/HPUnstructured/main.xml index d0a400ee..04e22a1b 100644 --- a/libTests/referenceTestCases/euler/2D/HPUnstructured/mainV5.xml +++ b/libTests/referenceTestCases/euler/2D/HPUnstructured/main.xml @@ -4,7 +4,7 @@ - + diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructured/mesh.xml b/libTests/referenceTestCases/euler/2D/HPUnstructured/mesh.xml new file mode 100644 index 00000000..8a0419c2 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/HPUnstructured/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructured/modelV4.xml b/libTests/referenceTestCases/euler/2D/HPUnstructured/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/HPUnstructured/modelV4.xml rename to libTests/referenceTestCases/euler/2D/HPUnstructured/model.xml diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/initialConditions.xml b/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/initialConditions.xml new file mode 100644 index 00000000..c334a461 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/initialConditions.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/main.xml b/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/main.xml new file mode 100644 index 00000000..dd9d9623 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/main.xml @@ -0,0 +1,15 @@ + + + euler2DHPUnstructuredMeshMappingRestart + + + + + + + + + green-gauss + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/mesh.xml b/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/mesh.xml new file mode 100644 index 00000000..9b757a1a --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/mesh.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructured/modelV4.xml b/libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPUnstructured/modelV4.xml rename to libTests/referenceTestCases/euler/2D/HPUnstructuredMeshMappingRestart/model.xml diff --git a/libTests/referenceTestCases/euler/2D/RayleighTaylor/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/RayleighTaylor/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/RayleighTaylor/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/RayleighTaylor/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/2D/RayleighTaylor/mainV5.xml b/libTests/referenceTestCases/euler/2D/RayleighTaylor/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/RayleighTaylor/mainV5.xml rename to libTests/referenceTestCases/euler/2D/RayleighTaylor/main.xml diff --git a/libTests/referenceTestCases/euler/2D/RayleighTaylor/meshV5.xml b/libTests/referenceTestCases/euler/2D/RayleighTaylor/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/RayleighTaylor/meshV5.xml rename to libTests/referenceTestCases/euler/2D/RayleighTaylor/mesh.xml diff --git a/libTests/referenceTestCases/euler/2D/RayleighTaylor/modelV4.xml b/libTests/referenceTestCases/euler/2D/RayleighTaylor/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/RayleighTaylor/modelV4.xml rename to libTests/referenceTestCases/euler/2D/RayleighTaylor/model.xml diff --git a/libTests/referenceTestCases/euler/2D/disc/initialConditions.xml b/libTests/referenceTestCases/euler/2D/disc/initialConditions.xml new file mode 100644 index 00000000..c5cbc488 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/disc/initialConditions.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/mainV5.xml b/libTests/referenceTestCases/euler/2D/disc/main.xml similarity index 67% rename from libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/mainV5.xml rename to libTests/referenceTestCases/euler/2D/disc/main.xml index d771baf6..8b3a7752 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/mainV5.xml +++ b/libTests/referenceTestCases/euler/2D/disc/main.xml @@ -1,10 +1,10 @@ - euler2DNozzleSupersonicInjection + euler2Ddisc - - + + diff --git a/libTests/referenceTestCases/euler/2D/disc/mesh.xml b/libTests/referenceTestCases/euler/2D/disc/mesh.xml new file mode 100644 index 00000000..c7076cc4 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/disc/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/disc/model.xml b/libTests/referenceTestCases/euler/2D/disc/model.xml new file mode 100644 index 00000000..51e654a7 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/disc/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/foil/initialConditions.xml b/libTests/referenceTestCases/euler/2D/foil/initialConditions.xml new file mode 100644 index 00000000..78d6537c --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/foil/initialConditions.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/foil/main.xml b/libTests/referenceTestCases/euler/2D/foil/main.xml new file mode 100644 index 00000000..1e69ca2f --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/foil/main.xml @@ -0,0 +1,30 @@ + + + euler2Dfoil + + + + + + + + green-gauss + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/foil/mesh.xml b/libTests/referenceTestCases/euler/2D/foil/mesh.xml new file mode 100644 index 00000000..a860dcd9 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/foil/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/foil/model.xml b/libTests/referenceTestCases/euler/2D/foil/model.xml new file mode 100644 index 00000000..05f6a066 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/foil/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/immersedBoundaries/initialConditions.xml b/libTests/referenceTestCases/euler/2D/immersedBoundaries/initialConditions.xml new file mode 100644 index 00000000..bfbdcb1d --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/immersedBoundaries/initialConditions.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/immersedBoundaries/main.xml b/libTests/referenceTestCases/euler/2D/immersedBoundaries/main.xml new file mode 100644 index 00000000..2e6fc823 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/immersedBoundaries/main.xml @@ -0,0 +1,13 @@ + + + euler2DImmersedBoundaries + + + + + + + + mc + + diff --git a/libTests/referenceTestCases/euler/2D/immersedBoundaries/mesh.xml b/libTests/referenceTestCases/euler/2D/immersedBoundaries/mesh.xml new file mode 100644 index 00000000..9c23e448 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/immersedBoundaries/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/modelV4.xml b/libTests/referenceTestCases/euler/2D/immersedBoundaries/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/modelV4.xml rename to libTests/referenceTestCases/euler/2D/immersedBoundaries/model.xml diff --git a/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/initialConditions.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/initialConditions.xml new file mode 100644 index 00000000..b98a0149 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/initialConditions.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/main.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/main.xml new file mode 100644 index 00000000..191cfd0e --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/main.xml @@ -0,0 +1,19 @@ + + + euler2DnozzleInjectionStagState + + + + + + + + green-gauss + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/meshV5.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/mesh.xml similarity index 74% rename from libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/meshV5.xml rename to libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/mesh.xml index 738d92ab..8012d8bc 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/meshV5.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/modelV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/modelV4.xml rename to libTests/referenceTestCases/euler/2D/nozzles/injectionStagState/model.xml diff --git a/libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/initialConditions.xml similarity index 69% rename from libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/initialConditions.xml index e9051fe7..26956d69 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/initialConditionsV4.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/initialConditions.xml @@ -9,13 +9,15 @@ - - - + + + + + - - + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/mainV5.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/main.xml similarity index 92% rename from libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/mainV5.xml rename to libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/main.xml index 42970d1e..ccfc46bc 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/subsonicInjection/mainV5.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/main.xml @@ -1,6 +1,6 @@ - euler2DnozzleSubsonicInjection + euler2DnozzleInjectionTemp diff --git a/nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/meshV5.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/mesh.xml similarity index 74% rename from nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/meshV5.xml rename to libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/mesh.xml index 738d92ab..8012d8bc 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/meshV5.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/euler/3D/LPCenter/modelV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/3D/LPCenter/modelV4.xml rename to libTests/referenceTestCases/euler/2D/nozzles/injectionTemp/model.xml diff --git a/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml similarity index 72% rename from nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml index f0cbfbfd..0e433583 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml @@ -7,17 +7,19 @@ - - - - - - + + + - - + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/main.xml similarity index 90% rename from libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml rename to libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/main.xml index 4bd74a8b..3589e3c8 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/main.xml @@ -6,5 +6,5 @@ - + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/mesh.xml similarity index 65% rename from libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml rename to libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/mesh.xml index be7e9eb9..f258467d 100644 --- a/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/mesh.xml @@ -2,6 +2,6 @@ - + diff --git a/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/model.xml similarity index 86% rename from nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml rename to libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/model.xml index 5b3bd27d..10f925d9 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/model.xml @@ -1,7 +1,7 @@ - + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/initialConditionsV4.xml deleted file mode 100644 index 64345ad8..00000000 --- a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/initialConditionsV4.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/initialConditions.xml similarity index 77% rename from nonreg/nonregTests/euler/2D/nozzles/tankWithShock/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/initialConditions.xml index 7358b672..0f64cdf7 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/initialConditionsV4.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/initialConditions.xml @@ -9,11 +9,11 @@ - - + + - - + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/mainV5.xml b/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/mainV5.xml rename to libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/main.xml diff --git a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/meshV5.xml b/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/mesh.xml similarity index 77% rename from libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/meshV5.xml rename to libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/mesh.xml index 389e4f5c..e6f64574 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/meshV5.xml +++ b/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/modelV4.xml b/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/modelV4.xml rename to libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/model.xml diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/initialConditions.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/initialConditions.xml new file mode 100644 index 00000000..d1af5c55 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/initialConditions.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/main.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/main.xml new file mode 100644 index 00000000..062e44f9 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/main.xml @@ -0,0 +1,18 @@ + + + euler2DshockTubeCartesian + + + + + + + + minmod + + + + green-gauss + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/mesh.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/mesh.xml new file mode 100644 index 00000000..f7aa6c0a --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/mesh.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/model.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/model.xml new file mode 100644 index 00000000..e8e4045c --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/cartesian/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/mainV5.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/mainV5.xml rename to libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/main.xml diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/meshV5.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/meshV5.xml rename to libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/mesh.xml diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/modelV4.xml b/libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/modelV4.xml rename to libTests/referenceTestCases/euler/2D/shockTubes/cylindrical/model.xml diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/initialConditions.xml b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/initialConditions.xml new file mode 100644 index 00000000..2791ef15 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/initialConditions.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/main.xml b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/main.xml new file mode 100644 index 00000000..2428ee17 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/main.xml @@ -0,0 +1,18 @@ + + + euler2DshockTubeUnstruct + + + + + + + + + + green-gauss + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/mesh.xml b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/mesh.xml new file mode 100644 index 00000000..ebba324d --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/model.xml b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/model.xml new file mode 100644 index 00000000..e8e4045c --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/shockTubes/unstruct/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/initialConditionsV4.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/mainV5.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/mainV5.xml rename to libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/main.xml diff --git a/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/meshV5.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/meshV5.xml rename to libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/mesh.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/modelV4.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/model.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/HPLeft/modelV4.xml rename to libTests/referenceTestCases/euler/2D/transports/rectangleDiagonal/model.xml diff --git a/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/initialConditions.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/initialConditions.xml new file mode 100644 index 00000000..669e9e97 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/initialConditions.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/main.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/main.xml new file mode 100644 index 00000000..d75456b2 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/main.xml @@ -0,0 +1,16 @@ + + + euler2DTransportRectangleDiagonalStruct + + + + + + + + + green-gauss + + diff --git a/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/mesh.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/mesh.xml new file mode 100644 index 00000000..e5426a89 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPRight/modelV4.xml b/libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/model.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/HPRight/modelV4.xml rename to libTests/referenceTestCases/euler/2D/transports/rectangleDiagonalUnstruct/model.xml diff --git a/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/initialConditions.xml b/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/initialConditions.xml new file mode 100644 index 00000000..f6636847 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/initialConditions.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/main.xml b/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/main.xml new file mode 100644 index 00000000..7749cb83 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/main.xml @@ -0,0 +1,13 @@ + + + euler2DTransport1dCartesian + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/mesh.xml b/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/mesh.xml new file mode 100644 index 00000000..59dce159 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/mesh.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/HPCenter/modelV4.xml b/libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter/modelV4.xml rename to libTests/referenceTestCases/euler/2D/transports/transport1dCartesian/model.xml diff --git a/libTests/referenceTestCases/euler/2D/venturi/initialConditions.xml b/libTests/referenceTestCases/euler/2D/venturi/initialConditions.xml new file mode 100644 index 00000000..369ca14f --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/venturi/initialConditions.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/euler/2D/venturi/main.xml b/libTests/referenceTestCases/euler/2D/venturi/main.xml new file mode 100644 index 00000000..fe051cff --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/venturi/main.xml @@ -0,0 +1,31 @@ + + + euler2Dventuri + + + + + + + + + green-gauss + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/injection/meshV5.xml b/libTests/referenceTestCases/euler/2D/venturi/mesh.xml similarity index 76% rename from nonreg/nonregTests/PUEq/2D/nozzles/injection/meshV5.xml rename to libTests/referenceTestCases/euler/2D/venturi/mesh.xml index 92c51113..cc433600 100644 --- a/nonreg/nonregTests/PUEq/2D/nozzles/injection/meshV5.xml +++ b/libTests/referenceTestCases/euler/2D/venturi/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/libTests/referenceTestCases/euler/2D/venturi/model.xml b/libTests/referenceTestCases/euler/2D/venturi/model.xml new file mode 100644 index 00000000..ca65e475 --- /dev/null +++ b/libTests/referenceTestCases/euler/2D/venturi/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/libTests/referenceTestCases/euler/3D/LPCenter/initialConditionsV4.xml b/libTests/referenceTestCases/euler/3D/LPCenter/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/euler/3D/LPCenter/initialConditionsV4.xml rename to libTests/referenceTestCases/euler/3D/LPCenter/initialConditions.xml diff --git a/libTests/referenceTestCases/euler/3D/LPCenter/mainV5.xml b/libTests/referenceTestCases/euler/3D/LPCenter/main.xml similarity index 100% rename from libTests/referenceTestCases/euler/3D/LPCenter/mainV5.xml rename to libTests/referenceTestCases/euler/3D/LPCenter/main.xml diff --git a/libTests/referenceTestCases/euler/3D/LPCenter/meshV5.xml b/libTests/referenceTestCases/euler/3D/LPCenter/mesh.xml similarity index 100% rename from libTests/referenceTestCases/euler/3D/LPCenter/meshV5.xml rename to libTests/referenceTestCases/euler/3D/LPCenter/mesh.xml diff --git a/nonreg/nonregTests/euler/2D/HPCenter_restart/modelV4.xml b/libTests/referenceTestCases/euler/3D/LPCenter/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter_restart/modelV4.xml rename to libTests/referenceTestCases/euler/3D/LPCenter/model.xml diff --git a/libTests/referenceTestCases/euler/3D/shockTubeCylinder/initialConditions.xml b/libTests/referenceTestCases/euler/3D/shockTubeCylinder/initialConditions.xml new file mode 100644 index 00000000..7d21b8dc --- /dev/null +++ b/libTests/referenceTestCases/euler/3D/shockTubeCylinder/initialConditions.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libTests/referenceTestCases/euler/3D/shockTubeCylinder/main.xml b/libTests/referenceTestCases/euler/3D/shockTubeCylinder/main.xml new file mode 100644 index 00000000..7f55f275 --- /dev/null +++ b/libTests/referenceTestCases/euler/3D/shockTubeCylinder/main.xml @@ -0,0 +1,18 @@ + + + euler3DshockTubeCylinder + + + + + + + + + green-gauss + + + + diff --git a/libTests/referenceTestCases/euler/3D/shockTubeCylinder/mesh.xml b/libTests/referenceTestCases/euler/3D/shockTubeCylinder/mesh.xml new file mode 100644 index 00000000..5107f6e4 --- /dev/null +++ b/libTests/referenceTestCases/euler/3D/shockTubeCylinder/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/modelV4.xml b/libTests/referenceTestCases/euler/3D/shockTubeCylinder/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/modelV4.xml rename to libTests/referenceTestCases/euler/3D/shockTubeCylinder/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/initialConditionsV4.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/initialConditions.xml similarity index 75% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/initialConditionsV4.xml rename to libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/initialConditions.xml index 6f3826e7..1d78c0f1 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/initialConditionsV4.xml +++ b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/initialConditions.xml @@ -6,21 +6,22 @@ - + - - + + + - + - + @@ -30,10 +31,10 @@ - + - + diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/mainV5.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/main.xml similarity index 69% rename from libTests/referenceTestCases/eulerHomogeneous/shockTubes/mainV5.xml rename to libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/main.xml index e460b19c..2eef6d3a 100644 --- a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/mainV5.xml +++ b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/main.xml @@ -1,13 +1,13 @@ - eulerHomogeneousShockTube + eulerHomogeneousShockTubeCartesian - - diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/mesh.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/mesh.xml new file mode 100644 index 00000000..5d4e2a8c --- /dev/null +++ b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/modelV4.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/model.xml similarity index 100% rename from libTests/referenceTestCases/eulerHomogeneous/shockTubes/modelV4.xml rename to libTests/referenceTestCases/eulerHomogeneous/shockTubes/cartesian/model.xml diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/initialConditions.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/initialConditions.xml new file mode 100644 index 00000000..c3206c92 --- /dev/null +++ b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/initialConditions.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/main.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/main.xml new file mode 100644 index 00000000..a08c9486 --- /dev/null +++ b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/main.xml @@ -0,0 +1,16 @@ + + + eulerHomogeneousShockTubeUnstructured + + + + + + + + + green-gauss + + diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/mesh.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/mesh.xml new file mode 100644 index 00000000..a587600d --- /dev/null +++ b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/mesh.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/nonreg/nonregTests/errors/errorRestartOutputType/modelV4.xml b/libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/model.xml similarity index 100% rename from nonreg/nonregTests/errors/errorRestartOutputType/modelV4.xml rename to libTests/referenceTestCases/eulerHomogeneous/shockTubes/unstructured/model.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/initialConditionsV4.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/initialConditionsV4.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/initialConditions.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/mainV5.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/main.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/mainV5.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/main.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/meshV5.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/mesh.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/meshV5.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/mesh.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/modelV4.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/model.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/modelV4.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/VanDerWaals/model.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditionsV4.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditionsV4.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditions.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/mainV5.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/main.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/mainV5.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/main.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/meshV5.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/mesh.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/meshV5.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/mesh.xml diff --git a/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/modelV4.xml b/libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/model.xml similarity index 100% rename from libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/modelV4.xml rename to libTests/referenceTestCases/eulerKorteweg/1D/shockTubes/polynomialEOS/model.xml diff --git a/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/initialConditionsV4.xml b/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/initialConditionsV4.xml rename to libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/initialConditions.xml diff --git a/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/mainV5.xml b/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/main.xml similarity index 100% rename from libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/mainV5.xml rename to libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/main.xml diff --git a/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/meshV5.xml b/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/mesh.xml similarity index 100% rename from libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/meshV5.xml rename to libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/mesh.xml diff --git a/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/modelV4.xml b/libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/model.xml similarity index 100% rename from libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/modelV4.xml rename to libTests/referenceTestCases/nonLinearSchrodinger/1D/shockTube/model.xml diff --git a/nonreg/ECOGEN_nonReg_full.list b/nonreg/ECOGEN_nonReg_full.list index b39987cb..bed0f24f 100644 --- a/nonreg/ECOGEN_nonReg_full.list +++ b/nonreg/ECOGEN_nonReg_full.list @@ -2,18 +2,26 @@ ./nonreg/nonregTests/euler/1D/shockTubes/HPRight/ 1 ./nonreg/nonregTests/euler/1D/shockTubes/spherical/ 1 ./nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/ 1 -./nonreg/nonregTests/euler/2D/HPUnstructured/ 1 ./nonreg/nonregTests/euler/2D/shockTubes/cylindrical/ 1 +./nonreg/nonregTests/euler/2D/shockTubes/unstruct/ 1 ./nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/ 1 +./nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/ 1 ./nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/ 1 ./nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/ 1 ./nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/ 1 +./nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/ 1 ./nonreg/nonregTests/PUEq/2D/RichtmyerMeshkov/ 1 ./nonreg/nonregTests/PUEq/2D/nozzles/tank/ 1 ./nonreg/nonregTests/PUEq/2D/nozzles/injection/ 1 ./nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/ 1 +./nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/ 1 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/ 1 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/ 1 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/ 1 ./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/ 1 ./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/ 1 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/ 1 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/ 1 ./nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/ 1 ./nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/ 1 ./nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/ 1 @@ -24,22 +32,30 @@ ./nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/ 1 ./nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/ 1 ./nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/ 1 -./nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/ 1 +./nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/ 3 +./nonreg/nonregTests/PTUEq/heating/heatedVapourAir/ 1 ./nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/ 1 +./nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/ 1 ./nonreg/nonregTests/errors/errorXMLElement/ 1 ./nonreg/nonregTests/errors/errorXMLAttribute/ 1 ./nonreg/nonregTests/errors/errorRestartOutputType/ 1 ./nonreg/nonregTests/euler/1D/transport/negativeVelocity/ 2 ./nonreg/nonregTests/euler/1D/shockTubes/HPLeft/ 3 +./nonreg/nonregTests/euler/2D/HPUnstructured/ 2 +./nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/ 3 +./nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/ 1 +./nonreg/nonregTests/euler/2D/immersedBoundaries/ 3 +./nonreg/nonregTests/euler/2D/disc/ 3 ./nonreg/nonregTests/euler/2D/fan/ 3 +./nonreg/nonregTests/euler/2D/foil/ 3 ./nonreg/nonregTests/euler/2D/HPCenter/ 7 ./nonreg/nonregTests/euler/2D/HPCenter_restart/ 7 ./nonreg/nonregTests/euler/2D/nozzles/tankWithShock/ 7 -./nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/ 7 -./nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/ 3 -./nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/ 1 +./nonreg/nonregTests/euler/2D/nozzles/injectionTemp/ 3 ./nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/ 7 +./nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/ 4 ./nonreg/nonregTests/euler/3D/LPCenter/ 7 +./nonreg/nonregTests/euler/3D/LPCenterEllipsoid/ 7 ./nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/ 2 ./nonreg/nonregTests/PUEq/1D/cavitation/ 5 ./nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/ 7 @@ -50,18 +66,25 @@ ./nonreg/nonregTests/PUEq/2D/testUnstructured/ 7 ./nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/ 7 ./nonreg/nonregTests/PUEq/2D/RayleighTaylor/ 7 -./nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/ 7 +./nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/ 7 +./nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/ 7 +./nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/ 7 ./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/ 7 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/ 4 ./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/ 7 ./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/ 7 ./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/ 7 ./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/ 7 -./nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/ 7 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/ 7 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/ 7 +./nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/ 4 ./nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/ 7 ./nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/ 7 ./nonreg/nonregTests/PUEq/3D/unstructured/ 7 ./nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/ 7 ./nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/ 7 +./nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/ 7 +./nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/ 7 ./nonreg/nonregTests/UEq/1D/mixture/waterAir/ 7 ./nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/ 7 ./nonreg/nonregTests/UEq/1D/cavitation/ 6 @@ -70,6 +93,8 @@ ./nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/ 7 ./nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/ 7 ./nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/ 6 -./nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/ 7 +./nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/ 7 +./nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/ 7 ./nonreg/nonregTests/eulerHomogeneous/shockTubes/ 4 -./nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/ 7 \ No newline at end of file +./nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/ 7 +./nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/ 7 \ No newline at end of file diff --git a/nonreg/nonreg.sh b/nonreg/nonreg.sh index 8fde151d..da76dbb7 100755 --- a/nonreg/nonreg.sh +++ b/nonreg/nonreg.sh @@ -11,7 +11,7 @@ MAIN_OUTPUT="mainOutput.out" REPORT_FILE="report.out" REFERENCE_BRANCH=origin/devel #REFERENCE_BRANCH="devel" -if [ -z $CI ] +if [ -z "$CI" ] then VALIDATION_BRANCH=$(git symbolic-ref HEAD --short) else @@ -36,6 +36,17 @@ then exit 1 fi +#Check if Gmsh is installed +#-------------------------- +gmsh --version &> /dev/null +#On Ubuntu Gmsh redirects to stdout while on MacOS +#it redirects to stderr (even if success) +if [ $? != 0 ] +then + echo "WARNING: Gmsh is not installed or not avalaible in your PATH." + echo "All unstructured nonreg test cases will not tested." +fi + echo "************************************************************************" echo "-------- RUNNING $VALIDATION_BRANCH BRANCH NONREG TESTS -----------" echo "************************************************************************" @@ -95,10 +106,18 @@ echo "Computing differences between reference and validation branches..." diff -x $MAIN_OUTPUT -qr -x 'infoCalcul.out' -x '.DS_Store' $reportFolderName/results_reference $reportFolderName/results_validation > $reportFolderName/diff_nonreg.out || true if [ -s $reportFolderName/diff_nonreg.out ] then - echo "Differences exist: Details available in $reportFolderName/diff_nonreg.out file." + echo "Differences exist: details available in $reportFolderName/diff_nonreg.out file." + if [ -n "$CI" ] #If continuous integration + then + echo "Differences exist: details available in attached file" | mutt -s "ECOGEN: Non regression failed" -a $reportFolderName/diff_nonreg.out -- $GITLAB_USER_EMAIL + fi error=1 else - echo "Non-regression tests complete: Results present no difference!" + echo "Non-regression tests complete: results present no difference!" + if [ -n "$CI" ] #If continuous integration + then + echo "Non-regression tests complete: results present no difference! Ready to merge" | mutt -s "ECOGEN: Non regression succeeded" $GITLAB_USER_EMAIL + fi fi #Sending error code if something went wrong diff --git a/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/initialConditions.xml b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/initialConditions.xml new file mode 100644 index 00000000..09d27581 --- /dev/null +++ b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/initialConditions.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/main.xml b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/main.xml new file mode 100644 index 00000000..1eb31528 --- /dev/null +++ b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/main.xml @@ -0,0 +1,10 @@ + + + pressureTemperatureVelocityEq1DheatedVapourAir + + + + + + + diff --git a/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/mesh.xml b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/mesh.xml new file mode 100644 index 00000000..639545bb --- /dev/null +++ b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/model.xml b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/model.xml new file mode 100644 index 00000000..b570cef4 --- /dev/null +++ b/nonreg/nonregTests/PTUEq/heating/heatedVapourAir/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/initialConditionsV4.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/initialConditionsV4.xml rename to nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/initialConditions.xml diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/mainV5.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/main.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/mainV5.xml rename to nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/main.xml diff --git a/libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/meshV5.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/mesh.xml similarity index 100% rename from libTests/referenceTestCases/PTUEq/shockTubes/interfaceDodecane/meshV5.xml rename to nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/mesh.xml diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/model.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/model.xml new file mode 100644 index 00000000..37441eea --- /dev/null +++ b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/cartesian/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/initialConditions.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/initialConditions.xml new file mode 100644 index 00000000..7c51c8ea --- /dev/null +++ b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/initialConditions.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/main.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/main.xml new file mode 100644 index 00000000..807d815b --- /dev/null +++ b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/main.xml @@ -0,0 +1,16 @@ + + + temperaturePressureVelocityEq1DShockTubeInterfaceDodecaneUnstructured + + + + + + + + minmod + + + green-gauss + + diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/mesh.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/mesh.xml new file mode 100644 index 00000000..23165577 --- /dev/null +++ b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/model.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/model.xml new file mode 100644 index 00000000..37441eea --- /dev/null +++ b/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/unstructured/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/meshV5.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/PTUEq/shockTubes/interfaceWaterAir/model.xml diff --git a/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/initialConditionsV4.xml b/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/initialConditionsV4.xml rename to nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/initialConditions.xml diff --git a/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/mainV5.xml b/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/main.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/mainV5.xml rename to nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/main.xml diff --git a/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/meshV5.xml b/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/mesh.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/meshV5.xml rename to nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/mesh.xml diff --git a/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/modelV4.xml b/nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/model.xml similarity index 100% rename from nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/modelV4.xml rename to nonreg/nonregTests/PTUEq/transports/interfaceAirHelium/model.xml diff --git a/nonreg/nonregTests/PUEq/1D/cavitation/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/1D/cavitation/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/cavitation/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/1D/cavitation/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/1D/cavitation/mainV5.xml b/nonreg/nonregTests/PUEq/1D/cavitation/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/cavitation/mainV5.xml rename to nonreg/nonregTests/PUEq/1D/cavitation/main.xml diff --git a/nonreg/nonregTests/PUEq/1D/cavitation/meshV5.xml b/nonreg/nonregTests/PUEq/1D/cavitation/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/cavitation/meshV5.xml rename to nonreg/nonregTests/PUEq/1D/cavitation/mesh.xml diff --git a/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/modelV4.xml b/nonreg/nonregTests/PUEq/1D/cavitation/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/squareWaterExplosion/modelV4.xml rename to nonreg/nonregTests/PUEq/1D/cavitation/model.xml diff --git a/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/initialConditions.xml b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/initialConditions.xml new file mode 100644 index 00000000..77d192bb --- /dev/null +++ b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/initialConditions.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/main.xml b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/main.xml new file mode 100644 index 00000000..90778377 --- /dev/null +++ b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/main.xml @@ -0,0 +1,10 @@ + + + pressureVelocityEq1DheatedVapourAir + + + + + + + diff --git a/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/mesh.xml b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/mesh.xml new file mode 100644 index 00000000..639545bb --- /dev/null +++ b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/modelV4.xml b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/model.xml similarity index 54% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/modelV4.xml rename to nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/model.xml index 41164782..64ee138d 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/modelV4.xml +++ b/nonreg/nonregTests/PUEq/1D/heating/heatedVapourAir/model.xml @@ -1,9 +1,9 @@ - - + - - - + + + + diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/mainV5.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/mainV5.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/main.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/meshV5.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/meshV5.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/mesh.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/modelV4.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/modelV4.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/epoxySpinel/model.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/meshV5.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAir/model.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/main.xml diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/meshV5.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml similarity index 100% rename from libTests/referenceTestCases/eulerHomogeneous/shockTubes/meshV5.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml b/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml rename to nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/model.xml diff --git a/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/mainV5.xml b/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/mainV5.xml rename to nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/main.xml diff --git a/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/meshV5.xml b/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/meshV5.xml rename to nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/model.xml b/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/model.xml new file mode 100644 index 00000000..0e4324d1 --- /dev/null +++ b/nonreg/nonregTests/PUEq/1D/sphericalCollapse/Pratio1427/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/meshV5.xml b/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/PUEq/1D/transports/interfaceWaterAir/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/RayleighTaylor/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/RayleighTaylor/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/RayleighTaylor/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/RayleighTaylor/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/RayleighTaylor/mainV5.xml b/nonreg/nonregTests/PUEq/2D/RayleighTaylor/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/RayleighTaylor/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/RayleighTaylor/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/RayleighTaylor/meshV5.xml b/nonreg/nonregTests/PUEq/2D/RayleighTaylor/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/RayleighTaylor/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/RayleighTaylor/mesh.xml diff --git a/nonreg/nonregTests/PUEq/2D/RayleighTaylor/modelV4.xml b/nonreg/nonregTests/PUEq/2D/RayleighTaylor/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/RayleighTaylor/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/RayleighTaylor/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/initialConditions.xml b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/initialConditions.xml new file mode 100644 index 00000000..084dc97c --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/initialConditions.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/main.xml b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/main.xml new file mode 100644 index 00000000..c947e1cb --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/main.xml @@ -0,0 +1,13 @@ + + + pressureVelocityEq2DdiscLimitSinglePhase + + + + + + + + green-gauss + + diff --git a/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/mesh.xml b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/mesh.xml new file mode 100644 index 00000000..b0532b0c --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/model.xml b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/model.xml new file mode 100644 index 00000000..c42cf8b6 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/discLimitSinglePhase/model.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/injection/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/nozzles/injection/initialConditions.xml similarity index 83% rename from libTests/referenceTestCases/PUEq/2D/nozzles/injection/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/injection/initialConditions.xml index 063784e5..9371bd28 100644 --- a/libTests/referenceTestCases/PUEq/2D/nozzles/injection/initialConditionsV4.xml +++ b/nonreg/nonregTests/PUEq/2D/nozzles/injection/initialConditions.xml @@ -9,13 +9,13 @@ - - + + - - + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/injection/mainV5.xml b/nonreg/nonregTests/PUEq/2D/nozzles/injection/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/nozzles/injection/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/injection/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/injection/mesh.xml b/nonreg/nonregTests/PUEq/2D/nozzles/injection/mesh.xml new file mode 100644 index 00000000..71d63263 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/nozzles/injection/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/injection/modelV4.xml b/nonreg/nonregTests/PUEq/2D/nozzles/injection/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/nozzles/injection/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/injection/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml similarity index 77% rename from libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml index 1e80db9a..c1434837 100644 --- a/libTests/referenceTestCases/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml +++ b/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml @@ -7,18 +7,20 @@ - - - - - - + + + - - + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml b/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/main.xml similarity index 91% rename from nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/main.xml index ba89189a..52d69997 100644 --- a/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml +++ b/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/main.xml @@ -6,5 +6,5 @@ - + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml b/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/mesh.xml similarity index 65% rename from libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/mesh.xml index be7e9eb9..f258467d 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml +++ b/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/mesh.xml @@ -2,6 +2,6 @@ - + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml b/nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/lowMachSmoothCrossSection/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/initialConditions.xml b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/initialConditions.xml new file mode 100644 index 00000000..ad70b445 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/initialConditions.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/main.xml b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/main.xml new file mode 100644 index 00000000..9630ec24 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/main.xml @@ -0,0 +1,13 @@ + + + pressureVelocityEq2DnozzleSupersonicOutlet + + + + + + + + green-gauss + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/tank/meshV5.xml b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/mesh.xml similarity index 77% rename from nonreg/nonregTests/PUEq/2D/nozzles/tank/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/mesh.xml index 77009fde..47f6fd0d 100644 --- a/nonreg/nonregTests/PUEq/2D/nozzles/tank/meshV5.xml +++ b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/mesh.xml @@ -2,7 +2,7 @@ - + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/model.xml b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/model.xml new file mode 100644 index 00000000..1596380d --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/nozzles/outletPressurePathological/model.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/2D/nozzles/tank/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/nozzles/tank/initialConditions.xml similarity index 83% rename from libTests/referenceTestCases/PUEq/2D/nozzles/tank/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/tank/initialConditions.xml index aa3bb0f8..0bec4f8c 100644 --- a/libTests/referenceTestCases/PUEq/2D/nozzles/tank/initialConditionsV4.xml +++ b/nonreg/nonregTests/PUEq/2D/nozzles/tank/initialConditions.xml @@ -9,15 +9,15 @@ - - + + - - + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/tank/mainV5.xml b/nonreg/nonregTests/PUEq/2D/nozzles/tank/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/nozzles/tank/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/tank/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/tank/mesh.xml b/nonreg/nonregTests/PUEq/2D/nozzles/tank/mesh.xml new file mode 100644 index 00000000..4cd8b731 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/nozzles/tank/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/nozzles/tank/modelV4.xml b/nonreg/nonregTests/PUEq/2D/nozzles/tank/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/nozzles/tank/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/nozzles/tank/model.xml diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/initialConditions.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/initialConditionsV4.xml deleted file mode 100644 index 6767b2a7..00000000 --- a/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/initialConditionsV4.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/mainV5.xml b/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/meshV5.xml b/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/modelV4.xml b/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/model.xml similarity index 100% rename from libTests/referenceTestCases/PUEq/2D/richtmyerMeshkov/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/modelV4.xml b/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/modelV4.xml deleted file mode 100644 index e16274d3..00000000 --- a/nonreg/nonregTests/PUEq/2D/richtmyerMeshkov/modelV4.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/mainV5.xml b/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/meshV5.xml b/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/mesh.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/modelV4.xml b/nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/shockBubble/heliumAir/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/mainV5.xml b/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/meshV5.xml b/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/mesh.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/modelV4.xml b/nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/shockTubeFreeSurface/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/initialConditions.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/initialConditions.xml new file mode 100644 index 00000000..86eb166e --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/main.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/main.xml new file mode 100644 index 00000000..e9fede42 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/main.xml @@ -0,0 +1,18 @@ + + + pressureVelocityEq2DshockTubeUnstruct + + + + + + + + + minmod + + + + green-gauss + + diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/mesh.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/mesh.xml new file mode 100644 index 00000000..4ce61964 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/model.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/model.xml new file mode 100644 index 00000000..15522da4 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstruct/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/initialConditions.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/initialConditions.xml new file mode 100644 index 00000000..86eb166e --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/main.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/main.xml new file mode 100644 index 00000000..dbfde069 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/main.xml @@ -0,0 +1,18 @@ + + + pressureVelocityEq2DshockTubeUnstructRotated + + + + + + + + + minmod + + + + green-gauss + + diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/mesh.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/mesh.xml new file mode 100644 index 00000000..421d8dd4 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/model.xml b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/model.xml new file mode 100644 index 00000000..15522da4 --- /dev/null +++ b/nonreg/nonregTests/PUEq/2D/shockTubeUnstructRotated/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/mainV5.xml b/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/meshV5.xml b/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/modelV4.xml b/nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/sphericalCollapse/Pratio1427/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/squareWaterExplosion/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/squareWaterExplosion/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/mainV5.xml b/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/squareWaterExplosion/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/squareWaterExplosion/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/meshV5.xml b/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/squareWaterExplosion/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/squareWaterExplosion/mesh.xml diff --git a/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/modelV4.xml b/nonreg/nonregTests/PUEq/2D/squareWaterExplosion/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/squareWaterExplosion/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/testUnstructured/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/testUnstructured/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/testUnstructured/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/testUnstructured/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/testUnstructured/mainV5.xml b/nonreg/nonregTests/PUEq/2D/testUnstructured/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/testUnstructured/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/testUnstructured/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/testUnstructured/meshV5.xml b/nonreg/nonregTests/PUEq/2D/testUnstructured/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/testUnstructured/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/testUnstructured/mesh.xml diff --git a/nonreg/nonregTests/PUEq/2D/testUnstructured/modelV4.xml b/nonreg/nonregTests/PUEq/2D/testUnstructured/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/testUnstructured/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/testUnstructured/model.xml diff --git a/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/mainV5.xml b/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/mainV5.xml rename to nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/main.xml diff --git a/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/meshV5.xml b/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/meshV5.xml rename to nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/mesh.xml diff --git a/nonreg/nonregTests/PUEq/3D/unstructured/modelV4.xml b/nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/unstructured/modelV4.xml rename to nonreg/nonregTests/PUEq/2D/transportWaterSquareInAir/model.xml diff --git a/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/mainV5.xml b/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/mainV5.xml rename to nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/main.xml diff --git a/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/meshV5.xml b/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/meshV5.xml rename to nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/mesh.xml diff --git a/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/modelV4.xml b/nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/modelV4.xml rename to nonreg/nonregTests/PUEq/3D/shockBubble/heliumAir/model.xml diff --git a/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/mainV5.xml b/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/mainV5.xml rename to nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/main.xml diff --git a/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/meshV5.xml b/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/meshV5.xml rename to nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/modelV4.xml b/nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/modelV4.xml rename to nonreg/nonregTests/PUEq/3D/sphericalCollapse/Pratio1427/model.xml diff --git a/nonreg/nonregTests/PUEq/3D/unstructured/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/3D/unstructured/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/unstructured/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/3D/unstructured/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/3D/unstructured/mainV5.xml b/nonreg/nonregTests/PUEq/3D/unstructured/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/unstructured/mainV5.xml rename to nonreg/nonregTests/PUEq/3D/unstructured/main.xml diff --git a/nonreg/nonregTests/PUEq/3D/unstructured/meshV5.xml b/nonreg/nonregTests/PUEq/3D/unstructured/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/3D/unstructured/meshV5.xml rename to nonreg/nonregTests/PUEq/3D/unstructured/mesh.xml diff --git a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/modelV4.xml b/nonreg/nonregTests/PUEq/3D/unstructured/model.xml similarity index 65% rename from libTests/referenceTestCases/PUEq/2D/foil/cavitation/modelV4.xml rename to nonreg/nonregTests/PUEq/3D/unstructured/model.xml index 43373f7a..a33dc512 100644 --- a/libTests/referenceTestCases/PUEq/2D/foil/cavitation/modelV4.xml +++ b/nonreg/nonregTests/PUEq/3D/unstructured/model.xml @@ -1,6 +1,6 @@ - - + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/mainV5.xml deleted file mode 100644 index 70dcb0b9..00000000 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/evap/evapShockTube/mainV5.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - pressureVelocityEq1DshockTubeEvap - - - - - - - - diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/main.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/model.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/model.xml new file mode 100644 index 00000000..05d4f39c --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK2/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/initialConditions.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/initialConditions.xml new file mode 100644 index 00000000..43ef38b3 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/main.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/main.xml new file mode 100644 index 00000000..ef499f50 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/main.xml @@ -0,0 +1,15 @@ + + + pressureVelocityEq2Dgravity + + + + + + + + vanleer + thinc + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/mesh.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/mesh.xml new file mode 100644 index 00000000..c99adf24 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/gravity/RK4/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/initialConditions.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/initialConditions.xml new file mode 100644 index 00000000..54801d5b --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/initialConditions.xml @@ -0,0 +1,50 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/main.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/main.xml new file mode 100644 index 00000000..247e62c1 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/main.xml @@ -0,0 +1,13 @@ + + + pressureVelocityEq3DheatConductionCylinder + + + + + + + + vanleer + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/mesh.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/mesh.xml new file mode 100644 index 00000000..0cff247e --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/mesh.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/model.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/model.xml new file mode 100644 index 00000000..695e121c --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/cylinder/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/main.xml similarity index 91% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/main.xml index b660d98e..d6d03608 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/mainV5.xml +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/main.xml @@ -2,8 +2,8 @@ pressureVelocityEq1DConduction - - + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/heatConduction/simple/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/initialConditions.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/initialConditions.xml new file mode 100644 index 00000000..64c89981 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/main.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/main.xml new file mode 100644 index 00000000..b4d541c0 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/main.xml @@ -0,0 +1,19 @@ + + + pressureVelocityEq1Dcondensation + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/mesh.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/mesh.xml new file mode 100644 index 00000000..bb647377 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/model.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/model.xml new file mode 100644 index 00000000..e3a1b12a --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/condensation/model.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/initialConditions.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/initialConditions.xml new file mode 100644 index 00000000..ecf14179 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/initialConditions.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/main.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/main.xml new file mode 100644 index 00000000..d59c95f4 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/main.xml @@ -0,0 +1,14 @@ + + + pressureVelocityEq1DevapExpansionTubeEquilibrium + + + + + + + + vanleer + + + \ No newline at end of file diff --git a/nonreg/nonregTests/errors/errorRestartOutputType/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/mesh.xml similarity index 82% rename from nonreg/nonregTests/errors/errorRestartOutputType/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/mesh.xml index 69d29c3c..5b2a66df 100644 --- a/nonreg/nonregTests/errors/errorRestartOutputType/meshV5.xml +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/mesh.xml @@ -3,6 +3,6 @@ - + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/model.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/model.xml new file mode 100644 index 00000000..bda43f43 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evapExpansionTubeEquilibrium/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/initialConditions.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/initialConditions.xml new file mode 100644 index 00000000..7a3b4d8e --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/initialConditions.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/main.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/main.xml new file mode 100644 index 00000000..73ec4278 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/main.xml @@ -0,0 +1,19 @@ + + + pressureVelocityEq1Devaporation + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/mesh.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/mesh.xml new file mode 100644 index 00000000..bb647377 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/model.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/model.xml new file mode 100644 index 00000000..f13290a8 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/phaseChange/evaporation/model.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/initialConditions.xml similarity index 81% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/initialConditions.xml index 657b988e..4ef18457 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditionsV4.xml +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/initialConditions.xml @@ -12,21 +12,21 @@ - - + + - + - - + + - + - - + + - + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/main.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/main.xml new file mode 100644 index 00000000..ae0e980e --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/main.xml @@ -0,0 +1,17 @@ + + + pressureVelocityEq2DsurfaceTensionCylinderToSphereSymmetry + + + + + + + + mc + minmod + minmod + thinc + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/model.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/model.xml new file mode 100644 index 00000000..71ddd38a --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/cylinderToSphereSymmetry/model.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/main.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/main.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/dropletImpact_restart/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditions.xml similarity index 76% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditions.xml index 201ec21e..c9fcb1ee 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditionsV4.xml +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/initialConditions.xml @@ -12,25 +12,25 @@ - - + + - + - - + + - + - - + + - + - - + + - + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/main.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircle/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditions.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditions.xml new file mode 100644 index 00000000..4ef18457 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/initialConditions.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/main.xml similarity index 87% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/main.xml index 773bddc4..8bab18e0 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mainV5.xml +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/main.xml @@ -2,10 +2,6 @@ pressureVelocityEq2DsurfaceTensionSquareToCircleSymmetry - diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mesh.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mesh.xml new file mode 100644 index 00000000..a448f4d8 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetry/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/initialConditions.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/initialConditions.xml new file mode 100644 index 00000000..4ef18457 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/initialConditions.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/main.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/main.xml new file mode 100644 index 00000000..828d915d --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/main.xml @@ -0,0 +1,19 @@ + + + pressureVelocityEq2DsurfaceTensionSquareToCircleSymmetryGreenGauss + + + + + + + + mc + minmod + minmod + thinc + + + green-gauss + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/mesh.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/mesh.xml new file mode 100644 index 00000000..21248f10 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/model.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/model.xml new file mode 100644 index 00000000..151112b4 --- /dev/null +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/squareToCircleSymmetryGreenGauss/model.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditions.xml similarity index 86% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditions.xml index 96bc3292..e2b2ef5d 100644 --- a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditionsV4.xml +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/initialConditions.xml @@ -13,16 +13,16 @@ - - + + - + - - + + - + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/main.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterCylinderInAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditions.xml similarity index 82% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditions.xml index 5f9f1544..9037ab48 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditionsV4.xml +++ b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/initialConditions.xml @@ -13,22 +13,22 @@ - - + + - + - - + + - + - - + + - + diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/main.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir/model.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditionsV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditionsV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/initialConditions.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mainV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/main.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mainV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/main.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/meshV5.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/meshV5.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/mesh.xml diff --git a/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/modelV4.xml b/nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/model.xml similarity index 100% rename from nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/modelV4.xml rename to nonreg/nonregTests/PUEq/AddPhysicalEffects/surfaceTension/waterDropletInAir_axisym/model.xml diff --git a/nonreg/nonregTests/UEq/1D/cavitation/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/cavitation/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/cavitation/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/cavitation/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/cavitation/mainV5.xml b/nonreg/nonregTests/UEq/1D/cavitation/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/cavitation/mainV5.xml rename to nonreg/nonregTests/UEq/1D/cavitation/main.xml diff --git a/nonreg/nonregTests/UEq/1D/cavitation/meshV5.xml b/nonreg/nonregTests/UEq/1D/cavitation/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/cavitation/meshV5.xml rename to nonreg/nonregTests/UEq/1D/cavitation/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/cavitation/modelV4.xml b/nonreg/nonregTests/UEq/1D/cavitation/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/cavitation/modelV4.xml rename to nonreg/nonregTests/UEq/1D/cavitation/model.xml diff --git a/nonreg/nonregTests/UEq/1D/mixture/waterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/mixture/waterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/mixture/waterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/mixture/waterAir/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/mixture/waterAir/mainV5.xml b/nonreg/nonregTests/UEq/1D/mixture/waterAir/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/mixture/waterAir/mainV5.xml rename to nonreg/nonregTests/UEq/1D/mixture/waterAir/main.xml diff --git a/nonreg/nonregTests/UEq/1D/mixture/waterAir/meshV5.xml b/nonreg/nonregTests/UEq/1D/mixture/waterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/mixture/waterAir/meshV5.xml rename to nonreg/nonregTests/UEq/1D/mixture/waterAir/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/mixture/waterAir/modelV4.xml b/nonreg/nonregTests/UEq/1D/mixture/waterAir/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/mixture/waterAir/modelV4.xml rename to nonreg/nonregTests/UEq/1D/mixture/waterAir/model.xml diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditions.xml similarity index 96% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditions.xml index 5a33025a..dc6d561b 100644 --- a/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditionsV4.xml +++ b/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/initialConditions.xml @@ -4,7 +4,7 @@ - + diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mainV5.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/main.xml similarity index 92% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/main.xml index 1b49231a..f976f394 100644 --- a/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mainV5.xml +++ b/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/main.xml @@ -3,7 +3,7 @@ velocityEq1DshockOnDiffusedInterfaceWaterAir - + diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/modelV4.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/model.xml similarity index 74% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/model.xml index d1df53b5..d8c55cf1 100644 --- a/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/modelV4.xml +++ b/nonreg/nonregTests/UEq/1D/shockOnInterface/diffusedInterfaceWaterAir/model.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mainV5.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/modelV4.xml b/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/model.xml similarity index 74% rename from nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/model.xml index 8f96adb3..f064b214 100644 --- a/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/modelV4.xml +++ b/nonreg/nonregTests/UEq/1D/shockOnInterface/sharpInterfaceWaterAir/model.xml @@ -3,5 +3,5 @@ - + \ No newline at end of file diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/initialConditions.xml b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/initialConditions.xml new file mode 100644 index 00000000..8b716d27 --- /dev/null +++ b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/initialConditions.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/main.xml b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/main.xml new file mode 100644 index 00000000..8355a7b2 --- /dev/null +++ b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/main.xml @@ -0,0 +1,13 @@ + + + velocityEq1DshockTubeHMXWaterAir + + + + + + + + vanleer + + diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/mesh.xml b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/mesh.xml new file mode 100644 index 00000000..db887ce5 --- /dev/null +++ b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/model.xml b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/model.xml new file mode 100644 index 00000000..e713663c --- /dev/null +++ b/nonreg/nonregTests/UEq/1D/shockTubes/HMXWaterAir/model.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/mainV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/mainV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/main.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/modelV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/modelV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/epoxySpinel/model.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/mainV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/mainV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/main.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/modelV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/modelV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceAirHelium/model.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAir/model.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/mainV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/main.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/modelV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/interfaceWaterAirNASG/model.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/mixtures/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/mixtures/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/mainV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/mixtures/mainV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/mixtures/main.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/mixtures/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/mixtures/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/modelV4.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixtures/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/shockTubes/mixtures/modelV4.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/mixtures/model.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/initialConditions.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/initialConditions.xml new file mode 100644 index 00000000..33d8dd78 --- /dev/null +++ b/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/initialConditions.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/main.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/main.xml new file mode 100644 index 00000000..815e0a19 --- /dev/null +++ b/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/main.xml @@ -0,0 +1,13 @@ + + + velocityEq1DshockTubeMixturesSupersonic + + + + + + + + vanleer + + diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/meshV5.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/model.xml b/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/model.xml new file mode 100644 index 00000000..713b91e3 --- /dev/null +++ b/nonreg/nonregTests/UEq/1D/shockTubes/mixturesSupersonic/model.xml @@ -0,0 +1,12 @@ + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/mainV5.xml b/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/mainV5.xml rename to nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/main.xml diff --git a/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/meshV5.xml b/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/meshV5.xml rename to nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/modelV4.xml b/nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/modelV4.xml rename to nonreg/nonregTests/UEq/1D/sphericalCollapse/Pratio1427/model.xml diff --git a/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/meshV5.xml b/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/UEq/1D/transports/interfaceWaterAir/model.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/initialConditionsV4.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/mainV5.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/mainV5.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/main.xml diff --git a/libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/meshV5.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/mesh.xml similarity index 100% rename from libTests/referenceTestCases/UEq/2D/nonSphericalCollapseNearWall/meshV5.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/mesh.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/modelV4.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/modelV4.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/model.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/initialConditionsV4.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/initialConditions.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/mainV5.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/mainV5.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/main.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/meshV5.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall/meshV5.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/mesh.xml diff --git a/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/modelV4.xml b/nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/modelV4.xml rename to nonreg/nonregTests/UEq/2D/nonSphericalCollapseNearWall_restart/model.xml diff --git a/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/initialConditionsV4.xml b/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/initialConditions.xml similarity index 90% rename from libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/initialConditionsV4.xml rename to nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/initialConditions.xml index cc37d3c8..68ff324b 100644 --- a/libTests/referenceTestCases/UEq/2D/squareToCircleSymmetry/initialConditionsV4.xml +++ b/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/initialConditions.xml @@ -14,17 +14,17 @@ - - diff --git a/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/mainV5.xml b/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/main.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/mainV5.xml rename to nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/main.xml diff --git a/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/meshV5.xml b/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/meshV5.xml rename to nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/mesh.xml diff --git a/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/modelV4.xml b/nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/model.xml similarity index 100% rename from nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/modelV4.xml rename to nonreg/nonregTests/UEq/2D/squareToCircleSymmetry/model.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/meshV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/meshV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/mesh.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockOnInterface/interfaceWaterAir/model.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditionsV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditionsV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/initialConditions.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/mainV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/main.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/mainV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/main.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/meshV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/meshV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/mesh.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/modelV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/model.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/modelV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/epoxySpinel/model.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditionsV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/initialConditions.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mainV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/main.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mainV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/main.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/meshV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mesh.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/meshV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/mesh.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/modelV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/model.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/modelV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceAirHelium/model.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/main.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/meshV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mesh.xml similarity index 70% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/meshV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mesh.xml index fbb59304..c48505c3 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/meshV5.xml +++ b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/mesh.xml @@ -3,7 +3,7 @@ - - + + diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/shockTubes/interfaceWaterAir/model.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditionsV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditionsV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/initialConditions.xml diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/mainV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/main.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/mainV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/main.xml diff --git a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/meshV5.xml b/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/mesh.xml similarity index 89% rename from nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/meshV5.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/mesh.xml index 9f953dd0..728d6321 100644 --- a/nonreg/nonregTests/PTUEq/shockTubes/interfaceDodecane/meshV5.xml +++ b/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/mesh.xml @@ -3,7 +3,7 @@ - + diff --git a/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/modelV4.xml b/nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/model.xml similarity index 100% rename from nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/modelV4.xml rename to nonreg/nonregTests/UEqTotEnergy/1D/transports/interfaceWaterAir/model.xml diff --git a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/initialConditionsV4.xml b/nonreg/nonregTests/errors/errorRestartOutputType/initialConditions.xml similarity index 75% rename from libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/initialConditionsV4.xml rename to nonreg/nonregTests/errors/errorRestartOutputType/initialConditions.xml index 6f3826e7..1d78c0f1 100644 --- a/libTests/referenceTestCases/PUEq/AddPhysicalEffects/evap/evapShockTube/initialConditionsV4.xml +++ b/nonreg/nonregTests/errors/errorRestartOutputType/initialConditions.xml @@ -6,21 +6,22 @@ - + - - + + + - + - + @@ -30,10 +31,10 @@ - + - + diff --git a/nonreg/nonregTests/errors/errorRestartOutputType/initialConditionsV4.xml b/nonreg/nonregTests/errors/errorRestartOutputType/initialConditionsV4.xml deleted file mode 100644 index 6a86ce3c..00000000 --- a/nonreg/nonregTests/errors/errorRestartOutputType/initialConditionsV4.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nonreg/nonregTests/errors/errorRestartOutputType/mainV5.xml b/nonreg/nonregTests/errors/errorRestartOutputType/main.xml similarity index 100% rename from nonreg/nonregTests/errors/errorRestartOutputType/mainV5.xml rename to nonreg/nonregTests/errors/errorRestartOutputType/main.xml diff --git a/nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml b/nonreg/nonregTests/errors/errorRestartOutputType/mesh.xml similarity index 100% rename from nonreg/nonregTests/PUEq/1D/shockTubes/interfaceWaterAirNASG/meshV5.xml rename to nonreg/nonregTests/errors/errorRestartOutputType/mesh.xml diff --git a/nonreg/nonregTests/eulerHomogeneous/shockTubes/modelV4.xml b/nonreg/nonregTests/errors/errorRestartOutputType/model.xml similarity index 100% rename from nonreg/nonregTests/eulerHomogeneous/shockTubes/modelV4.xml rename to nonreg/nonregTests/errors/errorRestartOutputType/model.xml diff --git a/nonreg/nonregTests/errors/errorXMLAttribute/initialConditionsV4.xml b/nonreg/nonregTests/errors/errorXMLAttribute/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLAttribute/initialConditionsV4.xml rename to nonreg/nonregTests/errors/errorXMLAttribute/initialConditions.xml diff --git a/nonreg/nonregTests/errors/errorXMLAttribute/mainV5.xml b/nonreg/nonregTests/errors/errorXMLAttribute/main.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLAttribute/mainV5.xml rename to nonreg/nonregTests/errors/errorXMLAttribute/main.xml diff --git a/nonreg/nonregTests/errors/errorXMLAttribute/meshV5.xml b/nonreg/nonregTests/errors/errorXMLAttribute/mesh.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLAttribute/meshV5.xml rename to nonreg/nonregTests/errors/errorXMLAttribute/mesh.xml diff --git a/nonreg/nonregTests/errors/errorXMLAttribute/modelV4.xml b/nonreg/nonregTests/errors/errorXMLAttribute/model.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLAttribute/modelV4.xml rename to nonreg/nonregTests/errors/errorXMLAttribute/model.xml diff --git a/nonreg/nonregTests/errors/errorXMLElement/initialConditionsV4.xml b/nonreg/nonregTests/errors/errorXMLElement/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLElement/initialConditionsV4.xml rename to nonreg/nonregTests/errors/errorXMLElement/initialConditions.xml diff --git a/nonreg/nonregTests/errors/errorXMLElement/mainV5.xml b/nonreg/nonregTests/errors/errorXMLElement/main.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLElement/mainV5.xml rename to nonreg/nonregTests/errors/errorXMLElement/main.xml diff --git a/nonreg/nonregTests/errors/errorXMLElement/meshV5.xml b/nonreg/nonregTests/errors/errorXMLElement/mesh.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLElement/meshV5.xml rename to nonreg/nonregTests/errors/errorXMLElement/mesh.xml diff --git a/nonreg/nonregTests/errors/errorXMLElement/modelV4.xml b/nonreg/nonregTests/errors/errorXMLElement/model.xml similarity index 100% rename from nonreg/nonregTests/errors/errorXMLElement/modelV4.xml rename to nonreg/nonregTests/errors/errorXMLElement/model.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/initialConditionsV4.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/initialConditions.xml similarity index 92% rename from nonreg/nonregTests/euler/1D/shockTubes/HPLeft/initialConditionsV4.xml rename to nonreg/nonregTests/euler/1D/shockTubes/HPLeft/initialConditions.xml index 023d31f2..ae90815b 100644 --- a/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/initialConditionsV4.xml +++ b/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/initialConditions.xml @@ -21,6 +21,7 @@ + @@ -29,6 +30,7 @@ + diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/mainV5.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/main.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/HPLeft/mainV5.xml rename to nonreg/nonregTests/euler/1D/shockTubes/HPLeft/main.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/meshV5.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/HPLeft/meshV5.xml rename to nonreg/nonregTests/euler/1D/shockTubes/HPLeft/mesh.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/model.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/model.xml new file mode 100644 index 00000000..e8e4045c --- /dev/null +++ b/nonreg/nonregTests/euler/1D/shockTubes/HPLeft/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPRight/initialConditionsV4.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPRight/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/HPRight/initialConditionsV4.xml rename to nonreg/nonregTests/euler/1D/shockTubes/HPRight/initialConditions.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPRight/mainV5.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPRight/main.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/HPRight/mainV5.xml rename to nonreg/nonregTests/euler/1D/shockTubes/HPRight/main.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/HPRight/meshV5.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPRight/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/HPRight/meshV5.xml rename to nonreg/nonregTests/euler/1D/shockTubes/HPRight/mesh.xml diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/modelV4.xml b/nonreg/nonregTests/euler/1D/shockTubes/HPRight/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/modelV4.xml rename to nonreg/nonregTests/euler/1D/shockTubes/HPRight/model.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/spherical/initialConditionsV4.xml b/nonreg/nonregTests/euler/1D/shockTubes/spherical/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/spherical/initialConditionsV4.xml rename to nonreg/nonregTests/euler/1D/shockTubes/spherical/initialConditions.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/spherical/mainV5.xml b/nonreg/nonregTests/euler/1D/shockTubes/spherical/main.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/spherical/mainV5.xml rename to nonreg/nonregTests/euler/1D/shockTubes/spherical/main.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/spherical/meshV5.xml b/nonreg/nonregTests/euler/1D/shockTubes/spherical/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/spherical/meshV5.xml rename to nonreg/nonregTests/euler/1D/shockTubes/spherical/mesh.xml diff --git a/nonreg/nonregTests/euler/1D/shockTubes/spherical/modelV4.xml b/nonreg/nonregTests/euler/1D/shockTubes/spherical/model.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/shockTubes/spherical/modelV4.xml rename to nonreg/nonregTests/euler/1D/shockTubes/spherical/model.xml diff --git a/nonreg/nonregTests/euler/1D/transport/negativeVelocity/initialConditionsV4.xml b/nonreg/nonregTests/euler/1D/transport/negativeVelocity/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/negativeVelocity/initialConditionsV4.xml rename to nonreg/nonregTests/euler/1D/transport/negativeVelocity/initialConditions.xml diff --git a/nonreg/nonregTests/euler/1D/transport/negativeVelocity/mainV5.xml b/nonreg/nonregTests/euler/1D/transport/negativeVelocity/main.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/negativeVelocity/mainV5.xml rename to nonreg/nonregTests/euler/1D/transport/negativeVelocity/main.xml diff --git a/nonreg/nonregTests/euler/1D/transport/negativeVelocity/meshV5.xml b/nonreg/nonregTests/euler/1D/transport/negativeVelocity/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/negativeVelocity/meshV5.xml rename to nonreg/nonregTests/euler/1D/transport/negativeVelocity/mesh.xml diff --git a/nonreg/nonregTests/euler/1D/transport/negativeVelocity/modelV4.xml b/nonreg/nonregTests/euler/1D/transport/negativeVelocity/model.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/negativeVelocity/modelV4.xml rename to nonreg/nonregTests/euler/1D/transport/negativeVelocity/model.xml diff --git a/nonreg/nonregTests/euler/1D/transport/positiveVelocity/initialConditionsV4.xml b/nonreg/nonregTests/euler/1D/transport/positiveVelocity/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/positiveVelocity/initialConditionsV4.xml rename to nonreg/nonregTests/euler/1D/transport/positiveVelocity/initialConditions.xml diff --git a/nonreg/nonregTests/euler/1D/transport/positiveVelocity/mainV5.xml b/nonreg/nonregTests/euler/1D/transport/positiveVelocity/main.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/positiveVelocity/mainV5.xml rename to nonreg/nonregTests/euler/1D/transport/positiveVelocity/main.xml diff --git a/nonreg/nonregTests/euler/1D/transport/positiveVelocity/meshV5.xml b/nonreg/nonregTests/euler/1D/transport/positiveVelocity/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/positiveVelocity/meshV5.xml rename to nonreg/nonregTests/euler/1D/transport/positiveVelocity/mesh.xml diff --git a/nonreg/nonregTests/euler/1D/transport/positiveVelocity/modelV4.xml b/nonreg/nonregTests/euler/1D/transport/positiveVelocity/model.xml similarity index 100% rename from nonreg/nonregTests/euler/1D/transport/positiveVelocity/modelV4.xml rename to nonreg/nonregTests/euler/1D/transport/positiveVelocity/model.xml diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/initialConditions.xml similarity index 73% rename from nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/initialConditions.xml index 82591e5c..19d4c099 100644 --- a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/initialConditionsV4.xml +++ b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/initialConditions.xml @@ -2,22 +2,22 @@ - + - - + + + - - + diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/main.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/main.xml new file mode 100644 index 00000000..7efd4f29 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/main.xml @@ -0,0 +1,33 @@ + + + EulerBlasiusLEIS + + + + + + + + + + + minmod + + + + green-gauss + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/mainV5.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/mainV5.xml deleted file mode 100644 index 3415c4aa..00000000 --- a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/mainV5.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - EulerBlasiusLEIS - - - - - - - - - - - vanleer - - - - finite-difference - - - \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/mesh.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/mesh.xml new file mode 100644 index 00000000..a5a2a6e7 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/modelV4.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/modelV4.xml rename to nonreg/nonregTests/euler/2D/Blasius/BlasiusLEIS/model.xml diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/initialConditions.xml similarity index 73% rename from nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/initialConditions.xml index 9f895870..390e374c 100644 --- a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/initialConditionsV4.xml +++ b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/initialConditions.xml @@ -8,19 +8,19 @@ - - + + - - + + - - + + diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/mainV5.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/mainV5.xml rename to nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/main.xml diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/meshV5.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/meshV5.xml rename to nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/mesh.xml diff --git a/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/modelV4.xml b/nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/modelV4.xml rename to nonreg/nonregTests/euler/2D/Blasius/BlasiusLaminar/model.xml diff --git a/nonreg/nonregTests/euler/2D/HPCenter/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/HPCenter/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/HPCenter/initialConditions.xml diff --git a/nonreg/nonregTests/euler/2D/HPCenter/mainV5.xml b/nonreg/nonregTests/euler/2D/HPCenter/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter/mainV5.xml rename to nonreg/nonregTests/euler/2D/HPCenter/main.xml diff --git a/nonreg/nonregTests/euler/2D/HPCenter/meshV5.xml b/nonreg/nonregTests/euler/2D/HPCenter/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter/meshV5.xml rename to nonreg/nonregTests/euler/2D/HPCenter/mesh.xml diff --git a/nonreg/nonregTests/euler/3D/LPCenter/modelV4.xml b/nonreg/nonregTests/euler/2D/HPCenter/model.xml similarity index 100% rename from nonreg/nonregTests/euler/3D/LPCenter/modelV4.xml rename to nonreg/nonregTests/euler/2D/HPCenter/model.xml diff --git a/nonreg/nonregTests/euler/2D/HPCenter_restart/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/HPCenter_restart/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter_restart/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/HPCenter_restart/initialConditions.xml diff --git a/nonreg/nonregTests/euler/2D/HPCenter_restart/mainV5.xml b/nonreg/nonregTests/euler/2D/HPCenter_restart/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter_restart/mainV5.xml rename to nonreg/nonregTests/euler/2D/HPCenter_restart/main.xml diff --git a/nonreg/nonregTests/euler/2D/HPCenter_restart/meshV5.xml b/nonreg/nonregTests/euler/2D/HPCenter_restart/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPCenter_restart/meshV5.xml rename to nonreg/nonregTests/euler/2D/HPCenter_restart/mesh.xml diff --git a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/modelV4.xml b/nonreg/nonregTests/euler/2D/HPCenter_restart/model.xml similarity index 78% rename from nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/modelV4.xml rename to nonreg/nonregTests/euler/2D/HPCenter_restart/model.xml index 94d2b3c8..fe074f7f 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/modelV4.xml +++ b/nonreg/nonregTests/euler/2D/HPCenter_restart/model.xml @@ -1,5 +1,5 @@ - + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructured/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/HPUnstructured/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPUnstructured/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/HPUnstructured/initialConditions.xml diff --git a/nonreg/nonregTests/euler/2D/HPUnstructured/mainV5.xml b/nonreg/nonregTests/euler/2D/HPUnstructured/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/HPUnstructured/mainV5.xml rename to nonreg/nonregTests/euler/2D/HPUnstructured/main.xml diff --git a/nonreg/nonregTests/euler/2D/HPUnstructured/meshV5.xml b/nonreg/nonregTests/euler/2D/HPUnstructured/mesh.xml similarity index 62% rename from nonreg/nonregTests/euler/2D/HPUnstructured/meshV5.xml rename to nonreg/nonregTests/euler/2D/HPUnstructured/mesh.xml index 706b073d..5b20badd 100644 --- a/nonreg/nonregTests/euler/2D/HPUnstructured/meshV5.xml +++ b/nonreg/nonregTests/euler/2D/HPUnstructured/mesh.xml @@ -2,7 +2,7 @@ - - + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/modelV4.xml b/nonreg/nonregTests/euler/2D/HPUnstructured/model.xml similarity index 78% rename from libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/modelV4.xml rename to nonreg/nonregTests/euler/2D/HPUnstructured/model.xml index 94d2b3c8..e3cc42ec 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/supersonicInjection/modelV4.xml +++ b/nonreg/nonregTests/euler/2D/HPUnstructured/model.xml @@ -1,5 +1,5 @@ - + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/initialConditions.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/initialConditions.xml new file mode 100644 index 00000000..29042adf --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/initialConditions.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/main.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/main.xml new file mode 100644 index 00000000..fc7a5619 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/main.xml @@ -0,0 +1,22 @@ + + + euler2DHPUnstructuredMeshMappingRestartPar + + + + + + + + + green-gauss + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/mesh.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/mesh.xml new file mode 100644 index 00000000..c30dc7e4 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/mesh.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/model.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/model.xml new file mode 100644 index 00000000..e3cc42ec --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartPar/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/initialConditions.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/initialConditions.xml new file mode 100644 index 00000000..29042adf --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/initialConditions.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/main.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/main.xml new file mode 100644 index 00000000..93437442 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/main.xml @@ -0,0 +1,22 @@ + + + euler2DHPUnstructuredMeshMappingRestartSeq + + + + + + + + + green-gauss + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/mesh.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/mesh.xml new file mode 100644 index 00000000..c30dc7e4 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/mesh.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/model.xml b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/model.xml new file mode 100644 index 00000000..e3cc42ec --- /dev/null +++ b/nonreg/nonregTests/euler/2D/HPUnstructuredMeshMappingRestartSeq/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nonreg/nonregTests/euler/2D/disc/initialConditions.xml b/nonreg/nonregTests/euler/2D/disc/initialConditions.xml new file mode 100644 index 00000000..c5cbc488 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/disc/initialConditions.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/mainV5.xml b/nonreg/nonregTests/euler/2D/disc/main.xml similarity index 67% rename from nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/mainV5.xml rename to nonreg/nonregTests/euler/2D/disc/main.xml index 29f46c70..e48b6d8a 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/mainV5.xml +++ b/nonreg/nonregTests/euler/2D/disc/main.xml @@ -1,10 +1,10 @@ - euler2DNozzleSupersonicInjection + euler2Ddisc - - + + diff --git a/nonreg/nonregTests/euler/2D/disc/mesh.xml b/nonreg/nonregTests/euler/2D/disc/mesh.xml new file mode 100644 index 00000000..b0532b0c --- /dev/null +++ b/nonreg/nonregTests/euler/2D/disc/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/disc/model.xml b/nonreg/nonregTests/euler/2D/disc/model.xml new file mode 100644 index 00000000..51e654a7 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/disc/model.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/fan/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/fan/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/fan/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/fan/initialConditions.xml diff --git a/nonreg/nonregTests/euler/2D/fan/mainV5.xml b/nonreg/nonregTests/euler/2D/fan/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/fan/mainV5.xml rename to nonreg/nonregTests/euler/2D/fan/main.xml diff --git a/nonreg/nonregTests/euler/2D/fan/meshV5.xml b/nonreg/nonregTests/euler/2D/fan/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/fan/meshV5.xml rename to nonreg/nonregTests/euler/2D/fan/mesh.xml diff --git a/nonreg/nonregTests/euler/2D/fan/modelV4.xml b/nonreg/nonregTests/euler/2D/fan/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/fan/modelV4.xml rename to nonreg/nonregTests/euler/2D/fan/model.xml diff --git a/nonreg/nonregTests/euler/2D/foil/initialConditions.xml b/nonreg/nonregTests/euler/2D/foil/initialConditions.xml new file mode 100644 index 00000000..5561eaad --- /dev/null +++ b/nonreg/nonregTests/euler/2D/foil/initialConditions.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/foil/main.xml b/nonreg/nonregTests/euler/2D/foil/main.xml new file mode 100644 index 00000000..dda1e775 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/foil/main.xml @@ -0,0 +1,30 @@ + + + euler2Dfoil + + + + + + + + green-gauss + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/foil/mesh.xml b/nonreg/nonregTests/euler/2D/foil/mesh.xml new file mode 100644 index 00000000..a860dcd9 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/foil/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/foil/model.xml b/nonreg/nonregTests/euler/2D/foil/model.xml new file mode 100644 index 00000000..05f6a066 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/foil/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/immersedBoundaries/initialConditions.xml b/nonreg/nonregTests/euler/2D/immersedBoundaries/initialConditions.xml new file mode 100644 index 00000000..bfbdcb1d --- /dev/null +++ b/nonreg/nonregTests/euler/2D/immersedBoundaries/initialConditions.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/immersedBoundaries/main.xml b/nonreg/nonregTests/euler/2D/immersedBoundaries/main.xml new file mode 100644 index 00000000..2e6fc823 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/immersedBoundaries/main.xml @@ -0,0 +1,13 @@ + + + euler2DImmersedBoundaries + + + + + + + + mc + + diff --git a/nonreg/nonregTests/euler/2D/immersedBoundaries/mesh.xml b/nonreg/nonregTests/euler/2D/immersedBoundaries/mesh.xml new file mode 100644 index 00000000..9c23e448 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/immersedBoundaries/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/immersedBoundaries/model.xml b/nonreg/nonregTests/euler/2D/immersedBoundaries/model.xml new file mode 100644 index 00000000..fe074f7f --- /dev/null +++ b/nonreg/nonregTests/euler/2D/immersedBoundaries/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/initialConditions.xml similarity index 71% rename from nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/nozzles/injectionTemp/initialConditions.xml index e9051fe7..997fe2b5 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/initialConditionsV4.xml +++ b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/initialConditions.xml @@ -9,13 +9,13 @@ - - - + + + - - + + diff --git a/nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/mainV5.xml b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/main.xml similarity index 92% rename from nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/mainV5.xml rename to nonreg/nonregTests/euler/2D/nozzles/injectionTemp/main.xml index 530b7e86..ec6e3e2b 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/subsonicInjection/mainV5.xml +++ b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/main.xml @@ -1,6 +1,6 @@ - euler2DnozzleSubsonicInjection + euler2DnozzleInjectionTemp diff --git a/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/mesh.xml b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/mesh.xml new file mode 100644 index 00000000..8012d8bc --- /dev/null +++ b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/model.xml b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/model.xml new file mode 100644 index 00000000..fe074f7f --- /dev/null +++ b/nonreg/nonregTests/euler/2D/nozzles/injectionTemp/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml similarity index 62% rename from libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml index f0cbfbfd..a7128f99 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditionsV4.xml +++ b/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/initialConditions.xml @@ -7,17 +7,19 @@ + + + + + + + + + + - - + - - - - - - - diff --git a/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml b/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/mainV5.xml rename to nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/main.xml diff --git a/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml b/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/mesh.xml similarity index 65% rename from nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml rename to nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/mesh.xml index be7e9eb9..f258467d 100644 --- a/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/meshV5.xml +++ b/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/mesh.xml @@ -2,6 +2,6 @@ - + diff --git a/libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml b/nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/model.xml similarity index 100% rename from libTests/referenceTestCases/euler/2D/nozzles/lowMachSmoothCrossSection/modelV4.xml rename to nonreg/nonregTests/euler/2D/nozzles/lowMachSmoothCrossSection/model.xml diff --git a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/initialConditionsV4.xml deleted file mode 100644 index 64345ad8..00000000 --- a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/initialConditionsV4.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/meshV5.xml b/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/meshV5.xml deleted file mode 100644 index be0372aa..00000000 --- a/nonreg/nonregTests/euler/2D/nozzles/supersonicInjection/meshV5.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/initialConditions.xml similarity index 77% rename from libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/nozzles/tankWithShock/initialConditions.xml index 7358b672..0f64cdf7 100644 --- a/libTests/referenceTestCases/euler/2D/nozzles/tankWithShock/initialConditionsV4.xml +++ b/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/initialConditions.xml @@ -9,11 +9,11 @@ - - + + - - + + diff --git a/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/mainV5.xml b/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/nozzles/tankWithShock/mainV5.xml rename to nonreg/nonregTests/euler/2D/nozzles/tankWithShock/main.xml diff --git a/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/mesh.xml b/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/mesh.xml new file mode 100644 index 00000000..1ad7be2e --- /dev/null +++ b/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/meshV5.xml b/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/meshV5.xml deleted file mode 100644 index be0372aa..00000000 --- a/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/meshV5.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/modelV4.xml b/nonreg/nonregTests/euler/2D/nozzles/tankWithShock/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/nozzles/tankWithShock/modelV4.xml rename to nonreg/nonregTests/euler/2D/nozzles/tankWithShock/model.xml diff --git a/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/shockTubes/cylindrical/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/shockTubes/cylindrical/initialConditions.xml diff --git a/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/mainV5.xml b/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/shockTubes/cylindrical/mainV5.xml rename to nonreg/nonregTests/euler/2D/shockTubes/cylindrical/main.xml diff --git a/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/meshV5.xml b/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/shockTubes/cylindrical/meshV5.xml rename to nonreg/nonregTests/euler/2D/shockTubes/cylindrical/mesh.xml diff --git a/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/modelV4.xml b/nonreg/nonregTests/euler/2D/shockTubes/cylindrical/model.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/shockTubes/cylindrical/modelV4.xml rename to nonreg/nonregTests/euler/2D/shockTubes/cylindrical/model.xml diff --git a/nonreg/nonregTests/euler/2D/shockTubes/unstruct/initialConditions.xml b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/initialConditions.xml new file mode 100644 index 00000000..2791ef15 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/initialConditions.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/shockTubes/unstruct/main.xml b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/main.xml new file mode 100644 index 00000000..2af9e177 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/main.xml @@ -0,0 +1,18 @@ + + + euler2DshockTubeUnstruct + + + + + + + + minmod + + + + green-gauss + + + \ No newline at end of file diff --git a/nonreg/nonregTests/euler/2D/shockTubes/unstruct/mesh.xml b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/mesh.xml new file mode 100644 index 00000000..ebba324d --- /dev/null +++ b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/shockTubes/unstruct/model.xml b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/model.xml new file mode 100644 index 00000000..e8e4045c --- /dev/null +++ b/nonreg/nonregTests/euler/2D/shockTubes/unstruct/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/initialConditionsV4.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/initialConditionsV4.xml rename to nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/initialConditions.xml diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/mainV5.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/main.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/mainV5.xml rename to nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/main.xml diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/meshV5.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/meshV5.xml rename to nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/mesh.xml diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/model.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/model.xml new file mode 100644 index 00000000..fe074f7f --- /dev/null +++ b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonal/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/initialConditions.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/initialConditions.xml new file mode 100644 index 00000000..669e9e97 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/initialConditions.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/main.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/main.xml new file mode 100644 index 00000000..8fa5f7ab --- /dev/null +++ b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/main.xml @@ -0,0 +1,16 @@ + + + euler2DTransportRectangleDiagonalStruct + + + + + + + + superbee + + + green-gauss + + diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/mesh.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/mesh.xml new file mode 100644 index 00000000..e5426a89 --- /dev/null +++ b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/model.xml b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/model.xml new file mode 100644 index 00000000..fe074f7f --- /dev/null +++ b/nonreg/nonregTests/euler/2D/transports/rectangleDiagonalUnstruct/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nonreg/nonregTests/euler/3D/LPCenter/initialConditionsV4.xml b/nonreg/nonregTests/euler/3D/LPCenter/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/euler/3D/LPCenter/initialConditionsV4.xml rename to nonreg/nonregTests/euler/3D/LPCenter/initialConditions.xml diff --git a/nonreg/nonregTests/euler/3D/LPCenter/mainV5.xml b/nonreg/nonregTests/euler/3D/LPCenter/main.xml similarity index 100% rename from nonreg/nonregTests/euler/3D/LPCenter/mainV5.xml rename to nonreg/nonregTests/euler/3D/LPCenter/main.xml diff --git a/nonreg/nonregTests/euler/3D/LPCenter/meshV5.xml b/nonreg/nonregTests/euler/3D/LPCenter/mesh.xml similarity index 100% rename from nonreg/nonregTests/euler/3D/LPCenter/meshV5.xml rename to nonreg/nonregTests/euler/3D/LPCenter/mesh.xml diff --git a/nonreg/nonregTests/euler/3D/LPCenter/model.xml b/nonreg/nonregTests/euler/3D/LPCenter/model.xml new file mode 100644 index 00000000..fe074f7f --- /dev/null +++ b/nonreg/nonregTests/euler/3D/LPCenter/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/initialConditions.xml b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/initialConditions.xml new file mode 100644 index 00000000..c4311e1e --- /dev/null +++ b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/initialConditions.xml @@ -0,0 +1,40 @@ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/main.xml b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/main.xml new file mode 100644 index 00000000..9e41d58e --- /dev/null +++ b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/main.xml @@ -0,0 +1,17 @@ + + + euler3DLPCenterEllipsoid + + + + + + + + + + + + vanleer + + diff --git a/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/mesh.xml b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/mesh.xml new file mode 100644 index 00000000..fffc3bc7 --- /dev/null +++ b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/model.xml b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/model.xml new file mode 100644 index 00000000..fe074f7f --- /dev/null +++ b/nonreg/nonregTests/euler/3D/LPCenterEllipsoid/model.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/initialConditionsV4.xml b/nonreg/nonregTests/eulerHomogeneous/shockTubes/initialConditions.xml similarity index 68% rename from libTests/referenceTestCases/eulerHomogeneous/shockTubes/initialConditionsV4.xml rename to nonreg/nonregTests/eulerHomogeneous/shockTubes/initialConditions.xml index 6a86ce3c..1d78c0f1 100644 --- a/libTests/referenceTestCases/eulerHomogeneous/shockTubes/initialConditionsV4.xml +++ b/nonreg/nonregTests/eulerHomogeneous/shockTubes/initialConditions.xml @@ -42,25 +42,4 @@ - - - - - - - diff --git a/nonreg/nonregTests/eulerHomogeneous/shockTubes/initialConditionsV4.xml b/nonreg/nonregTests/eulerHomogeneous/shockTubes/initialConditionsV4.xml deleted file mode 100644 index 6a86ce3c..00000000 --- a/nonreg/nonregTests/eulerHomogeneous/shockTubes/initialConditionsV4.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/nonreg/nonregTests/eulerHomogeneous/shockTubes/mainV5.xml b/nonreg/nonregTests/eulerHomogeneous/shockTubes/main.xml similarity index 100% rename from nonreg/nonregTests/eulerHomogeneous/shockTubes/mainV5.xml rename to nonreg/nonregTests/eulerHomogeneous/shockTubes/main.xml diff --git a/nonreg/nonregTests/eulerHomogeneous/shockTubes/mesh.xml b/nonreg/nonregTests/eulerHomogeneous/shockTubes/mesh.xml new file mode 100644 index 00000000..ab6062bd --- /dev/null +++ b/nonreg/nonregTests/eulerHomogeneous/shockTubes/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/eulerHomogeneous/shockTubes/model.xml b/nonreg/nonregTests/eulerHomogeneous/shockTubes/model.xml new file mode 100644 index 00000000..21d03db2 --- /dev/null +++ b/nonreg/nonregTests/eulerHomogeneous/shockTubes/model.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/initialConditions.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/initialConditions.xml new file mode 100644 index 00000000..b1d44cc8 --- /dev/null +++ b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/initialConditions.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/main.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/main.xml new file mode 100644 index 00000000..7eb3b63e --- /dev/null +++ b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/main.xml @@ -0,0 +1,17 @@ + + + vanDerWaals1DShockTube + + + + + + + + vanleer + + + green-gauss + + + diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/mesh.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/mesh.xml new file mode 100644 index 00000000..7f860908 --- /dev/null +++ b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/mesh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/model.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/model.xml new file mode 100644 index 00000000..eea9af24 --- /dev/null +++ b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/VanDerWaals/model.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditionsV4.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditionsV4.xml rename to nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/initialConditions.xml diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/mainV5.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/main.xml similarity index 100% rename from nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/mainV5.xml rename to nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/main.xml diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/meshV5.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/mesh.xml similarity index 100% rename from nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/meshV5.xml rename to nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/mesh.xml diff --git a/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/modelV4.xml b/nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/model.xml similarity index 100% rename from nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/modelV4.xml rename to nonreg/nonregTests/eulerKorteweg/1D/shockTubes/polynomialEOS/model.xml diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/initialConditionsV4.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/initialConditions.xml similarity index 100% rename from nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/initialConditionsV4.xml rename to nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/initialConditions.xml diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/mainV5.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/main.xml similarity index 91% rename from nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/mainV5.xml rename to nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/main.xml index 7e21bc2b..97c20199 100644 --- a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/mainV5.xml +++ b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/main.xml @@ -1,6 +1,6 @@ - nonLinearSchrodinger1DShockTube + nonLinearSchrodinger1DShockTubeAMR diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/mesh.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/mesh.xml new file mode 100644 index 00000000..38ec3138 --- /dev/null +++ b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/mesh.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/modelV4.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/model.xml similarity index 100% rename from nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/modelV4.xml rename to nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/AMR/model.xml diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/initialConditions.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/initialConditions.xml new file mode 100644 index 00000000..ff8ddc74 --- /dev/null +++ b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/initialConditions.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/main.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/main.xml new file mode 100644 index 00000000..9308a893 --- /dev/null +++ b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/main.xml @@ -0,0 +1,17 @@ + + + nonLinearSchrodinger1DShockTubeNonAMR + + + + + + + + minmod + + + green-gauss + + + diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/meshV5.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/mesh.xml similarity index 100% rename from nonreg/nonregTests/nonLinearSchrodinger/1D/shockTube/meshV5.xml rename to nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/mesh.xml diff --git a/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/model.xml b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/model.xml new file mode 100644 index 00000000..1a1d995d --- /dev/null +++ b/nonreg/nonregTests/nonLinearSchrodinger/1D/shockTubes/nonAMR/model.xml @@ -0,0 +1,4 @@ + + + + diff --git a/scripts/cluster/pvserver.q b/scripts/cluster/pvserver.q deleted file mode 100644 index 10e5d8c6..00000000 --- a/scripts/cluster/pvserver.q +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -#SBATCH --job-name=paraview -#SBATCH -o parav_now.out -#SBATCH --partition=normal -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=1 -#SBATCH --mem=120000 -#SBATCH --export=ALL -#SBATCH -t 24:00:00 - -mpirun /home/kevinsch/software/ParaView-5.6.0-MPI-Linux-64bit/bin/pvserver --force-offscreen-rendering diff --git a/scripts/cluster/run-pvserver.sh b/scripts/cluster/run-pvserver.sh deleted file mode 100644 index a7873814..00000000 --- a/scripts/cluster/run-pvserver.sh +++ /dev/null @@ -1,103 +0,0 @@ -#!/bin/bash - -# Start a ParaView server -# For more information see tutorial 'ParaView server' - -start() -{ - if [ -f $path_save ] - then - # Read ParaView path - path_paraview=$(cat "$path_save") - - # Set path to executables - cmd_mpiexec=$path_paraview"mpiexec" - cmd_pvserver=$path_paraview"pvserver" - - # Command - $cmd_mpiexec -np $1 $cmd_pvserver --force-offscreen-rendering - - else - echo 'ParaView path is not set, could not start server.' - fi -} - -set_path() -{ - # Path is stored into .path file in current directory. - # Be aware that depending on location of this script sudo - # permissions might be required. - - # Check/edit if ending of given path is '/' - if [ "${1: -1}" != "/" ] - then - path_to_set=$1"/" - else - path_to_set=$1 - fi - - echo "$path_to_set" > "$path_save" - if [ $? == 0 ] - then - echo "ParaView path has been set to $1." - else - echo 'Could not set path (sudo access required).' - fi -} - -help() -{ - # Display help - echo 'Start a ParaView server. Requires to set path to ParaView bin folder.' - echo - echo 'Usage: run-pvserver [OPTION]' - echo 'Options:' - echo ' -h, --help Print help.' - echo ' -np, --number-cores Select the number of cores (default is 1 when not provided).' - echo ' -p, --path Set path to ParaView executables' - echo - echo 'Example to set path and run server for 1st time:' - echo ' $ ./run-pvserver.sh --path /opt/ParaView-5.8.0-MPI-Linux-Python3.7-64bit/bin/' - echo ' Path has been set to /opt/ParaView-5.8.0-MPI-Linux-Python3.7-64bit/bin/.' - echo ' $ ./run-pvserver # Using default number of core, i.e. single core' - echo ' Waiting for client...' - echo ' Connection URL: cs://cid:11111' - echo ' Accepting connection(s): cid:11111' -} - -# Set default number of cores -core=1 - -# Current path of the script -path_save=$(dirname "$0")/.path - -# Main -if [ $# -gt 0 ] -then - case "$1" in - -np | --number-cores) - if [ $# -eq 2 ] - then - core=$2 - fi - start $core - exit 0 - ;; - -p | --path) - if [ $# -eq 2 ] - then - set_path $2 - else - echo 'Path could not be set.' - fi - exit - ;; - -h | --help) - help - exit 0 - ;; -esac -else - start $core - exit 0 -fi diff --git a/scripts/cluster/runClusterCaltech.q b/scripts/cluster/runClusterCaltech.q deleted file mode 100644 index c46b6802..00000000 --- a/scripts/cluster/runClusterCaltech.q +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -#SBATCH --job-name=test -#SBATCH -o run.out -#SBATCH -e run.err -#SBATCH --partition=normal -#SBATCH --export=ALL -#SBATCH -t 24:00:00 -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=24 - -mpirun /home/kevinsch/ECOGEN/ECOGEN_CFPgroupVersion/ECOGEN/ECOGEN - diff --git a/scripts/cluster/runClusterIUSTI.sh b/scripts/cluster/runClusterIUSTI.sh deleted file mode 100644 index a821e3d6..00000000 --- a/scripts/cluster/runClusterIUSTI.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash -# -#$ -N chocGoutte2 -#$ -cwd -#$ -j y -#$ -S /bin/bash -# -#$ -q Douze -#$ -pe ompi_douze 24 -#$ -v OMP_NUM_THREADS=1 -# -# Name de l'executable -NAME=./ECOGEN -MYARGS="" - -. /local/opt/Modules/3.2.9/init/sh -module load openmpi-intel/1.10.1 intel - -MYCOMMAND="mpirun -np $NSLOTS ${NAME} ${MYARGS}" - -$MYCOMMAND - diff --git a/scripts/others/CurvatureCircleFit.m b/scripts/others/CurvatureCircleFit.m new file mode 100644 index 00000000..a7f8d09d --- /dev/null +++ b/scripts/others/CurvatureCircleFit.m @@ -0,0 +1,77 @@ +%------------------------------------------------------------------------------------------------------------------------------- +% OBJECTIVE +%------------------------------------------------------------------------------------------------------------------------------- +% Here is a brief summary of what the code appears to be doing based on ChatGPT interpretation: +% - The code defines some initial conditions such as a range of values for the Mach number (M), the specific heat ratio (gamma_eos), +% the ambient pressure (pinf), and the freestream velocity (ua). +% - It then calculates the density and velocity of a water droplet at the stagnation point (uw) using the given Mach number and +% assuming incompressible flow. +% - The code defines a range of angles (theta_droplet) and uses them to plot the shape of the water droplet (a circle). +% - The code then proceeds to do some ray tracing calculations to determine the path of light rays passing through the water droplet. +% It appears that the code is iterating over different values of n (the refractive index of water) and alpha (the angle of incidence +% of the light ray) to calculate the position of the light ray after passing through the droplet. The resulting positions are plotted +% in a loop for each value of n. +% - Finally, the code fits a circle to the positions of the light rays using the "circfit" function, which returns the radius of the +% circle (r) and its center (xc, yc). The code then plots the value of r normalized by the droplet radius (11e-3) as a function of +% Mach number. +% It is worth noting that the code is currently commented out in some places (e.g., the last line of the code block). +% Therefore, it is possible that some parts of the code are not currently executing or are incomplete. + +%------------------------------------------------------------------------------------------------------------------------------- +% CODE +%------------------------------------------------------------------------------------------------------------------------------- +clear all; close all; clc; + +%% Initial conditions +M = [1:0.01:10]; + +gamma_eos = 2.35; +pinf = 1.00e9; +ua = 345*M; +p1 = 1.01325e5; +rho1 = 1028; +uw = sqrt(gamma_eos*(pinf+p1)/rho1); +n = uw./ua; +a = 11e-3; +theta_droplet = [0:pi/1000:2*pi]; + +k = [1]; +t = a/uw%(839-47)*0.05e-6 + +%% Ray tracing +alpha = [0:pi/1000:2*pi]; +for n_level = 1:length(n) +for i = 1:length(alpha) + if alpha(i) < asin(1/n(n_level)) + theta(i) = asin(n(n_level)*sin(alpha(i))); + gamma(i) = 2*k*theta(i)-alpha(i)-(k-1)*pi; + xm{n_level}(i) = (uw*t-n(n_level)*a*(1-cos(alpha(i)))-2*(k-1)*a*cos(theta(i)))*cos(gamma(i)-theta(i))-a*cos(gamma(i)-2*theta(i)); + ym{n_level}(i) = (uw*t-n(n_level)*a*(1-cos(alpha(i)))-2*(k-1)*a*cos(theta(i)))*sin(gamma(i)-theta(i))-a*sin(gamma(i)-2*theta(i)); + end +end +plot(xm{n_level},ym{n_level},'r'); hold on; +end + +%% Plots +plot(a*cos(theta_droplet),a*sin(theta_droplet),'k'); hold on; +axis equal; +xlim([-a a]) +ylim([-a a]) + +%% Fit circle + +for i = 1:n_level + clear R + clear XC + clear YC + [R,XC,YC] = circfit(xm{i},ym{i}); + r(i) = R; + xc(i) = XC; + yc(i) = YC; +end + +close all +plot(M,r./11e-3,'k') + +% plot(xm{n_level},ym{n_level},'r'); hold on; axis equal; +% plot(XC+R*cos(alpha),YC+R*sin(alpha),'b') \ No newline at end of file diff --git a/scripts/others/RayTracing.m b/scripts/others/RayTracing.m new file mode 100644 index 00000000..fd7af855 --- /dev/null +++ b/scripts/others/RayTracing.m @@ -0,0 +1,113 @@ +%------------------------------------------------------------------------------------------------------------------------------- +% OBJECTIVE +%------------------------------------------------------------------------------------------------------------------------------- +% This code simulates the position of waves within a droplet. The latter being impacted by a shock wave. +% It corresponds to the analytical wave description described in: +% L. Biasiori-Poulanges, K. Schmidmayer. A phenomenological analysis of droplet shock-induced cavitation using a multiphase +% modelling approach. Physics of Fluids, Vol. 35, 013312, 2023. + +%------------------------------------------------------------------------------------------------------------------------------- +% CODE +%------------------------------------------------------------------------------------------------------------------------------- + +clear all; close all; clc; + +%% Initial conditions +Ms = 2.4; + +a = 11.0e-3; +b = 11.0e-3; +epsilon=(b/a)^2-1; +alpha=linspace(-pi/2,pi/2,1000); + +c = 345; +uw = sqrt(4.4*(6e8+1.01325e5)/998); +ua = Ms*c; +n = uw/ua; + +t_impact = (22e-3-20e-3)/ua; +Delta_frame = 0.5e-6; +t_frame5 = 5*Delta_frame; + +index = 0; +for i = 28:12:75 + index = index+1; + time(index) = (t_frame5-t_impact)+i*0.5e-6; +end +disp(time); + +for j = 1:length(time) + t=time(j); + + %% Wavefronts + for i=1:length(alpha) + + delta(i) = -alpha(i)+asin(n*sin(alpha(i))); + + xb(i) = -a^2/sqrt(a^2+b^2*tan(alpha(i))^2); + yb(i) = tan(alpha(i))*b^2/sqrt(a^2+b^2*tan(alpha(i))^2); + + xc(i) = xb(i)+(uw*t-n*(a-a^2/sqrt(a^2+tan(alpha(i))^2*b^2)))*cos(delta(i)); + yc(i) = yb(i)+(uw*t-n*(a-a^2/sqrt(a^2+tan(alpha(i))^2*b^2)))*sin(delta(i)); + + xd(i) = (a^2*xb(i)*sin(delta(i))^2-b^2*xb(i)*cos(delta(i))^2-... + a^2*yb(i)*sin(2*delta(i)))/(b^2*cos(delta(i))^2+a^2*sin(delta(i))^2); + yd(i) = (b^2*yb(i)*cos(delta(i))^2-a^2*yb(i)*sin(delta(i))^2-... + b^2*xb(i)*sin(2*delta(i)))/(b^2*cos(delta(i))^2+a^2*sin(delta(i))^2); + + ErefEx(i) = ((a^4*yd(i)^2-b^4*xd(i)^2)*cos(delta(i))-... + 2*a^2*b^2*xd(i)*yd(i)*sin(delta(i)))/(a^4*yd(i)^2+b^4*xd(i)^2); + + ErefEy(i) = ((b^4*xd(i)^2-a^4*yd(i)^2)*sin(delta(i))-... + 2*a^2*b^2*xd(i)*yd(i)*cos(delta(i)))/(a^4*yd(i)^2+b^4*xd(i)^2); + + l(i) = uw*t-n*(a+xb(i))+2*(b^2*xb(i)*cos(delta(i))+a^2*yb(i)*sin(delta(i)))/(b^2*cos(delta(i))^2+a^2*sin(delta(i))^2); + + xe(i) = xd(i)+l(i)*ErefEx(i); + ye(i) = yd(i)+l(i)*ErefEy(i); + + end + + %% Droplet + C = [0 0]; % center + th = linspace(0,2*pi) ; + x_droplet = C(1)+a*cos(th) ; + y_droplet = C(2)+b*sin(th) ; + + %% Graph Setting + xcolor = linspace(-2*pi,2*pi); + ycolor = sin(xcolor); + + str_green = '#008080'; + str_red = '#C60C1F'; + str_blue = '#050572'; + str_gray = '#3E3E40'; + + color_green = sscanf(str_green(2:end),'%2x%2x%2x',[1 3])/255; + color_red = sscanf(str_red(2:end),'%2x%2x%2x',[1 3])/255; + color_blue = sscanf(str_blue(2:end),'%2x%2x%2x',[1 3])/255; + color_gray = sscanf(str_gray(2:end),'%2x%2x%2x',[1 3])/255; + + %% Plots + plot(xc,yc,'color',color_red,'linewidth',0.5); hold on; + plot(xe,ye,'color',color_green,'linewidth',0.5); + +end + +%Droplet +plot(x_droplet,y_droplet,'color',color_gray,'linewidth',2); +axis equal + + +xlim([-a,a]); +ylim([-b,b]); +% xlabel('$x$~[m]', 'Interpreter', 'Latex', 'FontSize', 16) +% ylabel('$y$~[m]', 'Interpreter', 'Latex', 'FontSize', 16) + +% set(0, 'defaultAxesTickLabelInterpreter','latex'); +% set(0, 'defaultLegendInterpreter','latex'); + +aa = get(gca,'XTickLabel'); +set(gca,'fontsize',16); + +pause; \ No newline at end of file diff --git a/scripts/others/qrcode/logo.png b/scripts/others/qrcode/logo.png new file mode 100644 index 00000000..a3df683f Binary files /dev/null and b/scripts/others/qrcode/logo.png differ diff --git a/scripts/others/qrcode/qrcode-ecogen.py b/scripts/others/qrcode/qrcode-ecogen.py new file mode 100644 index 00000000..baf9d33d --- /dev/null +++ b/scripts/others/qrcode/qrcode-ecogen.py @@ -0,0 +1,57 @@ +# Create a QR code for the ECOGEN website + +# Highly inspired from https://www.geeksforgeeks.org/how-to-generate-qr-codes-with-a-custom-logo-using-python/ + +# Install qrcode library in virtual environment using the following +# pip3 -m venv venv +# source venv/bin/activate +# pip install -r requirements.txt + +# Librairies +import qrcode +from PIL import Image + +# Inputs +img = Image.open('logo.png') +url = 'https://code-mphi.github.io/ECOGEN/' + +# Taking base width +basewidth = 100 + +# Adjust image size +wpercent = (basewidth/float(img.size[0])) +hsize = int((float(img.size[1])*float(wpercent))) +logo = img.resize((basewidth, hsize), Image.ANTIALIAS) +QRcode = qrcode.QRCode( + error_correction=qrcode.constants.ERROR_CORRECT_H +) + +# Adding URL to QRcode +QRcode.add_data(url) + +# Generating QR code +QRcode.make() + +# Set colors pixel +QRcolor_pixel = 'Black' +# QRcolor_pixel = (74, 147, 185) # RGB blue +QRcolor_background = 'white' + + +# Adding color to QR code +QRimg = QRcode.make_image( + fill_color=QRcolor_pixel, back_color=QRcolor_background).convert('RGB') + +# Set size of QR code + overlay logo (careful img should +# be less than 30% of QR code to be valid) +pos = ((QRimg.size[0] - logo.size[0]) // 2, + (QRimg.size[1] - logo.size[1]) // 2) +QRimg.paste(logo, pos) + +# Save image +QRimg.save('qrcode.png') +print('QR code generated.') + +# Simple version without logo +# qr = qrcode.make(url) +# qr.save('qrcode-ecogen.png') diff --git a/scripts/others/qrcode/qrcode.png b/scripts/others/qrcode/qrcode.png new file mode 100644 index 00000000..628ff9ed Binary files /dev/null and b/scripts/others/qrcode/qrcode.png differ diff --git a/scripts/others/rename-input-files.sh b/scripts/others/rename-input-files.sh new file mode 100755 index 00000000..7b1ed79c --- /dev/null +++ b/scripts/others/rename-input-files.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Rename all simulation input files +# To be run in root ecogen folder using ./scripts/others/rename-input-files.sh + +find . -type f -name 'mainV5.xml' -exec rename 's/mainV5.xml/main.xml/' {} + +find . -type f -name 'meshV5.xml' -exec rename 's/meshV5.xml/mesh.xml/' {} + +find . -type f -name 'modelV4.xml' -exec rename 's/modelV4.xml/model.xml/' {} + +find . -type f -name 'initialConditionsV4.xml' -exec rename 's/initialConditionsV4.xml/initialConditions.xml/' {} + \ No newline at end of file diff --git a/scripts/postTreatment/.gitignore b/scripts/postTreatment/.gitignore deleted file mode 100644 index 7a41367f..00000000 --- a/scripts/postTreatment/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.pdf -*.csv -*.txt \ No newline at end of file diff --git a/scripts/postTreatment/RayleighTaylor.py b/scripts/postTreatment/RayleighTaylor.py deleted file mode 100644 index 63e244ef..00000000 --- a/scripts/postTreatment/RayleighTaylor.py +++ /dev/null @@ -1,150 +0,0 @@ -#------------------------------------------------------------------------------------------------------------------------------- -# OBJECTIVE -#------------------------------------------------------------------------------------------------------------------------------- -# This script is for the post-treatment of the Rayleigh--Taylor instability. -# It aims to compare the interface front displacement of the simulations with the analytical inviscid and/or viscous solutions. -# The analytical solutions are based on the papers of: -# Nourgaliev, R. R., Liou, M. S., & Theofanous, T. G. (2008). Numerical prediction of interfacial instabilities: Sharp interface method (SIM). Journal of Computational Physics, 227(8), 3940-3970. -# Duff, R. E., Harlow, F. H., Hirt, C. W. (1962). Effects of diffusion on interface instability between gases. The Physics of Fluids, 5(4), 417-425. -# Cook, A. W., Cabot, W., & Miller, P. L. (2004). The mixing transition in Rayleigh-Taylor instability. Journal of Fluid Mechanics, 511, 333. -# The comparison is done through a convergence study with L2 norms. - -#------------------------------------------------------------------------------------------------------------------------------- -# IMPORTS -#------------------------------------------------------------------------------------------------------------------------------- -import math -from matplotlib import rc -import matplotlib.pyplot as plt -import numpy as np - -#------------------------------------------------------------------------------------------------------------------------------- -# PARAMETERS TO DEFINE / INITIAL CONDITIONS -#------------------------------------------------------------------------------------------------------------------------------- -# Variables -# --------- -rho_l = 1. #Density light fluid -g = 9.81 #Gravity -wave_length = 0.2 #Wave-length (characteristic length) -At = 0.5 #Atwood number -R = 76. #Reynolds number -m = 3. #Viscosity ratio. Note that herein, nu_l = nu_h (h for heavy fluid). Therefore, this ratio is the density ratio - -# Observables -# ----------- -Ntest = 4 #Number of test cases -mesh = np.array([10, 20, 40, 80]) #Resolution in the wave-length direction -mesh = mesh * 2 -epsilon_t = np.zeros(Ntest) #Interface front displacement -t0 = 0.05 #Initial time (when the flow is already started) -t = 1. - t0 #Time -front_position_at_t0 = 0.5 #Initial interface front position -epsilon_0 = 0.5115 - front_position_at_t0 #Initial interface front displacement -epsilon_t[0] = 0.827 - front_position_at_t0 -epsilon_t[1] = 0.7902 - front_position_at_t0 -epsilon_t[2] = 0.78234 - front_position_at_t0 -epsilon_t[3] = 0.78085 - front_position_at_t0 - -# Analytical-Rayleigh--Taylor, dimensionless growth factor -# -------------------------------------------------------- -K_RT_analytical = 0.28 - -#------------------------------------------------------------------------------------------------------------------------------- -# COMPUTATIONS -#------------------------------------------------------------------------------------------------------------------------------- -rho_h = rho_l * (At + 1.) / (1. - At) #Density heavy fluid -nu = wave_length * ((wave_length * g)**0.5) / R #Kinematic viscosity -mu_l = rho_l * nu #Dynamic viscosity light fluid -mu_h = mu_l * m #Dynamic viscosity heavy fluid -tau_RT = (wave_length / g)**0.5 #Characteristic time -k = 2. * math.pi / wave_length #Wave-number -print('Simulation parameters (SI):') -print('lambda =', wave_length) -print('g =', g) -print('rho_l =', rho_l) -print('rho_h =', rho_h) -print('mu_l =', mu_l) -print('mu_h =', mu_h) - -#------------------------------------------------------------------------------------------------------------------------------- -# SIMULATION RESULTS DETERMINATION -#------------------------------------------------------------------------------------------------------------------------------- -# Results -# ------- -t_star = t / tau_RT #Scaled time -k_RT = k / (g / nu**2.)**(1. / 3.) #Dimensionless wave-number -K_RT = np.zeros(Ntest) #Dimensionless growth factor -for i in range(0, K_RT.size): - K_RT[i] = math.log(epsilon_t[i] / epsilon_0) / t / (g**2. / nu)**(1. / 3.) -print('Results:') -print('k_RT =', k_RT) -print('K_RT[-1] =', K_RT[-1]) -print('t =', t) -print('Amplitude simu =', epsilon_t[-1] - epsilon_0) - -# Analytical solutions -# -------------------- -# Inviscid solution -A_invisc = epsilon_0 * math.exp((At * g * k)**0.5 * t) #Amplitude -print('Amplitude inviscid =', A_invisc) -# Viscous solution -A_viscous = epsilon_0 * math.exp(((At * g * k + nu**2. * k**4.)**0.5 - nu * k**2.) * t) #Amplitude -print('Amplitude viscous =', A_viscous) -C = 0.85 -Ate_over_At = 0.48 -alpha = (C / 2.)**2. * Ate_over_At**3. -h = alpha * At * g * t**2. + 2. * (alpha * At * g * epsilon_0)**0.5 * t + epsilon_0 -print('alpha =', alpha) -print('h =', h) - -# Convergence -# ----------- -# With highest resolution being surrogate truth -L2_resolution = np.zeros(Ntest - 1) #L2 norm -for i in range(0, L2_resolution.size): - L2_resolution[i] = ((K_RT[i] - K_RT[-1])**2.)**0.5 -q_resolution = math.log(L2_resolution[-1] / L2_resolution[0]) / math.log(mesh[0] / mesh[-2]) #Linear coefficient of the L2 norm -# With analytical solution being surrogate truth -L2_analytical = np.zeros(Ntest) #L2 norm -for i in range(0, L2_analytical.size): - L2_analytical[i] = ((K_RT[i] - K_RT_analytical)**2.)**0.5 -q_analytical = math.log(L2_analytical[-1] / L2_analytical[0]) / math.log(mesh[0] / mesh[-1]) #Linear coefficient of the L2 norm - -#------------------------------------------------------------------------------------------------------------------------------- -# PLOT RESULTS -#------------------------------------------------------------------------------------------------------------------------------- -# Plot parameters -# --------------- -SMALL_SIZE = 8 -MEDIUM_SIZE = 12 -BIGGER_SIZE = 16 -rc('axes', titlesize=BIGGER_SIZE) # fontsize of the figure title -rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x and y labels -rc('xtick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('ytick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize -rc('text', usetex=True) -rc('font', family='serif') - -# Figure 1 -# -------- -plt.title('Rayleigh--Taylor convergence') -plt.plot(mesh[0:-1], L2_resolution, 'r-d', label='Surrogate truth = highest resolution') -plt.plot(mesh, L2_analytical, 'b-X', label='Surrogate truth = analytical solution') -x = np.array([mesh[0], mesh[2]]) -y = np.array([1.6 / mesh[0]**2., 1.6 / mesh[2]**2.]) -plt.plot(x, y, 'k-', label=r'$\propto 1/N^2$') -plt.text(40.2, 3.4e-4, r'$q$={:.3f}'.format(q_resolution), fontsize=MEDIUM_SIZE, color='r') -plt.text(40.2, 2.4e-4, r'$q$={:.3f}'.format(q_analytical), fontsize=MEDIUM_SIZE, color='b') -plt.xlabel(r'$N$') -plt.ylabel(r'$\mathcal{L}^2$') -plt.xscale('log') -plt.yscale('log') -plt.legend() -plt.grid(b=True, which='major', color='k', linestyle='-') -plt.grid(b=True, which='minor', color='k', linestyle=':') -# ax = plt.gca() -# ax.set_xticks([20, 40, 80], minor=True) -# plt.xticks([20, 40, 80], [20, 40, 80]) -plt.savefig('RayleighTaylor_L2.pdf') -# plt.show() - diff --git a/scripts/postTreatment/blasius/blasius_computation.py b/scripts/postTreatment/blasius/blasius_computation.py deleted file mode 100644 index 9de1e43f..00000000 --- a/scripts/postTreatment/blasius/blasius_computation.py +++ /dev/null @@ -1,259 +0,0 @@ -#!/usr/bin/python3 - -#------------------------------------------------------------------------------------------------------------------------------- -# OBJECTIVE -#------------------------------------------------------------------------------------------------------------------------------- -# This script (1/2) is for the post-treatment of a subsonic flow over a flat flate, i.e. Blasius' test case. -# It aims to compare steady dimensionless normal/tangential velocities with the analytical solution. -# The analytical solution is based on the book: -# 'I do like CFD', vol. 1, Katate Masatsuka -# The comparison is done through a convergence study with L2 norms. - -#------------------------------------------------------------------------------------------------------------------------------- -# IMPORTS -#------------------------------------------------------------------------------------------------------------------------------- -import math -import numpy as np - -#------------------------------------------------------------------------------------------------------------------------------- -# PARAMETERS TO DEFINE / INITIAL CONDITIONS -#------------------------------------------------------------------------------------------------------------------------------- -# Variables -# --------- -uinf = 102. # Free stream velocity -rho = 1.2 # Density (supposed constant for Blasius solution) -mu = 1.82e-5 # Dynamic viscosity -xplate = 0.02 # Position of leading edge plate -x = 0.405 # Horizontal position for data extraction -h = 0.01 # Max. vertical position - -# Observables -# ----------- -files = ['mesh_200x90.csv', 'mesh_400x105.csv', 'mesh_800x120.csv', 'mesh_1600x135.csv'] # Filenames (under current directory) - -# Parameters for reference analytical solution -# -------------------------------------------- -dh0 = 1.e-4 # First vertical position for plot analytical sol. -q = 1.045 # Geometric sequence ratio for vertical position - -#------------------------------------------------------------------------------------------------------------------------------- -# COMPUTATIONS -#------------------------------------------------------------------------------------------------------------------------------- -nu = mu/rho # Kinematic viscosity -xref = x - xplate # Reference position from the beginning of leading edge -Re = uinf * xref / nu # External Reynolds number - -Ny = round(math.log(h / dh0) / math.log(q)) # Number of vertical position for plot exact sol. - -#------------------------------------------------------------------------------------------------------------------------------- -# FUNCTIONS -#------------------------------------------------------------------------------------------------------------------------------- -def rhs(F): - """Build right hand side of the ODE eq. 7.15.53. - - This function is used during ODE integration insde blasius() function. - - Args: - F: vector F to integrate (3 components) - - Returns: - G: RHS vector G (3 components) - """ - - f = F[0] - f1 = F[1] - f2 = F[2] - - G = np.array([f1, f2, - 0.5 * f * f2]) - return G - -def blasius(etap, Re): - """Compute the Blasius analytical solution (u,v) at a given position (xp, yp). - - This method uses the one-step integration given in the book 'I do like CFD', - vol. 1, Katate Masatsuka (see section 'Flat Plate Boundary Layer'). - - Args: - etap: dimensionless Blasius variable - Re: free stream Reynolds number at xref position - - Returns: - u: dimensionless horizontal velocity - v: dimensionless vertical velocity - """ - - F = np.zeros(3) # Left hand side of ODE (see eq. 7.15.53) - K1 = np.zeros(3) # Runge--Kutta variable K1 (3 components vector) - K2 = np.zeros(3) # Runge--Kutta variable K2 - K3 = np.zeros(3) # Runge--Kutta variable K3 - - f2_0 = 0.3320573362151946 # Pre-computed initial value (see eq. 7.15.59) - deta = 1.e-3 # Increment for ODE integration - done = False - one_over_three = 1. / 3. - one_over_six = 1. / 6. - - # Integrate ODE to eta = etap by RK4 scheme - # 1. Initial values - eta = 0. - F[0] = 0. - F[1] = 0. - F[2] = f2_0 - - # 2. Steps to eta = etap - if etap > 0.: - while True: - if (eta + deta > etap): - deta = etap - eta - done = True - eta += deta - K1 = F + 0.5 * deta * rhs(F) - K2 = F + 0.5 * deta * rhs(K1) - K3 = F + deta * rhs(K2) - F = (K1 + 2. * K2 + K3 - F) * one_over_three + deta * rhs(K3) * one_over_six - - if (done): - break - - # Solution at eta = etap, i.e. (x,y) = (xp,yp) - f = F[0] - f1 = F[1] - u = f1 - v = 0.5 / math.sqrt(Re) * (etap * f1 - f) - return u, v - -#------------------------------------------------------------------------------------------------------------------------------- -# SIMULATION RESULTS DETERMINATION -#------------------------------------------------------------------------------------------------------------------------------- -# Results -# ------- -Nmesh = len(files) # Number of test cases -y = [] # Array of vertical positions -u = [] # Array of normal velocities -v = [] # Array of tangential velocities -ustar = [] # Array of dimensionless normal velocity -vstar = [] # Array of dimensionless tangential velocity -eta = [] # Array of Blasius dimensionless variable -u_bls = [] # Array of dimensionless analytical normal velocity -v_bls = [] # Array of dimensionless analytical tangential velocity - -# Read data of each mesh -# Column names -# 0. Vx -# 1. Vy -# 2. Vz -# 3. x -# 4. y -# 5. z - -count = 0 -for f in files: - y.append(np.loadtxt(f, delimiter=',', skiprows=1)[:,4]) - u.append(np.loadtxt(f, delimiter=',', skiprows=1)[:,0]) - v.append(np.loadtxt(f, delimiter=',', skiprows=1)[:,1]) - - ustar.append(np.zeros(y[count].size)) - vstar.append(np.zeros(y[count].size)) - eta.append(np.zeros(y[count].size)) - u_bls.append(np.zeros(y[count].size)) - v_bls.append(np.zeros(y[count].size)) - count += 1 - -# L2 convergence with ponderation by cells' height -dy = [] -for t in range(Nmesh): - dy.append(np.zeros(y[t].size)) - dy[t][0] = 2. * y[t][0] - -for t in range(Nmesh): - sumDy = 0. - for i in range(1, y[t].size): - sumDy += dy[t][i-1] # Current state - dy[t][i] = 2. * (y[t][i] - sumDy) - - -for t in range(Nmesh): - for i in range(y[t].size): - eta[t][i] = y[t][i] / xref * math.sqrt(Re) - ustar[t][i] = u[t][i] / uinf - vstar[t][i] = v[t][i] / uinf # * math.sqrt(Re) - - # Analytical solutions for L2 norm - # -------------------------------- - print('Computing analytical solution for L2 norm of file {}...'.format(files[t])) - for i in range(y[t].size): - print(' {}%'.format(int(i / y[t].size * 100))) - u_bls[t][i], v_bls[t][i] = blasius(eta[t][i], Re) - -# Convergence -# ----------- -# With analytical solution being surrogate truth -L2_analytical = np.zeros(Nmesh) # L2 norm -for t in range(Nmesh): - num = 0. - den = 0. - for i in range(y[t].size): - # num += (u_bls[t][i] - ustar[t][i]) ** 2. - num += dy[t][i] * (u_bls[t][i] - ustar[t][i]) ** 2. - den += dy[t][i] - # L2_analytical[t] = (num / y[t].size) ** 0.5 - L2_analytical[t] = (num / den) ** 0.5 - -# Analytical solution for plot -# ---------------------------- -u_plt = np.zeros(Ny) # Array of dimensionless analytical normal velocity -v_plt = np.zeros(Ny) # Array of dimensionless analytical tangential velocity -y_plt = np.fromiter((dh0 * q**i for i in range(Ny)), float) # Array of vertical position (following geometric sequence) -eta_plt = np.fromiter((yi / xref * math.sqrt(Re) for yi in y_plt), float) # Array of dimensionless position, i.e. Blasius var. - -print('Computing analytical solution for plot...') -for i in range(Ny): - print(' {}%'.format(int(i / Ny * 100))) - eta_plt[i] = y_plt[i] / xref * math.sqrt(Re) - u_plt[i], v_plt[i] = blasius(eta_plt[i], Re) - -#------------------------------------------------------------------------------------------------------------------------------- -# WRITE RESULTS -#------------------------------------------------------------------------------------------------------------------------------- - -# Results for simulations -# ----------------------- -print('Writing results...') -# Each simulation has its own output file -columns = 'y' + ' ' + 'eta' + ' ' + 'ustar' + ' ' + 'vstar' + ' ' \ - + 'u_bls' + ' ' + 'v_bls' + ' ' + 'L2_analytical' + '\n' - -files = [files[t][:-4] for t in range(Nmesh)] # remove csv extension - -for t in range(Nmesh): - file = 'res_' + files[t] + '.txt' - print('Writing file {} done'.format(file)) - data = np.array([y[t], eta[t], ustar[t], vstar[t], - u_bls[t], v_bls[t], L2_analytical[t]], dtype=object) - data = data.T - with open(file, 'w') as f: - f.write(columns) - for i in range(y[t].size): - f.write(str(y[t][i]) + ' ' - + str(eta[t][i]) + ' ' - + str(ustar[t][i]) + ' ' - + str(vstar[t][i]) + ' ' - + str(u_bls[t][i]) + ' ' - + str(v_bls[t][i]) + ' ' - + str(L2_analytical[t])+ '\n') - -# Results for plotting analytical sol. -# ------------------------------------ -file = 'exact.txt' -print('Writing file {} done'.format(file)) -columns = 'y' + ' ' + 'eta' + ' ' + 'u' + ' ' + 'v' + '\n' -with open(file, 'w') as f: - f.write(columns) - for i in range(Ny): - f.write(str(y_plt[i]) + ' ' - + str(eta_plt[i]) + ' ' - + str(u_plt[i]) + ' ' - + str(v_plt[i]) + '\n') - -print('') -print('Results are stored in files mentionned above.\nTo plot use script blasius_plots.py.') \ No newline at end of file diff --git a/scripts/postTreatment/blasius/blasius_plots.py b/scripts/postTreatment/blasius/blasius_plots.py deleted file mode 100644 index 037a5c4e..00000000 --- a/scripts/postTreatment/blasius/blasius_plots.py +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/python3 - -#------------------------------------------------------------------------------------------------------------------------------- -# OBJECTIVE -#------------------------------------------------------------------------------------------------------------------------------- -# This script (2/2) is for the post-treatment of a subsonic flow over a flat flate, i.e. Blasius' test case. -# It aims to compare steady dimensionless normal/tangential velocities with the analytical solution. -# The analytical solution is based on the book: -# 'I do like CFD', vol. 1, Katate Masatsuka -# The comparison is done through a convergence study with L2 norms. - -#------------------------------------------------------------------------------------------------------------------------------- -# IMPORTS -#------------------------------------------------------------------------------------------------------------------------------- -from matplotlib import rc -import matplotlib.pyplot as plt -import numpy as np -import math - -#------------------------------------------------------------------------------------------------------------------------------- -# PARAMETERS TO DEFINE / INITIAL CONDITIONS -#------------------------------------------------------------------------------------------------------------------------------- -# Observables -# ----------- -files = ['res_mesh_200x90.txt', 'res_mesh_400x105.txt', 'res_mesh_800x120.txt', 'res_mesh_1600x135.txt'] - # Filenames of post-treated results - # (simulation w/ corresponding analytical sol.) -file_exact = 'exact.txt' # Analytical sol. for plot (continuous) - -#------------------------------------------------------------------------------------------------------------------------------- -# READING RESULTS FROM Blasius_computation.py -#------------------------------------------------------------------------------------------------------------------------------- -# Post-treated results -# -------------------- -Nmesh = len(files) # Number of test cases -y = [] # Array of vertical positions -ustar = [] # Array of dimensionless normal velocity -vstar = [] # Array of dimensionless tangential velocity -eta = [] # Array of Blasius dimensionless variable -u_bls = [] # Array of dimensionless analytical normal velocity -v_bls = [] # Array of dimensionless analytical tangential velocity - -L2_analytical = np.zeros(Nmesh) # L2 norm array build upon analytical sol. -dy = np.zeros(Nmesh) # Array of vertical size of 1st cell next to the wall -dy_str = [] # Array of vertical size for plot - -# Read data of each mesh -# Column names -# 0. y -# 1. eta -# 2. ustar -# 3. vstar -# 4. u_bls -# 5. v_bls -# 6. L2_analytical - -count = 0 -for f in files: - y.append(np.loadtxt(f, delimiter=' ', skiprows=1)[:,0]) - eta.append(np.loadtxt(f, delimiter=' ', skiprows=1)[:,1]) - ustar.append(np.loadtxt(f, delimiter=' ', skiprows=1)[:,2]) - vstar.append(np.loadtxt(f, delimiter=' ', skiprows=1)[:,3]) - u_bls.append(np.loadtxt(f, delimiter=' ', skiprows=1)[:,4]) - v_bls.append(np.loadtxt(f, delimiter=' ', skiprows=1)[:,5]) - L2_analytical[count] = (np.loadtxt(f, delimiter=' ', skiprows=1)[0,6]) - count += 1 - -# Creates array of dy for x-axis of L2 plot -dy = np.zeros(Nmesh) -for t in range(Nmesh): - dy[t] = y[t][0] * 2. - dy_str.append('dy = ' + str("{:.2e}".format(dy[t]))) - -# Linear coefficient of the L2 norm -q_analytical = math.log(L2_analytical[-1] / L2_analytical[0]) / math.log(dy[-1] / dy[0]) - -# Analytical sol. built for plot (continuous) -# ------------------------------------------- - -# Column names -# 0. y -# 1. eta -# 2. u -# 3. v - -eta_exact = np.insert(np.loadtxt(file_exact, delimiter=' ', skiprows=1)[:,1], 0, 0.) # Note that null value is added to take into account wall -u_exact = np.insert(np.loadtxt(file_exact, delimiter=' ', skiprows=1)[:,2], 0, 0.) -v_exact = np.insert(np.loadtxt(file_exact, delimiter=' ', skiprows=1)[:,3], 0, 0.) - -# Crop arrays for better plot -eta_max = 15. -eta_crp = [] -ustar_crp = [] -vstar_crp = [] - -# Numerical sol. -for t in range(Nmesh): - for i in range(y[t].size): - if eta[t][i] > eta_max: - p = int(i - 1) - break - eta_crp.append(np.array(eta[t][0:p])) - ustar_crp.append(np.array(ustar[t][0:p])) - vstar_crp.append(np.array(vstar[t][0:p])) - -# Analytical sol. -for i in range(eta_exact.size): - if eta_exact[i] > eta_max: - p = int(i) - break - -eta_exact_crp = np.array(eta_exact[0:p]) -u_exact_crp = np.array(u_exact[0:p]) -v_exact_crp = np.array(v_exact[0:p]) - -#------------------------------------------------------------------------------------------------------------------------------- -# PLOT RESULTS -#------------------------------------------------------------------------------------------------------------------------------- -# Plot parameters -# --------------- - -SMALL_SIZE = 8 -MEDIUM_SIZE = 12 -BIGGER_SIZE = 16 -rc('axes', titlesize=BIGGER_SIZE) # fontsize of the figure title -rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x and y labels -rc('xtick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('ytick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize -rc('text', usetex=True) -rc('font', family='serif') -style_plt = ['r-d', 'g-X', 'b-o', 'm-v'] # style use for curve plot - -# Figure 1 -# -------- -plt.clf() -plt.title('Blasius convergence') -plt.plot(dy, L2_analytical, 'b-d', label='Simulation') - -#x = np.array([dy[-2], dy[0]]) -#y = np.array([1. / dy[-2], 1. / dy[0]]) -#plt.plot(x, y, 'k-', label=r'$\propto 1/N^2$') - -plt.text(1.3e-4, 1.2e-2, r'$q$={:.3f}'.format(q_analytical), fontsize=MEDIUM_SIZE, color='b') -plt.xlabel(r'$\Delta y_l$') -plt.ylabel(r'$\mathcal{L}^2$') -plt.xscale('log') -plt.yscale('log') -plt.legend() -plt.grid(b=True, which='major', color='k', linestyle='-') -plt.grid(b=True, which='minor', color='k', linestyle=':') -# ax = plt.gca() -# ax.set_xticks([20, 40, 80], minor=True) -# plt.xticks([20, 40, 80], [20, 40, 80]) -plt.savefig('Blasius_L2.pdf', bbox_inches='tight') -# plt.show() - -# Figure 2 -# -------- -plt.clf() -plt.title('Velocity profile x') -for t in range(Nmesh): - plt.plot(eta_crp[t], ustar_crp[t], style_plt[t], label=dy_str[t]) -plt.plot(eta_exact_crp, u_exact_crp, 'k-', label='Analytical') -plt.xlabel(r'$\eta$') -plt.ylabel(r'$u^{*}$') -plt.legend() -plt.savefig('Blasius_vx.pdf', bbox_inches='tight') - -# Figure 3 -# -------- -plt.clf() -plt.title('Velocity profile y') -for t in range(Nmesh): - plt.plot(eta_crp[t], vstar_crp[t], style_plt[t], label=dy_str[t]) -plt.plot(eta_exact_crp, v_exact_crp, 'k-', label='Analytical') -plt.xlabel(r'$\eta$') -plt.ylabel(r'$v^{*}$') -plt.legend() -plt.savefig('Blasius_vy.pdf') \ No newline at end of file diff --git a/scripts/postTreatment/blasiusLEIS.py b/scripts/postTreatment/blasiusLEIS.py deleted file mode 100644 index 3256f42d..00000000 --- a/scripts/postTreatment/blasiusLEIS.py +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/python3 - -#------------------------------------------------------------------------------------------------------------------------------- -# OBJECTIVE -#------------------------------------------------------------------------------------------------------------------------------- -# This script is for the post-treatment of a supersonic viscous flow over a heated flat plate. -# The interaction with a flat plate at fixed temperature produces thermal and dynamic boundary layers -# as well as a Leading Edge Interaction Shock (LEIS). -# Analytical solutions are not avalaible, thus only a comparison with numerical results is done here. -# Comparison is done with results of following publications: -# - Thevand, N., Daniel, E., & Loraud, J. C. (1999). On high‐resolution schemes for solving unsteady compressible two‐phase -# dilute viscous flows. International journal for numerical methods in fluids, 31(4), 681-702. -# - Jacobs, P. A. (1991). Single-block Navier-Stokes integrator. -# INSTITUTE FOR COMPUTER APPLICATIONS IN SCIENCE AND ENGINEERING HAMPTON VA. - -#------------------------------------------------------------------------------------------------------------------------------- -# IMPORTS -#------------------------------------------------------------------------------------------------------------------------------- -from matplotlib import rc -import matplotlib.pyplot as plt -import numpy as np - -#------------------------------------------------------------------------------------------------------------------------------- -# PARAMETERS TO DEFINE -#------------------------------------------------------------------------------------------------------------------------------- -# Observables -# ----------- - -# Single file extracted from ParaView -f_ecogen = 'ecogen.csv' -# 0. T -# 1. ux -# 2. uy -# 3. uz -# 4. x -# 5. y -# 6. z - -# Two files from digitization -f_ux_jacobs = 'ux_jacobs.txt' -# 0. y -# 1. ux -f_temp_jacobs = 'temp_jacobs.txt' -# 0. y -# 1. T - -# Single file from Daniel's code output -f_daniel = 'daniel.txt' -# 0. y -# 1. ux -# 2. uy -# 3. p -# 4. T -# 5. rho -# Other columns are not useful - -# Parameter -ymax = 0.02 # Max height for plot - -#------------------------------------------------------------------------------------------------------------------------------- -# READING RESULTS -#------------------------------------------------------------------------------------------------------------------------------- -# Reading input files -# ------------------- -y_ecogen = np.loadtxt(f_ecogen, delimiter=',', skiprows=1)[:,5] -ux_ecogen = np.loadtxt(f_ecogen, delimiter=',', skiprows=1)[:,1] -temp_ecogen = np.loadtxt(f_ecogen, delimiter=',', skiprows=1)[:,0] - -y_ux_jacobs = np.loadtxt(f_ux_jacobs, delimiter=',', skiprows=1)[:,0] -ux_jacobs = np.loadtxt(f_ux_jacobs, delimiter=',', skiprows=1)[:,1] - -y_temp_jacobs = np.loadtxt(f_temp_jacobs, delimiter=',', skiprows=1)[:,0] -temp_jacobs = np.loadtxt(f_temp_jacobs, delimiter=',', skiprows=1)[:,1] - -y_daniel = np.loadtxt(f_daniel, delimiter=',')[:,0] -ux_daniel = np.loadtxt(f_daniel, delimiter=',')[:,1] -temp_daniel = np.loadtxt(f_daniel, delimiter=',')[:,4] - -# Crop results -# ------------ -index = 0 - -for i in range(y_ecogen.size): - if y_ecogen[i] > ymax: - index = int(i) - y_ecogen = np.array(y_ecogen[0:index]) - ux_ecogen = np.array(ux_ecogen[0:index]) - temp_ecogen = np.array(temp_ecogen[0:index]) - break - -for i in range(y_ux_jacobs.size): - if y_ux_jacobs[i] > ymax: - index = int(i) - y_ux_jacobs = np.array(y_ux_jacobs[0:index]) - ux_jacobs = np.array(ux_jacobs[0:index]) - break - -for i in range(y_temp_jacobs.size): - if y_temp_jacobs[i] > ymax: - index = int(i) - y_temp_jacobs = np.array(y_temp_jacobs[0:index]) - temp_jacobs = np.array(temp_jacobs[0:index]) - break - -for i in range(y_daniel.size): - if y_daniel[i] > ymax: - index = int(i) - y_daniel = np.array(y_daniel[0:index]) - ux_daniel = np.array(ux_daniel[0:index]) - temp_daniel = np.array(temp_daniel[0:index]) - break - -#------------------------------------------------------------------------------------------------------------------------------- -# PLOT RESULTS -#------------------------------------------------------------------------------------------------------------------------------- -# Plot parameters -# --------------- - -SMALL_SIZE = 8 -MEDIUM_SIZE = 12 -BIGGER_SIZE = 16 -rc('axes', titlesize=BIGGER_SIZE) # fontsize of the figure title -rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x and y labels -rc('xtick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('ytick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize -rc('text', usetex=True) -rc('font', family='serif') - -# Figure Velocity on x -# -------------------- -plt.clf() -plt.title('Velocity profile') - -plt.plot(y_ecogen, ux_ecogen, 'k-d', label='ECOGEN') -plt.plot(y_ux_jacobs, ux_jacobs, 'b-o', label='Jacobs') -plt.plot(y_daniel, ux_daniel, 'r-x', label='Daniel') - -plt.xlabel(r'$y \ (m)$') -plt.ylabel(r'$u \ (m.s^{-1})$') -plt.legend() -plt.grid() -plt.tight_layout() -plt.savefig('velocity.pdf', pad_inches=0.02) - -# Figure temperature -# ------------------ -plt.clf() -plt.title('Temperature profile') - -plt.plot(y_ecogen, temp_ecogen, 'k-d', label='ECOGEN') -plt.plot(y_temp_jacobs, temp_jacobs, 'b-o', label='Jacobs') -plt.plot(y_daniel, temp_daniel, 'r-x', label='Daniel') - -plt.xlabel(r'$y \ (m)$') -plt.ylabel(r'$T \ (K)$') -plt.legend() -plt.grid() -plt.tight_layout() -plt.savefig('temperature.pdf', pad_inches=0.02) diff --git a/scripts/postTreatment/sphericalCollapse_postTreatment.py b/scripts/postTreatment/sphericalCollapse_postTreatment.py deleted file mode 100644 index 314127ed..00000000 --- a/scripts/postTreatment/sphericalCollapse_postTreatment.py +++ /dev/null @@ -1,187 +0,0 @@ -#------------------------------------------------------------------------------------------------------------------------------- -# OBJECTIVE -#------------------------------------------------------------------------------------------------------------------------------- -# This script is for the post-treatment of spherical bubble collapse. -# Indeed, it allows to compute the radius over time of the bubble and compare it to the semi-analytical solution of the -# compressible Keller--Miksis equation. -# To do so, it is necessary to define the corresponsding parameters and data to post-treat in the following section. The data -# must contain the total volume of the bubble in the "infoCalcul.out" file, which is not a feature always exported. Appropriate -# commented sections in Run::initialize(), Run::solver() and Output::saveInfos() methods must therefore be uncommented. The -# concerned variable is m_volumePhaseK. - -#------------------------------------------------------------------------------------------------------------------------------- -# IMPORTS -#------------------------------------------------------------------------------------------------------------------------------- -import math -from matplotlib import rc -import matplotlib.pyplot as plt -import numpy as np -from scipy import integrate - -#------------------------------------------------------------------------------------------------------------------------------- -# PARAMETERS TO DEFINE / INITIAL CONDITIONS -#------------------------------------------------------------------------------------------------------------------------------- -# Dimensionful variables -# ---------------------- -rhoL = 1000. -cL = 1631.652 -gamma = 1.4 -muL = 0. -sigma = 0. -Pv = 0. #Pv = 1500.; #Pv = 3550. -Pinf = 50.6625e5 -R0 = 1.e-4 -Pb0 = 3550. + 2.*sigma/R0 -P = 0. -w = 0. -k = (Pb0 - Pv) * R0**(3.*gamma) - -# Number of points for the semi-analytical Keller--Miksis solution -# ---------------------------------------------------------------- -time_pts = 2000 - -# Load data in files -# ------------------ -file_1D = open("../../results/pressureVelocityEq1DsphericalCollapse_Pratio1427_100cellsPerD/infoCalcul.out", "r") -file_2D = open("../../results/pressureVelocityEq2DsphericalCollapse_Pratio1427_200cellsPerD/infoCalcul.out", "r") - -#------------------------------------------------------------------------------------------------------------------------------- -# COMPUTATIONS -#------------------------------------------------------------------------------------------------------------------------------- -# Dimensionless variables -# ----------------------- -x_init = R0/R0 -P0 = Pinf - Pv -k_dimLess = k / (P0 * R0**(3.*gamma)) -sigma_dimLess = 2.*sigma/R0/P0 -cL_dimLess = cL*(rhoL/P0)**(1./2.) -nuL = 4.*muL/R0/(rhoL*P0)**(1./2.) -w_dimLess = w*R0*(rhoL/P0)**(1./2.) - -# Radius and interface velocity -# ----------------------------- -u_star_eq = 0. -u_star_outEq = -(1.-Pb0/Pinf)/(cL/(Pinf/rhoL)**0.5) -x0_eq = [x_init, u_star_eq] -x0_outEq = [x_init, u_star_outEq] - -# Times -# ----- -t_TC = 0.915*(rhoL/(Pinf-Pv))**(1./2.)*R0 -t_dimLessCoeff = (P0/rhoL)**(1./2.)/R0 -t0 = 0. -t_end = 2.*t_TC*t_dimLessCoeff -tspan = np.linspace(t0, t_end, time_pts) #The points of evaluation of solution -tspan_plot = tspan/t_dimLessCoeff/t_TC - -# Evaluate the Keller-Miksis ODE with substitution parameter to obtain a set of first order equations -# --------------------------------------------------------------------------------------------------- -def MK(t_dimLess, x, P0, k_dimLess, gamma, nuL, sigma_dimLess, cL_dimLess, P, w_dimLess): - dxdt = np.zeros(2) - dxdt[0] = x[1] - dxdt[1] = ( (dxdt[0]**3.)/2. + dxdt[0]*((1.-3.*gamma)*k_dimLess*x[0]**(-3.*gamma) - 1.) - - cL_dimLess*(3./2.*dxdt[0]**2. + nuL*dxdt[0]/x[0] + sigma_dimLess/x[0] - k_dimLess*x[0]**(-3.*gamma) + 1.) - + (1. + dxdt[0]/cL_dimLess)*P*cL_dimLess/P0*math.sin(w_dimLess*(t_dimLess + x[0]/cL_dimLess)) ) / (nuL - x[0]*(dxdt[0] - cL_dimLess)) - return dxdt - -# Solve the compressible Keller-Miksis equation -# --------------------------------------------- -# Equilibrium -x_eq = np.zeros((len(tspan), len(x0_eq))) #Array for solution (R, u) -x_eq[0, :] = x0_eq -r_eq = integrate.ode(MK).set_integrator("dopri5") #Choice of method -r_eq.set_initial_value(x0_eq, t0).set_f_params(P0, k_dimLess, gamma, nuL, sigma_dimLess, cL_dimLess, P, w_dimLess) #Initial values (y, t) and then *args -for i in range(1, tspan.size): - x_eq[i, :] = r_eq.integrate(tspan[i]) #Get one more value, add it to the array - if not r_eq.successful(): - raise RuntimeError("Could not integrate") -# Out of equilibrium -x_outEq = np.zeros((len(tspan), len(x0_outEq))) #Array for solution (R, u) -x_outEq[0, :] = x0_outEq -r_outEq = integrate.ode(MK).set_integrator("dopri5") #Choice of method -r_outEq.set_initial_value(x0_outEq, t0).set_f_params(P0, k_dimLess, gamma, nuL, sigma_dimLess, cL_dimLess, P, w_dimLess) #Initial values (y, t) and then *args -for i in range(1, tspan.size): - x_outEq[i, :] = r_outEq.integrate(tspan[i]) #Get one more value, add it to the array - if not r_outEq.successful(): - raise RuntimeError("Could not integrate") - -#------------------------------------------------------------------------------------------------------------------------------- -# SIMULATION RESULTS DETERMINATION -#------------------------------------------------------------------------------------------------------------------------------- -# Radius computation -# ------------------ -# 1D - volume -# 2D - (volume*4/math.pi)**(1/2) ; note that we only compute 1/4th of the disk -# 3D - (volume*8*3/4/math.pi)**(1/3) ; note that we only compute 1/8th of the sphere - -# 1D -# -- -lines_1D = file_1D.readlines() -del lines_1D[0] #Delete the first line of the file (useless) -time_1D = [] -volume_1D = [] -for line in lines_1D: - split_line = line.split() - volume_1D.append(float(split_line[7])) #The volume is the 8th variable in the infoCalcul.out file - time_1D.append(float(split_line[2])) #The time is the 3rd variable in the infoCalcul.out file -R0_1D = volume_1D[0] -non_dim_radius_1D = [element /R0_1D for element in volume_1D] #Non-dimensionalized radius -non_dim_time_1D = [element /t_TC*R0/R0_1D for element in time_1D] #Non-dimensionalized time - -# 2D -# -- -lines_2D = file_2D.readlines() -del lines_2D[0] #Delete the first line of the file (useless) -time_2D = [] -volume_2D = [] -for line in lines_2D: - split_line = line.split() - volume_2D.append(float(split_line[7])) #The volume is the 8th variable in the infoCalcul.out file - time_2D.append(float(split_line[2])) #The time is the 3rd variable in the infoCalcul.out file -R0_2D = (volume_2D[0]*4/math.pi)**(1/2) -non_dim_radius_2D = [(element *4/math.pi)**(1/2) / R0_2D for element in volume_2D] #Non-dimensionalized radius -non_dim_time_2D = [element /t_TC*R0/R0_2D for element in time_2D] #Non-dimensionalized time - -# 3D -# -- -# lines_3D = file_3D.readlines() -# del lines_3D[0] #Delete the first line of the file (useless) -# time_3D = [] -# volume_3D = [] -# for line in lines_3D: -# split_line = line.split() -# volume_3D.append(float(split_line[7])) #The volume is the 8th variable in the infoCalcul.out file -# time_3D.append(float(split_line[2])) #The time is the 3rd variable in the infoCalcul.out file -# R0_3D = (volume_3D[0]*8*3/4/math.pi)**(1/3) -# non_dim_radius_3D = [(element *8*3/4/math.pi)**(1/3) / R0_3D for element in volume_3D] #Non-dimensionalized radius -# non_dim_time_3D = [element /t_TC*R0/R0_3D for element in time_3D] #Non-dimensionalized time - -#------------------------------------------------------------------------------------------------------------------------------- -# PLOT RESULTS -#------------------------------------------------------------------------------------------------------------------------------- -# Plot parameters -# --------------- -SMALL_SIZE = 8 -MEDIUM_SIZE = 12 -BIGGER_SIZE = 16 -rc('axes', titlesize=BIGGER_SIZE) # fontsize of the figure title -rc('axes', labelsize=BIGGER_SIZE) # fontsize of the x and y labels -rc('xtick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('ytick', labelsize=MEDIUM_SIZE) # fontsize of the tick labels -rc('legend', fontsize=MEDIUM_SIZE) # legend fontsize -rc('text', usetex=True) -rc('font', family='serif') - -# Figure 1 -# -------- -plt.title('Axi-symmetry validation') -plt.plot(tspan_plot, x_outEq[:, 0], 'k-', label='Keller--Miksis, $\dot{R}_0 \\neq 0$') -# plt.plot(tspan_plot, x_eq[:, 0], 'k:', label='Keller--Miksis, $\dot{R}_0 = 0$') -plt.plot(non_dim_time_1D, non_dim_radius_1D, 'r--', label='1D - 100c/d') -plt.plot(non_dim_time_2D, non_dim_radius_2D, 'b-.', label='2D - 200c/d') -plt.xlabel(r'$t/t_c$') -plt.ylabel(r'$R/R_0$') -plt.legend() -# plt.grid(True) -plt.savefig('fig1.pdf') -plt.show() diff --git a/scripts/run.sh b/scripts/run.sh index bfa0467d..a1890f0a 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -45,6 +45,23 @@ touch $mainOutput rm -f $reportFile touch $reportFile +#Set Gmsh options according to its version +#----------------------------------------- +#By default Gmsh version >4 produces mesh file +#not compatible with ECOGEN. Specific options are set +# to make the mesh file compliant. +gmshOptions="" +gmsh --version &> "gmsh.txt" +if [ $? == 0 ] +then + gmshVersion=$(cat "gmsh.txt" | cut -d"." -f1) + if [ "$gmshVersion" -ge "4" ] + then + gmshOptions="-part_ghosts -format msh22" + fi +fi +rm "gmsh.txt" + #Looping on test cases #--------------------- testNum=0 @@ -57,11 +74,12 @@ do #Running gmsh if necessary #************************* - meshType=$(sed -n 's///p' | sed '{s/\t//g};{s/ //g}') - if [ $meshType == "unStructured" ] + meshType=$(sed -n 's///p' | tr -d '[:space:]') + meshType=$(echo "$meshType" | tr '[:upper:]' '[:lower:]') # Convert to lowercase + if [ $meshType == "unstructured" ] then - geoFile=$(sed '{s/\t//g};{s/ //g}' ${testsList[$k]}meshV5.xml | sed -n 's/^> $mainOutput 2>&1 + geoFile=$(sed 's/\t//g' ${testsList[$k]}mesh.xml | sed 's/ //g' | sed -n 's/^> $mainOutput 2>&1 if [ $? != 0 ] then status="failed: mesh generation failed" diff --git a/scripts/tools/paraviewMacro_bubbleCollapse.xml b/scripts/tools/paraviewMacro_bubbleCollapse.xml deleted file mode 100644 index a6c63127..00000000 --- a/scripts/tools/paraviewMacro_bubbleCollapse.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/tools/saturation/plot-pv.gnu b/scripts/tools/saturation/plot-pv.gnu new file mode 100644 index 00000000..3d97878d --- /dev/null +++ b/scripts/tools/saturation/plot-pv.gnu @@ -0,0 +1,39 @@ +# Plot experimental and numerical saturation curve p-v +# Numerical saturation curve can be obtained with the +# script psat-num.py +# Experimental data can be found in NIST Fluid database + +# Be aware that numerical pressure is converted to bar + +reset + +set key font ",12" +set title font ",12" +set xlabel font ",12" +set tics font ",10" + +set style data points +set grid +set key + +# Zoom on liquid/gas +set xrange [-2:102] +set yrange [0:0.12] + +# Zoom on gas +# set xrange [3.6:150] +# set yrange [0:0.12] + +# Zoom on liquid +# set xrange [0.0009:0.0011] +# set yrange [0.006:0.1] + +set xlabel "v (m3/kg)" +set title "p (bar)" + +plot "psat-num.out" u 3:($2*0.00001) lc "blue" lw 3 w p title 'vL - num.', \ + "psat-num.out" u 4:($2*0.00001) lc "forest-green" lw 3 w p title 'vG - num.', \ + "psat-exp.out" u 4:2 title 'vL - exp.' lc "red" lw 1.5 w l, \ + "psat-exp.out" u 16:2 title 'vG - exp.' lc "orange" lw 1.5 w l + +pause(-1) diff --git a/scripts/tools/saturation/psat-num.py b/scripts/tools/saturation/psat-num.py new file mode 100644 index 00000000..a039e682 --- /dev/null +++ b/scripts/tools/saturation/psat-num.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 + +#--------------------------- +# OBJECTIVE +#--------------------------- + +# This script allows to compute the numerical saturation +# curve p-v for a given temperature range. +# The liquid and vapor obey SG/IG EOS and are calibrated +# using the saturation experimental data, for more ref. see +# Le Métayer, O., Massoni, J., & Saurel, R. (2004). +# Élaboration des lois d'état d'un liquide et de sa vapeur +# pour les modèles d'écoulements diphasiques. +# International journal of thermal sciences, 43(3), 265-276. + +#--------------------------- +# IMPORTS +#--------------------------- + +import numpy as np +from math import floor, exp, log + +print('Running...') + +#--------------------------- +# PARAMETERS TO DEFINE +#--------------------------- + +print('Read input EOS parameters...') + +# EOS parameters +# Liquid +cpl = 4183.93 # Heat capacity at constant pressure (J.kg-1.K-1) +cvl = 1479.48 # Heat capacity at constant volume (J.kg-1.K-1) +pinfl = 8.05163e8 # Matter cohesion parameter (Pa) +gammal = 2.82798 # Adiabatic index (-) +ql = -1.14264e6 # Energy constant (J.kg-1) +qpl = 0. # Entropy constant (J.kg-1.K-1) + +# Gas +cpg = 1809.74 # Heat capacity at constant pressure (J.kg-1.K-1) +cvg = 1348.71 # Heat capacity at constant volume (J.kg-1.K-1) +pinfg = 0. # Matter cohesion parameter (Pa) +gammag = 1.34183 # Adiabatic index (-) +qg = 2.00685e6 # Energy constant (J.kg-1) +qpg = -30025.9 # Entropy constant (J.kg-1.K-1) + +# Temperature range of interest +Tmin = 278. # Min. temperature (K) +Tmax = 318. # Max. temperature (K) + +#--------------------------- +# COMPUTATIONS +#--------------------------- + +# Compute Psat coefficients +A = (cpl - cpg + qpg - qpl) / (cpg - cvg) +B = (ql - qg) / (cpg - cvg) +C = (cpg - cpl) / (cpg - cvg) +D = (cpl - cvl) / (cpg - cvg) + +# Temperature range of the calibration (K) +T = np.linspace(Tmin, Tmax, num=50) + +psat = np.zeros(T.size) +vl = np.zeros(T.size) +vg = np.zeros(T.size) + +print('Compute saturation quantities...') + +# Temperature loop +for i in range(T.size): + progress = int(i / T.size * 100) + if (progress % 10 == 0): + print('Progress {}%'.format(progress)) + psat1 = 2.e-5 + err = 1. + count = 0 + # Compute Psat with Newton-Raphson procedure applied to Gibbs free energy eq. + while (abs(err) > 1.e-5): + f = psat1 + pinfg - exp( A + B / T[i] + C * log(T[i]) ) * (psat1 + pinfl)**D + df = 1. - exp( A + B / T[i] + C * log(T[i])) * D * (psat1 + pinfl)**(D - 1.) + psat2 = psat1 - f / df + err = (psat2 - psat1) / (0.5 * (psat1 + psat2)) + psat1 = psat2 + count += 1 + if (count > 50): + print('WARNING: Newton-Raphson has not converged for temperature ', T[i]) + psat[i] = psat1 + + # Compute specific volumes using each phase EOS + vl[i] = (gammal - 1.) * cvl * T[i] / (psat[i] + pinfl) + vg[i] = (gammag - 1.) * cvg * T[i] / (psat[i] + pinfg) + +#--------------------------- +# WRITE RESULTS +#--------------------------- + +print('Write results...') + +with open('psat-num.out', 'w') as f: + f.write('T' + ' ' + 'Psat' + ' ' + 'vL' + ' ' + 'vG' + '\n') + for i in range(T.size): + f.write(str(T[i]) + ' ' + str(psat[i]) + ' ' + str(vl[i]) + ' ' + str(vg[i]) + '\n') + f.close() + +print('Done.') \ No newline at end of file diff --git a/scripts/tools/saturation/saturation-state.py b/scripts/tools/saturation/saturation-state.py new file mode 100644 index 00000000..32364c10 --- /dev/null +++ b/scripts/tools/saturation/saturation-state.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python3 + +#------------------------------------------------------- +# OBJECTIVE +#------------------------------------------------------- + +# This script allows to compute the saturation state using a given +# pressure or temperature for a liquid/gas mixture. +# The Stiffened Gas or Ideal Gas (pinf = 0) equation of state (EOS) +# is used for each phase. + +#------------------------------------------------------- +# IMPORTS +#------------------------------------------------------- +from math import exp, log + +#------------------------------------------------------- +# PARAMETERS TO DEFINE +#------------------------------------------------------- + +# EOS parameters +# Liquid +cvl = 1816. # Heat capacity at constant volume (J.kg-1.K-1) +gammal = 2.35 # Adiabatic index (-) +pinfl = 1.e9 # Matter cohesion parameter (Pa) +ql = -1167.e3 # Energy constant (J.kg-1) +qpl = 0. # Entropy constant (J.kg-1.K-1) + +# Gas +cvg = 1040. # Heat capacity at constant volume (J.kg-1.K-1) +gammag = 1.43 # Adiabatic index (-) +pinfg = 0. # Matter cohesion parameter (Pa) +qg = 2030.e3 # Energy constant (J.kg-1) +qpg = -23.4e3 # Entropy constant (J.kg-1.K-1) + +# Input state condition +p = 100.e5 # Saturation pressure (Pa) +T = 373. # Saturation temperature (K) +computeSatFromTemp = False # Choice on the method to compute saturation state + +#------------------------------------------------------- +# COMPUTATIONS +#------------------------------------------------------- + +cpl = gammal * cvl # Heat capacity at constant pressure (J.kg-1.K-1) +cpg = gammag * cvg # Heat capacity at constant pressure (J.kg-1.K-1) + +# Compute Psat coefficients +A = (cpl - cpg + qpg - qpl) / (cpg - cvg) +B = (ql - qg) / (cpg - cvg) +C = (cpg - cpl) / (cpg - cvg) +D = (cpl - cvl) / (cpg - cvg) + +print('Running...') + +err = 1. +it = 0 + +if (computeSatFromTemp): + print('Compute saturation state from temperature') + psat1 = 2.e5 # Initial guess + while (abs(err) > 1.e-5): + f = psat1 + pinfg - exp( A + B / T + C * log(T) ) * (psat1 + pinfl)**D + df = 1. - exp( A + B / T + C * log(T)) * D * (psat1 + pinfl)**(D - 1.) + + psat2 = psat1 - f / df + err = (psat2 - psat1) / (0.5 * (psat1 + psat2)) + print('Iteration:', it, '| Psat =', psat2, '| Psat(old) =', psat1) + psat1 = psat2 + + it += 1 + if (it > 50): + print('WARNING: Newton-Raphson has not converged.') + # Save final pressure + p = psat1 + print('Temp =', T, 'K') + print('Psat =', p, 'Pa') + +else: + print('Compute saturation state from pressure') + Tsat1 = 350. # Initial guess + while (abs(err) > 1.e-5): + f = log(p + pinfg) - A - B / Tsat1 - C * log(Tsat1) - D * log(p + pinfl) + df = B / (Tsat1**2.) - C / Tsat1 + + Tsat2 = Tsat1 - f / df + err = (Tsat2 - Tsat1) / (0.5 * (Tsat1 + Tsat2)) + print('Iteration:', it, '| Tsat =', Tsat2, '| Tsat(old) =', Tsat1) + Tsat1 = Tsat2 + + it += 1 + if (it > 50): + print('WARNING: Newton-Raphson has not converged.') + # Save final temperature + T = Tsat1 + print('p =', p, 'Pa') + print('Tsat =', T, 'K') + +# Compute saturation phase densities +rhog = (p+pinfg) / (gammag - 1.) / cvg / T +rhol = (p+pinfl) / (gammal - 1.) / cvl / T + +#------------------------------------------------------- +# WRITE RESULTS +#------------------------------------------------------- + +print('rhoGSat =', rhog, 'kg/m3') +print('rhoLSat =', rhol, 'kg/m3') + +print('Done.') \ No newline at end of file diff --git a/src/AdditionalPhysics/AddPhys.cpp b/src/AdditionalPhysics/AddPhys.cpp index 507d4f81..a72f28ad 100644 --- a/src/AdditionalPhysics/AddPhys.cpp +++ b/src/AdditionalPhysics/AddPhys.cpp @@ -44,11 +44,11 @@ void AddPhys::computeFluxAddPhys(CellInterface* cellInterface) { this->solveFluxAddPhys(cellInterface); - if (cellInterface->getCellGauche()->getLvl() == cellInterface->getCellDroite()->getLvl()) { //CoefAMR = 1 for the two + if (cellInterface->getCellLeft()->getLvl() == cellInterface->getCellRight()->getLvl()) { //CoefAMR = 1 for the two this->addFluxAddPhys(cellInterface, 1.); //Add flux on the right cell this->subtractFluxAddPhys(cellInterface, 1.); //Subtract flux on the left cell } - else if (cellInterface->getCellGauche()->getLvl() > cellInterface->getCellDroite()->getLvl()) { //CoefAMR = 1 for the left and 0.5 for the right + else if (cellInterface->getCellLeft()->getLvl() > cellInterface->getCellRight()->getLvl()) { //CoefAMR = 1 for the left and 0.5 for the right this->addFluxAddPhys(cellInterface, 0.5); //Add flux on the right cell this->subtractFluxAddPhys(cellInterface, 1.); //Subtract flux on the left cell } @@ -71,8 +71,8 @@ void AddPhys::computeFluxAddPhysBoundary(CellInterface* cellInterface) void AddPhys::addFluxAddPhys(CellInterface* cellInterface, const double& coefAMR) { //No "time step" - double coefA = cellInterface->getFace()->getSurface() / cellInterface->getCellDroite()->getElement()->getVolume() * coefAMR; - cellInterface->getCellDroite()->getCons()->addFlux(coefA); + double coefA = cellInterface->getFace()->getSurface() / cellInterface->getCellRight()->getElement()->getVolume() * coefAMR; + cellInterface->getCellRight()->getCons()->addFlux(coefA); } //*********************************************************************** @@ -80,8 +80,8 @@ void AddPhys::addFluxAddPhys(CellInterface* cellInterface, const double& coefAMR void AddPhys::subtractFluxAddPhys(CellInterface* cellInterface, const double& coefAMR) { //No "time step" - double coefA = cellInterface->getFace()->getSurface() / cellInterface->getCellGauche()->getElement()->getVolume() * coefAMR; - cellInterface->getCellGauche()->getCons()->subtractFlux(coefA); + double coefA = cellInterface->getFace()->getSurface() / cellInterface->getCellLeft()->getElement()->getVolume() * coefAMR; + cellInterface->getCellLeft()->getCons()->subtractFlux(coefA); } //*********************************************************************** diff --git a/src/AdditionalPhysics/Conductivity/APEConductivity.cpp b/src/AdditionalPhysics/Conductivity/APEConductivity.cpp index fc311d57..ad7b9313 100644 --- a/src/AdditionalPhysics/Conductivity/APEConductivity.cpp +++ b/src/AdditionalPhysics/Conductivity/APEConductivity.cpp @@ -58,8 +58,8 @@ void APEConductivity::solveFluxAddPhys(CellInterface* cellInterface) m_binormal = cellInterface->getFace()->getBinormal(); // Copy and projection on orientation axis attached to the edge of gradients of left and right cells - m_gradTLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(0); - m_gradTRight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(0); + m_gradTLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(0); + m_gradTRight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(0); m_gradTLeft.localProjection(m_normal, m_tangent, m_binormal); m_gradTRight.localProjection(m_normal, m_tangent, m_binormal); @@ -79,7 +79,7 @@ void APEConductivity::solveFluxAddPhysBoundary(CellInterface* cellInterface) m_binormal = cellInterface->getFace()->getBinormal(); // Copy and projection on orientation axes attached to the edge of gradients of left and right cells - m_gradTLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(0); + m_gradTLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(0); m_gradTLeft.localProjection(m_normal, m_tangent, m_binormal); int typeCellInterface(cellInterface->whoAmI()); @@ -133,11 +133,11 @@ void APEConductivity::solveFluxConductivityNonReflecting(const Coord& gradTLeft) void APEConductivity::solveFluxConductivityWallImposedTemp(CellInterface *cellInterface) { // Retrieve local temperatures - double temperatureLeft(cellInterface->getCellGauche()->getPhase(0)->getTemperature()); + double temperatureLeft(cellInterface->getCellLeft()->getPhase(0)->getTemperature()); double tempWall(cellInterface->getBoundaryHeatQuantity()); // Distances cell center/cell interface - double distLeft(cellInterface->getCellGauche()->distance(cellInterface)); + double distLeft(cellInterface->getCellLeft()->distance(cellInterface)); // Compute the temperature gradient locally double dTdx((tempWall - temperatureLeft) / distLeft); @@ -175,7 +175,7 @@ void APEConductivity::solveFluxConductivityOther() const void APEConductivity::communicationsAddPhys(const int& dim, const int& lvl) { - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, 0); //m_gradT + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, 0); //m_gradT } //*********************************************************************** \ No newline at end of file diff --git a/src/AdditionalPhysics/Conductivity/APUEqConductivity.cpp b/src/AdditionalPhysics/Conductivity/APUEqConductivity.cpp index df9ecb83..6fa218c3 100644 --- a/src/AdditionalPhysics/Conductivity/APUEqConductivity.cpp +++ b/src/AdditionalPhysics/Conductivity/APUEqConductivity.cpp @@ -75,14 +75,14 @@ void APUEqConductivity::solveFluxAddPhys(CellInterface* cellInterface) for (int numPhase = 0; numPhase < numberPhases; numPhase++) { // Copy and projection on orientation axis attached to the edge of gradients of left and right cells - m_gradTkLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(numPhase); - m_gradTkRight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(numPhase); + m_gradTkLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(numPhase); + m_gradTkRight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(numPhase); m_gradTkLeft.localProjection(m_normal, m_tangent, m_binormal); m_gradTkRight.localProjection(m_normal, m_tangent, m_binormal); // Extraction of alphak - double alphakLeft = cellInterface->getCellGauche()->getPhase(numPhase)->getAlpha(); - double alphakRight = cellInterface->getCellDroite()->getPhase(numPhase)->getAlpha(); + double alphakLeft = cellInterface->getCellLeft()->getPhase(numPhase)->getAlpha(); + double alphakRight = cellInterface->getCellRight()->getPhase(numPhase)->getAlpha(); this->solveFluxConductivityInner(m_gradTkLeft, m_gradTkRight, alphakLeft, alphakRight, numPhase); } @@ -112,17 +112,17 @@ void APUEqConductivity::solveFluxAddPhysBoundary(CellInterface* cellInterface) for (int numPhase = 0; numPhase < numberPhases; numPhase++) { // Copy and projection on orientation axes attached to the edge of gradients of left and right cells - m_gradTkLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(numPhase); + m_gradTkLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(numPhase); m_gradTkLeft.localProjection(m_normal, m_tangent, m_binormal); // Extraction of alphak - double alphakLeft = cellInterface->getCellGauche()->getPhase(numPhase)->getAlpha(); + double alphakLeft = cellInterface->getCellLeft()->getPhase(numPhase)->getAlpha(); int typeCellInterface = cellInterface->whoAmI(); if (typeCellInterface == NONREFLECTING) { this->solveFluxConductivityNonReflecting(m_gradTkLeft, alphakLeft, numPhase); } else if (typeCellInterface == WALL || typeCellInterface == SYMMETRY) { this->solveFluxConductivityWall(); } - else if (typeCellInterface == OUTFLOW) { this->solveFluxConductivityOutflow(); } - else if (typeCellInterface == INJ) { this->solveFluxConductivityInflow(); } + else if (typeCellInterface == OUTLETPRESSURE) { this->solveFluxConductivityOutletPressure(); } + else if (typeCellInterface == INLETINJSTAGSTATE) { this->solveFluxConductivityInletInjStagState(); } else { this->solveFluxConductivityOther(); } // etc... Boundaries not taken into account yet for conductivity, pay attention } @@ -168,7 +168,7 @@ void APUEqConductivity::solveFluxConductivityWall() const //*********************************************************************** -void APUEqConductivity::solveFluxConductivityOutflow() const +void APUEqConductivity::solveFluxConductivityOutletPressure() const { //Not manage at the moment, just an example @@ -181,7 +181,7 @@ void APUEqConductivity::solveFluxConductivityOutflow() const //*********************************************************************** -void APUEqConductivity::solveFluxConductivityInflow() const +void APUEqConductivity::solveFluxConductivityInletInjStagState() const { //Not manage at the moment, just an example @@ -211,7 +211,7 @@ void APUEqConductivity::solveFluxConductivityOther() const void APUEqConductivity::communicationsAddPhys(const int& dim, const int& lvl) { for (int k = 0; k < numberPhases; k++) { - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, k); + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, k); } } diff --git a/src/AdditionalPhysics/Conductivity/APUEqConductivity.h b/src/AdditionalPhysics/Conductivity/APUEqConductivity.h index 3cf7d2dc..1dce3cec 100644 --- a/src/AdditionalPhysics/Conductivity/APUEqConductivity.h +++ b/src/AdditionalPhysics/Conductivity/APUEqConductivity.h @@ -62,10 +62,10 @@ class APUEqConductivity : public APUEq void solveFluxConductivityNonReflecting(const Coord& gradTkLeft, const double& alphakL, const int& numPhase) const; //! \brief Solve the conductivity flux at a boundary with an wall type void solveFluxConductivityWall() const; - //! \brief Solve the conductivity flux at a boundary with an outflow type - void solveFluxConductivityOutflow() const; - //! \brief Solve the conductivity flux at a boundary with an inflow type - void solveFluxConductivityInflow() const; + //! \brief Solve the conductivity flux at a boundary with an inlet injection using stagnation state type + void solveFluxConductivityInletInjStagState() const; + //! \brief Solve the conductivity flux at a boundary with an outlet at imposed pressure type + void solveFluxConductivityOutletPressure() const; //! \brief Solve the conductivity flux at a boundary with non-defined type yet void solveFluxConductivityOther() const; virtual void addNonCons(Cell* /*cell*/) {}; //The conductivity does not involve non-conservative terms. diff --git a/src/AdditionalPhysics/Conductivity/QAPConductivity.cpp b/src/AdditionalPhysics/Conductivity/QAPConductivity.cpp index 855106d2..d6c75c5f 100644 --- a/src/AdditionalPhysics/Conductivity/QAPConductivity.cpp +++ b/src/AdditionalPhysics/Conductivity/QAPConductivity.cpp @@ -38,7 +38,7 @@ QAPConductivity::QAPConductivity(AddPhys* addPhys) : QuantitiesAddPhys(addPhys), numPhasesCond.resize(numberPhases); for (int k = 0; k < numberPhases; ++k) { m_gradTk[k] = 0.; - variableNamesCond[k] = temperature; + variableNamesCond[k] = Variable::temperature; numPhasesCond[k] = k; } } @@ -51,7 +51,7 @@ QAPConductivity::~QAPConductivity(){} void QAPConductivity::computeQuantities(Cell* cell) { - cell->computeGradient(m_gradTk, variableNamesCond, numPhasesCond); + cell->computeGradients(m_gradTk, variableNamesCond, numPhasesCond); } //*********************************************************************** diff --git a/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.cpp b/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.cpp index c1fe1e76..4f5d9be8 100644 --- a/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.cpp +++ b/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.cpp @@ -109,14 +109,14 @@ void APUEqSurfaceTension::solveFluxAddPhys(CellInterface* cellInterface) m_binormal = cellInterface->getFace()->getBinormal(); // Copy and projection on orientation axes attached to the edge of velocities of left and right cells - m_velocityLeft = cellInterface->getCellGauche()->getMixture()->getVelocity(); - m_velocityRight = cellInterface->getCellDroite()->getMixture()->getVelocity(); + m_velocityLeft = cellInterface->getCellLeft()->getMixture()->getVelocity(); + m_velocityRight = cellInterface->getCellRight()->getMixture()->getVelocity(); m_velocityLeft.localProjection(m_normal, m_tangent, m_binormal); m_velocityRight.localProjection(m_normal, m_tangent, m_binormal); // Copy and projection on orientation axes attached to the edge of gradients of left and right cells - m_gradCLeft = cellInterface->getCellGauche()->getQPA(m_numQPAGradC)->getGrad(); - m_gradCRight = cellInterface->getCellDroite()->getQPA(m_numQPAGradC)->getGrad(); + m_gradCLeft = cellInterface->getCellLeft()->getQPA(m_numQPAGradC)->getGrad(); + m_gradCRight = cellInterface->getCellRight()->getQPA(m_numQPAGradC)->getGrad(); m_gradCLeft.localProjection(m_normal, m_tangent, m_binormal); m_gradCRight.localProjection(m_normal, m_tangent, m_binormal); @@ -140,11 +140,11 @@ void APUEqSurfaceTension::solveFluxAddPhysBoundary(CellInterface* cellInterface) m_binormal = cellInterface->getFace()->getBinormal(); // Copy and projection on orientation axes attached to the edge of velocities of left and right cells - m_velocityLeft = cellInterface->getCellGauche()->getMixture()->getVelocity(); + m_velocityLeft = cellInterface->getCellLeft()->getMixture()->getVelocity(); m_velocityLeft.localProjection(m_normal, m_tangent, m_binormal); // Copy and projection on orientation axes attached to the edge of gradients of left and right cells - m_gradCLeft = cellInterface->getCellGauche()->getQPA(m_numQPAGradC)->getGrad(); + m_gradCLeft = cellInterface->getCellLeft()->getQPA(m_numQPAGradC)->getGrad(); m_gradCLeft.localProjection(m_normal, m_tangent, m_binormal); // Reset of fluxBuffUEq (allow to then do the sum of surface-tension effects for the different phases combinations) @@ -153,8 +153,8 @@ void APUEqSurfaceTension::solveFluxAddPhysBoundary(CellInterface* cellInterface) int typeCellInterface = cellInterface->whoAmI(); if (typeCellInterface == NONREFLECTING) { this->solveFluxSurfaceTensionNonReflecting(m_velocityLeft, m_gradCLeft); } else if (typeCellInterface == WALL || typeCellInterface == SYMMETRY) { this->solveFluxSurfaceTensionWall(m_gradCLeft); } - else if (typeCellInterface == OUTFLOW) { this->solveFluxSurfaceTensionOutflow(); } - else if (typeCellInterface == INJ) { this->solveFluxSurfaceTensionInflow(); } + else if (typeCellInterface == OUTLETPRESSURE) { this->solveFluxSurfaceTensionOutletPressure(); } + else if (typeCellInterface == INLETINJSTAGSTATE) { this->solveFluxSurfaceTensionInletInjStagState(); } else { this->solveFluxSurfaceTensionOther(); } //Else // etc... Boundaries not taken into account yet for surface tension, pay attention @@ -230,7 +230,7 @@ void APUEqSurfaceTension::solveFluxSurfaceTensionWall(const Coord& gradCLeft) co //*********************************************************************** -void APUEqSurfaceTension::solveFluxSurfaceTensionOutflow() const +void APUEqSurfaceTension::solveFluxSurfaceTensionOutletPressure() const { //Not manage at the moment, just an example @@ -243,7 +243,7 @@ void APUEqSurfaceTension::solveFluxSurfaceTensionOutflow() const //*********************************************************************** -void APUEqSurfaceTension::solveFluxSurfaceTensionInflow() const +void APUEqSurfaceTension::solveFluxSurfaceTensionInletInjStagState() const { //Not manage at the moment, just an example @@ -341,7 +341,7 @@ void APUEqSurfaceTension::reinitializeColorFunction(std::vector* cellsLvl void APUEqSurfaceTension::communicationsAddPhys(const int& dim, const int& lvl) { - parallel.communicationsVector(QPA, dim, lvl, m_numQPAGradC); + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPAGradC); } //*********************************************************************** diff --git a/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.h b/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.h index 1e35411b..a78ab77d 100644 --- a/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.h +++ b/src/AdditionalPhysics/SurfaceTension/APUEqSurfaceTension.h @@ -60,10 +60,10 @@ class APUEqSurfaceTension : public APUEq //! \brief Solve the surface-tension flux at a boundary with a wall type //! \param gradCLeft color function gradient of the left cell void solveFluxSurfaceTensionWall(const Coord& gradCLeft) const; - //! \brief Solve the surface-tension flux at a boundary with an outflow type - void solveFluxSurfaceTensionOutflow() const; - //! \brief Solve the surface-tension flux at a boundary with an inflow (injection) type - void solveFluxSurfaceTensionInflow() const; + //! \brief Solve the surface-tension flux at a boundary with an inlet injection using stagnation state type + void solveFluxSurfaceTensionInletInjStagState() const; + //! \brief Solve the surface-tension flux at a boundary with an outlet at imposed pressure type + void solveFluxSurfaceTensionOutletPressure() const; //! \brief Solve the surface-tension flux at a boundary with non-defined type yet void solveFluxSurfaceTensionOther() const; virtual void addNonCons(Cell* /*cell*/) {}; //The surface-tension effects do not involve non-conservative terms. diff --git a/src/AdditionalPhysics/SurfaceTension/QAPSurfaceTension.cpp b/src/AdditionalPhysics/SurfaceTension/QAPSurfaceTension.cpp index 8874904f..c8f321ca 100644 --- a/src/AdditionalPhysics/SurfaceTension/QAPSurfaceTension.cpp +++ b/src/AdditionalPhysics/SurfaceTension/QAPSurfaceTension.cpp @@ -37,7 +37,7 @@ QAPSurfaceTension::QAPSurfaceTension(AddPhys* addPhys) : QuantitiesAddPhys(addPh m_gradC[0] = 0.; variableNameSurfTens.resize(1); numPhaseSurfTens.resize(1); - variableNameSurfTens[0] = transport; + variableNameSurfTens[0] = Variable::transport; numPhaseSurfTens[0] = m_addPhys->getNumTransportAssociated(); } @@ -49,7 +49,7 @@ QAPSurfaceTension::~QAPSurfaceTension(){} void QAPSurfaceTension::computeQuantities(Cell* cell) { - cell->computeGradient(m_gradC, variableNameSurfTens, numPhaseSurfTens); + cell->computeGradients(m_gradC, variableNameSurfTens, numPhaseSurfTens); } //*********************************************************************** diff --git a/src/AdditionalPhysics/Viscosity/APEViscosity.cpp b/src/AdditionalPhysics/Viscosity/APEViscosity.cpp index bb2e1406..da062856 100644 --- a/src/AdditionalPhysics/Viscosity/APEViscosity.cpp +++ b/src/AdditionalPhysics/Viscosity/APEViscosity.cpp @@ -58,15 +58,15 @@ void APEViscosity::addQuantityAddPhys(Cell* cell) void APEViscosity::solveFluxAddPhys(CellInterface* cellInterface) { // Copy velocities and gradients of left and right cells - m_velocityLeft = cellInterface->getCellGauche()->getPhase(0)->getVelocity(); - m_velocityRight = cellInterface->getCellDroite()->getPhase(0)->getVelocity(); + m_velocityLeft = cellInterface->getCellLeft()->getPhase(0)->getVelocity(); + m_velocityRight = cellInterface->getCellRight()->getPhase(0)->getVelocity(); - m_gradULeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(1); - m_gradURight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(1); - m_gradVLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(2); - m_gradVRight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(2); - m_gradWLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(3); - m_gradWRight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(3); + m_gradULeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(1); + m_gradURight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(1); + m_gradVLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(2); + m_gradVRight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(2); + m_gradWLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(3); + m_gradWRight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(3); m_normal = cellInterface->getFace()->getNormal(); m_tangent = cellInterface->getFace()->getTangent(); @@ -75,15 +75,9 @@ void APEViscosity::solveFluxAddPhys(CellInterface* cellInterface) // Projection on orientation axes attached to the edge of velocities and gradients m_velocityLeft.localProjection(m_normal, m_tangent, m_binormal); m_velocityRight.localProjection(m_normal, m_tangent, m_binormal); - m_gradULeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradURight.localProjection(m_normal, m_tangent, m_binormal); - m_gradVLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradVRight.localProjection(m_normal, m_tangent, m_binormal); - m_gradWLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradWRight.localProjection(m_normal, m_tangent, m_binormal); - m_tensorLeft.setTensorByColumns(m_gradULeft, m_gradVLeft, m_gradWLeft); - m_tensorRight.setTensorByColumns(m_gradURight, m_gradVRight, m_gradWRight); + m_tensorLeft.setTensorByLines(m_gradULeft, m_gradVLeft, m_gradWLeft); + m_tensorRight.setTensorByLines(m_gradURight, m_gradVRight, m_gradWRight); m_tensorLeft.localProjection(m_normal, m_tangent, m_binormal); m_tensorRight.localProjection(m_normal, m_tangent, m_binormal); m_tensorLeft.tensorToCoords(m_gradULeft, m_gradVLeft, m_gradWLeft); @@ -103,10 +97,10 @@ void APEViscosity::solveFluxAddPhysBoundary(CellInterface* cellInterface) //DEV// BC Injection, Tank, Outflow to do // Copy velocities and gradients of left and right cells - m_velocityLeft = cellInterface->getCellGauche()->getPhase(0)->getVelocity(); - m_gradULeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(1); - m_gradVLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(2); - m_gradWLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(3); + m_velocityLeft = cellInterface->getCellLeft()->getPhase(0)->getVelocity(); + m_gradULeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(1); + m_gradVLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(2); + m_gradWLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(3); m_normal = cellInterface->getFace()->getNormal(); m_tangent = cellInterface->getFace()->getTangent(); @@ -114,19 +108,16 @@ void APEViscosity::solveFluxAddPhysBoundary(CellInterface* cellInterface) // Projection on orientation axes attached to the edge of velocities and gradients m_velocityLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradULeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradVLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradWLeft.localProjection(m_normal, m_tangent, m_binormal); - m_tensorLeft.setTensorByColumns(m_gradULeft, m_gradVLeft, m_gradWLeft); + m_tensorLeft.setTensorByLines(m_gradULeft, m_gradVLeft, m_gradWLeft); m_tensorLeft.localProjection(m_normal, m_tangent, m_binormal); m_tensorLeft.tensorToCoords(m_gradULeft, m_gradVLeft, m_gradWLeft); // Distances cells/cell interfaces for weighting on the flux - double distLeft = cellInterface->getCellGauche()->distance(cellInterface); + double distLeft = cellInterface->getCellLeft()->distance(cellInterface); int typeCellInterface = cellInterface->whoAmI(); - if (typeCellInterface == NONREFLECTING || typeCellInterface == OUTFLOW || typeCellInterface == INJ || typeCellInterface == TANK || typeCellInterface == SUBINJ) { + if (typeCellInterface == NONREFLECTING || typeCellInterface == OUTLETPRESSURE || typeCellInterface == INLETINJSTAGSTATE || typeCellInterface == INLETTANK || typeCellInterface == INLETINJTEMP) { this->solveFluxViscosityNonReflecting(m_velocityLeft, m_gradULeft, m_gradVLeft, m_gradWLeft, m_mu); } else if (typeCellInterface == WALL) { @@ -273,9 +264,9 @@ void APEViscosity::solveFluxViscosityOther() const void APEViscosity::communicationsAddPhys(const int& dim, const int& lvl) { - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, 1); //m_gradU - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, 2); //m_gradV - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, 3); //m_gradW + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, 1); //m_gradU + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, 2); //m_gradV + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, 3); //m_gradW } //*********************************************************************** \ No newline at end of file diff --git a/src/AdditionalPhysics/Viscosity/APUEqViscosity.cpp b/src/AdditionalPhysics/Viscosity/APUEqViscosity.cpp index 91ecc0a2..30a7314e 100644 --- a/src/AdditionalPhysics/Viscosity/APUEqViscosity.cpp +++ b/src/AdditionalPhysics/Viscosity/APUEqViscosity.cpp @@ -60,21 +60,21 @@ void APUEqViscosity::addQuantityAddPhys(Cell* cell) void APUEqViscosity::solveFluxAddPhys(CellInterface* cellInterface) { // Copy velocities and gradients of left and right cells - m_velocityLeft = cellInterface->getCellGauche()->getMixture()->getVelocity(); - m_velocityRight = cellInterface->getCellDroite()->getMixture()->getVelocity(); + m_velocityLeft = cellInterface->getCellLeft()->getMixture()->getVelocity(); + m_velocityRight = cellInterface->getCellRight()->getMixture()->getVelocity(); - m_gradULeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(1); - m_gradURight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(1); - m_gradVLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(2); - m_gradVRight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(2); - m_gradWLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(3); - m_gradWRight = cellInterface->getCellDroite()->getQPA(m_numQPA)->getGrad(3); + m_gradULeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(1); + m_gradURight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(1); + m_gradVLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(2); + m_gradVRight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(2); + m_gradWLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(3); + m_gradWRight = cellInterface->getCellRight()->getQPA(m_numQPA)->getGrad(3); // Compute the mixture mu on left and right double muMixLeft(0.), muMixRight(0.); for (int k = 0; k < numberPhases; k++) { - muMixLeft += cellInterface->getCellGauche()->getPhase(k)->getAlpha()*m_muk[k]; - muMixRight += cellInterface->getCellDroite()->getPhase(k)->getAlpha()*m_muk[k]; + muMixLeft += cellInterface->getCellLeft()->getPhase(k)->getAlpha()*m_muk[k]; + muMixRight += cellInterface->getCellRight()->getPhase(k)->getAlpha()*m_muk[k]; } m_normal = cellInterface->getFace()->getNormal(); @@ -84,15 +84,9 @@ void APUEqViscosity::solveFluxAddPhys(CellInterface* cellInterface) // Projection on orientation axes attached to the edge of velocities and gradients m_velocityLeft.localProjection(m_normal, m_tangent, m_binormal); m_velocityRight.localProjection(m_normal, m_tangent, m_binormal); - m_gradULeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradURight.localProjection(m_normal, m_tangent, m_binormal); - m_gradVLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradVRight.localProjection(m_normal, m_tangent, m_binormal); - m_gradWLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradWRight.localProjection(m_normal, m_tangent, m_binormal); - - m_tensorLeft.setTensorByColumns(m_gradULeft, m_gradVLeft, m_gradWLeft); - m_tensorRight.setTensorByColumns(m_gradURight, m_gradVRight, m_gradWRight); + + m_tensorLeft.setTensorByLines(m_gradULeft, m_gradVLeft, m_gradWLeft); + m_tensorRight.setTensorByLines(m_gradURight, m_gradVRight, m_gradWRight); m_tensorLeft.localProjection(m_normal, m_tangent, m_binormal); m_tensorRight.localProjection(m_normal, m_tangent, m_binormal); m_tensorLeft.tensorToCoords(m_gradULeft, m_gradVLeft, m_gradWLeft); @@ -112,15 +106,15 @@ void APUEqViscosity::solveFluxAddPhysBoundary(CellInterface* cellInterface) ////KS//DEV// BC Injection, Tank, Outflow to do // Copy velocities and gradients of left and right cells - m_velocityLeft = cellInterface->getCellGauche()->getMixture()->getVelocity(); - m_gradULeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(1); - m_gradVLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(2); - m_gradWLeft = cellInterface->getCellGauche()->getQPA(m_numQPA)->getGrad(3); + m_velocityLeft = cellInterface->getCellLeft()->getMixture()->getVelocity(); + m_gradULeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(1); + m_gradVLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(2); + m_gradWLeft = cellInterface->getCellLeft()->getQPA(m_numQPA)->getGrad(3); // Compute the mixture mu on left and right double muMixLeft(0.); for (int k = 0; k < numberPhases; k++) { - muMixLeft += cellInterface->getCellGauche()->getPhase(k)->getAlpha()*m_muk[k]; + muMixLeft += cellInterface->getCellLeft()->getPhase(k)->getAlpha()*m_muk[k]; } m_normal = cellInterface->getFace()->getNormal(); @@ -129,19 +123,16 @@ void APUEqViscosity::solveFluxAddPhysBoundary(CellInterface* cellInterface) // Projection on orientation axes attached to the edge of velocities and gradients m_velocityLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradULeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradVLeft.localProjection(m_normal, m_tangent, m_binormal); - m_gradWLeft.localProjection(m_normal, m_tangent, m_binormal); - m_tensorLeft.setTensorByColumns(m_gradULeft, m_gradVLeft, m_gradWLeft); + m_tensorLeft.setTensorByLines(m_gradULeft, m_gradVLeft, m_gradWLeft); m_tensorLeft.localProjection(m_normal, m_tangent, m_binormal); m_tensorLeft.tensorToCoords(m_gradULeft, m_gradVLeft, m_gradWLeft); // Distances cells/cell interfaces for weighting on the flux - double distLeft = cellInterface->getCellGauche()->distance(cellInterface); + double distLeft = cellInterface->getCellLeft()->distance(cellInterface); int typeCellInterface = cellInterface->whoAmI(); - if (typeCellInterface == NONREFLECTING || typeCellInterface == OUTFLOW || typeCellInterface == INJ || typeCellInterface == TANK || typeCellInterface == SUBINJ) { + if (typeCellInterface == NONREFLECTING || typeCellInterface == OUTLETPRESSURE || typeCellInterface == INLETINJSTAGSTATE || typeCellInterface == INLETTANK || typeCellInterface == INLETINJTEMP) { this->solveFluxViscosityNonReflecting(m_velocityLeft, m_gradULeft, m_gradVLeft, m_gradWLeft, muMixLeft); } else if (typeCellInterface == WALL) { @@ -392,9 +383,9 @@ void APUEqViscosity::addSymmetricTermsRadialAxisOnY(Cell* cell) void APUEqViscosity::communicationsAddPhys(const int& dim, const int& lvl) { - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, 1); //m_gradU - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, 2); //m_gradV - parallel.communicationsVector(QPA, dim, lvl, m_numQPA, 3); //m_gradW + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, 1); //m_gradU + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, 2); //m_gradV + parallel.communicationsVector(Variable::QPA, dim, lvl, m_numQPA, 3); //m_gradW } //*********************************************************************** diff --git a/src/AdditionalPhysics/Viscosity/QAPViscosity.cpp b/src/AdditionalPhysics/Viscosity/QAPViscosity.cpp index 8b9eccd7..751539bd 100644 --- a/src/AdditionalPhysics/Viscosity/QAPViscosity.cpp +++ b/src/AdditionalPhysics/Viscosity/QAPViscosity.cpp @@ -40,9 +40,9 @@ QAPViscosity::QAPViscosity(AddPhys* addPhys) : QuantitiesAddPhys(addPhys), m_gra m_grads[i] = 0.; numPhasesVisc[i] = 0; } - variableNamesVisc[0] = velocityU; - variableNamesVisc[1] = velocityV; - variableNamesVisc[2] = velocityW; + variableNamesVisc[0] = Variable::velocityU; + variableNamesVisc[1] = Variable::velocityV; + variableNamesVisc[2] = Variable::velocityW; } //*********************************************************************** @@ -53,7 +53,7 @@ QAPViscosity::~QAPViscosity(){} void QAPViscosity::computeQuantities(Cell* cell) { - cell->computeGradient(m_grads, variableNamesVisc, numPhasesVisc); + cell->computeGradients(m_grads, variableNamesVisc, numPhasesVisc); } //*********************************************************************** diff --git a/src/AdditionalPhysics/Viscosity/QAPViscosity.h b/src/AdditionalPhysics/Viscosity/QAPViscosity.h index 78238bbf..a73642dd 100644 --- a/src/AdditionalPhysics/Viscosity/QAPViscosity.h +++ b/src/AdditionalPhysics/Viscosity/QAPViscosity.h @@ -48,7 +48,7 @@ class QAPViscosity : public QuantitiesAddPhys virtual const Coord& getGrad(const int& num = -1) const { return m_grads[num-1]; }; //1:U, 2:V, 3:W protected: - std::vector m_grads; //!< Gradient vectors of the velocities of the cell in x-, y- and z-directions (ex: m_grads[0] = (du/dx, du/dy, du/dz)) + std::vector m_grads; //!< Vector of the velocity gradients of the cell in x-, y- and z-directions (ex: m_grads[0] = (du/dx, du/dy, du/dz)) private: }; diff --git a/src/BoundConds/BoundCond.cpp b/src/BoundConds/BoundCond.cpp index 9cc788bb..9f2a8d5f 100644 --- a/src/BoundConds/BoundCond.cpp +++ b/src/BoundConds/BoundCond.cpp @@ -77,11 +77,12 @@ void BoundCond::computeFluxAddPhys(AddPhys &addPhys) void BoundCond::solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim type) { bufferCellLeft->copyVec(m_cellLeft->getPhases(type), m_cellLeft->getMixture(type), m_cellLeft->getTransports(type)); - //Velocity projection on geometric reference frame of the face - bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); //Computation of extended variables (Phases, Mixture, AddPhys) bufferCellLeft->fulfillState(); + //Vector and tensor projections on geometric reference frame of the face + bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + //Riemann problem double dxLeft(m_cellLeft->getElement()->getLCFL()); dxLeft = dxLeft*std::pow(2., (double)m_lvl); @@ -131,7 +132,7 @@ void BoundCond::raffineCellInterfaceExterne(const int& nbCellsY, const int& nbCe this->creerCellInterfaceChild(); m_cellInterfacesChildren[0]->creerFaceChild(this); - m_cellInterfacesChildren[0]->getFace()->initializeAutres(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellInterfacesChildren[0]->getFace()->initializeOthers(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); m_cellInterfacesChildren[0]->getFace()->setPos(m_face->getPos().getX(), m_face->getPos().getY(), m_face->getPos().getZ()); m_cellInterfacesChildren[0]->getFace()->setSize(m_face->getSize()); if (m_face->getPos().getX() < cellRef->getElement()->getPosition().getX()) { @@ -157,7 +158,7 @@ void BoundCond::raffineCellInterfaceExterne(const int& nbCellsY, const int& nbCe for (int i = 0; i < 2; i++) { this->creerCellInterfaceChild(); m_cellInterfacesChildren[i]->creerFaceChild(this); - m_cellInterfacesChildren[i]->getFace()->initializeAutres(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellInterfacesChildren[i]->getFace()->initializeOthers(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); } //Face selon X @@ -261,7 +262,7 @@ void BoundCond::raffineCellInterfaceExterne(const int& nbCellsY, const int& nbCe for (int i = 0; i < 4; i++) { this->creerCellInterfaceChild(); m_cellInterfacesChildren[i]->creerFaceChild(this); - m_cellInterfacesChildren[i]->getFace()->initializeAutres(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellInterfacesChildren[i]->getFace()->initializeOthers(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); m_cellInterfacesChildren[i]->getFace()->setSize(0.5*m_face->getSize()); } diff --git a/src/BoundConds/BoundCond.h b/src/BoundConds/BoundCond.h index 38e42d0e..25c6b044 100644 --- a/src/BoundConds/BoundCond.h +++ b/src/BoundConds/BoundCond.h @@ -32,7 +32,7 @@ #define BOUNDCOND_H #include "../Order1/CellInterface.h" -#include "../Order2/CellInterfaceO2.h" //Ajouter pour l'AMR, a priori ne pose pas de probleme +#include "../Order2/CellInterfaceO2Cartesian.h" //Add for AMR, a priori does not pose a problem #include "../libTierces/tinyxml2.h" #include "../Errors.h" #include "../Tools.h" @@ -64,6 +64,8 @@ class BoundCond : public CellInterface virtual double getBoundData(VarBoundary var) const; virtual double getBoundaryHeatQuantity() const { Errors::errorMessage("getBoundaryHeatQuantity not available for boundary used"); return 0.; } + virtual void checkMrfInterface(Source* /*sourceMRF*/) {}; + //Pour methode AMR virtual void computeXi(const double& /*criteriaVar*/, const bool& /*varRho*/, const bool& /*varP*/, const bool& /*varU*/, const bool& /*varAlpha*/) {}; virtual void computeFluxXi(); diff --git a/src/BoundConds/BoundCondInj.cpp b/src/BoundConds/BoundCondInletInjStagState.cpp similarity index 81% rename from src/BoundConds/BoundCondInj.cpp rename to src/BoundConds/BoundCondInletInjStagState.cpp index ce99e633..eb1c484a 100644 --- a/src/BoundConds/BoundCondInj.cpp +++ b/src/BoundConds/BoundCondInletInjStagState.cpp @@ -28,13 +28,13 @@ // along with ECOGEN (file LICENSE). // If not, see . -#include "BoundCondInj.h" +#include "BoundCondInletInjStagState.h" using namespace tinyxml2; //**************************************************************************** -BoundCondInj::BoundCondInj(int numPhysique, XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName) : +BoundCondInletInjStagState::BoundCondInletInjStagState(int numPhysique, XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName) : BoundCond(numPhysique), m_T0(0.) { m_ak0 = new double[numbPhases]; @@ -43,8 +43,8 @@ BoundCondInj::BoundCondInj(int numPhysique, XMLElement* element, const int& numb //Reading injection surface-mass-flow condition (kg/s/m�) //------------------------------------------------------- - XMLElement* sousElement(element->FirstChildElement("dataInjection")); - if (sousElement == NULL) throw ErrorXMLElement("dataInjection", fileName, __FILE__, __LINE__); + XMLElement* sousElement(element->FirstChildElement("dataInletInj")); + if (sousElement == NULL) throw ErrorXMLElement("dataInletInj", fileName, __FILE__, __LINE__); //Attributes reading XMLError error; error = sousElement->QueryDoubleAttribute("m0", &m_m0); @@ -100,8 +100,8 @@ BoundCondInj::BoundCondInj(int numPhysique, XMLElement* element, const int& numb //--------------------- m_valueTransport = new double[numbTransports]; if (numbTransports) { - XMLElement* sousElement(element->FirstChildElement("dataInjection")); - if (sousElement == NULL) throw ErrorXMLElement("dataInjection", fileName, __FILE__, __LINE__); + XMLElement* sousElement(element->FirstChildElement("dataInletInj")); + if (sousElement == NULL) throw ErrorXMLElement("dataInletInj", fileName, __FILE__, __LINE__); XMLError error; int foundColors(0); @@ -129,7 +129,7 @@ BoundCondInj::BoundCondInj(int numPhysique, XMLElement* element, const int& numb //**************************************************************************** -BoundCondInj::BoundCondInj(const BoundCondInj &Source, const int& lvl) : BoundCond(Source, lvl) +BoundCondInletInjStagState::BoundCondInletInjStagState(const BoundCondInletInjStagState &Source, const int& lvl) : BoundCond(Source, lvl) { m_ak0 = new double[numberPhases]; m_rhok0 = new double[numberPhases]; @@ -152,7 +152,7 @@ BoundCondInj::BoundCondInj(const BoundCondInj &Source, const int& lvl) : BoundCo //**************************************************************************** -BoundCondInj::~BoundCondInj() +BoundCondInletInjStagState::~BoundCondInletInjStagState() { delete[] m_ak0; delete[] m_rhok0; @@ -162,28 +162,28 @@ BoundCondInj::~BoundCondInj() //**************************************************************************** -void BoundCondInj::createBoundary(TypeMeshContainer& cellInterfaces) +void BoundCondInletInjStagState::createBoundary(TypeMeshContainer& cellInterfaces) { - cellInterfaces.push_back(new BoundCondInj(*(this))); + cellInterfaces.push_back(new BoundCondInletInjStagState(*(this))); } //**************************************************************************** -void BoundCondInj::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) +void BoundCondInletInjStagState::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) { - model->solveRiemannInflow(cellLeft, dxLeft, dtMax, m_m0, m_ak0, m_rhok0, m_pk0, m_boundData); + model->solveRiemannInletInjStagState(cellLeft, dxLeft, dtMax, m_m0, m_ak0, m_rhok0, m_pk0, m_boundData); } //**************************************************************************** -void BoundCondInj::solveRiemannTransportBoundary(Cell& cellLeft) const +void BoundCondInletInjStagState::solveRiemannTransportBoundary(Cell& cellLeft) const { - model->solveRiemannTransportInflow(cellLeft, m_valueTransport); + model->solveRiemannTransportInletInjStagState(cellLeft, m_valueTransport); } //**************************************************************************** -void BoundCondInj::printInfo() +void BoundCondInletInjStagState::printInfo() { std::cout << m_numPhysique << std::endl; std::cout << m_m0 << std::endl; @@ -194,9 +194,9 @@ void BoundCondInj::printInfo() //******************************AMR Method*********************************** //*************************************************************************** -void BoundCondInj::creerCellInterfaceChild() +void BoundCondInletInjStagState::creerCellInterfaceChild() { - m_cellInterfacesChildren.push_back(new BoundCondInj(*this, m_lvl + 1)); + m_cellInterfacesChildren.push_back(new BoundCondInletInjStagState(*this, m_lvl + 1)); } //**************************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondInj.h b/src/BoundConds/BoundCondInletInjStagState.h similarity index 77% rename from src/BoundConds/BoundCondInj.h rename to src/BoundConds/BoundCondInletInjStagState.h index cd310c86..d840cf59 100644 --- a/src/BoundConds/BoundCondInj.h +++ b/src/BoundConds/BoundCondInletInjStagState.h @@ -28,24 +28,23 @@ // along with ECOGEN (file LICENSE). // If not, see . -#ifndef BOUNDCONDINJ_H -#define BOUNDCONDINJ_H +#ifndef BOUNDCONDINLETINJSTAGSTATE_H +#define BOUNDCONDINLETINJSTAGSTATE_H #include "BoundCond.h" - -class BoundCondInj : public BoundCond +class BoundCondInletInjStagState : public BoundCond { public: - BoundCondInj(int numPhysique, tinyxml2::XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName = "Unknown file"); - BoundCondInj(const BoundCondInj &Source, const int& lvl = 0); //Copy ctor (useful for AMR) - virtual ~BoundCondInj(); + BoundCondInletInjStagState(int numPhysique, tinyxml2::XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName = "Unknown file"); + BoundCondInletInjStagState(const BoundCondInletInjStagState &Source, const int& lvl = 0); //Copy ctor (useful for AMR) + virtual ~BoundCondInletInjStagState(); virtual void createBoundary(TypeMeshContainer& cellInterfaces); virtual void solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax); virtual void solveRiemannTransportBoundary(Cell& cellLeft) const; - virtual int whoAmI() const { return INJ; }; + virtual int whoAmI() const { return INLETINJSTAGSTATE; }; virtual void printInfo(); //For AMR method @@ -61,4 +60,4 @@ class BoundCondInj : public BoundCond double* m_valueTransport; }; -#endif // BOUNDCONDINJ_H +#endif diff --git a/src/BoundConds/BoundCondSubInj.cpp b/src/BoundConds/BoundCondInletInjTemp.cpp similarity index 78% rename from src/BoundConds/BoundCondSubInj.cpp rename to src/BoundConds/BoundCondInletInjTemp.cpp index d539811e..e213e067 100644 --- a/src/BoundConds/BoundCondSubInj.cpp +++ b/src/BoundConds/BoundCondInletInjTemp.cpp @@ -28,19 +28,19 @@ // along with ECOGEN (file LICENSE). // If not, see . -#include "BoundCondSubInj.h" +#include "BoundCondInletInjTemp.h" using namespace tinyxml2; //**************************************************************************** -BoundCondSubInj::BoundCondSubInj(int numPhysique, XMLElement* element, const int& numbPhases, std::string fileName) : BoundCond(numPhysique) +BoundCondInletInjTemp::BoundCondInletInjTemp(int numPhysique, XMLElement* element, const int& numbPhases, std::string fileName) : BoundCond(numPhysique) { m_Tk0 = new double[numbPhases]; m_ak0 = new double[numbPhases]; - XMLElement* subElement(element->FirstChildElement("dataInjection")); - if (subElement == NULL) throw ErrorXMLElement("dataInjection", fileName, __FILE__, __LINE__); + XMLElement* subElement(element->FirstChildElement("dataInletInj")); + if (subElement == NULL) throw ErrorXMLElement("dataInletInj", fileName, __FILE__, __LINE__); // Reading specific massflow (kg.s-1.m-2) // -------------------------------------- @@ -72,7 +72,7 @@ BoundCondSubInj::BoundCondSubInj(int numPhysique, XMLElement* element, const int //**************************************************************************** -BoundCondSubInj::BoundCondSubInj(const BoundCondSubInj& Source, const int& lvl) : BoundCond(Source, lvl) +BoundCondInletInjTemp::BoundCondInletInjTemp(const BoundCondInletInjTemp& Source, const int& lvl) : BoundCond(Source, lvl) { m_Tk0 = new double[numberPhases]; m_ak0 = new double[numberPhases]; @@ -87,27 +87,29 @@ BoundCondSubInj::BoundCondSubInj(const BoundCondSubInj& Source, const int& lvl) //**************************************************************************** -BoundCondSubInj::~BoundCondSubInj() +BoundCondInletInjTemp::~BoundCondInletInjTemp() { + delete[] m_Tk0; + delete[] m_ak0; } //**************************************************************************** -void BoundCondSubInj::createBoundary(TypeMeshContainer& cellInterfaces) +void BoundCondInletInjTemp::createBoundary(TypeMeshContainer& cellInterfaces) { - cellInterfaces.push_back(new BoundCondSubInj(*(this))); + cellInterfaces.push_back(new BoundCondInletInjTemp(*(this))); } //**************************************************************************** -void BoundCondSubInj::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) +void BoundCondInletInjTemp::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) { - model->solveRiemannSubInj(cellLeft, dxLeft, dtMax, m_m0, m_Tk0, m_ak0, m_boundData); + model->solveRiemannInletInjTemp(cellLeft, dxLeft, dtMax, m_m0, m_Tk0, m_ak0, m_boundData); } //**************************************************************************** -void BoundCondSubInj::printInfo() +void BoundCondInletInjTemp::printInfo() { std::cout << m_numPhysique << std::endl; std::cout << m_m0 << std::endl; @@ -118,9 +120,9 @@ void BoundCondSubInj::printInfo() //******************************AMR Method*********************************** //**************************************************************************** -void BoundCondSubInj::creerCellInterfaceChild() +void BoundCondInletInjTemp::creerCellInterfaceChild() { - m_cellInterfacesChildren.push_back(new BoundCondSubInj(*this, m_lvl + 1)); + m_cellInterfacesChildren.push_back(new BoundCondInletInjTemp(*this, m_lvl + 1)); } //**************************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondSubInj.h b/src/BoundConds/BoundCondInletInjTemp.h similarity index 80% rename from src/BoundConds/BoundCondSubInj.h rename to src/BoundConds/BoundCondInletInjTemp.h index dab0c031..89827168 100644 --- a/src/BoundConds/BoundCondSubInj.h +++ b/src/BoundConds/BoundCondInletInjTemp.h @@ -28,24 +28,22 @@ // along with ECOGEN (file LICENSE). // If not, see . -#ifndef BOUNDCONDSUBINJ_H -#define BOUNDCONDSUBINJ_H +#ifndef BOUNDCONDINLETINJTEMP_H +#define BOUNDCONDINLETINJTEMP_H #include "BoundCond.h" -// This boundary condition is specific for Euler model - -class BoundCondSubInj : public BoundCond +class BoundCondInletInjTemp : public BoundCond { public: - BoundCondSubInj(int numPhysique, tinyxml2::XMLElement* element, const int& numbPhases, std::string fileName = "Unknown file"); - BoundCondSubInj(const BoundCondSubInj& Source, const int& lvl = 0); // Copy ctor (useful for AMR) - ~BoundCondSubInj(); + BoundCondInletInjTemp(int numPhysique, tinyxml2::XMLElement* element, const int& numbPhases, std::string fileName = "Unknown file"); + BoundCondInletInjTemp(const BoundCondInletInjTemp& Source, const int& lvl = 0); // Copy ctor (useful for AMR) + ~BoundCondInletInjTemp(); virtual void createBoundary(TypeMeshContainer& cellInterfaces); virtual void solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax); - virtual int whoAmI() const { return SUBINJ; }; + virtual int whoAmI() const { return INLETINJTEMP; }; virtual void printInfo(); // For AMR method diff --git a/src/BoundConds/BoundCondTank.cpp b/src/BoundConds/BoundCondInletTank.cpp similarity index 83% rename from src/BoundConds/BoundCondTank.cpp rename to src/BoundConds/BoundCondInletTank.cpp index 18b5ad7b..7ad662fb 100644 --- a/src/BoundConds/BoundCondTank.cpp +++ b/src/BoundConds/BoundCondInletTank.cpp @@ -28,13 +28,13 @@ // along with ECOGEN (file LICENSE). // If not, see . -#include "BoundCondTank.h" +#include "BoundCondInletTank.h" using namespace tinyxml2; //**************************************************************************** -BoundCondTank::BoundCondTank(int numPhysique, XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName) : +BoundCondInletTank::BoundCondInletTank(int numPhysique, XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName) : BoundCond(numPhysique) { m_ak0 = new double[numbPhases]; @@ -43,8 +43,8 @@ BoundCondTank::BoundCondTank(int numPhysique, XMLElement* element, const int& nu //Reading tank pressure and temperature conditions //------------------------------------------------ - XMLElement* sousElement(element->FirstChildElement("dataTank")); - if (sousElement == NULL) throw ErrorXMLElement("dataTank", fileName, __FILE__, __LINE__); + XMLElement* sousElement(element->FirstChildElement("dataInletTank")); + if (sousElement == NULL) throw ErrorXMLElement("dataInletTank", fileName, __FILE__, __LINE__); //Attributes reading XMLError error; error = sousElement->QueryDoubleAttribute("p0", &m_p0); @@ -75,7 +75,7 @@ BoundCondTank::BoundCondTank(int numPhysique, XMLElement* element, const int& nu for (e = 0; e < numbPhases; e++) { if (nameEOS == eos[e]->getName()) { break; } } - if (e == numbPhases) { throw ErrorXMLEOSInconnue(nameEOS, fileName, __FILE__, __LINE__); } + if (e == numbPhases) { throw ErrorXMLEOSUnknown(nameEOS, fileName, __FILE__, __LINE__); } //Reading fluid proportion if (fluid->QueryDoubleAttribute("alpha", &m_ak0[e]) == XML_NO_ERROR) { @@ -137,8 +137,8 @@ BoundCondTank::BoundCondTank(int numPhysique, XMLElement* element, const int& nu //--------------------- m_valueTransport = new double[numbTransports]; if (numbTransports) { - XMLElement* sousElement(element->FirstChildElement("dataTank")); - if (sousElement == NULL) throw ErrorXMLElement("dataTank", fileName, __FILE__, __LINE__); + XMLElement* sousElement(element->FirstChildElement("dataInletTank")); + if (sousElement == NULL) throw ErrorXMLElement("dataInletTank", fileName, __FILE__, __LINE__); XMLError error; int foundColors(0); @@ -166,7 +166,7 @@ BoundCondTank::BoundCondTank(int numPhysique, XMLElement* element, const int& nu //**************************************************************************** -BoundCondTank::BoundCondTank(const BoundCondTank &Source, const int& lvl) : BoundCond(Source, lvl) +BoundCondInletTank::BoundCondInletTank(const BoundCondInletTank &Source, const int& lvl) : BoundCond(Source, lvl) { m_ak0 = new double[numberPhases]; m_Yk0 = new double[numberPhases]; @@ -189,7 +189,7 @@ BoundCondTank::BoundCondTank(const BoundCondTank &Source, const int& lvl) : Boun //**************************************************************************** -BoundCondTank::~BoundCondTank() +BoundCondInletTank::~BoundCondInletTank() { delete[] m_ak0; delete[] m_Yk0; @@ -199,28 +199,28 @@ BoundCondTank::~BoundCondTank() //**************************************************************************** -void BoundCondTank::createBoundary(TypeMeshContainer& cellInterfaces) +void BoundCondInletTank::createBoundary(TypeMeshContainer& cellInterfaces) { - cellInterfaces.push_back(new BoundCondTank(*(this))); + cellInterfaces.push_back(new BoundCondInletTank(*(this))); } //**************************************************************************** -void BoundCondTank::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) +void BoundCondInletTank::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) { - model->solveRiemannTank(cellLeft, dxLeft, dtMax, m_ak0, m_rhok0, m_p0, m_T0, m_boundData); + model->solveRiemannInletTank(cellLeft, dxLeft, dtMax, m_ak0, m_rhok0, m_p0, m_T0, m_boundData); } //**************************************************************************** -void BoundCondTank::solveRiemannTransportBoundary(Cell& cellLeft) const +void BoundCondInletTank::solveRiemannTransportBoundary(Cell& cellLeft) const { - model->solveRiemannTransportTank(cellLeft, m_valueTransport); + model->solveRiemannTransportInletTank(cellLeft, m_valueTransport); } //**************************************************************************** -void BoundCondTank::printInfo() +void BoundCondInletTank::printInfo() { std::cout << m_numPhysique << std::endl; std::cout << m_rhok0[0] << std::endl; @@ -230,9 +230,9 @@ void BoundCondTank::printInfo() //******************************AMR Method************************************ //**************************************************************************** -void BoundCondTank::creerCellInterfaceChild() +void BoundCondInletTank::creerCellInterfaceChild() { - m_cellInterfacesChildren.push_back(new BoundCondTank(*this, m_lvl + 1)); + m_cellInterfacesChildren.push_back(new BoundCondInletTank(*this, m_lvl + 1)); } //**************************************************************************** diff --git a/src/BoundConds/BoundCondTank.h b/src/BoundConds/BoundCondInletTank.h similarity index 78% rename from src/BoundConds/BoundCondTank.h rename to src/BoundConds/BoundCondInletTank.h index cf824a8d..bfbfb2f5 100644 --- a/src/BoundConds/BoundCondTank.h +++ b/src/BoundConds/BoundCondInletTank.h @@ -28,23 +28,23 @@ // along with ECOGEN (file LICENSE). // If not, see . -#ifndef BOUNDCONDTANK_H -#define BOUNDCONDTANK_H +#ifndef BOUNDCONDINLETTANK_H +#define BOUNDCONDINLETTANK_H #include "BoundCond.h" -class BoundCondTank : public BoundCond +class BoundCondInletTank : public BoundCond { public: - BoundCondTank(int numPhysique, tinyxml2::XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName = "Unknown file"); - BoundCondTank(const BoundCondTank &Source, const int& lvl = 0); //Copy ctor (useful for AMR) - virtual ~BoundCondTank(); + BoundCondInletTank(int numPhysique, tinyxml2::XMLElement* element, const int& numbPhases, const int& numbTransports, std::vector nameTransports, Eos** eos, std::string fileName = "Unknown file"); + BoundCondInletTank(const BoundCondInletTank &Source, const int& lvl = 0); //Copy ctor (useful for AMR) + virtual ~BoundCondInletTank(); virtual void createBoundary(TypeMeshContainer& cellInterfaces); virtual void solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax); virtual void solveRiemannTransportBoundary(Cell& cellLeft) const; - virtual int whoAmI() const { return TANK; }; + virtual int whoAmI() const { return INLETTANK; }; virtual void printInfo(); //For AMR method @@ -60,4 +60,4 @@ class BoundCondTank : public BoundCond double* m_valueTransport; }; -#endif // BOUNDCONDTANK_H +#endif // BOUNDCONDINLETTANK_H diff --git a/src/BoundConds/BoundCondNoFlux.o b/src/BoundConds/BoundCondNoFlux.o deleted file mode 100644 index 43f17327..00000000 Binary files a/src/BoundConds/BoundCondNoFlux.o and /dev/null differ diff --git a/src/BoundConds/BoundCondOutletMassflow.cpp b/src/BoundConds/BoundCondOutletMassflow.cpp new file mode 100644 index 00000000..c99a5c0b --- /dev/null +++ b/src/BoundConds/BoundCondOutletMassflow.cpp @@ -0,0 +1,94 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#include "BoundCondOutletMassflow.h" + +using namespace tinyxml2; + +//**************************************************************************** + +BoundCondOutletMassflow::BoundCondOutletMassflow(int numPhysique, XMLElement* element, std::string fileName) : + BoundCond(numPhysique) +{ + XMLElement* sousElement(element->FirstChildElement("dataOutletMassflow")); + if (sousElement == NULL) throw ErrorXMLElement("dataOutletMassflow", fileName, __FILE__, __LINE__); + + // Reading specific massflow (kg.s-1.m-2) + // -------------------------------------- + XMLError error; + error = sousElement->QueryDoubleAttribute("m0", &m_m0); + if (error != XML_NO_ERROR) throw ErrorXMLAttribut("m0", fileName, __FILE__, __LINE__); +} + +//**************************************************************************** + +BoundCondOutletMassflow::BoundCondOutletMassflow(const BoundCondOutletMassflow& Source, const int& lvl) : BoundCond(Source, lvl) +{ + m_m0 = Source.m_m0; +} + +//**************************************************************************** + +BoundCondOutletMassflow::~BoundCondOutletMassflow() +{ +} + +//**************************************************************************** + +void BoundCondOutletMassflow::createBoundary(TypeMeshContainer& cellInterfaces) +{ + cellInterfaces.push_back(new BoundCondOutletMassflow(*(this))); +} + +//**************************************************************************** + +void BoundCondOutletMassflow::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) +{ + model->solveRiemannOutletMassflow(cellLeft, dxLeft, dtMax, m_m0, m_boundData); +} + +//**************************************************************************** + +void BoundCondOutletMassflow::printInfo() +{ + std::cout << m_numPhysique << std::endl; + std::cout << m_m0 << std::endl; +} + +//*************************************************************************** +//******************************AMR Method*********************************** +//*************************************************************************** + +void BoundCondOutletMassflow::creerCellInterfaceChild() +{ + m_cellInterfacesChildren.push_back(new BoundCondOutletMassflow(*this, m_lvl + 1)); +} + +//**************************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondOutletMassflow.h b/src/BoundConds/BoundCondOutletMassflow.h new file mode 100644 index 00000000..78591133 --- /dev/null +++ b/src/BoundConds/BoundCondOutletMassflow.h @@ -0,0 +1,56 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef BOUNDCONDOUTLETMASSLOW_H +#define BOUNDCONDOUTLETMASSLOW_H + +#include "BoundCond.h" + +class BoundCondOutletMassflow : public BoundCond +{ + public: + BoundCondOutletMassflow(int numPhysique, tinyxml2::XMLElement* element, std::string fileName = "Unknown file"); + BoundCondOutletMassflow(const BoundCondOutletMassflow& Source, const int& lvl = 0); //Copy ctor (useful for AMR) + virtual ~BoundCondOutletMassflow(); + + virtual void createBoundary(TypeMeshContainer& cellInterfaces); + virtual void solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax); + + virtual int whoAmI() const { return OUTLETMASSFLOW; }; + virtual void printInfo(); + + //For AMR method + virtual void creerCellInterfaceChild(); /*!< Create a child cell interface (not initialized) */ + + private: + double m_m0; //!< Outlet specific massflow +}; + +#endif // BOUNDCONDOUTLETMASSLOW_H diff --git a/src/BoundConds/BoundCondOutflow.cpp b/src/BoundConds/BoundCondOutletPressure.cpp similarity index 75% rename from src/BoundConds/BoundCondOutflow.cpp rename to src/BoundConds/BoundCondOutletPressure.cpp index ba133436..3aef1601 100644 --- a/src/BoundConds/BoundCondOutflow.cpp +++ b/src/BoundConds/BoundCondOutletPressure.cpp @@ -28,18 +28,18 @@ // along with ECOGEN (file LICENSE). // If not, see . -#include "BoundCondOutflow.h" +#include "BoundCondOutletPressure.h" using namespace tinyxml2; //**************************************************************************** -BoundCondOutflow::BoundCondOutflow(int numPhysique, XMLElement* element, const int& numbTransports, std::vector nameTransports, std::string fileName) : +BoundCondOutletPressure::BoundCondOutletPressure(int numPhysique, XMLElement* element, const int& numbTransports, std::vector nameTransports, std::string fileName) : BoundCond(numPhysique) { //Reading imposed outflow pressure - XMLElement* sousElement(element->FirstChildElement("dataOutflow")); - if (sousElement == NULL) throw ErrorXMLElement("dataOutflow", fileName, __FILE__, __LINE__); + XMLElement* sousElement(element->FirstChildElement("dataOutletPressure")); + if (sousElement == NULL) throw ErrorXMLElement("dataOutletPressure", fileName, __FILE__, __LINE__); //Reading attributes //------------------ XMLError error; @@ -72,7 +72,7 @@ BoundCondOutflow::BoundCondOutflow(int numPhysique, XMLElement* element, const i //**************************************************************************** -BoundCondOutflow::BoundCondOutflow(const BoundCondOutflow& Source, const int& lvl) : BoundCond(Source, lvl) +BoundCondOutletPressure::BoundCondOutletPressure(const BoundCondOutletPressure& Source, const int& lvl) : BoundCond(Source, lvl) { m_p0 = Source.m_p0; m_valueTransport = new double[numberTransports]; @@ -83,35 +83,35 @@ BoundCondOutflow::BoundCondOutflow(const BoundCondOutflow& Source, const int& lv //**************************************************************************** -BoundCondOutflow::~BoundCondOutflow() +BoundCondOutletPressure::~BoundCondOutletPressure() { delete[] m_valueTransport; } //**************************************************************************** -void BoundCondOutflow::createBoundary(TypeMeshContainer& cellInterfaces) +void BoundCondOutletPressure::createBoundary(TypeMeshContainer& cellInterfaces) { - cellInterfaces.push_back(new BoundCondOutflow(*(this))); + cellInterfaces.push_back(new BoundCondOutletPressure(*(this))); } //**************************************************************************** -void BoundCondOutflow::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) +void BoundCondOutletPressure::solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax) { - model->solveRiemannOutflow(cellLeft, dxLeft, dtMax, m_p0, m_boundData); + model->solveRiemannOutletPressure(cellLeft, dxLeft, dtMax, m_p0, m_boundData); } //**************************************************************************** -void BoundCondOutflow::solveRiemannTransportBoundary(Cell& cellLeft) const +void BoundCondOutletPressure::solveRiemannTransportBoundary(Cell& cellLeft) const { - model->solveRiemannTransportOutflow(cellLeft, m_valueTransport); + model->solveRiemannTransportOutletPressure(cellLeft, m_valueTransport); } //**************************************************************************** -void BoundCondOutflow::printInfo() +void BoundCondOutletPressure::printInfo() { std::cout << m_numPhysique << std::endl; std::cout << m_p0 << std::endl; @@ -121,9 +121,9 @@ void BoundCondOutflow::printInfo() //******************************AMR Method*********************************** //*************************************************************************** -void BoundCondOutflow::creerCellInterfaceChild() +void BoundCondOutletPressure::creerCellInterfaceChild() { - m_cellInterfacesChildren.push_back(new BoundCondOutflow(*this, m_lvl + 1)); + m_cellInterfacesChildren.push_back(new BoundCondOutletPressure(*this, m_lvl + 1)); } //**************************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondOutflow.h b/src/BoundConds/BoundCondOutletPressure.h similarity index 77% rename from src/BoundConds/BoundCondOutflow.h rename to src/BoundConds/BoundCondOutletPressure.h index 87a7b6f7..c0640b79 100644 --- a/src/BoundConds/BoundCondOutflow.h +++ b/src/BoundConds/BoundCondOutletPressure.h @@ -28,23 +28,23 @@ // along with ECOGEN (file LICENSE). // If not, see . -#ifndef BOUNDCONDOUTFLOW_H -#define BOUNDCONDOUTFLOW_H +#ifndef BOUNDCONDOUTLETPRESSURE_H +#define BOUNDCONDOUTLETPRESSURE_H #include "BoundCond.h" -class BoundCondOutflow : public BoundCond +class BoundCondOutletPressure : public BoundCond { public: - BoundCondOutflow(int numPhysique, tinyxml2::XMLElement* element, const int& numbTransports, std::vector nameTransports, std::string fileName); - BoundCondOutflow(const BoundCondOutflow& Source, const int& lvl = 0); //Copy ctor (useful for AMR) - virtual ~BoundCondOutflow(); + BoundCondOutletPressure(int numPhysique, tinyxml2::XMLElement* element, const int& numbTransports, std::vector nameTransports, std::string fileName); + BoundCondOutletPressure(const BoundCondOutletPressure& Source, const int& lvl = 0); //Copy ctor (useful for AMR) + virtual ~BoundCondOutletPressure(); virtual void createBoundary(TypeMeshContainer& cellInterfaces); virtual void solveRiemannBoundary(Cell& cellLeft, const double& dxLeft, double& dtMax); virtual void solveRiemannTransportBoundary(Cell& cellLeft) const; - virtual int whoAmI() const { return OUTFLOW; }; + virtual int whoAmI() const { return OUTLETPRESSURE; }; virtual void printInfo(); //For AMR method @@ -56,4 +56,4 @@ class BoundCondOutflow : public BoundCond double* m_valueTransport; }; -#endif // BOUNDCONDOUTFLOW_H +#endif // BOUNDCONDOUTLETPRESSURE_H diff --git a/src/BoundConds/BoundCondSymmetryO2.cpp b/src/BoundConds/BoundCondSymmetryO2Cartesian.cpp similarity index 73% rename from src/BoundConds/BoundCondSymmetryO2.cpp rename to src/BoundConds/BoundCondSymmetryO2Cartesian.cpp index 8afa9b05..f4b32c65 100644 --- a/src/BoundConds/BoundCondSymmetryO2.cpp +++ b/src/BoundConds/BoundCondSymmetryO2Cartesian.cpp @@ -28,37 +28,37 @@ // along with ECOGEN (file LICENSE). // If not, see . -#include "BoundCondSymmetryO2.h" +#include "BoundCondSymmetryO2Cartesian.h" //**************************************************************************** -BoundCondSymmetryO2::BoundCondSymmetryO2(const BoundCondSymmetryO2& Source, const int& lvl) : BoundCondWallO2(Source, lvl) +BoundCondSymmetryO2Cartesian::BoundCondSymmetryO2Cartesian(const BoundCondSymmetryO2Cartesian& Source, const int& lvl) : BoundCondWallO2Cartesian(Source, lvl) {} //**************************************************************************** -BoundCondSymmetryO2::BoundCondSymmetryO2(int numPhysique) : BoundCondWallO2(numPhysique) +BoundCondSymmetryO2Cartesian::BoundCondSymmetryO2Cartesian(int numPhysique) : BoundCondWallO2Cartesian(numPhysique) {} //**************************************************************************** -BoundCondSymmetryO2::~BoundCondSymmetryO2() +BoundCondSymmetryO2Cartesian::~BoundCondSymmetryO2Cartesian() {} //**************************************************************************** -void BoundCondSymmetryO2::createBoundary(TypeMeshContainer& cellInterfaces) +void BoundCondSymmetryO2Cartesian::createBoundary(TypeMeshContainer& cellInterfaces) { - cellInterfaces.push_back(new BoundCondSymmetryO2(*(this))); + cellInterfaces.push_back(new BoundCondSymmetryO2Cartesian(*(this))); } //**************************************************************************** -//******************************AMR Method*********************************** +//******************************AMR Method************************************ //**************************************************************************** -void BoundCondSymmetryO2::creerCellInterfaceChild() +void BoundCondSymmetryO2Cartesian::creerCellInterfaceChild() { - m_cellInterfacesChildren.push_back(new BoundCondSymmetryO2(*this, m_lvl + 1)); + m_cellInterfacesChildren.push_back(new BoundCondSymmetryO2Cartesian(*this, m_lvl + 1)); } //**************************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondSymmetryO2.h b/src/BoundConds/BoundCondSymmetryO2Cartesian.h similarity index 78% rename from src/BoundConds/BoundCondSymmetryO2.h rename to src/BoundConds/BoundCondSymmetryO2Cartesian.h index e4f9e684..8f02992b 100644 --- a/src/BoundConds/BoundCondSymmetryO2.h +++ b/src/BoundConds/BoundCondSymmetryO2Cartesian.h @@ -28,18 +28,17 @@ // along with ECOGEN (file LICENSE). // If not, see . -#ifndef BOUNDCONDSYMMETRYO2_H -#define BOUNDCONDSYMMETRYO2_H +#ifndef BOUNDCONDSYMMETRYO2CARTESIAN_H +#define BOUNDCONDSYMMETRYO2CARTESIAN_H -#include "BoundCondWallO2.h" +#include "BoundCondWallO2Cartesian.h" - -class BoundCondSymmetryO2 : public BoundCondWallO2 +class BoundCondSymmetryO2Cartesian : public BoundCondWallO2Cartesian { public: - BoundCondSymmetryO2(const BoundCondSymmetryO2& Source, const int& lvl = 0); //Copy ctor (useful for AMR) - BoundCondSymmetryO2(int numPhysique); - virtual ~BoundCondSymmetryO2(); + BoundCondSymmetryO2Cartesian(const BoundCondSymmetryO2Cartesian& Source, const int& lvl = 0); //Copy ctor (useful for AMR) + BoundCondSymmetryO2Cartesian(int numPhysique); + virtual ~BoundCondSymmetryO2Cartesian(); virtual void createBoundary(TypeMeshContainer& cellInterfaces); @@ -53,4 +52,4 @@ class BoundCondSymmetryO2 : public BoundCondWallO2 private: }; -#endif // BOUNDCONDSYMMETRYO2_H +#endif // BOUNDCONDSYMMETRYO2CARTESIAN_H diff --git a/src/BoundConds/BoundCondSymmetryO2NS.cpp b/src/BoundConds/BoundCondSymmetryO2NS.cpp new file mode 100644 index 00000000..1801a326 --- /dev/null +++ b/src/BoundConds/BoundCondSymmetryO2NS.cpp @@ -0,0 +1,55 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#include "BoundCondSymmetryO2NS.h" + +//**************************************************************************** + +BoundCondSymmetryO2NS::BoundCondSymmetryO2NS(const BoundCondSymmetryO2NS& Source, const int& lvl) : BoundCondWallO2NS(Source, lvl) +{} + +//**************************************************************************** + +BoundCondSymmetryO2NS::BoundCondSymmetryO2NS(int numPhysique) : BoundCondWallO2NS(numPhysique) +{} + +//**************************************************************************** + +BoundCondSymmetryO2NS::~BoundCondSymmetryO2NS() +{} + +//**************************************************************************** + +void BoundCondSymmetryO2NS::createBoundary(TypeMeshContainer& cellInterfaces) +{ + cellInterfaces.push_back(new BoundCondSymmetryO2NS(*(this))); +} + +//**************************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondSymmetryO2NS.h b/src/BoundConds/BoundCondSymmetryO2NS.h new file mode 100644 index 00000000..9c838d0c --- /dev/null +++ b/src/BoundConds/BoundCondSymmetryO2NS.h @@ -0,0 +1,52 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef BOUNDCONDSYMMETRYO2NS_H +#define BOUNDCONDSYMMETRYO2NS_H + +#include "BoundCondWallO2NS.h" + +class BoundCondSymmetryO2NS : public BoundCondWallO2NS +{ +public: + BoundCondSymmetryO2NS(const BoundCondSymmetryO2NS& Source, const int& lvl = 0); //Copy ctor (useful for AMR) + BoundCondSymmetryO2NS(int numPhysique); + virtual ~BoundCondSymmetryO2NS(); + + virtual void createBoundary(TypeMeshContainer& cellInterfaces); + + virtual int whoAmI() const { return SYMMETRY; }; + +protected: + +private: +}; + +#endif // BOUNDCONDSYMMETRYO2NS_H diff --git a/src/BoundConds/BoundCondWallO2.cpp b/src/BoundConds/BoundCondWallO2Cartesian.cpp similarity index 80% rename from src/BoundConds/BoundCondWallO2.cpp rename to src/BoundConds/BoundCondWallO2Cartesian.cpp index fa890998..86e8af97 100644 --- a/src/BoundConds/BoundCondWallO2.cpp +++ b/src/BoundConds/BoundCondWallO2Cartesian.cpp @@ -28,26 +28,26 @@ // along with ECOGEN (file LICENSE). // If not, see . -#include "BoundCondWallO2.h" +#include "BoundCondWallO2Cartesian.h" //**************************************************************************** -BoundCondWallO2::BoundCondWallO2(const BoundCondWallO2& Source, const int& lvl) : BoundCondWall(Source, lvl) +BoundCondWallO2Cartesian::BoundCondWallO2Cartesian(const BoundCondWallO2Cartesian& Source, const int& lvl) : BoundCondWall(Source, lvl) {} //**************************************************************************** -BoundCondWallO2::BoundCondWallO2(int numPhysique, tinyxml2::XMLElement* element, std::string fileName) : BoundCondWall(numPhysique, element, fileName) +BoundCondWallO2Cartesian::BoundCondWallO2Cartesian(int numPhysique, tinyxml2::XMLElement* element, std::string fileName) : BoundCondWall(numPhysique, element, fileName) {} //**************************************************************************** -BoundCondWallO2::BoundCondWallO2(int numPhysique) : BoundCondWall(numPhysique) +BoundCondWallO2Cartesian::BoundCondWallO2Cartesian(int numPhysique) : BoundCondWall(numPhysique) {} //**************************************************************************** -BoundCondWallO2::~BoundCondWallO2() +BoundCondWallO2Cartesian::~BoundCondWallO2Cartesian() { for (int k = 0; k < numberPhases; k++) { delete m_vecPhasesSlopes[k]; @@ -59,14 +59,14 @@ BoundCondWallO2::~BoundCondWallO2() //**************************************************************************** -void BoundCondWallO2::createBoundary(TypeMeshContainer& cellInterfaces) +void BoundCondWallO2Cartesian::createBoundary(TypeMeshContainer& cellInterfaces) { - cellInterfaces.push_back(new BoundCondWallO2(*(this))); + cellInterfaces.push_back(new BoundCondWallO2Cartesian(*(this))); } //*********************************************************************** -void BoundCondWallO2::allocateSlopes(int& /*allocateSlopeLocal*/) +void BoundCondWallO2Cartesian::allocateSlopes(int& /*allocateSlopeLocal*/) { //Allocation of phase slopes m_vecPhasesSlopes = new Phase*[numberPhases]; @@ -89,7 +89,7 @@ void BoundCondWallO2::allocateSlopes(int& /*allocateSlopeLocal*/) //*********************************************************************** -void BoundCondWallO2::computeSlopes(Prim type) +void BoundCondWallO2Cartesian::computeSlopes(Prim type) { //Slopes des velocities normals aux limites double distanceX, distanceY, distanceZ; @@ -118,17 +118,15 @@ void BoundCondWallO2::computeSlopes(Prim type) //*********************************************************************** -void BoundCondWallO2::solveRiemann(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type) +void BoundCondWallO2Cartesian::solveRiemann(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type) { bufferCellLeft->copyVec(m_cellLeft->getPhases(type), m_cellLeft->getMixture(type), m_cellLeft->getTransports(type)); //Calcul des distances cell interfaces <-> cells pour l extrapolation double distanceGauche(this->distance(m_cellLeft)); - //KS//FP// A voir avec Fabien comment faire ca bien pour qu'il n'y est aucun probleme en non-structure ! - //Probleme que la distance est une norme et donc on ne change pas le signe de la slope pour faire correctement l'extrapolation if (m_face->getNormal().getX() < 0. || m_face->getNormal().getY() < 0. || m_face->getNormal().getZ() < 0.) { distanceGauche = -distanceGauche; } - //Extrapolation gauche + //Left side of interface extrapolation double epsInterface(1.e-4); m_cellLeft->computeLocalSlopesLimite(*this, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, epsInterface); for (int k = 0; k < numberPhases; k++) { @@ -139,10 +137,11 @@ void BoundCondWallO2::solveRiemann(double& dtMax, Limiter& globalLimiter, Limite bufferCellLeft->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceGauche); } - //Projection des velocities sur repere attache a la face - bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); - //Calcul des variables etendus (Phases, Mixture, AddPhys) + //Computation of extended variables (Phases, Mixture, AddPhys) bufferCellLeft->fulfillState(); + + //Vector and tensor projections on geometric reference frame of the face + bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); //Riemann problem double dxLeft(m_cellLeft->getElement()->getLCFL()); @@ -157,21 +156,21 @@ void BoundCondWallO2::solveRiemann(double& dtMax, Limiter& globalLimiter, Limite //*********************************************************************** -Phase* BoundCondWallO2::getSlopesPhase(const int& phaseNumber) const +Phase* BoundCondWallO2Cartesian::getSlopesPhase(const int& phaseNumber) const { return m_vecPhasesSlopes[phaseNumber]; } //*********************************************************************** -Mixture* BoundCondWallO2::getSlopesMixture() const +Mixture* BoundCondWallO2Cartesian::getSlopesMixture() const { return m_mixtureSlopes; } //*********************************************************************** -Transport* BoundCondWallO2::getSlopesTransport(const int& numberTransport) const +Transport* BoundCondWallO2Cartesian::getSlopesTransport(const int& numberTransport) const { return &m_vecTransportsSlopes[numberTransport]; } @@ -181,9 +180,9 @@ Transport* BoundCondWallO2::getSlopesTransport(const int& numberTransport) const //******************************AMR Method*********************************** //*************************************************************************** -void BoundCondWallO2::creerCellInterfaceChild() +void BoundCondWallO2Cartesian::creerCellInterfaceChild() { - m_cellInterfacesChildren.push_back(new BoundCondWallO2(*this, m_lvl + 1)); + m_cellInterfacesChildren.push_back(new BoundCondWallO2Cartesian(*this, m_lvl + 1)); } //**************************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondWallO2.h b/src/BoundConds/BoundCondWallO2Cartesian.h similarity index 75% rename from src/BoundConds/BoundCondWallO2.h rename to src/BoundConds/BoundCondWallO2Cartesian.h index 93716bfb..a559cf68 100644 --- a/src/BoundConds/BoundCondWallO2.h +++ b/src/BoundConds/BoundCondWallO2Cartesian.h @@ -28,19 +28,19 @@ // along with ECOGEN (file LICENSE). // If not, see . -#ifndef BOUNDCONDWALLO2_H -#define BOUNDCONDWALLO2_H +#ifndef BOUNDCONDWALLO2CARTESIAN_H +#define BOUNDCONDWALLO2CARTESIAN_H #include "BoundCondWall.h" -class BoundCondWallO2 : public BoundCondWall +class BoundCondWallO2Cartesian : public BoundCondWall { public: - BoundCondWallO2(const BoundCondWallO2& Source, const int& lvl = 0); //Copy ctor (useful for AMR) - BoundCondWallO2(int numPhysique, tinyxml2::XMLElement* element, std::string fileName); - BoundCondWallO2(int numPhysique); - virtual ~BoundCondWallO2(); + BoundCondWallO2Cartesian(const BoundCondWallO2Cartesian& Source, const int& lvl = 0); //Copy ctor (useful for AMR) + BoundCondWallO2Cartesian(int numPhysique, tinyxml2::XMLElement* element, std::string fileName); + BoundCondWallO2Cartesian(int numPhysique); + virtual ~BoundCondWallO2Cartesian(); virtual void createBoundary(TypeMeshContainer& cellInterfaces); virtual void allocateSlopes(int& /*allocateSlopeLocal*/); @@ -58,10 +58,10 @@ class BoundCondWallO2 : public BoundCondWall virtual void creerCellInterfaceChild(); /*!< Create a child cell interface (not initialized) */ protected: - Phase** m_vecPhasesSlopes; /*!< vecteur des slopes des phases */ - Mixture* m_mixtureSlopes; /*!< vecteur des slopes de mixture */ - Transport* m_vecTransportsSlopes; /*!< vecteur des slopes des transports */ + Phase** m_vecPhasesSlopes; /*!< vector des slopes des phases */ + Mixture* m_mixtureSlopes; /*!< vector des slopes de mixture */ + Transport* m_vecTransportsSlopes; /*!< vector des slopes des transports */ private: }; -#endif // BOUNDCONDWALLO2_H +#endif // BOUNDCONDWALLO2CARTESIAN_H diff --git a/src/BoundConds/BoundCondWallO2NS.cpp b/src/BoundConds/BoundCondWallO2NS.cpp new file mode 100644 index 00000000..3fff6625 --- /dev/null +++ b/src/BoundConds/BoundCondWallO2NS.cpp @@ -0,0 +1,101 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#include "BoundCondWallO2NS.h" + +//**************************************************************************** + +BoundCondWallO2NS::BoundCondWallO2NS(const BoundCondWallO2NS& Source, const int& lvl) : BoundCondWall(Source, lvl) +{} + +//**************************************************************************** + +BoundCondWallO2NS::BoundCondWallO2NS(int numPhysique, tinyxml2::XMLElement* element, std::string fileName) : BoundCondWall(numPhysique, element, fileName) +{} + +//**************************************************************************** + +BoundCondWallO2NS::BoundCondWallO2NS(int numPhysique) : BoundCondWall(numPhysique) +{} + +//**************************************************************************** + +BoundCondWallO2NS::~BoundCondWallO2NS() +{} + +//**************************************************************************** + +void BoundCondWallO2NS::createBoundary(TypeMeshContainer& cellInterfaces) +{ + cellInterfaces.push_back(new BoundCondWallO2NS(*(this))); +} + +//*********************************************************************** + +void BoundCondWallO2NS::solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim type) +{ + // Initialize buffer cells used in Riemann problem + bufferCellLeft->copyVec(m_cellLeft->getPhases(type), m_cellLeft->getMixture(type), m_cellLeft->getTransports(type)); + + // For NS extrapolation a scalar product between the distance + // Coord rij and the gradient is already done during CellO2NS::computeLocalSlopes + // and stored in slopesPhase/MixtureLocal1 + // Therefore, to stay compliant with cartesian 2nd order, distance is equal to 1 here + double distanceLeft = 1.0; + + // Left side of interface extrapolation + m_cellLeft->computeLocalSlopes(*this); // Build slopesPhasesLocal1 = theta_i * rij . grad(Wi) + for (int k = 0; k < numberPhases; k++) { + bufferCellLeft->getPhase(k)->extrapolate(*slopesPhasesLocal1[k], distanceLeft); // Build Wij_lim = Wi + theta_i * rij . grad(Wi) + bufferCellLeft->getPhase(k)->verifyAndCorrectPhase(); + bufferCellLeft->getPhase(k)->verifyAndCorrectDensityMax(); + } + bufferCellLeft->getMixture()->extrapolate(*slopesMixtureLocal1, distanceLeft); + for (int k = 0; k < numberTransports; k++) { + bufferCellLeft->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceLeft); + } + + // Compute extended variables since projection change some of them (Phases, Mixture, AddPhys) + bufferCellLeft->fulfillState(); + + // Vector and tensor projections into reference frame attached to the face + bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + + // Riemann problem + double dxLeft(m_cellLeft->getElement()->getLCFL()); + this->solveRiemannBoundary(*bufferCellLeft, dxLeft, dtMax); + // Handling of transport functions (m_Sm known: need to be called after Riemann solver) + if (numberTransports > 0) { this->solveRiemannTransportBoundary(*bufferCellLeft); } + + // Flux projection into the absolute reference frame + model->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); +} + +//*********************************************************************** \ No newline at end of file diff --git a/src/BoundConds/BoundCondWallO2NS.h b/src/BoundConds/BoundCondWallO2NS.h new file mode 100644 index 00000000..a6a48fd5 --- /dev/null +++ b/src/BoundConds/BoundCondWallO2NS.h @@ -0,0 +1,50 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef BOUNDCONDWALLO2NS_H +#define BOUNDCONDWALLO2NS_H + +#include "BoundCondWall.h" + +class BoundCondWallO2NS : public BoundCondWall +{ + public: + BoundCondWallO2NS(const BoundCondWallO2NS& Source, const int& lvl = 0); //Copy ctor (useful for AMR) + BoundCondWallO2NS(int numPhysique, tinyxml2::XMLElement* element, std::string fileName); + BoundCondWallO2NS(int numPhysique); + virtual ~BoundCondWallO2NS(); + + virtual void createBoundary(TypeMeshContainer& cellInterfaces); + virtual void solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim type = vecPhases); + + virtual int whoAmI() const { return WALL; }; +}; + +#endif // BOUNDCONDWALLO2NS_H diff --git a/src/BoundConds/HeaderBoundCond.h b/src/BoundConds/HeaderBoundCond.h index 29fb02a2..8cb6ff71 100644 --- a/src/BoundConds/HeaderBoundCond.h +++ b/src/BoundConds/HeaderBoundCond.h @@ -32,14 +32,17 @@ #define HEADERBOUNDCOND_H #include "BoundCondNonReflecting.h" -#include "BoundCondInj.h" -#include "BoundCondSubInj.h" -#include "BoundCondTank.h" +#include "BoundCondInletTank.h" +#include "BoundCondInletInjStagState.h" +#include "BoundCondInletInjTemp.h" #include "BoundCondWall.h" -#include "BoundCondWallO2.h" +#include "BoundCondWallO2Cartesian.h" +#include "BoundCondWallO2NS.h" #include "BoundCondSymmetry.h" -#include "BoundCondSymmetryO2.h" -#include "BoundCondOutflow.h" +#include "BoundCondSymmetryO2Cartesian.h" +#include "BoundCondSymmetryO2NS.h" +#include "BoundCondOutletPressure.h" +#include "BoundCondOutletMassflow.h" #include "BoundCondNullFlux.h" //Add here header of new boundary conditions diff --git a/src/Eos/Eos.cpp b/src/Eos/Eos.cpp index 9a940232..5ea104cf 100644 --- a/src/Eos/Eos.cpp +++ b/src/Eos/Eos.cpp @@ -48,13 +48,13 @@ Eos::~Eos(){} //*********************************************************************** -void Eos::readPhysicalParameter(XMLNode *element) +void Eos::readPhysicalParameters(XMLNode *element) { XMLError error; XMLElement* sousElement(element->FirstChildElement("physicalParameters")); if (sousElement != NULL) { - //Recuperation des donnees + //Gathering data error = sousElement->QueryDoubleAttribute("mu", &m_mu); if (error != XML_NO_ERROR) m_mu = -1.; error = sousElement->QueryDoubleAttribute("lambda", &m_lambda); diff --git a/src/Eos/Eos.h b/src/Eos/Eos.h index 6bbcd72f..cb07c7e2 100644 --- a/src/Eos/Eos.h +++ b/src/Eos/Eos.h @@ -32,6 +32,7 @@ #define EOS_H #include "../Maths/Coord.h" +#include "../Maths/Tensor.h" #include "../Errors.h" #include "../libTierces/tinyxml2.h" @@ -64,7 +65,8 @@ class Eos const int& getNumber() const { return m_number; }; //! \brief Read physical parameters (viscosity, thermal conductivity....) - void readPhysicalParameter(tinyxml2::XMLNode *element); + //! \param element node element of XML file + void readPhysicalParameters(tinyxml2::XMLNode *element); //! \brief Compute the enthalpy of the phase //! \param density density (\f$\rho \f$) @@ -85,7 +87,7 @@ class Eos //! \return this -> hTotal //! \details hTotal is computed as :\f$H_{total} = \epsilon (\rho, p) + \frac{p}{\rho} + \frac{1}{2}\bm{u}^2 \f$. double computeTotalEnthalpy(const double& density, const double& pressure, const Coord& velocity) const; - //! \brief Return the dynamic viscosity of the fluid + //! \brief Return the dynamic viscosity of the fluid //!return \f$ \mu \f$ (Unit: Pa.s). const double& getMu() const { return m_mu; }; //! \brief get the thermal conductivity of the fluid diff --git a/src/Eos/EosPolynomial.h b/src/Eos/EosPolynomial.h index 25b33a99..e13c041f 100644 --- a/src/Eos/EosPolynomial.h +++ b/src/Eos/EosPolynomial.h @@ -70,6 +70,10 @@ class EosPolynomial : public Eos //! \details with dedrhoSecond : \f$ \frac{\partial^2 \epsilon}{\partial \rho^2} (\rho) = \frac{1}{\rho^2} \frac{\partial p}{\partial \rho} - \frac{2}{\rho} \frac{\partial \epsilon}{\partial \rho} \f$ virtual double dedrhoSecond(const double& density, const double& temperature) const; + //Checking + //! \brief Do nothing for Polynomial + virtual void verifyAndCorrectDensityMax(double& /*density*/) const {}; + //Get //! \brief Get the type that is to say the reduced name of the EOS in ECOGEN //! \return \f$ \ "Polynomial" \f$ diff --git a/src/Eos/EosSG.cpp b/src/Eos/EosSG.cpp index 8cd5b41d..f2c654ba 100644 --- a/src/Eos/EosSG.cpp +++ b/src/Eos/EosSG.cpp @@ -164,7 +164,7 @@ double EosSG::computeDensityPfinal(const double& initialPressure, const double& { double num((m_gamma)*(finalPressure + m_pInf)); double denom(num + initialPressure - finalPressure); - double finalDensity(initialDensity*num/std::max(denom, epsilonAlphaNull)); + double finalDensity(initialDensity*num / TB->returnNonZeroValue(denom)); if (drhodp != NULL) *drhodp = initialDensity*m_gamma*(initialPressure + m_pInf) / std::max((denom*denom), epsilonAlphaNull); return finalDensity; } diff --git a/src/Eos/EosSG.h b/src/Eos/EosSG.h index 6adddab4..f058f98e 100644 --- a/src/Eos/EosSG.h +++ b/src/Eos/EosSG.h @@ -192,7 +192,6 @@ class EosSG : public Eos //! \return specific volume (volume per mass unit) : \f$ v= (h - \epsilon_{ref})\frac{(\gamma-1)}{\gamma (p+p_{\infty})} \f$ from the definition of enthalpy \f$ h=\epsilon +pv \f$ virtual double vfpfh(const double& pressure, const double& enthalpy) const; - //Partial derivatives //! \brief Compute the partial derivative of the specific volume versus pressure at constant enthalpy //! \param pressure pressure (p) diff --git a/src/Eos/EosVDW.cpp b/src/Eos/EosVDW.cpp index 755b4a66..ac983a10 100644 --- a/src/Eos/EosVDW.cpp +++ b/src/Eos/EosVDW.cpp @@ -101,4 +101,13 @@ double EosVDW::dedrhoSecond(const double& density, const double& temperature) co return dpdrho / (density*density) - 2. * this->dedrho(density, temperature) / density; } +//*********************************************************************** + +void EosVDW::verifyAndCorrectDensityMax(double& density) const +{ + if (density > 1. / m_b - 1.e-10) { + density = 1. / m_b - 1.e-10; + } +} + //*********************************************************************** \ No newline at end of file diff --git a/src/Eos/EosVDW.h b/src/Eos/EosVDW.h index e2365004..98f9db85 100644 --- a/src/Eos/EosVDW.h +++ b/src/Eos/EosVDW.h @@ -84,6 +84,10 @@ class EosVDW : public Eos //! \details with dedrhoSecond : \f$ \frac{\partial^2 \epsilon}{\partial \rho^2} (\rho, T) = \frac{r T (1 - 2 \rho b)}{\rho^2 (1 - \rho b)^2} \f$ //KS//To update virtual double dedrhoSecond(const double& density, const double& /*temperature*/) const; + //Checking + //! \brief Do nothing for VDW + virtual void verifyAndCorrectDensityMax(double& density) const; + //Get //! \brief Get the type that is to say the reduced name of the EOS in ECOGEN //! \return \f$ \ "VDW" \f$ diff --git a/src/Errors.h b/src/Errors.h index 77f2f079..d0424494 100644 --- a/src/Errors.h +++ b/src/Errors.h @@ -154,21 +154,22 @@ class ErrorECOGEN : public std::exception std::string m_infoError; }; +//--------------------------------------------------------------- -//Exception handling on input XML files -//------------------------------------- +//Exception handling on input files (XML, mesh) +//--------------------------------------------- -class ErrorXML : public ErrorECOGEN +class ErrorInput : public ErrorECOGEN { public: //*************** - ErrorXML(std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1, int errorCode = 2) : - ErrorECOGEN(), m_errorCode(errorCode), m_lineNumber(lineNumber), m_sourceFile(sourceFile), m_fileXML(fileXML){} - virtual ~ErrorXML() throw(){} + ErrorInput(std::string fileInput = "", const char* sourceFile = "", int lineNumber = -1, int errorCode = 2) : + ErrorECOGEN(), m_errorCode(errorCode), m_lineNumber(lineNumber), m_sourceFile(sourceFile), m_fileInput(fileInput){} + virtual ~ErrorInput() throw(){} //*************** virtual const char* what(void) const throw() { - return "Exception during reading XML file: file not found or incorrect structure"; + return "Exception during reading input file"; } //*************** std::string infoError(void) const throw() @@ -177,10 +178,10 @@ class ErrorXML : public ErrorECOGEN message << "--------------------------------------------------" << std::endl; message << this->what() << std::endl; message << "****************************************" << std::endl; - if (m_fileXML != "") { message << " XML file concerned: '" << m_fileXML << "'" << std::endl; } + if (m_fileInput != "") { message << " Input file concerned: '" << m_fileInput << "'" << std::endl; } if (m_sourceFile != "") { - message << " infos on exception in code source :" << std::endl; + message << " Infos on exception in source code:" << std::endl; message << " file: '" << m_sourceFile << "'" << std::endl; if (m_lineNumber != -1) message << " line: " << m_lineNumber << std::endl; } @@ -200,11 +201,84 @@ class ErrorXML : public ErrorECOGEN //*************** int getErrorCode() { return m_errorCode; } //*************** -private: +protected: int m_errorCode; int m_lineNumber; std::string m_sourceFile; - std::string m_fileXML; + std::string m_fileInput; +}; + +//--------------------------------------------------------------- + +//Exception handling on unstructured mesh file +//-------------------------------------------- +class ErrorMeshNS : public ErrorInput +{ +public: + //*************** + ErrorMeshNS(std::string fileMesh = "", const char* sourceFile = "", int lineNumber = -1, int errorCode = 2) : + ErrorInput(fileMesh, sourceFile, lineNumber, errorCode) {} + virtual ~ErrorMeshNS() throw(){} + //*************** + virtual const char* what(void) const throw() + { + return "Exception during reading unstructured mesh file: file not found or incorrect structure"; + } + //*************** + std::string infoError(void) const throw() + { + std::stringstream message; + message << "--------------------------------------------------" << std::endl; + message << this->what() << std::endl; + message << "****************************************" << std::endl; + if (m_fileInput != "") { message << " mesh file concerned: '" << m_fileInput << "'" << std::endl; } + if (m_sourceFile != "") + { + message << " infos on exception in code source :" << std::endl; + message << " file: '" << m_sourceFile << "'" << std::endl; + if (m_lineNumber != -1) message << " line: " << m_lineNumber << std::endl; + } + message << this->additionalInfo(); + message << "--------------------------------------------------" << std::endl; + return message.str(); + } +}; + +//--------------------------------------------------------------- + +//Exception handling on input XML files +//------------------------------------- + +class ErrorXML : public ErrorInput +{ +public: + //*************** + ErrorXML(std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1, int errorCode = 2) : + ErrorInput(fileXML, sourceFile, lineNumber, errorCode) {} + virtual ~ErrorXML() throw(){} + //*************** + virtual const char* what(void) const throw() + { + return "Exception during reading XML file: file not found or incorrect structure"; + } + //*************** + std::string infoError(void) const throw() + { + std::stringstream message; + message << "--------------------------------------------------" << std::endl; + message << this->what() << std::endl; + message << "****************************************" << std::endl; + if (m_fileInput != "") { message << " XML file concerned: '" << m_fileInput << "'" << std::endl; } + if (m_sourceFile != "") + { + message << " infos on exception in code source :" << std::endl; + message << " file: '" << m_sourceFile << "'" << std::endl; + if (m_lineNumber != -1) message << " line: " << m_lineNumber << std::endl; + } + message << this->additionalInfo(); + message << "--------------------------------------------------" << std::endl; + return message.str(); + } }; //--------------------------------------------------------------- @@ -393,13 +467,13 @@ class ErrorXMLEOS : public ErrorXML //--------------------------------------------------------------- -class ErrorXMLEOSInconnue : public ErrorXML +class ErrorXMLEOSUnknown : public ErrorXML { public: //*************** - ErrorXMLEOSInconnue(std::string typeEOS = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : + ErrorXMLEOSUnknown(std::string typeEOS = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : ErrorXML(fileXML, sourceFile, lineNumber), m_typeEOS(typeEOS){} - virtual ~ErrorXMLEOSInconnue() throw(){} + virtual ~ErrorXMLEOSUnknown() throw(){} //*************** virtual const char* what(void) const throw() { @@ -419,13 +493,13 @@ class ErrorXMLEOSInconnue : public ErrorXML //--------------------------------------------------------------- -class ErrorXMLDomaineInconnu : public ErrorXML +class ErrorXMLDomaineUnknown : public ErrorXML { public: //*************** - ErrorXMLDomaineInconnu(std::string typeDomain = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : + ErrorXMLDomaineUnknown(std::string typeDomain = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : ErrorXML(fileXML, sourceFile, lineNumber), m_typeDomain(typeDomain){} - virtual ~ErrorXMLDomaineInconnu() throw(){} + virtual ~ErrorXMLDomaineUnknown() throw(){} //*************** virtual const char* what(void) const throw() { @@ -445,13 +519,13 @@ class ErrorXMLDomaineInconnu : public ErrorXML //--------------------------------------------------------------- -class ErrorXMLBoundCondInconnue : public ErrorXML +class ErrorXMLBoundCondUnknown : public ErrorXML { public: //*************** - ErrorXMLBoundCondInconnue(std::string typeBoundCond = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : + ErrorXMLBoundCondUnknown(std::string typeBoundCond = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : ErrorXML(fileXML, sourceFile, lineNumber), m_typeBoundCond(typeBoundCond) {} - virtual ~ErrorXMLBoundCondInconnue() throw() {} + virtual ~ErrorXMLBoundCondUnknown() throw() {} //*************** virtual const char* what(void) const throw() { @@ -497,13 +571,13 @@ class ErrorXMLEtat : public ErrorXML //--------------------------------------------------------------- -class ErrorXMLMateriauInconnu : public ErrorXML +class ErrorXMLMaterialUnknown : public ErrorXML { public: //*************** - ErrorXMLMateriauInconnu(std::string nameMateriau = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : + ErrorXMLMaterialUnknown(std::string nameMateriau = "", std::string fileXML = "", const char* sourceFile = "", int lineNumber = -1) : ErrorXML(fileXML, sourceFile, lineNumber), m_nameMateriau(nameMateriau){} - virtual ~ErrorXMLMateriauInconnu() throw(){} + virtual ~ErrorXMLMaterialUnknown() throw(){} //*************** virtual const char* what(void) const throw() { diff --git a/src/Geometries/GDCuboid.h b/src/Geometries/GDCuboid.h index a2016c13..a7253d1d 100644 --- a/src/Geometries/GDCuboid.h +++ b/src/Geometries/GDCuboid.h @@ -50,7 +50,7 @@ class GDCuboid : //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDCuboid(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Fichier Inconnu"); + GDCuboid(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Unknown file"); virtual ~GDCuboid(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GDCylinder.h b/src/Geometries/GDCylinder.h index b2cf525b..ad1bac4b 100644 --- a/src/Geometries/GDCylinder.h +++ b/src/Geometries/GDCylinder.h @@ -50,7 +50,7 @@ class GDCylinder : //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDCylinder(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Fichier Inconnu"); + GDCylinder(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Unknown file"); virtual ~GDCylinder(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GDDisc.h b/src/Geometries/GDDisc.h index 80ada449..20812161 100644 --- a/src/Geometries/GDDisc.h +++ b/src/Geometries/GDDisc.h @@ -50,7 +50,7 @@ class GDDisc : //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDDisc(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Fichier Inconnu"); + GDDisc(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Unknown file"); virtual ~GDDisc(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GDEllipse.h b/src/Geometries/GDEllipse.h index 87544fc3..d41a61b8 100644 --- a/src/Geometries/GDEllipse.h +++ b/src/Geometries/GDEllipse.h @@ -50,7 +50,7 @@ class GDEllipse : //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDEllipse(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Fichier Inconnu"); + GDEllipse(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Unknown file"); virtual ~GDEllipse(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GDEllipsoid.h b/src/Geometries/GDEllipsoid.h index a23944bd..bf0d90d7 100644 --- a/src/Geometries/GDEllipsoid.h +++ b/src/Geometries/GDEllipsoid.h @@ -50,7 +50,7 @@ class GDEllipsoid : //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDEllipsoid(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Fichier Inconnu"); + GDEllipsoid(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Unknown file"); virtual ~GDEllipsoid(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GDEntireDomainWithParticularities.cpp b/src/Geometries/GDEntireDomainWithParticularities.cpp index c0eb7ab4..b7f2f6d4 100644 --- a/src/Geometries/GDEntireDomainWithParticularities.cpp +++ b/src/Geometries/GDEntireDomainWithParticularities.cpp @@ -72,6 +72,10 @@ bool GDEntireDomainWithParticularities::belong(Coord& /*posElement*/, const int& //5. Rayleigh-Taylor instability //------------------------------ // return true; //always belong to entire domain + + //6. Blast-wave equation + //---------------------- + // return true; //always belong to entire domain } //****************************************************************** @@ -93,25 +97,29 @@ void GDEntireDomainWithParticularities::fillIn(Cell* cell) const for (int k = 0; k < numberPhases; k++) { cell->copyPhase(k, m_vecPhases[k]); } cell->copyMixture(m_mixture); for (int k = 0; k < numberTransports; k++) { cell->setTransport(m_vecTransports[k].getValue(), k); } + if(m_physicalEntity == -1){ cell->setWall(true); } + else{ cell->setWall(false); } //Particularities //1. Laplace pressure initialization //---------------------------------- // if (cell->getElement() != 0) { - // double pressure(0.); - // Coord posElement(cell->getPosition()); - // double radius; - // //radius = posElement.getX(); //1D - // //radius = std::pow(std::pow(posElement.getX(), 2.) + std::pow(posElement.getY(), 2.), 0.5); //2D - // radius = std::pow(std::pow(posElement.getX() - 0.75e-3, 2.) + std::pow(posElement.getY(), 2.), 0.5); //2D - // //radius = std::pow(std::pow(posElement.getX(), 2.) + std::pow(posElement.getY(), 2.) + std::pow(posElement.getZ(), 2.), 0.5); //3D - // //radius = std::pow(std::pow(posElement.getX() - 153.6e-3, 2.) + std::pow(posElement.getY(), 2.) + std::pow(posElement.getZ(), 2.), 0.5); //3D - // //pressure = 1.e5 + 1.e-3 / radius * (1.e4 - 1.e5); - // //pressure = 1.e5 + 1.e-3 / radius * (4.e3 - 1.e5); - // //pressure = 1.e5 + 1.e-3 / radius * (1.e3 - 1.e5); - // pressure = 50.6625e5 + 0.5e-3 / radius * (3.55e3 - 50.6625e5); - // for (int k = 0; k < numberPhases; k++) { cell->getPhase(k)->setPressure(pressure); } - // cell->getMixture()->setPressure(pressure); + // double pressure(0.); + // Coord posElement(cell->getPosition()); + // double radius; + // //radius = posElement.getX(); //1D + // //radius = std::pow(std::pow(posElement.getX(), 2.) + std::pow(posElement.getY(), 2.), 0.5); //2D + // //radius = std::pow(std::pow(posElement.getX() - 0.75e-3, 2.) + std::pow(posElement.getY(), 2.), 0.5); //2D + // radius = std::pow(std::pow(posElement.getX() - 2.e-4, 2.) + std::pow(posElement.getY(), 2.), 0.5); //2D + // //radius = std::pow(std::pow(posElement.getX(), 2.) + std::pow(posElement.getY(), 2.) + std::pow(posElement.getZ(), 2.), 0.5); //3D + // //radius = std::pow(std::pow(posElement.getX() - 153.6e-3, 2.) + std::pow(posElement.getY(), 2.) + std::pow(posElement.getZ(), 2.), 0.5); //3D + // //pressure = 1.e5 + 1.e-3 / radius * (1.e4 - 1.e5); + // //pressure = 1.e5 + 1.e-3 / radius * (4.e3 - 1.e5); + // //pressure = 1.e5 + 1.e-3 / radius * (1.e3 - 1.e5); + // //pressure = 353.e5 + 1.e-4 / radius * (1.e5 - 353.e5); + // pressure = 50.6625e5 + 1.e-4 / radius * (3.55e3 - 50.6625e5); + // for (int k = 0; k < numberPhases; k++) { cell->getPhase(k)->setPressure(pressure); } + // cell->getMixture()->setPressure(pressure); // } //2. Respecting special coordinates @@ -133,11 +141,13 @@ void GDEntireDomainWithParticularities::fillIn(Cell* cell) const //4. Random velocity perturbations: O(1e−4 u_s) //--------------------------------------------- + // if (cell->getElement() != 0) { // Coord perturbedVelocity(cell->getMixture()->getVelocity()); // perturbedVelocity.setX(static_cast(rand() % 2001 - 1000)/1.e3 * 1.e-3*151.821433232719 + perturbedVelocity.getX()); // perturbedVelocity.setY(static_cast(rand() % 2001 - 1000)/1.e3 * 1.e-3*151.821433232719 + perturbedVelocity.getY()); // perturbedVelocity.setZ(static_cast(rand() % 2001 - 1000)/1.e3 * 1.e-3*151.821433232719 + perturbedVelocity.getZ()); // cell->getMixture()->setVelocity(perturbedVelocity); + // } //5. Rayleigh-Taylor instability //------------------------------ @@ -207,6 +217,32 @@ void GDEntireDomainWithParticularities::fillIn(Cell* cell) const // } // cell->getMixture()->setPressure(pressure); // } + + //6. Blast-wave equation + //---------------------- + //p(t) = p0 + 2 p_s exp(−αt) * cos(ωt + π/3) + //p(x) = p0 + 2 p_s exp(-αr/c) * cos(ωr/c + π/3) + // if (cell->getElement() != 0) { + // double pressure(0.), velocity(0.), pk(0.); + // double beta(1.48e6), omega(1.21e6); //beta here is the alpha variable of the equation + // double posX(cell->getPosition().getX()); + // double p0(1.01325e5), pS(35e6), soundSpeed(1625.), density(1000.); + // double shockFront(7.5e-3); + + // if (posX < shockFront) { + // double r = posX - shockFront; + // pressure = p0 + 2 * pS * exp(beta * r / soundSpeed) * std::cos(- omega * r / soundSpeed + M_PI / 3.); + // velocity = (pressure - p0) / (density * soundSpeed); + + // for (int k = 0; k < numberPhases; k++) { + // pk = pressure; + // cell->getPhase(k)->getEos()->verifyAndModifyPressure(pk); + // cell->getPhase(k)->setPressure(pk); + // } + // cell->getMixture()->setPressure(pressure); + // cell->getMixture()->setU(velocity); + // } + // } } } diff --git a/src/Geometries/GDHalfSpace.cpp b/src/Geometries/GDHalfSpace.cpp index 2dbadf60..939beffc 100644 --- a/src/Geometries/GDHalfSpace.cpp +++ b/src/Geometries/GDHalfSpace.cpp @@ -117,6 +117,8 @@ void GDHalfSpace::fillIn(Cell* cell) const for (int k = 0; k < numberPhases; k++) { cell->copyPhase(k, m_vecPhases[k]); } cell->copyMixture(m_mixture); for (int k = 0; k < numberTransports; k++) { cell->setTransport(m_vecTransports[k].getValue(), k); } + if(m_physicalEntity == -1){ cell->setWall(true); } + else{ cell->setWall(false); } //To uncomment only for special test cases //4. Random velocity perturbations: O(1e−4 u_s) diff --git a/src/Geometries/GDHalfSpace.h b/src/Geometries/GDHalfSpace.h index 43b63293..cfa58d9c 100644 --- a/src/Geometries/GDHalfSpace.h +++ b/src/Geometries/GDHalfSpace.h @@ -47,7 +47,7 @@ class GDHalfSpace : public GeometricalDomain //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDHalfSpace(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName="Fichier Inconnu"); + GDHalfSpace(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName="Unknown file"); virtual ~GDHalfSpace(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GDRectangle.h b/src/Geometries/GDRectangle.h index 22bead30..b1322ff2 100644 --- a/src/Geometries/GDRectangle.h +++ b/src/Geometries/GDRectangle.h @@ -50,7 +50,7 @@ class GDRectangle : //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDRectangle(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Fichier Inconnu"); + GDRectangle(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Unknown file"); virtual ~GDRectangle(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GDSphere.h b/src/Geometries/GDSphere.h index 6c6e3378..4598453f 100644 --- a/src/Geometries/GDSphere.h +++ b/src/Geometries/GDSphere.h @@ -50,7 +50,7 @@ class GDSphere : //! \param element XML element to read for geometrical properties //! \param physicalEntity physical entity number relative to mesh generation (see mesh tool) //! \param fileName String name of readed XML file - GDSphere(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Fichier Inconnu"); + GDSphere(std::string name, std::vector vecPhases, Mixture* mixture, std::vector vecTransports, tinyxml2::XMLElement* element, const int& physicalEntity, std::string fileName = "Unknown file"); virtual ~GDSphere(); virtual bool belong(Coord& posElement, const int& /*lvl*/) const; diff --git a/src/Geometries/GeometricalDomain.cpp b/src/Geometries/GeometricalDomain.cpp index 7a8e85c9..21f31720 100644 --- a/src/Geometries/GeometricalDomain.cpp +++ b/src/Geometries/GeometricalDomain.cpp @@ -78,5 +78,7 @@ void GeometricalDomain::fillIn(Cell* cell) const for (int k = 0; k < numberPhases; k++) { cell->copyPhase(k, m_vecPhases[k]); } cell->copyMixture(m_mixture); for (int k = 0; k < numberTransports; k++) { cell->setTransport(m_vecTransports[k].getValue(), k); } + if(m_physicalEntity == -1){ cell->setWall(true); } + else{ cell->setWall(false); } } } \ No newline at end of file diff --git a/src/Geometries/GeometricalDomain.h b/src/Geometries/GeometricalDomain.h index f750fe5c..a0e2606c 100644 --- a/src/Geometries/GeometricalDomain.h +++ b/src/Geometries/GeometricalDomain.h @@ -64,6 +64,7 @@ class GeometricalDomain virtual void fillIn(Cell* cell) const; const std::string& getName() { return m_name; }; + const int& getPhysicalEntity() { return m_physicalEntity; }; protected: std::string m_name; //!< Geometrical domain name diff --git a/src/Gradients/Gradient.h b/src/Gradients/Gradient.h index 9ffac406..82618cf9 100644 --- a/src/Gradients/Gradient.h +++ b/src/Gradients/Gradient.h @@ -45,22 +45,13 @@ class Gradient Gradient(); virtual ~Gradient(); - - //! \brief Compute gradient coord (only used to compute density gradient) - //! \param cell Cell whose gradient must be calculated - //! \param nameVariables Name of the variable for which the gradient is calculated - //! \param numPhase Phase number - virtual Coord computeGradient(Cell* /*cell*/, Variable /*nameVariable*/, int /*numPhase*/ = -1) { - Errors::errorMessage("computeGradient not available for required gradient method"); - return Coord::defaultCoord; - }; - //! \brief Compute gradients (temperature, velocity, density) of a cell + //! \brief Compute gradients of a cell //! \param cell Cell whose gradient must be calculated //! \param grads Array of desired gradients, e.g. for temperature each component represents phase temperature and for velocity each component represents the gradient of a velocity component (grad(u), grad(v), grad(w)) //! \param nameVariables Name of the variable for which the gradient is calculated //! \param numPhases Phase numbers - virtual void computeGradient(Cell* /*cell*/, std::vector& /*grads*/, std::vector& /*nameVariables*/, std::vector& /*numPhases*/) { + virtual void computeGradients(Cell* /*cell*/, std::vector& /*grads*/, const std::vector& /*nameVariables*/, const std::vector& /*numPhases*/) { Errors::errorMessage("computeGradient not available for required gradient method"); }; diff --git a/src/Gradients/GradientFiniteDifference.cpp b/src/Gradients/GradientFiniteDifference.cpp index 66e0bddb..97b78db6 100644 --- a/src/Gradients/GradientFiniteDifference.cpp +++ b/src/Gradients/GradientFiniteDifference.cpp @@ -34,7 +34,7 @@ GradientFiniteDifference::GradientFiniteDifference() { - m_type = FD; + m_type = TypeGrad::FD; } //**************************************************************************** @@ -43,91 +43,7 @@ GradientFiniteDifference::~GradientFiniteDifference() {} //**************************************************************************** -Coord GradientFiniteDifference::computeGradient(Cell* cell, Variable nameVariable, int numPhase) -{ - int typeCellInterface(0); - double cg(0.), cd(0.), gradCellInterface(0.); - double distance(0.), distanceX(0.), distanceY(0.), distanceZ(0.); - double sumDistanceX(0.), sumDistanceY(0.), sumDistanceZ(0.); - Coord grad(0.); - - for (int b = 0; b < cell->getCellInterfacesSize(); b++) { - if (!cell->getCellInterface(b)->getSplit()) { - typeCellInterface = cell->getCellInterface(b)->whoAmI(); - if (typeCellInterface == 0) //Cell interface of type CellInterface/O2 (inner) - { - // Sum for each cell interface with ponderation using distance in each direction - // then the cell gradient is normalized by sum of distances. - distanceX = std::fabs(cell->getCellInterface(b)->getCellGauche()->distanceX(cell->getCellInterface(b)->getCellDroite())); - distanceY = std::fabs(cell->getCellInterface(b)->getCellGauche()->distanceY(cell->getCellInterface(b)->getCellDroite())); - distanceZ = std::fabs(cell->getCellInterface(b)->getCellGauche()->distanceZ(cell->getCellInterface(b)->getCellDroite())); - sumDistanceX += distanceX; - sumDistanceY += distanceY; - sumDistanceZ += distanceZ; - distance = cell->getCellInterface(b)->getCellGauche()->distance(cell->getCellInterface(b)->getCellDroite()); - - // Extracting left and right variables values for each cell interface - // and calculus of the gradient normal to the face - cg = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariable, numPhase); - cd = cell->getCellInterface(b)->getCellDroite()->selectScalar(nameVariable, numPhase); - gradCellInterface = (cd - cg) / distance; - - // Projection in the absolute system of coordinate - grad.setXYZ(grad.getX() + cell->getCellInterface(b)->getFace()->getNormal().getX()*gradCellInterface*distanceX, - grad.getY() + cell->getCellInterface(b)->getFace()->getNormal().getY()*gradCellInterface*distanceY, - grad.getZ() + cell->getCellInterface(b)->getFace()->getNormal().getZ()*gradCellInterface*distanceZ); - } - else { - distanceX = std::fabs(cell->distanceX(cell->getCellInterface(b))) * 2.; - distanceY = std::fabs(cell->distanceY(cell->getCellInterface(b))) * 2.; - distanceZ = std::fabs(cell->distanceZ(cell->getCellInterface(b))) * 2.; - sumDistanceX += distanceX; - sumDistanceY += distanceY; - sumDistanceZ += distanceZ; - - if (nameVariable == velocityU || nameVariable == velocityV || nameVariable == velocityW) { - // Extracting left variables values - // and calculus of the gradient normal to the face - distance = cell->distance(cell->getCellInterface(b)); - cg = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariable, numPhase); - gradCellInterface = - cg / distance; - - if (typeCellInterface == SYMMETRY) { - // Multiplication of the gradient by the normal direction to guarantee symmetry - if (nameVariable == velocityU) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getX()); } - if (nameVariable == velocityV) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getY()); } - if (nameVariable == velocityW) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getZ()); } - - // Projection in the absolute system of coordinate - grad.setXYZ(grad.getX() + cell->getCellInterface(b)->getFace()->getNormal().getX()*gradCellInterface*distanceX, - grad.getY() + cell->getCellInterface(b)->getFace()->getNormal().getY()*gradCellInterface*distanceY, - grad.getZ() + cell->getCellInterface(b)->getFace()->getNormal().getZ()*gradCellInterface*distanceZ); - } - else if (typeCellInterface == WALL) { - // Projection in the absolute system of coordinate - grad.setXYZ(grad.getX() + cell->getCellInterface(b)->getFace()->getNormal().getX()*gradCellInterface*distanceX, - grad.getY() + cell->getCellInterface(b)->getFace()->getNormal().getY()*gradCellInterface*distanceY, - grad.getZ() + cell->getCellInterface(b)->getFace()->getNormal().getZ()*gradCellInterface*distanceZ); - } - } - } - } - } - - // Verifications in multiD - if (sumDistanceX <= 1.e-12) { sumDistanceX = 1.; } - if (sumDistanceY <= 1.e-12) { sumDistanceY = 1.; } - if (sumDistanceZ <= 1.e-12) { sumDistanceZ = 1.; } - - // Final normalized gradient on the cell - grad.setXYZ(grad.getX() / sumDistanceX, grad.getY() / sumDistanceY, grad.getZ() / sumDistanceZ); - - return grad; -} - -//**************************************************************************** - -void GradientFiniteDifference::computeGradient(Cell* cell, std::vector& grads, std::vector& nameVariables, std::vector& numPhases) +void GradientFiniteDifference::computeGradients(Cell* cell, std::vector& grads, const std::vector& nameVariables, const std::vector& numPhases) { int typeCellInterface(0); double cg(0.), cd(0.), gradCellInterface(0.); @@ -142,19 +58,19 @@ void GradientFiniteDifference::computeGradient(Cell* cell, std::vector& g { // Sum for each cell interface with ponderation using distance in each direction // then the cell gradient is normalized by sum of distances. - distanceX = std::fabs(cell->getCellInterface(b)->getCellGauche()->distanceX(cell->getCellInterface(b)->getCellDroite())); - distanceY = std::fabs(cell->getCellInterface(b)->getCellGauche()->distanceY(cell->getCellInterface(b)->getCellDroite())); - distanceZ = std::fabs(cell->getCellInterface(b)->getCellGauche()->distanceZ(cell->getCellInterface(b)->getCellDroite())); + distanceX = std::fabs(cell->getCellInterface(b)->getCellLeft()->distanceX(cell->getCellInterface(b)->getCellRight())); + distanceY = std::fabs(cell->getCellInterface(b)->getCellLeft()->distanceY(cell->getCellInterface(b)->getCellRight())); + distanceZ = std::fabs(cell->getCellInterface(b)->getCellLeft()->distanceZ(cell->getCellInterface(b)->getCellRight())); sumDistanceX += distanceX; sumDistanceY += distanceY; sumDistanceZ += distanceZ; - distance = cell->getCellInterface(b)->getCellGauche()->distance(cell->getCellInterface(b)->getCellDroite()); + distance = cell->getCellInterface(b)->getCellLeft()->distance(cell->getCellInterface(b)->getCellRight()); // Extracting left and right variables values for each cell interface // and calculus of the gradients normal to the face for (unsigned int g = 0; g < grads.size(); g++) { - cg = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariables[g], numPhases[g]); - cd = cell->getCellInterface(b)->getCellDroite()->selectScalar(nameVariables[g], numPhases[g]); + cg = cell->getCellInterface(b)->getCellLeft()->selectScalar(nameVariables[g], numPhases[g]); + cd = cell->getCellInterface(b)->getCellRight()->selectScalar(nameVariables[g], numPhases[g]); gradCellInterface = (cd - cg) / distance; // Projection in the absolute system of coordinate @@ -173,17 +89,17 @@ void GradientFiniteDifference::computeGradient(Cell* cell, std::vector& g distance = cell->distance(cell->getCellInterface(b)); for (unsigned int g = 0; g < grads.size(); g++) { - if (nameVariables[g] == velocityU || nameVariables[g] == velocityV || nameVariables[g] == velocityW) { + if (nameVariables[g] == Variable::velocityU || nameVariables[g] == Variable::velocityV || nameVariables[g] == Variable::velocityW) { // Extracting left variables values // and calculus of the gradient normal to the face - cg = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariables[g], numPhases[g]); + cg = cell->getCellInterface(b)->getCellLeft()->selectScalar(nameVariables[g], numPhases[g]); gradCellInterface = - cg / distance; if (typeCellInterface == SYMMETRY) { // Multiplication of the gradient by the normal direction to guarantee symmetry - if (nameVariables[g] == velocityU) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getX()); } - if (nameVariables[g] == velocityV) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getY()); } - if (nameVariables[g] == velocityW) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getZ()); } + if (nameVariables[g] == Variable::velocityU) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getX()); } + if (nameVariables[g] == Variable::velocityV) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getY()); } + if (nameVariables[g] == Variable::velocityW) { gradCellInterface = gradCellInterface * std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getZ()); } // Projection in the absolute system of coordinate grads[g].setXYZ(grads[g].getX() + cell->getCellInterface(b)->getFace()->getNormal().getX()*gradCellInterface*distanceX, diff --git a/src/Gradients/GradientFiniteDifference.h b/src/Gradients/GradientFiniteDifference.h index dac0db6c..e66fdf75 100644 --- a/src/Gradients/GradientFiniteDifference.h +++ b/src/Gradients/GradientFiniteDifference.h @@ -43,16 +43,11 @@ class GradientFiniteDifference : public Gradient GradientFiniteDifference(); virtual ~GradientFiniteDifference(); - //! \brief Compute gradient coord (only used to compute density gradient) - //! \param nameVariables Name of the variable for which the gradient is calculated - //! \param numPhase Phase number - Coord computeGradient(Cell* cell, Variable nameVariable, int numPhase = -1); - //! \brief Compute gradients (temperature, velocity, density) of a cell //! \param grads Array of desired gradients, e.g. for temperature each component represents phase temperature and for velocity each component represents the gradient of a velocity component (grad(u), grad(v), grad(w)) //! \param nameVariables Name of the variable for which the gradient is calculated //! \param numPhases Phases numbers - void computeGradient(Cell* cell, std::vector& grads, std::vector& nameVariables, std::vector& numPhases); + void computeGradients(Cell* cell, std::vector& grads, const std::vector& nameVariables, const std::vector& numPhases); protected: }; diff --git a/src/Gradients/GradientGreenGauss.cpp b/src/Gradients/GradientGreenGauss.cpp index 240fa568..cc2ced92 100644 --- a/src/Gradients/GradientGreenGauss.cpp +++ b/src/Gradients/GradientGreenGauss.cpp @@ -34,7 +34,7 @@ GradientGreenGauss::GradientGreenGauss() { - m_type = GG; + m_type = TypeGrad::GG; } //**************************************************************************** @@ -48,7 +48,6 @@ void GradientGreenGauss::addGradInterface(Coord &grad, CellInterface &cellInterf // Since face normal is constructed through mesh vertex there is no indication of outward direction. // Outward normal direction is defined according to cell center. - Coord vFaceToElt(0.); vFaceToElt.setFromSubtractedVectors(cellInterface.getFace()->getPos(), cell.getElement()->getPosition()); double scalarProduct(Coord::scalarProduct(cellInterface.getFace()->getNormal(), vFaceToElt)); @@ -67,88 +66,7 @@ void GradientGreenGauss::addGradInterface(Coord &grad, CellInterface &cellInterf //**************************************************************************** -Coord GradientGreenGauss::computeGradient(Cell* cell, Variable nameVariable, int numPhase) -{ -// Compute gradient of cell using Green-Gauss method - int typeCellInterface(0); - double wl(0.), wr(0.), wf(0.); - double dl(0.), dr(0.); - Coord grad(0.); - - for (int b = 0; b < cell->getCellInterfacesSize(); b++) { - if (!cell->getCellInterface(b)->getSplit()) - { - typeCellInterface = cell->getCellInterface(b)->whoAmI(); - if (typeCellInterface == 0) // Inner interface (O1 or O2) - { - // Distances - dl = cell->getCellInterface(b)->distance(cell->getCellInterface(b)->getCellGauche()); - dr = cell->getCellInterface(b)->distance(cell->getCellInterface(b)->getCellDroite()); - - // Extracting left and right variables values - wl = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariable, numPhase); - wr = cell->getCellInterface(b)->getCellDroite()->selectScalar(nameVariable, numPhase); - - // Interpolation on face using barycenter - wf = (wl * dr + wr * dl) / (dl + dr); - - // Build gradient of the face - this->addGradInterface(grad, *cell->getCellInterface(b), *cell, wf); - } - else // Boundary - { - // Extracting left variable value - wl = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariable, numPhase); - - // For gradients other than velocity the face value is equals to the cell value - // Hence the gradient between the face and the center of the cell is null leading to adiatic condition for temperature for example. - // For velocity it is assumed that the flow is viscous leading to null value on a wall boundary for all components. - - if (nameVariable == velocityU || nameVariable == velocityV || nameVariable == velocityW) - { - switch (typeCellInterface) - { - case SYMMETRY: - // Multiplication of the gradient by the normal direction to guarantee symmetry - if (nameVariable == velocityU) { wf = wl * (1. - std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getX())); } - if (nameVariable == velocityV) { wf = wl * (1. - std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getY())); } - if (nameVariable == velocityW) { wf = wl * (1. - std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getZ())); } - break; - - case WALL: - if (!cell->getCellInterface(b)->isMRFWall()) wf = 0.; - else { - Coord velocityWall(0.); - velocityWall = cell->getCellInterface(b)->getWallRotationalVelocityMRF().cross(cell->getCellInterface(b)->getFace()->getPos()); - if (nameVariable == velocityU) { wf = velocityWall.getX(); } - if (nameVariable == velocityV) { wf = velocityWall.getY(); } - if (nameVariable == velocityW) { wf = velocityWall.getZ(); } - } - break; - - default: - wf = wl; // Null gradient on this interface - } - } - else { - wf = wl; // Null gradient on this interface - } - - // Build gradient of the face - this->addGradInterface(grad, *cell->getCellInterface(b), *cell, wf); - } - } - } - - // Cell gradient average - grad /= cell->getElement()->getVolume(); - - return grad; -} - -//**************************************************************************** - -void GradientGreenGauss::computeGradient(Cell* cell, std::vector& grads, std::vector& nameVariables, std::vector& numPhases) +void GradientGreenGauss::computeGradients(Cell* cell, std::vector& grads, const std::vector& nameVariables, const std::vector& numPhases) { // Compute gradient of cell using Green-Gauss method int typeCellInterface(0); @@ -163,14 +81,14 @@ void GradientGreenGauss::computeGradient(Cell* cell, std::vector& grads, if (typeCellInterface == 0) // Inner interface (O1 or O2) { // Distances - dl = cell->getCellInterface(b)->distance(cell->getCellInterface(b)->getCellGauche()); - dr = cell->getCellInterface(b)->distance(cell->getCellInterface(b)->getCellDroite()); + dl = cell->getCellInterface(b)->distance(cell->getCellInterface(b)->getCellLeft()); + dr = cell->getCellInterface(b)->distance(cell->getCellInterface(b)->getCellRight()); for (unsigned int g = 0; g < grads.size(); g++) { // Extracting left and right variables values - wl = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariables[g], numPhases[g]); - wr = cell->getCellInterface(b)->getCellDroite()->selectScalar(nameVariables[g], numPhases[g]); + wl = cell->getCellInterface(b)->getCellLeft()->selectScalar(nameVariables[g], numPhases[g]); + wr = cell->getCellInterface(b)->getCellRight()->selectScalar(nameVariables[g], numPhases[g]); // Interpolation on face using barycenter wf = (wl * dr + wr * dl) / (dl + dr); @@ -182,35 +100,51 @@ void GradientGreenGauss::computeGradient(Cell* cell, std::vector& grads, else // Boundary { for (unsigned int g = 0; g < grads.size(); g++) - { + { // Extracting left variable value - wl = cell->getCellInterface(b)->getCellGauche()->selectScalar(nameVariables[g], numPhases[g]); + wl = cell->getCellInterface(b)->getCellLeft()->selectScalar(nameVariables[g], numPhases[g]); // For gradients other than velocity the face value is equals to the cell value // Hence the gradient between the face and the center of the cell is null leading to adiatic condition for temperature for example. // For velocity it is assumed that the flow is viscous leading to null value on a wall boundary for all components. - if (nameVariables[g] == velocityU || nameVariables[g] == velocityV || nameVariables[g] == velocityW) + if (nameVariables[g] == Variable::velocityU || nameVariables[g] == Variable::velocityV || nameVariables[g] == Variable::velocityW) { switch (typeCellInterface) { case SYMMETRY: - // Multiplication of the gradient by the normal direction to guarantee symmetry - if (nameVariables[g] == velocityU) { wf = wl * (1. - std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getX())); } - if (nameVariables[g] == velocityV) { wf = wl * (1. - std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getY())); } - if (nameVariables[g] == velocityW) { wf = wl * (1. - std::fabs(cell->getCellInterface(b)->getFace()->getNormal().getZ())); } + { + // Project the velocity vector on the symmetry, set symmetry constraints (u_x = 0), and reverse + velocity.setXYZ(cell->getCellInterface(b)->getCellLeft()->selectScalar(Variable::velocityU, numPhases[g]), + cell->getCellInterface(b)->getCellLeft()->selectScalar(Variable::velocityV, numPhases[g]), + cell->getCellInterface(b)->getCellLeft()->selectScalar(Variable::velocityW, numPhases[g])); + velocity.localProjection(cell->getCellInterface(b)->getFace()->getNormal(), + cell->getCellInterface(b)->getFace()->getTangent(), + cell->getCellInterface(b)->getFace()->getBinormal()); + + velocity.setX(0.); + velocity.reverseProjection(cell->getCellInterface(b)->getFace()->getNormal(), + cell->getCellInterface(b)->getFace()->getTangent(), + cell->getCellInterface(b)->getFace()->getBinormal()); + + if (nameVariables[g] == Variable::velocityU) { wf = velocity.getX(); } + if (nameVariables[g] == Variable::velocityV) { wf = velocity.getY(); } + if (nameVariables[g] == Variable::velocityW) { wf = velocity.getZ(); } break; + } case WALL: + { if (!cell->getCellInterface(b)->isMRFWall()) wf = 0.; else { - Coord velocityWall(0.); - velocityWall = cell->getCellInterface(b)->getWallRotationalVelocityMRF().cross(cell->getCellInterface(b)->getFace()->getPos()); - if (nameVariables[g] == velocityU) { wf = velocityWall.getX(); } - if (nameVariables[g] == velocityV) { wf = velocityWall.getY(); } - if (nameVariables[g] == velocityW) { wf = velocityWall.getZ(); } + // velocity here is the wall velocity + velocity = cell->getCellInterface(b)->getWallRotationalVelocityMRF().cross(cell->getCellInterface(b)->getFace()->getPos()); + if (nameVariables[g] == Variable::velocityU) { wf = velocity.getX(); } + if (nameVariables[g] == Variable::velocityV) { wf = velocity.getY(); } + if (nameVariables[g] == Variable::velocityW) { wf = velocity.getZ(); } } break; + } default: wf = wl; // Null gradient on this interface diff --git a/src/Gradients/GradientGreenGauss.h b/src/Gradients/GradientGreenGauss.h index 6b366827..f872160e 100644 --- a/src/Gradients/GradientGreenGauss.h +++ b/src/Gradients/GradientGreenGauss.h @@ -49,16 +49,11 @@ class GradientGreenGauss : public Gradient //! \param faceValue Value of the face interpolated using barycenter void addGradInterface(Coord &grad, CellInterface &cellInterface, Cell &cell, double const& faceValue); - //! \brief Compute gradient coord (only used to compute density gradient) - //! \param nameVariables Name of the variable for which the gradient is calculated - //! \param numPhases Phases number's - Coord computeGradient(Cell* cell, Variable nameVariable, int numPhase = -1); - //! \brief Compute gradients (temperature, velocity, density) of a cell //! \param grads Array of desired gradients, e.g. for temperature each component represents phase temperature and for velocity each component represents the gradient of a velocity component (grad(u), grad(v), grad(w)) //! \param nameVariables Name of the variable for which the gradient is calculated //! \param numPhases Phases number's - virtual void computeGradient(Cell* cell, std::vector& grads, std::vector& nameVariables, std::vector& numPhases); + virtual void computeGradients(Cell* cell, std::vector& grads, const std::vector& nameVariables, const std::vector& numPhases); protected: }; diff --git a/src/InputOutput/HeaderInputOutput.h b/src/InputOutput/HeaderInputOutput.h index 80340eff..297e6264 100644 --- a/src/InputOutput/HeaderInputOutput.h +++ b/src/InputOutput/HeaderInputOutput.h @@ -44,6 +44,6 @@ #include "OutputBoundaryFluxGNU.h" #include "OutputBoundaryAllGNU.h" -//Ajouter ici entetes des nouvelles entrees sorties +//Add here headers of new outputs #endif // HEADERINPUTOUTPUT_H \ No newline at end of file diff --git a/src/InputOutput/IO.cpp b/src/InputOutput/IO.cpp index 2c835b30..7f9b4155 100644 --- a/src/InputOutput/IO.cpp +++ b/src/InputOutput/IO.cpp @@ -88,22 +88,21 @@ std::ostream& IO::writeb64Chaine(std::ostream& fluxSortie, char* chaine, int& ta //*********************************************************************** -void IO::copieFichier(std::string file, std::string dossierSource, std::string dossierDestination) +void IO::copyFile(std::string file, std::string srcFolder, std::string destFolder) { try { - std::ifstream fichierSource; - std::ofstream fichierDestination; + std::ifstream srcFile; + std::ofstream destFile; - fichierSource.open((dossierSource + file).c_str()); - fichierDestination.open((dossierDestination + file).c_str()); - //std::cout << "copie : " << dossierSource + file << " -> " << dossierDestination + file << std::endl; - if (!fichierSource) throw ErrorECOGEN("IO::copieFichier : file non trouve \"" + dossierSource + file + "\"", __FILE__, __LINE__); - if (!fichierDestination) throw ErrorECOGEN("IO::copieFichier : dossier non trouve \"" + dossierDestination + "\"", __FILE__, __LINE__); + srcFile.open((srcFolder + file).c_str()); + destFile.open((destFolder + file).c_str()); + if (!srcFile) throw ErrorInput("file not found \"" + srcFolder + file + "\"", __FILE__, __LINE__); + if (!destFile) throw ErrorInput("folder not found \"" + destFolder + "\"", __FILE__, __LINE__); - std::string ligne; - while (getline(fichierSource, ligne)) { fichierDestination << ligne << std::endl; } + std::string line; + while (getline(srcFile, line)) { destFile << line << std::endl; } } - catch (ErrorECOGEN &) { throw; } + catch (ErrorInput &) { throw; } } //*********************************************************************** \ No newline at end of file diff --git a/src/InputOutput/IO.h b/src/InputOutput/IO.h index b12083fa..4bca1e13 100644 --- a/src/InputOutput/IO.h +++ b/src/InputOutput/IO.h @@ -72,7 +72,7 @@ class IO return fluxSortie.write(reinterpret_cast(&value), sizeof(T)); } - // //Definition de template pour lecture au format binary + // //Definition de template pour read au format binary // template // static std::istream& read(std::istream &fluxEntree, T& value) // { @@ -85,9 +85,9 @@ class IO //Templates Format Binaire Base64 pour le XML VTK //----------------------------------------------- - //Template pour ajouter n importe quelle type de donnee a une chaine de caractere + //Template to add any type of data to a string template - static void ajouteAlaChaine(char* chaine, int& taille, T& value) + static void addToTheString(char* chaine, int& taille, T& value) { char* conversionChaine = reinterpret_cast(&value); for (unsigned int octet = 0; octet < sizeof(value); octet++) @@ -106,8 +106,8 @@ class IO return IO::writeb64Chaine(fluxSortie, chaine, tailleChaine); } - // //ATTENTION !!!!!!!!!!!Lecture non Fonctionnelle !!!!!!!!!!!!!! - // //Definition de template pour lecture au format binary base64 + // //ATTENTION !!!!!!!!!!!Read non Fonctionnelle !!!!!!!!!!!!!! + // //Definition de template pour read au format binary base64 // template // static std::istream& readb64(std::istream &fluxEntree, T& value) // { @@ -115,11 +115,11 @@ class IO // //Swap Little <-> Big endian eventuel // IO::endswap(&value); // }; - // //ATTENTION !!!!!!!!!!!Lecture non Fonctionnelle !!!!!!!!!!!!!! + // //ATTENTION !!!!!!!!!!!Read non Fonctionnelle !!!!!!!!!!!!!! static std::ostream& writeb64Chaine(std::ostream& fluxSortie, char* chaineAEncoder, int& taille); - static void copieFichier(std::string file, std::string dossierSource, std::string dossierDestination); + static void copyFile(std::string file, std::string srcFolder, std::string destFolder); private: diff --git a/src/InputOutput/Input.cpp b/src/InputOutput/Input.cpp index 5359811e..465bafb8 100644 --- a/src/InputOutput/Input.cpp +++ b/src/InputOutput/Input.cpp @@ -39,16 +39,10 @@ using namespace tinyxml2; Input::Input(Run *run) : m_run(run) { - //Attribution des numbers de version pour la lecture - m_vMain = 5; - m_vMesh = 5; - m_vCI = 4; - m_vModel = 4; - - m_nameMain = "mainV" + IO::toString(m_vMain) + ".xml"; - m_nameMesh = "meshV" + IO::toString(m_vMesh) + ".xml"; - m_nameCI = "initialConditionsV" + IO::toString(m_vCI) + ".xml"; - m_nameModel = "modelV" + IO::toString(m_vModel) + ".xml"; + m_nameMain = "main.xml"; + m_nameMesh = "mesh.xml"; + m_nameCI = "initialConditions.xml"; + m_nameModel = "model.xml"; } //*********************************************************************** @@ -57,21 +51,22 @@ Input::~Input(){} //*********************************************************************** -void Input::readInputXML(std::vector& domains, std::vector& boundCond) +void Input::readInputXML(std::vector& domains, std::vector& boundCond, std::vector& solidDomains) { try{ - //1) Parametres generaux du compute + //1) General computation parameters inputMain(m_run->m_simulationName); - //2) Donnees de Mesh + //2) Mesh data inputMesh(m_run->m_simulationName); - //3) Donnees models et fluids + //3) Model and fluid data inputModel(m_run->m_simulationName); - //4) Lecture des conditions initiales - inputInitialConditions(m_run->m_simulationName, domains, boundCond); + //4) Read initial conditions + inputInitialConditions(m_run->m_simulationName, domains, boundCond, solidDomains); + // Check compatibility of some specific input options verifyCompatibilityInput(m_run->m_simulationName); } - catch (ErrorXML &e){ + catch (ErrorInput &e){ if(rankCpu==0) std::cerr << e.infoError() << std::endl; throw; } @@ -82,22 +77,22 @@ void Input::readInputXML(std::vector& domains, std::vectorFirstChildElement("run"); if (element == NULL) throw ErrorXMLElement("run", fileName.str(), __FILE__, __LINE__); XMLNode* xmlNode2 = element->FirstChild(); @@ -105,10 +100,10 @@ void Input::inputMain(std::string casTest) XMLText* xmlText = xmlNode2->ToText(); if (xmlText == NULL) throw ErrorXMLElement("run", fileName.str(), __FILE__, __LINE__); - //Lecture des informations de sorties/prints + //Read des informations de sorties/prints element = computationParam->FirstChildElement("outputMode"); if (element == NULL) throw ErrorXMLElement("outputMode", fileName.str(), __FILE__, __LINE__); - //Lecture format sortie + //Read format sortie std::string format(element->Attribute("format")); if (format == "") throw ErrorXMLAttribut("format", fileName.str(), __FILE__, __LINE__); Tools::uppercase(format); @@ -116,14 +111,14 @@ void Input::inputMain(std::string casTest) else if (format == "GNU") { m_run->m_outPut = new OutputGNU(casTest, xmlText->Value(), element, fileName.str(), this); } else { throw ErrorXMLDev(fileName.str(), __FILE__, __LINE__); } - //Lecture des cuts 1D + //Read des cuts 1D element = computationParam->FirstChildElement("cut1D"); while (element != NULL) { m_run->m_cuts.push_back(new OutputCutGNU(casTest, xmlText->Value(), element, fileName.str(), LINE, this)); element = element->NextSiblingElement("cut1D"); } - //Lecture des cuts 2D + //Read des cuts 2D element = computationParam->FirstChildElement("cut2D"); while (element != NULL) { @@ -151,6 +146,16 @@ void Input::inputMain(std::string casTest) element = element->NextSiblingElement("globalQuantity"); } + //Record saturation pressure + //Be careful when using it, not fully generalized + element = computationParam->FirstChildElement("psat"); + if (element != NULL) { + bool recordPsat(false); + error = element->QueryBoolAttribute("record", &recordPsat); + if (error != XML_NO_ERROR) throw ErrorXMLAttribut("record", fileName.str(), __FILE__, __LINE__); + m_run->m_recordPsat = recordPsat; + } + //Record massflow on a given boundary element = computationParam->FirstChildElement("boundary"); while (element != NULL) @@ -170,14 +175,14 @@ void Input::inputMain(std::string casTest) element = element->NextSiblingElement("boundary"); } - //Recuperation Iteration / temps Physique + //Get Iteration / temps Physique element = computationParam->FirstChildElement("timeControlMode"); if (element == NULL) throw ErrorXMLElement("timeControlMode", fileName.str(), __FILE__, __LINE__); - error = element->QueryBoolAttribute("iterations", &m_run->m_controleIterations); + error = element->QueryBoolAttribute("iterations", &m_run->m_timeControlIterations); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("iterations", fileName.str(), __FILE__, __LINE__); - if (m_run->m_controleIterations) + if (m_run->m_timeControlIterations) { - //Recuperation Iterations / Frequence + //Get Iterations / Frequence sousElement = element->FirstChildElement("iterations"); if (sousElement == NULL) throw ErrorXMLElement("iterations", fileName.str(), __FILE__, __LINE__); error = sousElement->QueryIntAttribute("number", &m_run->m_nbIte); @@ -187,7 +192,7 @@ void Input::inputMain(std::string casTest) } else { - //Recuperation Temps / Frequence + //Get Temps / Frequence sousElement = element->FirstChildElement("physicalTime"); if (sousElement == NULL) throw ErrorXMLElement("physicalTime", fileName.str(), __FILE__, __LINE__); error = sousElement->QueryDoubleAttribute("totalTime", &m_run->m_finalPhysicalTime); @@ -196,7 +201,7 @@ void Input::inputMain(std::string casTest) if (error != XML_NO_ERROR) throw ErrorXMLAttribut("timeFreq", fileName.str(), __FILE__, __LINE__); } - //Recuperation CFL + //Get CFL element = computationParam->FirstChildElement("computationControl"); if (element == NULL) throw ErrorXMLElement("computationControl", fileName.str(), __FILE__, __LINE__); error = element->QueryDoubleAttribute("CFL", &m_run->m_cfl); @@ -219,7 +224,7 @@ void Input::inputMain(std::string casTest) m_run->m_gradient = new GradientFiniteDifference(); } - //Lecture Ordre2 + //Read Ordre2 element = computationParam->FirstChildElement("secondOrder"); if(element == NULL) { m_run->m_order = "FIRSTORDER"; @@ -231,7 +236,7 @@ void Input::inputMain(std::string casTest) else{ m_run->m_order = "SECONDORDER"; XMLNode *contenu; - //Recuperation global limiter + //Get global limiter sousElement = element->FirstChildElement("globalLimiter"); if (sousElement == NULL) throw ErrorXMLElement("globalLimiter", fileName.str(), __FILE__, __LINE__); contenu = sousElement->FirstChild(); @@ -245,7 +250,7 @@ void Input::inputMain(std::string casTest) else if (globalLimiter == "MC") { m_run->m_globalLimiter = new LimiterMC; } else if (globalLimiter == "THINC") { throw ErrorXMLAttribut("THINC can only be a volume-fraction limiter", fileName.str(), __FILE__, __LINE__); } else { throw ErrorXMLDev(fileName.str(), __FILE__, __LINE__); } - //Recuperation interface limiter + //Get interface limiter std::string interfaceLimiter = globalLimiter; sousElement = element->FirstChildElement("interfaceLimiter"); if (sousElement != NULL) { @@ -261,7 +266,7 @@ void Input::inputMain(std::string casTest) else if (interfaceLimiter == "MC") { m_run->m_interfaceLimiter = new LimiterMC; } else if (interfaceLimiter == "THINC") { throw ErrorXMLAttribut("THINC can only be a volume-fraction limiter", fileName.str(), __FILE__, __LINE__); } else { throw ErrorXMLDev(fileName.str(), __FILE__, __LINE__); } - //Recuperation global volume-fraction limiter + //Get global volume-fraction limiter std::string globalVolumeFractionLimiter = globalLimiter; sousElement = element->FirstChildElement("globalVolumeFractionLimiter"); if (sousElement != NULL) { @@ -277,7 +282,7 @@ void Input::inputMain(std::string casTest) else if (globalVolumeFractionLimiter == "MC") { m_run->m_globalVolumeFractionLimiter = new LimiterMC; } else if (globalVolumeFractionLimiter == "THINC") { m_run->m_globalVolumeFractionLimiter = new LimiterTHINC; } else { throw ErrorXMLDev(fileName.str(), __FILE__, __LINE__); } - //Recuperation interface volume-fraction limiter + //Get interface volume-fraction limiter std::string interfaceVolumeFractionLimiter = interfaceLimiter; sousElement = element->FirstChildElement("interfaceVolumeFractionLimiter"); if (sousElement != NULL) { @@ -320,21 +325,21 @@ void Input::inputMesh(std::string casTest) bool varRho(false), varP(false), varU(false), varAlpha(false); double xiSplit(1.), xiJoin(1.); - //1) Parsing du file XML par la bibliotheque tinyxml2 - //------------------------------------------------------ + //1) Parsing XML file with the library tinyxml2 + //--------------------------------------------- std::stringstream fileName(casTest + m_nameMesh); XMLDocument xmlMesh; XMLError error(xmlMesh.LoadFile(fileName.str().c_str())); //Le file est parse ici if (error != XML_SUCCESS) throw ErrorXML(fileName.str(), __FILE__, __LINE__); - //2) Recuperation des donnees principales du compute - //------------------------------------------------- - //Recuperation racine du document XML + //2) Get main mesh data + //--------------------- + //Get root of XML document XMLNode *mesh = xmlMesh.FirstChildElement("mesh"); if (mesh == NULL) throw ErrorXMLRacine("mesh", fileName.str(), __FILE__, __LINE__); XMLElement* element; - //Recuperation du type de mesh + //Get mesh type element = mesh->FirstChildElement("type"); if (element == NULL) throw ErrorXMLElement("type", fileName.str(), __FILE__, __LINE__); std::string structureMesh(element->Attribute("structure")); @@ -342,11 +347,16 @@ void Input::inputMesh(std::string casTest) Tools::uppercase(structureMesh); if (structureMesh == "UNSTRUCTURED") { + if (m_run->m_order == "SECONDORDER") { + Errors::errorMessage("Second-order method for unstructured meshes is not released yet because of bugs"); + exit(0); + } + //----------------MESH NON STRUCTURE --------------------- XMLElement* meshNS; meshNS = mesh->FirstChildElement("unstructuredMesh"); if (meshNS == NULL) throw ErrorXMLElement("unstructuredMesh", fileName.str(), __FILE__, __LINE__); - //Lecture name du file contenant les informations de mesh + //Read name du file contenant les informations de mesh element = meshNS->FirstChildElement("file"); if (element == NULL) throw ErrorXMLElement("file", fileName.str(), __FILE__, __LINE__); std::string meshFile(element->Attribute("name")); @@ -374,7 +384,7 @@ void Input::inputMesh(std::string casTest) else if (meshExtension == "MESH") throw ErrorXML("MESH format is not supported for file : " + meshFile, __FILE__, __LINE__); else { throw ErrorXML("mesh extension not supported for file : " + meshFile, __FILE__, __LINE__); } - //Recuperation pretraitement parallele + //Get pretraitement parallele element = meshNS->FirstChildElement("parallel"); if (element != NULL) { error = element->QueryBoolAttribute("GMSHPretraitement", &m_run->m_parallelPreTreatment); @@ -383,6 +393,40 @@ void Input::inputMesh(std::string casTest) //AMR method not possible with unstructured mesh element = meshNS->FirstChildElement("AMR"); if (element != NULL) { throw ErrorXMLAttribut("Methode AMR non possible avec mesh non structure", fileName.str(), __FILE__, __LINE__); } + + //Mesh analysis option + element = meshNS->FirstChildElement("extractReferenceLength"); + if (element != NULL) { + error = element->QueryBoolAttribute("state", &m_run->m_extractRefLength); + if (error != XML_NO_ERROR) throw ErrorXMLAttribut("extractReferenceLength", fileName.str(), __FILE__, __LINE__); + } + + //Mesh mapping restart option + element = meshNS->FirstChildElement("meshMappingRestart"); + if (element != NULL) { + // Read attributes + std::string resultFolderMapped = element->Attribute("resultFolder"); + if (resultFolderMapped == "") throw ErrorXMLAttribut("resultFolder", fileName.str(), __FILE__, __LINE__); + int restartFileNumber(0); + error = element->QueryIntAttribute("restartFileNumber", &restartFileNumber); + if (error != XML_NO_ERROR) throw ErrorXMLAttribut("restartFileNumber", fileName.str(), __FILE__, __LINE__); + m_run->m_meshFileMapped = element->Attribute("meshFile"); + if (m_run->m_meshFileMapped == "") throw ErrorXMLAttribut("meshFile", fileName.str(), __FILE__, __LINE__); + m_run->m_meshFileMapped = config.getWorkFolder() + m_run->m_meshFileMapped; + // Check if mapped file is conform + std::string meshMappedExtension(MeshUnStruct::readMeshFileExtension(m_run->m_meshFileMapped)); + Tools::uppercase(meshMappedExtension); + if (meshMappedExtension == "MSH" && meshMappedExtension == meshExtension) // Gmsh format & same on both simulation + { + std::string versionMapped(MUSGmsh::readVersion(m_run->m_meshFileMapped)); + if (versionMapped == "2.2") { + m_run->m_restartMeshMapping = true; + m_run->m_outputMeshMapping = new OutputXML(resultFolderMapped, restartFileNumber, this); + } + else throw ErrorXML("mesh version not supported for restart with mesh mapping, see file: " + m_run->m_meshFileMapped, __FILE__, __LINE__); + } + else { throw ErrorXML("mesh format not supported for restart with mesh mapping, see file: " + m_run->m_meshFileMapped, __FILE__, __LINE__); } + } } else if (structureMesh == "CARTESIAN") { @@ -390,7 +434,7 @@ void Input::inputMesh(std::string casTest) XMLElement* cartesianMesh; cartesianMesh = mesh->FirstChildElement("cartesianMesh"); if (cartesianMesh == NULL) throw ErrorXMLElement("cartesianMesh", fileName.str(), __FILE__, __LINE__); - //Recuperation des dimensions + //Get dimensions double lX, lY, lZ; element = cartesianMesh->FirstChildElement("dimensions"); if (element == NULL) throw ErrorXMLElement("dimensions", fileName.str(), __FILE__, __LINE__); @@ -400,7 +444,7 @@ void Input::inputMesh(std::string casTest) if (error != XML_NO_ERROR) throw ErrorXMLAttribut("y", fileName.str(), __FILE__, __LINE__); error = element->QueryDoubleAttribute("z", &lZ); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("z", fileName.str(), __FILE__, __LINE__); - //Recuperation des numbers de mailles + //Get number of cells int nbX, nbY, nbZ; element = cartesianMesh->FirstChildElement("numberCells"); if (element == NULL) throw ErrorXMLElement("numberCells", fileName.str(), __FILE__, __LINE__); @@ -485,7 +529,7 @@ void Input::inputMesh(std::string casTest) } //End stretching - //Recuperation des variables pour methode AMR + //Get des variables pour methode AMR element = cartesianMesh->FirstChildElement("AMR"); if (element != NULL) { //Interdiction parallele @@ -522,19 +566,19 @@ void Input::inputMesh(std::string casTest) void Input::inputModel(std::string casTest) { try{ - //1) Parsing du file XML par la bibliotheque tinyxml2 - //------------------------------------------------------ + //1) Parsing XML file with the library tinyxml2 + //--------------------------------------------- std::stringstream fileName(casTest + m_nameModel); XMLDocument xmlModel; XMLError error(xmlModel.LoadFile(fileName.str().c_str())); //Le file est parse ici if (error != XML_SUCCESS) throw ErrorXML(fileName.str(), __FILE__, __LINE__); - //2) Recuperation des donnees du Model - //------------------------------------- - //Recuperation racine du document XML + //2) Get model data + //----------------- + //Get root of XML document XMLNode *xmlNode = xmlModel.FirstChildElement("model"); if (xmlNode == NULL) throw ErrorXMLRacine("model", fileName.str(), __FILE__, __LINE__); - //Recuperation name du model resolu + //Get name of solved model XMLElement* element(xmlNode->FirstChildElement("flowModel")); if (element == NULL) throw ErrorXMLElement("flowModel", fileName.str(), __FILE__, __LINE__); std::string model(element->Attribute("name")); @@ -557,8 +601,8 @@ void Input::inputModel(std::string casTest) else if (model == "PRESSUREVELOCITYEQ") { error = element->QueryIntAttribute("numberPhases", &m_run->m_numberPhases); - m_run->m_model = new ModPUEq(m_run->m_numberTransports, m_run->m_numberPhases); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("numberPhases", fileName.str(), __FILE__, __LINE__); + m_run->m_model = new ModPUEq(m_run->m_numberTransports, m_run->m_numberPhases); error = element->QueryBoolAttribute("alphaNull", &alphaNull); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("alphaNull", fileName.str(), __FILE__, __LINE__); if (m_run->m_outPut->getReducedOutput()) { @@ -573,15 +617,17 @@ void Input::inputModel(std::string casTest) else if (model == "VELOCITYEQ") { error = element->QueryIntAttribute("numberPhases", &m_run->m_numberPhases); - m_run->m_model = new ModUEq(m_run->m_numberTransports, m_run->m_numberPhases); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("numberPhases", fileName.str(), __FILE__, __LINE__); + m_run->m_model = new ModUEq(m_run->m_numberTransports, m_run->m_numberPhases); error = element->QueryBoolAttribute("alphaNull", &alphaNull); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("alphaNull", fileName.str(), __FILE__, __LINE__); if (m_run->m_outPut->getReducedOutput()) { numberScalarsMixture = 2; //Density and pressure + numberScalarsPhase = 3; //Volume fraction, density and pressure } else { numberScalarsMixture = 3; //Density, pressure and total energy + numberScalarsPhase = 5; //Volume fraction, density, pressure, temperature and mass fraction } } else if (model == "VELOCITYEQTOTENERGY") @@ -628,6 +674,13 @@ void Input::inputModel(std::string casTest) error = element->QueryBoolAttribute("state", &lowMach); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("state", fileName.str(), __FILE__, __LINE__); m_run->m_model->setLowMach(lowMach); + if (lowMach) { + double machRefMin(1.e-2); + error = element->QueryDoubleAttribute("machRefMin", &machRefMin); + if (error == XML_NO_ERROR) { + m_run->m_model->setMachRefMin(machRefMin); + } + } } //Thermodynamique @@ -637,7 +690,7 @@ void Input::inputModel(std::string casTest) XMLElement* sousElement(xmlNode->FirstChildElement("EOS")); while (sousElement != NULL) { - //Lecture Eos + //Read Eos nameEOS.push_back(sousElement->Attribute("name")); if (nameEOS[EOSTrouvee] == "") throw ErrorXMLAttribut("name", fileName.str(), __FILE__, __LINE__); EOSTrouvee++; @@ -656,7 +709,7 @@ void Input::inputModel(std::string casTest) XMLElement* elementTransport(xmlNode->FirstChildElement("transport")); while (elementTransport != NULL) { - //Lecture name transport + //Read name transport m_run->m_nameGTR.push_back(elementTransport->Attribute("name")); if (m_run->m_nameGTR[transportsTrouvee] == "") throw ErrorXMLAttribut("name", fileName.str(), __FILE__, __LINE__); transportsTrouvee++; @@ -671,25 +724,32 @@ void Input::inputModel(std::string casTest) element = xmlNode->FirstChildElement("additionalPhysic"); while (element != NULL) { physiqueAddTrouvee++; - //Lecture physique additionnelle + //Read physique additionnelle std::string typeAddPhys(element->Attribute("type")); if (typeAddPhys == "") throw ErrorXMLAttribut("type", fileName.str(), __FILE__, __LINE__); Tools::uppercase(typeAddPhys); //switch sur le type de physique additionelle if (typeAddPhys == "SURFACETENSION") { //switch model d ecoulement - if (model == "PRESSUREVELOCITYEQ" || model == "VELOCITYEQ") { m_run->m_addPhys.push_back(new APUEqSurfaceTension(element, numberGPA, m_run->m_nameGTR, nameEOS, fileName.str())); } + if (model == "PRESSUREVELOCITYEQ" || model == "VELOCITYEQ") { + m_run->m_addPhys.push_back(new APUEqSurfaceTension(element, numberGPA, m_run->m_nameGTR, nameEOS, fileName.str())); + } else { throw ErrorXMLDev(fileName.str(), __FILE__, __LINE__); } } else if (typeAddPhys == "VISCOSITY") { //switch model d ecoulement - if (model == "PRESSUREVELOCITYEQ" || model == "VELOCITYEQ") { m_run->m_addPhys.push_back(new APUEqViscosity(numberGPA, m_run->m_eos, m_run->m_numberPhases)); } + if (model == "PRESSUREVELOCITYEQ" || model == "VELOCITYEQ") { + m_run->m_addPhys.push_back(new APUEqViscosity(numberGPA, m_run->m_eos, m_run->m_numberPhases)); + } else if (model == "EULER") { m_run->m_addPhys.push_back(new APEViscosity(numberGPA, m_run->m_eos)); } else { throw ErrorXMLDev(fileName.str(), __FILE__, __LINE__); } + m_run->m_viscous = true; } else if (typeAddPhys == "CONDUCTIVITY") { //switch model d ecoulement - if (model == "PRESSUREVELOCITYEQ" || model == "VELOCITYEQ") { m_run->m_addPhys.push_back(new APUEqConductivity(numberGPA, m_run->m_eos, m_run->m_numberPhases)); } + if (model == "PRESSUREVELOCITYEQ" || model == "VELOCITYEQ") { + m_run->m_addPhys.push_back(new APUEqConductivity(numberGPA, m_run->m_eos, m_run->m_numberPhases)); + } else if (model == "EULER") { m_run->m_addPhys.push_back(new APEConductivity(numberGPA, m_run->m_eos)); } else { throw ErrorXMLDev(fileName.str(), __FILE__, __LINE__); } } @@ -759,7 +819,7 @@ void Input::inputModel(std::string casTest) //Relaxations reading element = xmlNode->FirstChildElement("relaxation"); while (element != NULL) { - //Lecture source + //Read source std::string typeRelax(element->Attribute("type")); if (typeRelax == "") throw ErrorXMLAttribut("type", fileName.str(), __FILE__, __LINE__); Tools::uppercase(typeRelax); @@ -769,7 +829,7 @@ void Input::inputModel(std::string casTest) for (unsigned int r = 0; r < m_run->m_model->getRelaxations()->size(); r++) { if ((*m_run->m_model->getRelaxations())[r]->getType() == TypeRelax::PTMU) { throw ErrorXMLRelaxation(typeRelax, fileName.str(), __FILE__, __LINE__); } } - m_run->m_model->getRelaxations()->push_back(new RelaxationPTMu(element, fileName.str())); + m_run->m_model->getRelaxations()->push_back(new RelaxationPTMu(element, nameEOS, fileName.str())); } else if (typeRelax == "PT") { //Verify if relaxation not already added @@ -785,8 +845,12 @@ void Input::inputModel(std::string casTest) } std::string speedRelax(element->Attribute("speed")); Tools::uppercase(speedRelax); - if (speedRelax == "FINITE") { m_run->m_model->getRelaxations()->push_back(new RelaxationPFinite(element, fileName.str())); } - else { m_run->m_model->getRelaxations()->push_back(new RelaxationPInfinite()); } + if (speedRelax == "FINITE") { + m_run->m_model->getRelaxations()->push_back(new RelaxationPFinite(element, fileName.str())); + } + else { //Infinite + m_run->m_model->getRelaxations()->push_back(new RelaxationPInfinite()); + } } else { throw ErrorXMLRelaxation(typeRelax, fileName.str(), __FILE__, __LINE__); } element = element->NextSiblingElement("relaxation"); @@ -801,19 +865,19 @@ void Input::inputModel(std::string casTest) Eos* Input::inputEOS(std::string EOS, int& numberEOS) { try{ - //1) Parsing du file XML par la bibliotheque tinyxml2 - //------------------------------------------------------ + //1) Parsing XML file with the library tinyxml2 + //--------------------------------------------- std::stringstream fileName(config.getWorkFolder() + "./libEOS/" + EOS); XMLDocument xmlEOS; XMLError error(xmlEOS.LoadFile(fileName.str().c_str())); //Le file est parse ici if (error != XML_SUCCESS) throw ErrorXML(fileName.str(), __FILE__, __LINE__); - //2) Recuperation des donnees de l'EOS - //------------------------------------ - //Recuperation racine du document XML + //2) Get EOS data + //--------------- + //Get root of XML document XMLNode *xmlNode = xmlEOS.FirstChildElement("parametersEOS"); if (xmlNode == NULL) throw ErrorXMLRacine("parametersEOS", fileName.str(), __FILE__, __LINE__); - //Recuperation type d'EOS + //Get EOS type XMLElement* element; element = xmlNode->FirstChildElement("EOS"); if (element == NULL) throw ErrorXMLElement("EOS", fileName.str(), __FILE__, __LINE__); @@ -828,9 +892,9 @@ Eos* Input::inputEOS(std::string EOS, int& numberEOS) else if (typeEOS == "NASG"){ eos = new EosNASG(NamesParametresEos, numberEOS); } else if (typeEOS == "VDW"){ eos = new EosVDW(NamesParametresEos, numberEOS); } else if (typeEOS == "POLYNOMIAL"){ eos = new EosPolynomial(NamesParametresEos, numberEOS); } - else{ throw ErrorXMLEOSInconnue(typeEOS, fileName.str(), __FILE__, __LINE__); } //Cas ou la loi state est inconnue + else{ throw ErrorXMLEOSUnknown(typeEOS, fileName.str(), __FILE__, __LINE__); } //Cas ou la loi state est unknown - //Recuperation des parametres de l'EOS + //Get of EOS parameters element = xmlNode->FirstChildElement("parameters"); if (element == NULL) throw ErrorXMLElement("parameters", fileName.str(), __FILE__, __LINE__); std::vector parametresEos(NamesParametresEos.size()); @@ -840,8 +904,8 @@ Eos* Input::inputEOS(std::string EOS, int& numberEOS) if (error != XML_NO_ERROR) throw ErrorXMLAttribut(NamesParametresEos[p].c_str(), fileName.str(), __FILE__, __LINE__); } eos->assignParametersEos(EOS.c_str(), parametresEos); - //Lecture des parametres physiques (viscosite, conductivite, etc.) - eos->readPhysicalParameter(xmlNode); + //Read physical parameters (viscosity, thermal conductivity, etc.) + eos->readPhysicalParameters(xmlNode); return eos; } @@ -850,7 +914,7 @@ Eos* Input::inputEOS(std::string EOS, int& numberEOS) //*********************************************************************** -void Input::inputInitialConditions(std::string casTest, std::vector& domains, std::vector& boundCond) +void Input::inputInitialConditions(std::string casTest, std::vector& domains, std::vector& boundCond, std::vector& solidDomains) { try{ //1) Parsing du file XML par la bibliotheque tinyxml2 @@ -862,27 +926,26 @@ void Input::inputInitialConditions(std::string casTest, std::vectorFirstChildElement("physicalDomains")); if(elementDomaine == NULL) throw ErrorXMLElement("physicalDomains", fileName.str(), __FILE__, __LINE__); - //3) Recuperation des domains definis - //------------------------------------ + //3) Get defined domains + //---------------------- std::string nameDomaine, stateDomaine; - int domaineTrouve(0); XMLElement* element(elementDomaine->FirstChildElement("domain")); while (element != NULL) { - //A)Lecture name domain + //A)Read name domain //********************* nameDomaine = element->Attribute("name"); if (nameDomaine == "") throw ErrorXMLAttribut("name", fileName.str(), __FILE__, __LINE__); Tools::uppercase(nameDomaine); - //B)Lecture state domain + //B)Read state domain //********************** stateDomaine = element->Attribute("state"); if (stateDomaine == "") throw ErrorXMLAttribut("state", fileName.str(), __FILE__, __LINE__); @@ -909,57 +972,69 @@ void Input::inputInitialConditions(std::string casTest, std::vectorm_model->whoAmI() == "EULERHOMOGENEOUS") { stateMixture = new MixEulerHomogeneous(state, fileName.str()); } else if (m_run->m_model->whoAmI() == "NONLINEARSCHRODINGER") { stateMixture = new MixNonLinearSchrodinger(); } else if (m_run->m_model->whoAmI() == "EULERKORTEWEG") { stateMixture = new MixEulerKorteweg(); } - else { throw ErrorXMLElement("Couplage Model-Fluid non valide", fileName.str(), __FILE__, __LINE__); } + else { throw ErrorXMLElement("Not valid Model-Fluid coupling", fileName.str(), __FILE__, __LINE__); } //Then Reading phases states std::vector statesPhases; std::string typeMateriau; std::string nameEOS; XMLElement* material(state->FirstChildElement("material")); - int nbMateriauxEtat(0); + int nbMateriauxState(0); + int nbSolidState(0); while (material != NULL) { typeMateriau = material->Attribute("type"); Tools::uppercase(typeMateriau); - //READING FLUID - if (typeMateriau == "FLUID") { - nbMateriauxEtat++; + //Verifying that solids are setup first + if (nbSolidState < m_run->m_numberSolids) { + if (typeMateriau != "SOLID") { throw ErrorXMLEtat("Solid materials should be setup first", fileName.str(), __FILE__, __LINE__); } + } + + //READING FLUID AND SOLID + if (typeMateriau == "FLUID" || typeMateriau == "SOLID") { + nbMateriauxState++; //Find EOS nameEOS = material->Attribute("EOS"); int e(0); - for (e = nbMateriauxEtat - 1; e < m_run->m_numberPhases; e++) { + for (e = nbMateriauxState - 1; e < m_run->m_numberPhases; e++) { if (nameEOS == m_run->m_eos[e]->getName()) { break; } } - if (e == m_run->m_numberPhases) { throw ErrorXMLEOSInconnue(nameEOS, fileName.str(), __FILE__, __LINE__); } - if (e != nbMateriauxEtat-1) { throw ErrorXMLEtat("Materials in used states should be ordered in reference to modelXX.xml", fileName.str(), __FILE__, __LINE__); } - //Phase - if (m_run->m_model->whoAmI() == "EULER") { statesPhases.push_back(new PhaseEuler(material, m_run->m_eos[e], fileName.str())); } - else if (m_run->m_model->whoAmI() == "PRESSUREVELOCITYEQ") { statesPhases.push_back(new PhasePUEq(material, m_run->m_eos[e], stateMixture->getPressure(), fileName.str())); } - else if (m_run->m_model->whoAmI() == "VELOCITYEQ") { statesPhases.push_back(new PhaseUEq(material, m_run->m_eos[e], fileName.str())); } - else if (m_run->m_model->whoAmI() == "VELOCITYEQTOTENERGY") { statesPhases.push_back(new PhaseUEqTotEnergy(material, m_run->m_eos[e], fileName.str())); } - else if (m_run->m_model->whoAmI() == "TEMPERATUREPRESSUREVELOCITYEQ") { statesPhases.push_back(new PhasePTUEq(material, m_run->m_eos[e], fileName.str())); } - else if (m_run->m_model->whoAmI() == "EULERHOMOGENEOUS") { statesPhases.push_back(new PhaseEulerHomogeneous(material, m_run->m_eos[e], fileName.str())); } - else if (m_run->m_model->whoAmI() == "EULERKORTEWEG") { statesPhases.push_back(new PhaseEulerKorteweg(material, m_run->m_eos[e], fileName.str())); } - else { throw ErrorXMLElement("Not valid Model-Fluid coupling", fileName.str(), __FILE__, __LINE__); } + if (e == m_run->m_numberPhases) { throw ErrorXMLEOSUnknown(nameEOS, fileName.str(), __FILE__, __LINE__); } + if (e != nbMateriauxState - 1) { throw ErrorXMLEtat("Materials in used states should be ordered in reference to model.xml", fileName.str(), __FILE__, __LINE__); } + //Fluid phase + if (typeMateriau == "FLUID") { + if (m_run->m_model->whoAmI() == "EULER") { statesPhases.push_back(new PhaseEuler(material, m_run->m_eos[e], fileName.str())); } + else if (m_run->m_model->whoAmI() == "PRESSUREVELOCITYEQ") { statesPhases.push_back(new PhasePUEq(material, m_run->m_eos[e], stateMixture->getPressure(), fileName.str())); } + else if (m_run->m_model->whoAmI() == "VELOCITYEQ") { statesPhases.push_back(new PhaseUEq(material, m_run->m_eos[e], fileName.str())); } + else if (m_run->m_model->whoAmI() == "VELOCITYEQTOTENERGY") { statesPhases.push_back(new PhaseUEqTotEnergy(material, m_run->m_eos[e], fileName.str())); } + else if (m_run->m_model->whoAmI() == "TEMPERATUREPRESSUREVELOCITYEQ") { statesPhases.push_back(new PhasePTUEq(material, m_run->m_eos[e], fileName.str())); } + else if (m_run->m_model->whoAmI() == "EULERHOMOGENEOUS") { statesPhases.push_back(new PhaseEulerHomogeneous(material, m_run->m_eos[e], fileName.str())); } + else if (m_run->m_model->whoAmI() == "EULERKORTEWEG") { statesPhases.push_back(new PhaseEulerKorteweg(material, m_run->m_eos[e], fileName.str())); } + else { throw ErrorXMLElement("Not valid Model-Fluid coupling", fileName.str(), __FILE__, __LINE__); } + } + //Solid phase + else { + nbSolidState++; + throw ErrorXMLElement("Not valid Model-Solid coupling", fileName.str(), __FILE__, __LINE__); + } } - //READING "NONE" (not a fluid or solid) else if (typeMateriau == "NONE") { - nbMateriauxEtat++; + nbMateriauxState++; if (m_run->m_model->whoAmI() == "NONLINEARSCHRODINGER") { statesPhases.push_back(new PhaseNonLinearSchrodinger(material, nullptr, fileName.str())); } } - - //MATERIAU INCONNU - else { throw ErrorXMLMateriauInconnu(typeMateriau, fileName.str(), __FILE__, __LINE__); } //Cas ou le type de material n a pas ete implemente + //UNKNOWN MATERIAL + else { throw ErrorXMLMaterialUnknown(typeMateriau, fileName.str(), __FILE__, __LINE__); } //Cas ou le type de material n a pas ete implemente + material = material->NextSiblingElement("material"); } - if(nbMateriauxEtat!=m_run->m_numberPhases) throw ErrorXMLEtat(stateDomaine, fileName.str(), __FILE__, __LINE__); + if (nbMateriauxState != m_run->m_numberPhases) throw ErrorXMLEtat(stateDomaine, fileName.str(), __FILE__, __LINE__); + if (nbSolidState != m_run->m_numberSolids) throw ErrorXMLEtat(stateDomaine, fileName.str(), __FILE__, __LINE__); - //Lecture des variables transportees pour l'state trouve + //Read des variables transportees pour l'state trouve std::vector statesTransport(m_run->m_numberTransports); std::string nameTransport; double valueTransport(0.); XMLElement* elementTransport(state->FirstChildElement("transport")); - int nbTransports(0); while (elementTransport != NULL) { nameTransport = elementTransport->Attribute("name"); elementTransport->QueryDoubleAttribute("value", &valueTransport); @@ -969,94 +1044,152 @@ void Input::inputInitialConditions(std::string casTest, std::vectorm_numberTransports) { statesTransport[e].setValue(valueTransport); - nbTransports++; } elementTransport = elementTransport->NextSiblingElement("transport"); } //C)Reading optional physical entity //********************************** - int physicalEntity(element->IntAttribute("physicalEntity")); //Default value: 0 + int physicalEntity(element->IntAttribute("physicalEntity")); //Default value: 0 (-1 for immersed boundaries) + // Check that immersed boundaries are not used with an unstructured mesh + if (m_run->m_mesh->getType() == TypeM::UNS && physicalEntity == -1) { + throw ErrorXMLElement("Immersed boundaries not available for unstructured meshes", fileName.str(), __FILE__, __LINE__); + } //C)Reading domain type //********************* std::string typeDomaine(element->Attribute("type")); Tools::uppercase(typeDomaine); std::vector NamesParametresDomaine; - if (typeDomaine == "ENTIREDOMAIN") { domains.push_back(new GDEntireDomain(nameDomaine, statesPhases, stateMixture, statesTransport, physicalEntity)); } - else if (typeDomaine == "ENTIREDOMAINWITHPARTICULARITIES") { domains.push_back(new GDEntireDomainWithParticularities(nameDomaine, statesPhases, stateMixture, statesTransport, physicalEntity)); } - else if (typeDomaine == "HALFSPACE") { domains.push_back(new GDHalfSpace(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else if (typeDomaine == "DISC") { domains.push_back(new GDDisc(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else if (typeDomaine == "ELLIPSE") { domains.push_back(new GDEllipse(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else if (typeDomaine == "RECTANGLE") { domains.push_back(new GDRectangle(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else if (typeDomaine == "CUBOID") { domains.push_back(new GDCuboid(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else if (typeDomaine == "SPHERE") { domains.push_back(new GDSphere(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else if (typeDomaine == "ELLIPSOID") { domains.push_back(new GDEllipsoid(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else if (typeDomaine == "CYLINDER") { domains.push_back(new GDCylinder(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } - else{ throw ErrorXMLDomaineInconnu(typeDomaine, fileName.str(), __FILE__, __LINE__); } //Cas ou le domain n a pas ete implemente - domaineTrouve++; + if (typeDomaine == "ENTIREDOMAIN"){ + domains.push_back(new GDEntireDomain(nameDomaine, statesPhases, stateMixture, statesTransport, physicalEntity)); + if(physicalEntity==-1) { solidDomains.push_back(new GDEntireDomain(nameDomaine, statesPhases, stateMixture, statesTransport, physicalEntity)); } + } + else if (typeDomaine == "ENTIREDOMAINWITHPARTICULARITIES"){ + domains.push_back(new GDEntireDomainWithParticularities(nameDomaine, statesPhases, stateMixture, statesTransport, physicalEntity)); + if(physicalEntity==-1) {solidDomains.push_back(new GDEntireDomainWithParticularities(nameDomaine, statesPhases, stateMixture, statesTransport, physicalEntity)); } + } + else if (typeDomaine == "HALFSPACE"){ + domains.push_back(new GDHalfSpace(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDHalfSpace(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else if (typeDomaine == "DISC"){ + domains.push_back(new GDDisc(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDDisc(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else if (typeDomaine == "ELLIPSE"){ + domains.push_back(new GDEllipse(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDEllipse(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else if (typeDomaine == "RECTANGLE"){ + domains.push_back(new GDRectangle(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDRectangle(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else if (typeDomaine == "CUBOID"){ + domains.push_back(new GDCuboid(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDCuboid(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else if (typeDomaine == "SPHERE"){ + domains.push_back(new GDSphere(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDSphere(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else if (typeDomaine == "ELLIPSOID"){ + domains.push_back(new GDEllipsoid(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDEllipsoid(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else if (typeDomaine == "CYLINDER"){ + domains.push_back(new GDCylinder(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); + if(physicalEntity==-1) { solidDomains.push_back(new GDCylinder(nameDomaine, statesPhases, stateMixture, statesTransport, element, physicalEntity, fileName.str())); } + } + else{ throw ErrorXMLDomaineUnknown(typeDomaine, fileName.str(), __FILE__, __LINE__); } //Cas ou le domain n a pas ete implemente //Domaine suivant element = element->NextSiblingElement("domain"); - for (int k = 0; k < m_run->m_numberPhases; k++) { delete statesPhases[k]; } + for (unsigned int k = 0; k < statesPhases.size(); k++) { delete statesPhases[k]; } delete stateMixture; } //------------------------------ CONDITIONS AUX LIMITES ------------------------------- - //4) Recuperation racine CL du document XML - //----------------------------------------- + //4) Get root of XML document + //--------------------------- XMLElement* elementLimites(xmlNode->FirstChildElement("boundaryConditions")); if (elementLimites == NULL) throw ErrorXMLElement("boundaryConditions", fileName.str(), __FILE__, __LINE__); - //5) Recuperation des boundCond definies - //------------------------------------ + //5) Get defined boundary conditions + //----------------------------------- std::string nameBoundCond, stateLimite, typeBoundCond; int numBoundCond; - int boundCondTrouve(0); element = elementLimites->FirstChildElement("boundCond"); while (element != NULL) { - //A)Lecture name boundCond + //A)Reading name boundCond //************************ nameBoundCond = element->Attribute("name"); if (nameBoundCond == "") throw ErrorXMLAttribut("name", fileName.str(), __FILE__, __LINE__); Tools::uppercase(nameBoundCond); - //B)Lecture type boundCond + //B)Reading type boundCond //************************ typeBoundCond = element->Attribute("type"); if (typeBoundCond == "") throw ErrorXMLAttribut("type", fileName.str(), __FILE__, __LINE__); Tools::uppercase(typeBoundCond); - //C)Number de la boundCond associe a la geometrie mesh - //**************************************************** + //C)boundCond number related to mesh + //********************************** error = element->QueryIntAttribute("number", &numBoundCond); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("number", fileName.str(), __FILE__, __LINE__); - //D)Reading conLim specific data - //****************************** + //D)Reading boundCond specific data + //********************************* if (typeBoundCond == "NONREFLECTING") { boundCond.push_back(new BoundCondNonReflecting(numBoundCond)); } else if (typeBoundCond == "SYMMETRY") { if (m_run->m_order == "FIRSTORDER") { boundCond.push_back(new BoundCondSymmetry(numBoundCond)); } - else { boundCond.push_back(new BoundCondSymmetryO2(numBoundCond)); } + else { + if (m_run->m_mesh->getType() != TypeM::UNS) { // Cartesian, AMR + boundCond.push_back(new BoundCondSymmetryO2Cartesian(numBoundCond)); + } + else { // Unstructured + boundCond.push_back(new BoundCondSymmetryO2NS(numBoundCond)); + } + } } else if (typeBoundCond == "WALL") { - if (m_run->m_order == "FIRSTORDER") { boundCond.push_back(new BoundCondWall(numBoundCond, element, fileName.str())); } - else { boundCond.push_back(new BoundCondWallO2(numBoundCond, element, fileName.str())); } + if (m_run->m_viscous) { + if (m_run->m_order == "FIRSTORDER") { boundCond.push_back(new BoundCondWall(numBoundCond, element, fileName.str())); } + else { + if (m_run->m_mesh->getType() != TypeM::UNS) { // Cartesian, AMR + boundCond.push_back(new BoundCondWallO2Cartesian(numBoundCond, element, fileName.str())); + } + else { // Unstructured + boundCond.push_back(new BoundCondWallO2NS(numBoundCond, element, fileName.str())); + } + } + } + else { + if (m_run->m_order == "FIRSTORDER") { boundCond.push_back(new BoundCondSymmetry(numBoundCond)); } + else { + if (m_run->m_mesh->getType() != TypeM::UNS) { // Cartesian, AMR + boundCond.push_back(new BoundCondSymmetryO2Cartesian(numBoundCond)); + } + else { // Unstructured + boundCond.push_back(new BoundCondSymmetryO2NS(numBoundCond)); + } + } + } } - else if (typeBoundCond == "INJECTION") { boundCond.push_back(new BoundCondInj(numBoundCond, element, m_run->m_numberPhases, m_run->m_numberTransports, m_run->m_nameGTR, m_run->m_eos, fileName.str())); } - else if (typeBoundCond == "SUBINJECTION") { boundCond.push_back(new BoundCondSubInj(numBoundCond, element, m_run->m_numberPhases, fileName.str())); } - else if (typeBoundCond == "TANK") { boundCond.push_back(new BoundCondTank(numBoundCond, element, m_run->m_numberPhases, m_run->m_numberTransports, m_run->m_nameGTR, m_run->m_eos, fileName.str())); } - else if (typeBoundCond == "OUTFLOW") { boundCond.push_back(new BoundCondOutflow(numBoundCond, element, m_run->m_numberTransports, m_run->m_nameGTR, fileName.str())); } + else if (typeBoundCond == "INLETTANK") { boundCond.push_back(new BoundCondInletTank(numBoundCond, element, m_run->m_numberPhases, m_run->m_numberTransports, m_run->m_nameGTR, m_run->m_eos, fileName.str())); } + else if (typeBoundCond == "INLETINJSTAGSTATE") { boundCond.push_back(new BoundCondInletInjStagState(numBoundCond, element, m_run->m_numberPhases, m_run->m_numberTransports, m_run->m_nameGTR, m_run->m_eos, fileName.str())); } + else if (typeBoundCond == "INLETINJTEMP") { boundCond.push_back(new BoundCondInletInjTemp(numBoundCond, element, m_run->m_numberPhases, fileName.str())); } + else if (typeBoundCond == "OUTLETPRESSURE") { boundCond.push_back(new BoundCondOutletPressure(numBoundCond, element, m_run->m_numberTransports, m_run->m_nameGTR, fileName.str())); } + else if (typeBoundCond == "OUTLETMASSFLOW") { boundCond.push_back(new BoundCondOutletMassflow(numBoundCond, element, fileName.str())); } else if (typeBoundCond == "NULLFLUX") { boundCond.push_back(new BoundCondNullflux(numBoundCond)); } - else { throw ErrorXMLBoundCondInconnue(typeBoundCond, fileName.str(), __FILE__, __LINE__); } //Cas ou la limite n a pas ete implemente - boundCondTrouve++; - //Domaine suivant + else { throw ErrorXMLBoundCondUnknown(typeBoundCond, fileName.str(), __FILE__, __LINE__); } //If boundary condition not implemented + //Next domain element = element->NextSiblingElement("boundCond"); } } - catch (ErrorXML &){ throw; } // Renvoi au niveau suivant + catch (ErrorXML &){ throw; } } //*********************************************************************** @@ -1065,6 +1198,7 @@ void Input::verifyCompatibilityInput(std::string testCase) { // Checks parameters cross compatibility between input files try { + // Moving Reference Frame computation restrictions if (m_run->m_MRF != -1) { if (m_run->m_mesh->getType() != TypeM::UNS) { @@ -1076,6 +1210,29 @@ void Input::verifyCompatibilityInput(std::string testCase) throw ErrorXMLMessage("MRF is not compatible with this gradient method when using additionnal physics", fileName.str(), __FILE__, __LINE__); } } + + // Recording of Psat restrictions + if (m_run->m_recordPsat == true && m_run->m_numberPhases != 2) { + std::stringstream fileName(testCase + m_nameMain); + throw ErrorXMLMessage("Recording of saturation pressure is possible only for a liquid/vapor fluid", fileName.str(), __FILE__, __LINE__); + } + + // Check second-order compatibility on unstructured meshes + if (m_run->m_order == "SECONDORDER") { + if (m_run->m_mesh->getType() == TypeM::UNS) { + // Check limiter compatibility + if (m_run->m_globalLimiter->getType() == 0) { // Limiter is not Minmod or Superbee + std::stringstream fileName(testCase + m_nameMain); + throw ErrorXMLMessage("Selected global second-order limiter not compatible with unstructured meshes", fileName.str(), __FILE__, __LINE__); + } + // Check gradient compatibility + if (m_run->m_gradient->getType() == TypeGrad::FD) { + std::stringstream fileName(testCase + m_nameMain); + throw ErrorXMLMessage("Selected gradient method not compatible with second-order method on unstructured meshes", fileName.str(), __FILE__, __LINE__); + } + } + } + } catch (ErrorXML &) { throw; } } diff --git a/src/InputOutput/Input.h b/src/InputOutput/Input.h index cc287317..2bf08017 100644 --- a/src/InputOutput/Input.h +++ b/src/InputOutput/Input.h @@ -57,13 +57,13 @@ class Input Input(Run *run); virtual ~Input(); - void readInputXML(std::vector& domains, std::vector& boundCond); + void readInputXML(std::vector& domains, std::vector& boundCond, std::vector& solidDomains); void inputMain(std::string testCase); void inputMesh(std::string testCase); void inputModel(std::string testCase); Eos* inputEOS(std::string EOS, int& numberEOS); - void inputInitialConditions(std::string testCase, std::vector& domains, std::vector& boundCond); + void inputInitialConditions(std::string testCase, std::vector& domains, std::vector& boundCond, std::vector& solidDomains); void verifyCompatibilityInput(std::string testCase); //Accesseur @@ -74,17 +74,12 @@ class Input Run *getRun() const { return m_run; } private: - Run *m_run; //pointeur vers run + Run *m_run; // Pointer to run - int m_vMain; //!< Number de version file entree main - int m_vMesh; //!< Number de version file entree mesh - int m_vCI; //!< Number de version file entree initialConditions - int m_vModel; //!< Number de version file entree model - - std::string m_nameMain; //!< Name du file main - std::string m_nameMesh; //!< Name du file mesh - std::string m_nameCI; //!< Name du file initialConditions - std::string m_nameModel; //!< Name du file model + std::string m_nameMain; //!< Name of main file + std::string m_nameMesh; //!< Name of mesh file + std::string m_nameCI; //!< Name of initialConditions file + std::string m_nameModel; //!< Name of model file }; #endif // INPUT_H \ No newline at end of file diff --git a/src/InputOutput/Output.cpp b/src/InputOutput/Output.cpp index fe6a42b3..22ead8a0 100644 --- a/src/InputOutput/Output.cpp +++ b/src/InputOutput/Output.cpp @@ -41,7 +41,7 @@ Output::Output(){} //*************************************************************** Output::Output(std::string casTest, std::string nameRun, XMLElement* element, std::string fileName, Input *entree) : - m_input(entree), m_simulationName(casTest), m_folderOutput(nameRun), m_splitData(0), m_numFichier(0) + m_input(entree), m_simulationName(casTest), m_folderOutput(nameRun), m_splitData(0), m_numFichier(0), m_nbCpusRestarted(0) { //Affectation pointeur run m_run = m_input->getRun(); @@ -75,7 +75,7 @@ Output::Output(std::string casTest, std::string nameRun, XMLElement* element, st //Get if reduced output is on or off if (element->QueryBoolAttribute("reducedOutput", &m_reducedOutput) != XML_NO_ERROR) m_reducedOutput = false; - //Recuperation mode Ecriture + //Get writing mode error = element->QueryBoolAttribute("binary", &m_writeBinary); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("binary", fileName, __FILE__, __LINE__); @@ -106,14 +106,6 @@ Output::Output(std::string casTest, std::string nameRun, XMLElement* element, st mkdir(m_folderBoundaries.c_str(), S_IRWXU); mkdir(m_folderErrorsAndWarnings.c_str(), S_IRWXU); #endif - try { - //Sauvegarde des fichiers d entrees - IO::copieFichier(m_input->getMain(), m_simulationName, m_folderSavesInput); - IO::copieFichier(m_input->getMesh(), m_simulationName, m_folderSavesInput); - IO::copieFichier(m_input->getCI(), m_simulationName, m_folderSavesInput); - IO::copieFichier(m_input->getModel(), m_simulationName, m_folderSavesInput); - } - catch (ErrorECOGEN &) { throw; } } MPI_Barrier(MPI_COMM_WORLD); @@ -127,6 +119,35 @@ Output::Output(std::string casTest, std::string nameRun, XMLElement* element, st //*********************************************************************** +Output::Output(std::string nameRun, int fileNumberRestartMeshMapping, Input *input) : + m_folderOutput(nameRun), m_writeBinary(false), m_splitData(0), m_numFichier(fileNumberRestartMeshMapping) +{ + m_input = input; + m_run = m_input->getRun(); + + //Names communs + //------------ + m_infoCalcul = "infoCalcul.out"; + m_infoMesh = "infoMesh"; + m_treeStructure = "treeStructure"; + m_domainDecomposition = "domainDecomposition"; + m_fileNameResults = "result"; + m_filenameCollectionParaview = "collectionParaview"; + m_filenameCollectionVisIt = "collectionVisIt"; + + m_folderOutput = config.getWorkFolder() + "results/" + m_folderOutput + "/"; + m_folderSavesInput = m_folderOutput + "savesInput/"; + m_folderDatasets = m_folderOutput + "datasets/"; + m_folderInfoMesh = m_folderOutput + "infoMesh/"; + m_folderCuts = m_folderOutput + "cuts/"; + m_folderProbes = m_folderOutput + "probes/"; + m_folderGlobalQuantities = m_folderOutput + "globalQuantities/"; + m_folderBoundaries = m_folderOutput + "boundaries/"; + m_folderErrorsAndWarnings = m_folderOutput + "errorsAndWarnings/"; +} + +//*********************************************************************** + Output::Output(XMLElement* element) { //Printing precision (digits number) @@ -139,6 +160,19 @@ Output::~Output(){} //*********************************************************************** +void Output::copyInputFiles() const +{ + try { + IO::copyFile(m_input->getMain(), m_simulationName, m_folderSavesInput); + IO::copyFile(m_input->getMesh(), m_simulationName, m_folderSavesInput); + IO::copyFile(m_input->getCI(), m_simulationName, m_folderSavesInput); + IO::copyFile(m_input->getModel(), m_simulationName, m_folderSavesInput); + } + catch (ErrorInput &) { throw; } +} + +//*********************************************************************** + void Output::initializeOutput(const Cell& cell) { //Preparation de la cell de reference @@ -174,6 +208,20 @@ void Output::initializeOutput(std::vector* cellInterfacesLvl) //*********************************************************************** +void Output::initializeOutputMeshMapping(const Cell& cell) +{ + //Initialize reference cell + m_cellRef.allocate(m_run->m_addPhys); + for (int k = 0; k < m_run->m_numberPhases; k++) { m_cellRef.copyPhase(k, cell.getPhase(k)); } + m_cellRef.copyMixture(cell.getMixture()); + for (int k = 0; k < m_run->m_numberTransports; k++) { m_cellRef.setTransport(cell.getTransport(k).getValue(), k); } + + //Note that initializeSpecificOutput is not called to avoid to delete the content + //of the collection file of the mapped mesh. +} + +//*********************************************************************** + void Output::initializeOutputInfos() { try { @@ -265,14 +313,14 @@ void Output::readTree(Mesh* mesh, TypeMeshContainer* cellsLvl, TypeMeshCo //Update of persistent communications of cells lvl + 1 parallel.communicationsNumberGhostCells(lvl + 1); - parallel.updatePersistentCommunicationsLvlAMR(lvl + 1, mesh->getGeometrie()); + parallel.updatePersistentCommunicationsLvlAMR(lvl + 1, mesh->getProblemDimension()); } //Reconstruction of the arrays of cells and cell interfaces of lvl + 1 cellsLvl[lvl + 1].clear(); cellInterfacesLvl[lvl + 1].clear(); for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { cellsLvl[lvl][i]->buildLvlCellsAndLvlInternalCellInterfacesArrays(cellsLvl, cellInterfacesLvl); } - for (unsigned int i = 0; i < cellInterfacesLvl[lvl].size(); i++) { cellInterfacesLvl[lvl][i]->constructionTableauCellInterfacesExternesLvl(cellInterfacesLvl); } + for (unsigned int i = 0; i < cellInterfacesLvl[lvl].size(); i++) { cellInterfacesLvl[lvl][i]->constructionArrayExternalCellInterfacesLvl(cellInterfacesLvl); } } } nbCellsTotalAMR = 0; @@ -287,7 +335,7 @@ void Output::readTree(Mesh* mesh, TypeMeshContainer* cellsLvl, TypeMeshCo void Output::writeInfos() { if (m_run->m_iteration > 0) { - afficheInfoEcriture(); + printWritingInfo(); } saveInfos(); std::cout << "T" << m_run->m_numTest << " | Printing file number: " << m_numFichier << "... "; @@ -295,7 +343,19 @@ void Output::writeInfos() //*********************************************************************** -void Output::saveInfosMailles() const +void Output::writeProgress() +{ + double progress; + if (!m_run->m_timeControlIterations) progress = m_run->m_physicalTime / m_run->m_finalPhysicalTime * 100.; + else { + progress = double(m_run->m_iteration) / double(m_run->m_nbIte) * 100.; + } + std::cout << "T" << m_run->m_numTest << " | Iteration " << m_run->m_iteration << " / Timestep " << m_run->m_dt << " / Progress " << progress << "%" << std::endl; +} + +//*********************************************************************** + +void Output::saveInfoCells() const { try { std::ofstream fileStream; @@ -309,50 +369,50 @@ void Output::saveInfosMailles() const //*********************************************************************** -void Output::writeDataset(std::vector jeuDonnees, std::ofstream &fileStream, TypeData typeData) +void Output::writeDataset(std::vector dataset, std::ofstream &fileStream, TypeData typeData) { if (m_precision != 0) fileStream.precision(m_precision); if (!m_writeBinary) { - for (unsigned int k = 0; k < jeuDonnees.size(); k++) { fileStream << jeuDonnees[k] << " "; } + for (unsigned int k = 0; k < dataset.size(); k++) { fileStream << dataset[k] << " "; } } else { int donneeInt; float donneeFloat; double donneeDouble; char donneeChar; int taille; switch (typeData) { case DOUBLE: - taille = jeuDonnees.size()*sizeof(double); break; + taille = dataset.size()*sizeof(double); break; case FLOAT: - taille = jeuDonnees.size()*sizeof(float); break; + taille = dataset.size()*sizeof(float); break; case INT: - taille = jeuDonnees.size()*sizeof(int); break; + taille = dataset.size()*sizeof(int); break; case CHAR: - taille = jeuDonnees.size()*sizeof(char); break; + taille = dataset.size()*sizeof(char); break; } IO::writeb64(fileStream, taille); char* chaineTampon = new char[taille]; int index = 0; switch (typeData) { case DOUBLE: - for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - donneeDouble = static_cast(jeuDonnees[k]); - IO::ajouteAlaChaine(chaineTampon, index, donneeDouble); + for (unsigned int k = 0; k < dataset.size(); k++) { + donneeDouble = static_cast(dataset[k]); + IO::addToTheString(chaineTampon, index, donneeDouble); } break; case FLOAT: - for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - donneeFloat = static_cast(jeuDonnees[k]); - IO::ajouteAlaChaine(chaineTampon, index, donneeFloat); + for (unsigned int k = 0; k < dataset.size(); k++) { + donneeFloat = static_cast(dataset[k]); + IO::addToTheString(chaineTampon, index, donneeFloat); } break; case INT: - for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - donneeInt = static_cast(std::round(jeuDonnees[k])); - IO::ajouteAlaChaine(chaineTampon, index, donneeInt); + for (unsigned int k = 0; k < dataset.size(); k++) { + donneeInt = static_cast(std::round(dataset[k])); + IO::addToTheString(chaineTampon, index, donneeInt); } break; case CHAR: - for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - donneeChar = static_cast(jeuDonnees[k]); - IO::ajouteAlaChaine(chaineTampon, index, donneeChar); + for (unsigned int k = 0; k < dataset.size(); k++) { + donneeChar = static_cast(dataset[k]); + IO::addToTheString(chaineTampon, index, donneeChar); } break; } @@ -363,10 +423,10 @@ void Output::writeDataset(std::vector jeuDonnees, std::ofstream &fileStr //*********************************************************************** -void Output::getDataset(std::istringstream &data, std::vector& jeuDonnees) +void Output::getDataset(std::istringstream &data, std::vector& dataset) { if (!m_writeBinary) { - for (unsigned int k = 0; k < jeuDonnees.size(); k++) { data >> jeuDonnees[k]; } + for (unsigned int k = 0; k < dataset.size(); k++) { data >> dataset[k]; } } else { Errors::errorMessage("resuming on binary results file not available"); @@ -374,39 +434,39 @@ void Output::getDataset(std::istringstream &data, std::vector& jeuDonnee //int taille; //switch (typeData) { //case DOUBLE: - // taille = jeuDonnees.size() * sizeof(double); break; + // taille = dataset.size() * sizeof(double); break; //case FLOAT: - // taille = jeuDonnees.size() * sizeof(float); break; + // taille = dataset.size() * sizeof(float); break; //case INT: - // taille = jeuDonnees.size() * sizeof(int); break; + // taille = dataset.size() * sizeof(int); break; //case CHAR: - // taille = jeuDonnees.size() * sizeof(char); break; + // taille = dataset.size() * sizeof(char); break; //} //IO::writeb64(fileStream, taille); //char* chaineTampon = new char[taille]; int index = 0; //switch (typeData) { //case DOUBLE: - // for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - // donneeDouble = static_cast(jeuDonnees[k]); - // IO::ajouteAlaChaine(chaineTampon, index, donneeDouble); + // for (unsigned int k = 0; k < dataset.size(); k++) { + // donneeDouble = static_cast(dataset[k]); + // IO::addToTheString(chaineTampon, index, donneeDouble); // } // break; //case FLOAT: - // for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - // donneeFloat = static_cast(jeuDonnees[k]); - // IO::ajouteAlaChaine(chaineTampon, index, donneeFloat); + // for (unsigned int k = 0; k < dataset.size(); k++) { + // donneeFloat = static_cast(dataset[k]); + // IO::addToTheString(chaineTampon, index, donneeFloat); // } // break; //case INT: - // for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - // donneeInt = static_cast(jeuDonnees[k]); - // IO::ajouteAlaChaine(chaineTampon, index, donneeInt); + // for (unsigned int k = 0; k < dataset.size(); k++) { + // donneeInt = static_cast(dataset[k]); + // IO::addToTheString(chaineTampon, index, donneeInt); // } // break; //case CHAR: - // for (unsigned int k = 0; k < jeuDonnees.size(); k++) { - // donneeChar = static_cast(jeuDonnees[k]); - // IO::ajouteAlaChaine(chaineTampon, index, donneeChar); + // for (unsigned int k = 0; k < dataset.size(); k++) { + // donneeChar = static_cast(dataset[k]); + // IO::addToTheString(chaineTampon, index, donneeChar); // } // break; //} @@ -417,7 +477,7 @@ void Output::getDataset(std::istringstream &data, std::vector& jeuDonnee //*********************************************************************** -void Output::afficheInfoEcriture() const +void Output::printWritingInfo() const { std::cout << "T" << m_run->m_numTest << " | -------------------------------------------" << std::endl; std::cout << "T" << m_run->m_numTest << " | RESULTS FILE NUMBER: " << m_numFichier << ", ITERATION " << m_run->m_iteration << std::endl; @@ -510,6 +570,21 @@ void Output::readInfos() //*********************************************************************** +int Output::readNbCpu() +{ + std::fstream fileStream; + std::string nbCpusRestarted("0"); + try { + fileStream.open((m_folderOutput + m_infoCalcul).c_str(), std::ios::in); //Opening in reading mode + //Get number of CPU + std::getline(fileStream, nbCpusRestarted); + } + catch (ErrorECOGEN &) { fileStream.close(); throw; } + return std::stoi(nbCpusRestarted); +} + +//*********************************************************************** + std::string Output::createFilename(const char* name, int lvl, int proc, int numFichier) const { try { diff --git a/src/InputOutput/Output.h b/src/InputOutput/Output.h index d93efd43..0c924188 100644 --- a/src/InputOutput/Output.h +++ b/src/InputOutput/Output.h @@ -57,13 +57,19 @@ class Output Output(); //! \brief Main constructor for datasets used for OutputXML and OutputGNU according to outputMode - //! \param casTest Test case name (defined in "main.xml") + //! \param casTest Test case name (folder containing input xml files (main, mesh etc.) //! \param nameRun Folder to store results //! \param element XML outputMode element - //! \param fileName Full path to mainVX.xml of current test case + //! \param fileName Full path to main.xml of current test case //! \param entree Input pointer to access run pointer and its information Output(std::string casTest, std::string nameRun, tinyxml2::XMLElement* element, std::string fileName, Input* entree); + //! \brief Constructor for datasets used for OutputXML when mesh mapping restart option is activated + //! \param nameRun Folder to store results + //! \param fileNumberRestartMeshMapping Result file number of mapped mesh to be restarted from + //! \param input Input pointer to access run pointer and its information + Output(std::string nameRun, int fileNumberRestartMeshMapping, Input *input); + //! \brief Constructor for specific derived GNU outputs (boundary, probe, cut) //! \param element XML GNU output element to get stream precision Output(tinyxml2::XMLElement* element); @@ -73,26 +79,43 @@ class Output virtual void locateProbeInMesh(const TypeMeshContainer& /*cells*/, const int& /*nbCells*/, bool /*localSeeking*/ = false) { try { throw ErrorECOGEN("locateProbeInMesh not available for requested output format"); } catch (ErrorECOGEN&) { throw; } }; virtual Cell* locateProbeInAMRSubMesh(std::vector* /*cells*/, const int& /*nbCells*/) { try { throw ErrorECOGEN("locateProbeInMesh not available for requested output format"); } catch (ErrorECOGEN&) { throw; } return 0; }; + void copyInputFiles() const; void initializeOutput(const Cell& cell); - void initializeOutput(std::vector* cellInterfacesLvl); //!< Currently only used for OutputBoundaryMassflowGNU + void initializeOutput(std::vector* cellInterfacesLvl); //!* /*cellsLvl*/) { try { throw ErrorECOGEN("writeResults not available for requested output format"); } catch (ErrorECOGEN&) { throw; }}; virtual void writeResults(std::vector* /*cellInterfacesLvl*/) { try { throw ErrorECOGEN("writeResults not available for requested output format"); } catch (ErrorECOGEN&) { throw; } }; void printTree(Mesh* mesh, std::vector* cellsLvl, int m_restartAMRsaveFreq); virtual void writeInfos(); - void saveInfosMailles() const; + virtual void writeProgress(); + void saveInfoCells() const; virtual void initializeSpecificOutput() { try { throw ErrorECOGEN("initializeSpecificOutput not available for requested output format"); } catch (ErrorECOGEN&) { throw; } }; virtual void initializeSpecificOutput(std::vector* /*cellInterfacesLvl*/) { try { throw ErrorECOGEN("initializeSpecificOutput not available for requested output format"); } catch (ErrorECOGEN&) { throw; } }; //!< Currently only used for OutputBoundaryMassflowGNU + //! \brief Read the informations related to a previous simulation (number of cpu, time, file number, etc.) using infoCalcul file + //! \details Only the content since the file number to be restarted is kept (as the next files will overwrite the later content) void readInfos(); - virtual void readResults(Mesh* /*mesh*/, std::vector* /*cellsLvl*/) { try { throw ErrorECOGEN("readResutls not available for requested output format"); } catch (ErrorECOGEN&) { throw; } }; + //! \brief Read and return the number of cpu from the infoCalcul file of a performed simulation + int readNbCpu(); + //! \brief Read results of a previous simulation to restart from it + //! \details Available for all mesh types if the same number of cpus is used between both simulations + //! \param mesh Mesh object of the current simulation + //! \param cellsLvl Computationnal cells to be filled with results of previous simulation + virtual void readResults(Mesh* /*mesh*/, std::vector* /*cellsLvl*/) { try { throw ErrorECOGEN("readResults not available for requested output format"); } catch (ErrorECOGEN&) { throw; } }; + //! \brief Read results of a single partition of a previous simulation to restart from it + //! \details Available for GmshV2 only but allow the use of mesh mapping and/or use of a different number of cpu than the previous simulation + //! \param mesh Mesh object of a single partition of the previous simulation (either the same one as current or older one in case of mapping) + //! \param cellsLvl Computationnal cells to be filled with results of previous simulation + //! \param cpu Cpu number of the partition to be read + virtual void readResultsCpu(Mesh* /*mesh*/, std::vector* /*cellsLvl*/, int /*cpu*/) { try { throw ErrorECOGEN("readResultsCpu not available for requested output format"); } catch (ErrorECOGEN&) { throw; } }; void readDomainDecompostion(Mesh* mesh); void readTree(Mesh *mesh, TypeMeshContainer* cellsLvl, TypeMeshContainer* cellsLvlGhost, TypeMeshContainer* cellInterfacesLvl, const std::vector& addPhys, int& nbCellsTotalAMR); //Accessor - int getNumSortie() const { return m_numFichier; }; + int getNumFile() const { return m_numFichier; }; virtual double getNextTime() { try { throw ErrorECOGEN("getNextTime not available for requested output format"); } catch (ErrorECOGEN&) { throw; } return 0.; } virtual bool possesses() { try { throw ErrorECOGEN("possesses not available for requested output format"); } catch (ErrorECOGEN&) { throw; } return false; }; const std::string& getFolderOutput(){ return m_folderOutput;} @@ -102,12 +125,12 @@ class Output protected: //General data - void afficheInfoEcriture() const; + void printWritingInfo() const; void saveInfos() const; std::string createFilename(const char* name, int lvl = -1, int proc = -1, int numFichier = -1) const; - void writeDataset(std::vector jeuDonnees, std::ofstream& fileStream, TypeData typeData); - void getDataset(std::istringstream& data, std::vector& jeuDonnees); + void writeDataset(std::vector dataset, std::ofstream& fileStream, TypeData typeData); + void getDataset(std::istringstream& data, std::vector& dataset); Input* m_input; //!getFace()->getPos(), bound->getCellGauche()->getElement()->getPosition()); - double scalarProduct(Coord::scalarProduct(bound->getFace()->getNormal(), vFaceToElt)); - - // Switch normal if not in outward direction - if (scalarProduct > 0) { - nx = - nx; - ny = - ny; - nz = - nz; - } -} //*************************************************************** void OutputBoundaryAllGNU::writeResults(std::vector* cellInterfacesLvl) { - double rho, p, S, nx, ny, nz; + double rho, p, S, nx, ny, nz, mu; // Velocity extracted in the Riemann solver is defined in the face frame // and corresponds to the relative velocity in case of MRF. // The relative velocity is projected in the global frame to allow the reconstruction // of the absolute velocity with the rotationnal velocity if MRF is on. - Coord absVel; + // The boundary variables are defined as the primitive variables solution of + // the Riemann problem. + Coord absVel, shearStress; CellInterface *bound; // Avoid to create empty file for CPUs which have not any boundary faces @@ -105,30 +91,65 @@ void OutputBoundaryAllGNU::writeResults(std::vector* cellInterfa absVel.setXYZ(bound->getBoundData(VarBoundary::velU), bound->getBoundData(VarBoundary::velV), - bound->getBoundData(VarBoundary::velW)); + bound->getBoundData(VarBoundary::velW) + ); if (m_run->m_MRF != -1) { absVel.reverseProjection(bound->getFace()->getNormal(), bound->getFace()->getTangent(), - bound->getFace()->getBinormal()); - - absVel = m_run->m_sources[m_run->m_MRF]->computeAbsVelocity(absVel, bound->getCellGauche()->getPosition()); - + bound->getFace()->getBinormal() + ); + absVel = m_run->m_sources[m_run->m_MRF]->computeAbsVelocity(absVel, bound->getFace()->getPos()); absVel.localProjection(bound->getFace()->getNormal(), bound->getFace()->getTangent(), bound->getFace()->getBinormal()); } - p = bound->getBoundData(VarBoundary::p); - S = bound->getFace()->getSurface(); + // Face center position + double posX, posY, posZ; + posX = bound->getFace()->getPos().getX(); + posY = bound->getFace()->getPos().getY(); + posZ = bound->getFace()->getPos().getZ(); + + // Shear stress + mu = 0.; + if (numberPhases > 1) { + for (int k = 0; k < numberPhases; k++) { + mu += bound->getCellLeft()->getPhase(k)->getAlpha() * bound->getCellLeft()->getPhase(k)->getEos()->getMu(); + } + } + else { + mu = bound->getCellLeft()->getPhase(0)->getEos()->getMu(); + } + shearStress = bound->getCellLeft()->getVelocity(); + shearStress.localProjection(bound->getFace()->getNormal(), bound->getFace()->getTangent(), bound->getFace()->getBinormal()); + double distCellBound(bound->getFace()->distance(bound->getCellLeft()->getElement())); + shearStress.setXYZ( + mu / 3. * 4. * shearStress.getX() / distCellBound, + mu * shearStress.getY() / distCellBound, + mu * shearStress.getZ() / distCellBound + ); // It is assumed that the boundary is not moving + shearStress.reverseProjection(bound->getFace()->getNormal(), bound->getFace()->getTangent(), bound->getFace()->getBinormal()); + shearStress *= bound->getFace()->getSurface(); // Normal nx = bound->getFace()->getNormal().getX(); ny = bound->getFace()->getNormal().getY(); nz = bound->getFace()->getNormal().getZ(); - this->computeOutwardNormal(bound, nx, ny, nz); - fs << rho << " " + // Pressure force + p = bound->getBoundData(VarBoundary::p); + S = bound->getFace()->getSurface(); + double fpx, fpy, fpz; + fpx = p*S*nx; + fpy = p*S*ny; + fpz = p*S*nz; + + // Writing + fs << posX << " " << posY << " " << posZ << " " + << rho << " " << absVel.getX() << " " << absVel.getY() << " " << absVel.getZ() << " " - << p << " " << S << " " + << p << " " << S << " " + << fpx << " " << fpy << " " << fpz << " " + << shearStress.getX() << " " << shearStress.getY() << " " << shearStress.getZ() << " " << nx << " " << ny << " " << nz << std::endl; } diff --git a/src/InputOutput/OutputBoundaryAllGNU.h b/src/InputOutput/OutputBoundaryAllGNU.h index 54344658..02925543 100644 --- a/src/InputOutput/OutputBoundaryAllGNU.h +++ b/src/InputOutput/OutputBoundaryAllGNU.h @@ -39,8 +39,6 @@ class OutputBoundaryAllGNU : public OutputBoundaryGNU OutputBoundaryAllGNU(std::string casTest, std::string run, tinyxml2::XMLElement* element, std::string fileName, Input* entree); virtual ~OutputBoundaryAllGNU(); - void computeOutwardNormal(CellInterface* bound, double &nx, double &ny, double &nz); - // Virtual methods virtual void initializeSpecificOutputBound(); virtual void writeResults(std::vector* cellInterfacesLvl); diff --git a/src/InputOutput/OutputBoundaryFluxGNU.cpp b/src/InputOutput/OutputBoundaryFluxGNU.cpp index 23eeda3d..4557777c 100644 --- a/src/InputOutput/OutputBoundaryFluxGNU.cpp +++ b/src/InputOutput/OutputBoundaryFluxGNU.cpp @@ -73,7 +73,7 @@ void OutputBoundaryFluxGNU::initializeSpecificOutputBound() fs.close(); // Gnuplot script printing for visualization - ecritScriptGnuplot(m_fileNameResults); + writeScriptGnuplot(m_fileNameResults); } catch (ErrorECOGEN&) { throw; } } @@ -121,7 +121,7 @@ double OutputBoundaryFluxGNU::extractEnthalpyFlux(std::vector* c for (unsigned int c = 0; c < m_cellInterfaceIndexes.size(); c++) { // Absolute velocity is built on the specific region rotating or when whole geometry is rotating. if (m_run->m_sources[m_run->m_MRF]->getPhysicalEntity() - == cellInterfacesLvl[0][m_cellInterfaceIndexes[c]]->getCellGauche()->getElement()->getAppartenancePhysique() + == cellInterfacesLvl[0][m_cellInterfaceIndexes[c]]->getCellLeft()->getElement()->getAppartenancePhysique() || m_run->m_sources[m_run->m_MRF]->getPhysicalEntity() == 0) { m_flux += this->computeTotalEnthalpyFluxFaceMRF(cellInterfacesLvl[0][m_cellInterfaceIndexes[c]]); @@ -192,7 +192,7 @@ double OutputBoundaryFluxGNU::computeTotalEnthalpyFluxFaceMRF(CellInterface *bou bound->getFace()->getTangent(), bound->getFace()->getBinormal()); - absVel = m_run->m_sources[m_run->m_MRF]->computeAbsVelocity(absVel, bound->getCellGauche()->getPosition()); + absVel = m_run->m_sources[m_run->m_MRF]->computeAbsVelocity(absVel, bound->getCellLeft()->getPosition()); buff *= TB->eos[0]->computeTotalEnthalpy(bound->getBoundData(VarBoundary::rho), bound->getBoundData(VarBoundary::p), diff --git a/src/InputOutput/OutputBoundaryGNU.cpp b/src/InputOutput/OutputBoundaryGNU.cpp index 89e23388..98bab23b 100644 --- a/src/InputOutput/OutputBoundaryGNU.cpp +++ b/src/InputOutput/OutputBoundaryGNU.cpp @@ -78,8 +78,8 @@ OutputBoundaryGNU::~OutputBoundaryGNU() {} void OutputBoundaryGNU::initializeSpecificOutput(std::vector* cellInterfacesLvl) { try { - // Set time - m_nextAcq = 0.; + // Set time (zero if initial run and restart if restart activated) + m_nextAcq = m_run->m_physicalTime; // cellInterfaceNumbers keeps indexes of cellInterfaces // which are on the recorded boundary (avoid to loop on all diff --git a/src/InputOutput/OutputCutGNU.cpp b/src/InputOutput/OutputCutGNU.cpp index fbca72ef..ad551cf2 100644 --- a/src/InputOutput/OutputCutGNU.cpp +++ b/src/InputOutput/OutputCutGNU.cpp @@ -44,7 +44,7 @@ OutputCutGNU::OutputCutGNU(std::string casTest, std::string run, XMLElement* ele m_simulationName = casTest; if (type == LINE) { m_fileNameResults = "cut1D"; } else if (type == PLAN) { m_fileNameResults = "cut2D"; } - else { throw ErrorECOGEN("OutputCutGNU::OutputCutGNU : type de cut inconnu", __FILE__, __LINE__); } + else { throw ErrorECOGEN("OutputCutGNU::OutputCutGNU : type de cut unknown", __FILE__, __LINE__); } m_fileNameVisu = "plot_" + m_fileNameResults + ".gnu"; m_folderOutput = config.getWorkFolder() + "results/" + run + "/cuts/"; m_splitData = 0; @@ -56,9 +56,9 @@ OutputCutGNU::OutputCutGNU(std::string casTest, std::string run, XMLElement* ele XMLError error; double donnee; - Coord vertex, vecteur; + Coord vertex, vector; - //Recuperation donnees de cut 1D + //Get data of 1D cut sousElement = element->FirstChildElement("vertex"); if (sousElement == NULL) throw ErrorXMLElement("vertex", fileName, __FILE__, __LINE__); error = sousElement->QueryDoubleAttribute("x", &donnee); vertex.setX(donnee); @@ -69,18 +69,18 @@ OutputCutGNU::OutputCutGNU(std::string casTest, std::string run, XMLElement* ele if (error != XML_NO_ERROR) throw ErrorXMLAttribut("z", fileName, __FILE__, __LINE__); if (type == LINE) sousElement = element->FirstChildElement("vecDir"); else if (type == PLAN) { sousElement = element->FirstChildElement("vecNormal"); } - else { throw ErrorECOGEN("OutputCutGNU::OutputCutGNU : type de cut inconnu", __FILE__, __LINE__); } + else { throw ErrorECOGEN("OutputCutGNU::OutputCutGNU : type de cut unknown", __FILE__, __LINE__); } if (sousElement == NULL) throw ErrorXMLElement("vecDir ou vecNormal", fileName, __FILE__, __LINE__); - error = sousElement->QueryDoubleAttribute("x", &donnee); vecteur.setX(donnee); + error = sousElement->QueryDoubleAttribute("x", &donnee); vector.setX(donnee); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("x", fileName, __FILE__, __LINE__); - error = sousElement->QueryDoubleAttribute("y", &donnee); vecteur.setY(donnee); + error = sousElement->QueryDoubleAttribute("y", &donnee); vector.setY(donnee); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("y", fileName, __FILE__, __LINE__); - error = sousElement->QueryDoubleAttribute("z", &donnee); vecteur.setZ(donnee); + error = sousElement->QueryDoubleAttribute("z", &donnee); vector.setZ(donnee); if (error != XML_NO_ERROR) throw ErrorXMLAttribut("z", fileName, __FILE__, __LINE__); - if (type == LINE) { m_objet = new GOLine(vertex, vecteur); } - else if (type == PLAN) { m_objet = new GOPlan(vertex, vecteur); } - else { throw ErrorECOGEN("OutputCutGNU::OutputCutGNU : type de cut inconnu", __FILE__, __LINE__); } + if (type == LINE) { m_objet = new GOLine(vertex, vector); } + else if (type == PLAN) { m_objet = new GOPlan(vertex, vector); } + else { throw ErrorECOGEN("OutputCutGNU::OutputCutGNU : type de cut unknown", __FILE__, __LINE__); } } catch (ErrorECOGEN &) { throw; } @@ -108,9 +108,9 @@ void OutputCutGNU::writeResults(Mesh *mesh, std::vector* cellsLvl) try { //Create Gnuplot file to plot results if (rankCpu == 0) { - if (m_objet->getType() == LINE) { ecritScriptGnuplot(1); } - else if (m_objet->getType() == PLAN) { ecritScriptGnuplot(2); } - else { throw ErrorECOGEN("OutputCutGNU::writeResultsSpecifique : type de cut inconnu", __FILE__, __LINE__); } + if (m_objet->getType() == LINE) { writeScriptGnuplot(1); } + else if (m_objet->getType() == PLAN) { writeScriptGnuplot(2); } + else { throw ErrorECOGEN("OutputCutGNU::writeResultsSpecifique : type de cut unknown", __FILE__, __LINE__); } } } catch (ErrorECOGEN &) { throw; } diff --git a/src/InputOutput/OutputGNU.cpp b/src/InputOutput/OutputGNU.cpp index fe52aad0..c2a6fff9 100644 --- a/src/InputOutput/OutputGNU.cpp +++ b/src/InputOutput/OutputGNU.cpp @@ -66,12 +66,12 @@ void OutputGNU::writeResults(Mesh *mesh, std::vector* cellsLvl) fileStream.open(file.c_str()); if (!fileStream) { throw ErrorECOGEN("Impossible d ouvrir le file " + file, __FILE__, __LINE__); } if (m_precision != 0) fileStream.precision(m_precision); - mesh->writeResultsGnuplot(cellsLvl, fileStream); + mesh->writeResultsGnuplot(cellsLvl, fileStream, nullptr, m_run->m_recordPsat); fileStream << std::endl; fileStream.close(); //Creation du file gnuplot pour visualization des resultats - if (rankCpu == 0) ecritScriptGnuplot(mesh->getGeometrie()); + if (rankCpu == 0) writeScriptGnuplot(mesh->getProblemDimension()); } catch (ErrorECOGEN &) { throw; } m_numFichier++; @@ -79,7 +79,7 @@ void OutputGNU::writeResults(Mesh *mesh, std::vector* cellsLvl) //*********************************************************************** -void OutputGNU::ecritScriptGnuplot(const int& dim) +void OutputGNU::writeScriptGnuplot(const int& dim) { try { std::ofstream fileStream; @@ -109,7 +109,7 @@ void OutputGNU::ecritScriptGnuplot(const int& dim) fileStream << "show contour" << std::endl; //fileStream << "set view 180,180,1,1" << endl; } - else if (dim == 3) { throw ErrorECOGEN("OutputGNU::ecritScriptGnuplot : print script gnuplot non prevu en 3D", __FILE__, __LINE__); } + else if (dim == 3) { throw ErrorECOGEN("OutputGNU::writeScriptGnuplot : print script gnuplot non prevu en 3D", __FILE__, __LINE__); } //1) Variables des phases //----------------------- @@ -117,50 +117,57 @@ void OutputGNU::ecritScriptGnuplot(const int& dim) { //Variables scalars for (int var = 1; var <= m_cellRef.getPhase(phase)->getNumberScalars(); var++) { - fileStream << "set title '" << m_cellRef.getPhase(phase)->returnNameScalar(var); - if (m_cellRef.getPhase(phase)->getEos() != nullptr) { fileStream << "_" << m_cellRef.getPhase(phase)->getEos()->getName(); } + fileStream << "set title '" << formatVarNameStyle(m_cellRef.getPhase(phase)->returnNameScalar(var)); + if (m_cellRef.getPhase(phase)->getEos() != nullptr) { fileStream << "\\_" << formatVarNameStyle(m_cellRef.getPhase(phase)->getEos()->getName()); } fileStream << "'" << std::endl; printBlocGnuplot(fileStream, index, dim); - } //Fin var scalar + } //End var scalar //Variables vectorielles (u) for (int var = 1; var <= m_cellRef.getPhase(phase)->getNumberVectors(); var++) { - fileStream << "set title '" << m_cellRef.getPhase(phase)->returnNameVector(var); - if (m_cellRef.getPhase(phase)->getEos() != nullptr) { fileStream << "_" << m_cellRef.getPhase(phase)->getEos()->getName(); } + fileStream << "set title '" << formatVarNameStyle(m_cellRef.getPhase(phase)->returnNameVector(var)); + if (m_cellRef.getPhase(phase)->getEos() != nullptr) { fileStream << "\\_" << formatVarNameStyle(m_cellRef.getPhase(phase)->getEos()->getName()); } fileStream << "'" << std::endl; printBlocGnuplot(fileStream, index, dim); - } //Fin var vectorielle - } //Fin phase + } //End var vectorielle + } //End phase //2) Variables mixture //-------------------- //Variables scalars for (int var = 1; var <= m_cellRef.getMixture()->getNumberScalars(); var++) { - fileStream << "set title '" << m_cellRef.getMixture()->returnNameScalar(var) << "'" << std::endl; + fileStream << "set title '" << formatVarNameStyle(m_cellRef.getMixture()->returnNameScalar(var)) << "'" << std::endl; printBlocGnuplot(fileStream, index, dim); - } //Fin var scalar + } //End var scalar //Variables vectorielle for (int var = 1; var <= m_cellRef.getMixture()->getNumberVectors(); var++) { - fileStream << "set title '" << m_cellRef.getMixture()->returnNameVector(var) << "'" << std::endl; + fileStream << "set title '" << formatVarNameStyle(m_cellRef.getMixture()->returnNameVector(var)) << "'" << std::endl; printBlocGnuplot(fileStream, index, dim); - } //Fin var vectorielle + } //End var vectorielle //3) Variables transports //----------------------- for (int var = 1; var <= m_cellRef.getNumberTransports(); var++) { - fileStream << "set title 'Transport" << var << "'" << std::endl; + fileStream << "set title 'Transport\\_" << var << "'" << std::endl; printBlocGnuplot(fileStream, index, dim); - } //Fin var scalar + } //End var scalar - //4) Ecriture niveaux AMR - //----------------------- - fileStream << "set title 'Niveau AMR'" << std::endl; + //4) Write AMR levels + //------------------- + fileStream << "set title 'AMR level'" << std::endl; printBlocGnuplot(fileStream, index, dim); - //5) Ecriture variable detection gradients - //---------------------------------------- + //5) Write variable detection gradients + //------------------------------------- fileStream << "set title 'Xi'" << std::endl; printBlocGnuplot(fileStream, index, dim); + //6) Writing saturation pressure (specific recording) + //--------------------------------------------------- + if (m_run->m_recordPsat) { + fileStream << "set title 'Psat'" << std::endl; + printBlocGnuplot(fileStream, index, dim); + } + fileStream.close(); } @@ -169,7 +176,7 @@ void OutputGNU::ecritScriptGnuplot(const int& dim) //*********************************************************************** -void OutputGNU::ecritScriptGnuplot(const std::string& varName) +void OutputGNU::writeScriptGnuplot(const std::string& varName) { try { std::ofstream fileStream; @@ -181,7 +188,7 @@ void OutputGNU::ecritScriptGnuplot(const std::string& varName) fileStream << std::endl; fileStream << "set xlabel 't (s)'" << std::endl; - fileStream << "set title '" << varName << "'" << std::endl; + fileStream << "set title '" << formatVarNameStyle(varName) << "'" << std::endl; int index(2); int dim(0); @@ -227,7 +234,7 @@ std::string OutputGNU::createFilenameGNU(const char* name, int lvl, int proc, in std::stringstream num; if (m_splitData) { - throw ErrorECOGEN("OutputGNU::createFilenameGNU : donnees Separees non prevu", __FILE__, __LINE__); + throw ErrorECOGEN("OutputGNU::createFilenameGNU : separated data not planned", __FILE__, __LINE__); return 0; } num << name; @@ -237,7 +244,7 @@ std::string OutputGNU::createFilenameGNU(const char* name, int lvl, int proc, in if (m_writeBinary) { //num << "B64"; - throw ErrorECOGEN("OutputGNU::createFilenameGNU : donnees binaires non prevu", __FILE__, __LINE__); + throw ErrorECOGEN("OutputGNU::createFilenameGNU : binary data not planned", __FILE__, __LINE__); return 0; } //Gestion cpu @@ -246,7 +253,7 @@ std::string OutputGNU::createFilenameGNU(const char* name, int lvl, int proc, in if (lvl != -1) { //num << "_AMR" << lvl; - throw ErrorECOGEN("OutputGNU::createFilenameGNU : donnees AMR par niveau non prevu", __FILE__, __LINE__); + throw ErrorECOGEN("OutputGNU::createFilenameGNU : AMR data by level not planned", __FILE__, __LINE__); return 0; } //Gestion number de file resultat @@ -258,4 +265,22 @@ std::string OutputGNU::createFilenameGNU(const char* name, int lvl, int proc, in catch (ErrorECOGEN &) { throw; } } +//*********************************************************************** + +std::string OutputGNU::formatVarNameStyle(std::string const& varNameToFormat) const +{ + // Replace all occurrences of an underscore character in a given string with a backslash followed by an underscore + std::string str = varNameToFormat; + size_t pos = 0; + while ((pos = str.find("_", pos)) != std::string::npos) { + str.replace(pos, 1, "\\_"); + pos += 2; // Move past the replaced "\\_" + } + // Remove extension ".xml" for EOS file + if (str.length() >= 4 && str.substr(str.length() - 4) == ".xml") { + str = str.substr(0, str.length() - 4); // Remove the extension ".xml" + } + return str; +} + //*********************************************************************** \ No newline at end of file diff --git a/src/InputOutput/OutputGNU.h b/src/InputOutput/OutputGNU.h index d0b6e9e3..274b7850 100644 --- a/src/InputOutput/OutputGNU.h +++ b/src/InputOutput/OutputGNU.h @@ -43,7 +43,7 @@ class OutputGNU : public Output //! \param casTest Test case name (defined in "main.xml") //! \param nameRun Folder to store results //! \param element XML outputMode element - //! \param fileName Full path to mainVX.xml of current test case + //! \param fileName Full path to main.xml of current test case //! \param entree Input pointer to access run pointer and its information OutputGNU(std::string casTest, std::string run, tinyxml2::XMLElement* element, std::string fileName, Input *entree); @@ -60,12 +60,14 @@ class OutputGNU : public Output protected: - void ecritScriptGnuplot(const int& dim); - void ecritScriptGnuplot(const std::string& varName); + void writeScriptGnuplot(const int& dim); + void writeScriptGnuplot(const std::string& varName); std::string createFilenameGNU(const char* name, int lvl = -1, int proc = -1, int numFichier = -1, std::string nameVariable = "defaut") const; void printBlocGnuplot(std::ofstream& fileStream, int& index, const int& dim); + std::string formatVarNameStyle(std::string const& strToFormat) const; + std::string m_fileNameVisu; std::string m_folderScriptGnuplot; }; diff --git a/src/InputOutput/OutputGlobalGNU.cpp b/src/InputOutput/OutputGlobalGNU.cpp index bdbdf9ee..7277c8bb 100644 --- a/src/InputOutput/OutputGlobalGNU.cpp +++ b/src/InputOutput/OutputGlobalGNU.cpp @@ -80,7 +80,7 @@ void OutputGlobalGNU::initializeSpecificOutput() fileStream.close(); // Gnuplot script printing for visualization - ecritScriptGnuplot(m_fileNameResults); + writeScriptGnuplot(m_fileNameResults); } catch (ErrorECOGEN&) { throw; } } diff --git a/src/InputOutput/OutputProbeGNU.cpp b/src/InputOutput/OutputProbeGNU.cpp index d8484d59..41d4a1c5 100644 --- a/src/InputOutput/OutputProbeGNU.cpp +++ b/src/InputOutput/OutputProbeGNU.cpp @@ -95,7 +95,7 @@ void OutputProbeGNU::locateProbeInMesh(const TypeMeshContainer& cells, co double minimumDistance(1.e12), distance; for (int i = 0; i < nbCells; i++) { distance = m_objet->distancePoint(cells[i]->getPosition()); - if (distance < minimumDistance) { + if (distance < minimumDistance && !cells[i]->getWall()) { minimumDistance = distance; m_cell = cells[i]; if (distance <= cells[i]->getElement()->getLCFL()) break; @@ -153,7 +153,7 @@ Cell* OutputProbeGNU::locateProbeInAMRSubMesh(std::vector* cells, const i void OutputProbeGNU::initializeSpecificOutput() { //settings - m_nextAcq = 0.; + m_nextAcq = m_run->m_physicalTime; //Locate probe in mesh locateProbeInMesh(m_run->m_cellsLvl[0], m_run->m_mesh->getNumberCells()); @@ -173,7 +173,7 @@ void OutputProbeGNU::initializeSpecificOutput() fileStream.close(); //Gnuplot script printing for visualization - ecritScriptGnuplot(0); + writeScriptGnuplot(0); } } catch (ErrorECOGEN &) { throw; } diff --git a/src/InputOutput/OutputProbeGNU.h b/src/InputOutput/OutputProbeGNU.h index 73660cda..213dd3b9 100644 --- a/src/InputOutput/OutputProbeGNU.h +++ b/src/InputOutput/OutputProbeGNU.h @@ -48,7 +48,7 @@ class OutputProbeGNU : public OutputGNU //! //! //! \param casTest Folder name of test case input files - //! \param run Resutls folder name (defined in 'mainVX.xml') + //! \param run Resutls folder name (defined in 'main.xml') //! \param element XML element to read for probe data //! \param fileName string name of readed XML file //! \param entree Pointer to corresponding run entry object @@ -73,7 +73,7 @@ class OutputProbeGNU : public OutputGNU double m_nextAcq; //!< Next acquisition time Cell* m_cell; //!< Pointer to the level 0 cell containing the probe GeometricObject *m_objet; //!< To store position - bool* m_possessesProbe; //!< True if the CPU possesses probe + bool* m_possessesProbe; //!< True if the CPU possesses probe }; #endif //OUTPUTPROBEGNU_H \ No newline at end of file diff --git a/src/InputOutput/OutputXML.cpp b/src/InputOutput/OutputXML.cpp index 582940e7..c2d44ec0 100644 --- a/src/InputOutput/OutputXML.cpp +++ b/src/InputOutput/OutputXML.cpp @@ -43,6 +43,14 @@ OutputXML::OutputXML(std::string casTest, std::string run, XMLElement* element, //*********************************************************************** +OutputXML::OutputXML(std::string run, int fileNumberRestartMeshMapping, Input *input) : + Output(run, fileNumberRestartMeshMapping, input) +{ + m_type = TypeOutput::XML; +} + +//*********************************************************************** + OutputXML::~OutputXML(){} //*********************************************************************** @@ -79,10 +87,10 @@ void OutputXML::initializeSpecificOutput() void OutputXML::writeResults(Mesh* mesh, std::vector* cellsLvl) { try { - //Ecriture des fichiers de sortie au format XML + //Write output files with XML format writeResultsXML(mesh, cellsLvl); - //Ajout du file Collection pour grouper les niveaux, les temps, les CPU, etc. - if (rankCpu == 0) { ecritCollectionXML(mesh); } + //Add du file Collection pour grouper les niveaux, les temps, les CPU, etc. + if (rankCpu == 0) { writeCollectionXML(mesh); } } catch (ErrorECOGEN &) { throw; } // Renvoi au niveau suivant m_numFichier++; @@ -129,15 +137,61 @@ void OutputXML::readResults(Mesh *mesh, std::vector* cellsLvl) //3) Reading fluid data //--------------------- - ReadDonneesPhysiquesXML(mesh, cellsLvl, nodeCellData, fileName.str()); + ReadPhysicalDataXML(mesh, cellsLvl, nodeCellData, fileName.str()); m_numFichier++; - } //Fin try + } //End try catch (ErrorECOGEN &) { throw; } } //*********************************************************************** -void OutputXML::ReadDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLvl, XMLElement* nodeCellData, std::string fileName) +void OutputXML::readResultsCpu(Mesh *mesh, std::vector* cellsLvl, int cpu) +{ + try { + //1) Parsing XML file + //------------------- + std::stringstream fileName(m_folderDatasets + createFilenameXML(m_fileNameResults.c_str(), mesh, cpu, m_numFichier)); + XMLDocument xmlMain; + XMLError error(xmlMain.LoadFile(fileName.str().c_str())); //Le file est parse ici + if (error != XML_SUCCESS) throw ErrorXML(fileName.str(), __FILE__, __LINE__); + + //2) Entering XML file according to mesh + //-------------------------------------- + XMLElement* nodeVTK, *nodeGrid, *nodePiece, *nodeCellData; + nodeVTK = xmlMain.FirstChildElement("VTKFile"); + if (nodeVTK == NULL) throw ErrorXMLRacine("VTKFile", fileName.str(), __FILE__, __LINE__); + //Depend on mesh + switch (mesh->getType()) { + case REC: + nodeGrid = nodeVTK->FirstChildElement("RectilinearGrid"); + if (nodeGrid == NULL) throw ErrorXMLRacine("RectilinearGrid", fileName.str(), __FILE__, __LINE__); + break; + case UNS: + nodeGrid = nodeVTK->FirstChildElement("UnstructuredGrid"); + if (nodeGrid == NULL) throw ErrorXMLRacine("UnstructuredGrid", fileName.str(), __FILE__, __LINE__); + break; + case AMR: + nodeGrid = nodeVTK->FirstChildElement("UnstructuredGrid"); + if (nodeGrid == NULL) throw ErrorXMLRacine("UnstructuredGrid", fileName.str(), __FILE__, __LINE__); + break; + default: + throw ErrorECOGEN("Output::readResults: unknown mesh type", __FILE__, __LINE__); break; + } + nodePiece = nodeGrid->FirstChildElement("Piece"); + if (nodePiece == NULL) throw ErrorXMLRacine("Piece", fileName.str(), __FILE__, __LINE__); + nodeCellData = nodePiece->FirstChildElement("CellData"); + if (nodeCellData == NULL) throw ErrorXMLRacine("CellData", fileName.str(), __FILE__, __LINE__); + + //3) Reading fluid data + //--------------------- + ReadPhysicalDataXML(mesh, cellsLvl, nodeCellData, fileName.str()); + } //End try + catch (ErrorECOGEN &) { throw; } +} + +//*********************************************************************** + +void OutputXML::ReadPhysicalDataXML(Mesh *mesh, std::vector* cellsLvl, XMLElement* nodeCellData, std::string fileName) { int totalCellsLvlSize(0); for (int lvl = 0; lvl <= mesh->getLvlMax(); lvl++) { @@ -170,7 +224,7 @@ void OutputXML::ReadDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLvl mesh->setDataSet(vectorDataSet, cellsLvl, -var, phase); nodeData = nodeData->NextSiblingElement("DataArray"); } - } //Fin phase + } //End phase //2) Reading mixture data //----------------------- @@ -190,7 +244,7 @@ void OutputXML::ReadDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLvl mesh->setDataSet(vectorDataSet, cellsLvl, -var, mixture); nodeData = nodeData->NextSiblingElement("DataArray"); } - } //Fin mixture + } //End mixture //3) Transported data //------------------- @@ -211,7 +265,7 @@ void OutputXML::ReadDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLvl mesh->setDataSet(scalarDataSet, cellsLvl, 1, xi); nodeData = nodeData->NextSiblingElement("DataArray"); } - } //Fin try + } //End try catch (ErrorECOGEN &) { throw; } } @@ -226,7 +280,7 @@ std::string OutputXML::createFilenameXML(const char* name, Mesh *mesh, int proc, try { //FP//TODO Donnees separees a faire... - if (m_splitData) { throw ErrorECOGEN("OutputXML::createFilenameXML : donnees Separees non prevu", __FILE__, __LINE__); } + if (m_splitData) { throw ErrorECOGEN("OutputXML::createFilenameXML : separated data not done", __FILE__, __LINE__); } num << name; //Gestion nameVariable if ((nameVariable != "defaut") && (nameVariable != "visit")) num << "_" << nameVariable << "_"; @@ -252,7 +306,7 @@ std::string OutputXML::createFilenameXML(const char* name, Mesh *mesh, int proc, num << "vtu"; break; //num << "vtp"; break; default: - throw ErrorECOGEN("OutputXML::createFilenameXML : type mesh inconnu", __FILE__, __LINE__); + throw ErrorECOGEN("OutputXML::createFilenameXML : type mesh unknown", __FILE__, __LINE__); } } } @@ -269,52 +323,52 @@ void OutputXML::writeResultsXML(Mesh* mesh, std::vector* cellsLvl) try { - //1) Ouverture / creation file + //1) Opening and creation of file //------------------------------- std::string file = m_folderDatasets + createFilenameXML(m_fileNameResults.c_str(), mesh, rankCpu, m_numFichier); fileStream.open(file.c_str(), std::ios::trunc); if (!fileStream) { throw ErrorECOGEN("Impossible d ouvrir le file " + file, __FILE__, __LINE__); } fileStream << "" << std::endl; - //2) Ecriture du mesh - //----------------------- + //2) Write mesh + //------------- switch (mesh->getType()) { case REC: - ecritMeshRectilinearXML(mesh, fileStream); break; + writeMeshRectilinearXML(mesh, fileStream); break; case UNS: - ecritMeshUnstructuredXML(mesh, cellsLvl, fileStream); break; + writeMeshUnstructuredXML(mesh, cellsLvl, fileStream); break; case AMR: - ecritMeshUnstructuredXML(mesh, cellsLvl, fileStream); break; + writeMeshUnstructuredXML(mesh, cellsLvl, fileStream); break; default: - throw ErrorECOGEN("Output::writeResultsXML : type mesh inconnu", __FILE__, __LINE__); break; + throw ErrorECOGEN("Output::writeResultsXML : type mesh unknown", __FILE__, __LINE__); break; } - //3) Ecriture des donnees phases fluids - //------------------------------------- - ecritDonneesPhysiquesXML(mesh, cellsLvl, fileStream); + //3) Write fluid phase data + //------------------------- + writePhysicalDataXML(mesh, cellsLvl, fileStream); - //4) Finalisation file - //----------------------- + //4) Finalyse file + //---------------- switch (mesh->getType()) { case REC: - ecritFinFichierRectilinearXML(fileStream); break; + writeFinFichierRectilinearXML(fileStream); break; case UNS: - ecritFinFichierUnstructuredXML(fileStream); break; + writeFinFichierUnstructuredXML(fileStream); break; case AMR: - ecritFinFichierUnstructuredXML(fileStream); break; - //ecritFinFichierPolyDataXML(fileStream); break; + writeFinFichierUnstructuredXML(fileStream); break; + //writeFinFichierPolyDataXML(fileStream); break; default: - throw ErrorECOGEN("Output::writeResultsXML : type mesh inconnu", __FILE__, __LINE__); break; + throw ErrorECOGEN("Output::writeResultsXML : type mesh unknown", __FILE__, __LINE__); break; } fileStream.close(); - } //Fin try + } //End try catch (ErrorECOGEN &) { throw; } } //*********************************************************************** -void OutputXML::ecritCollectionXML(Mesh *mesh) +void OutputXML::writeCollectionXML(Mesh *mesh) { try { std::ofstream fileStream; @@ -361,9 +415,9 @@ void OutputXML::ecritCollectionXML(Mesh *mesh) //*********************************************************************** -void OutputXML::ecritDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel) +void OutputXML::writePhysicalDataXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel) { - std::vector jeuDonnees; + std::vector dataset; std::string prefix; if (parallel) { prefix = "P"; } @@ -374,8 +428,8 @@ void OutputXML::ecritDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLv fileStream << " <" << prefix << "CellData>" << std::endl; - //1) Ecriture des variables des phases - //------------------------------------ + //1) Write des variables des phases + //--------------------------------- for (int phase = 0; phase < m_run->getNumberPhases(); phase++) //For complete output //for (int phase = 0; phase < 1; phase++) //For reduced output { @@ -384,21 +438,21 @@ void OutputXML::ecritDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLv eosName = m_cellRef.getPhase(phase)->getEos()->getName(); eosName.erase(eosName.end()-4, eosName.end()); } - //Ecriture des variables scalars + //Write des variables scalars for (int var = 1; var <= m_cellRef.getPhase(phase)->getNumberScalars(); var++) { fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"F" << phase << "_" << m_cellRef.getPhase(phase)->returnNameScalar(var); if (m_cellRef.getPhase(phase)->getEos() != nullptr) { fileStream << "_" << eosName; } fileStream << "\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->recupereDonnees(cellsLvl, jeuDonnees, var, phase); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->getData(cellsLvl, dataset, var, phase); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "\"/>" << std::endl; } } - //Ecriture des variables vectorielles + //Write des variables vectorielles for (int var = 1; var <= m_cellRef.getPhase(phase)->getNumberVectors(); var++) { fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"F" << phase << "_" << m_cellRef.getPhase(phase)->returnNameVector(var); @@ -406,87 +460,87 @@ void OutputXML::ecritDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLv fileStream << "\" NumberOfComponents=\"3\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->recupereDonnees(cellsLvl, jeuDonnees, -var, phase); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->getData(cellsLvl, dataset, -var, phase); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "\"/>" << std::endl; } } - } //Fin phase + } //End phase - //2) Ecriture des donnees mixture - //------------------------------- + //2) Write mixture data + //--------------------- if (m_run->m_numberPhases > 1) { int mixture = -1; - //Ecriture des variables scalars du mixture + //Write des variables scalars du mixture for (int var = 1; var <= m_cellRef.getMixture()->getNumberScalars(); var++) { fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"" << m_cellRef.getMixture()->returnNameScalar(var) << "\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->recupereDonnees(cellsLvl, jeuDonnees, var, mixture); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->getData(cellsLvl, dataset, var, mixture); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "\"/>" << std::endl; } } - //Ecriture des variables vectorielles du mixture + //Write des variables vectorielles du mixture for (int var = 1; var <= m_cellRef.getMixture()->getNumberVectors(); var++) { fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"" << m_cellRef.getMixture()->returnNameVector(var) << "\" NumberOfComponents=\"3\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->recupereDonnees(cellsLvl, jeuDonnees, -var, mixture); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->getData(cellsLvl, dataset, -var, mixture); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "\"/>" << std::endl; } } - } //Fin mixture + } //End mixture - //3) Ecriture des transports et autres... - //--------------------------------------- + //3) Write of transports and others... + //------------------------------------ int transport = -2; //For complete output for (int var = 1; var <= m_run->m_numberTransports; var++) { fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"T" << var << "\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->recupereDonnees(cellsLvl, jeuDonnees, var, transport); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->getData(cellsLvl, dataset, var, transport); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "\"/>" << std::endl; } } - //4) Ecriture indicateur xi - //------------------------- + //4) Write indicateur xi + //---------------------- if (mesh->getType() == AMR) { //For complete output int xi = -3; fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"Xi\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->recupereDonnees(cellsLvl, jeuDonnees, 1, xi); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->getData(cellsLvl, dataset, 1, xi); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "\"/>" << std::endl; } } - //5) Ecriture gradient rho - //------------------------ + //5) Write gradient rho + //--------------------- int gradRho = -4; fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"gradRho\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->recupereDonnees(cellsLvl, jeuDonnees, 1, gradRho); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->getData(cellsLvl, dataset, 1, gradRho); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } @@ -498,53 +552,81 @@ void OutputXML::ecritDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLv fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"absoluteVelocityMRF\" NumberOfComponents=\"3\""; if (!parallel) { fileStream << " format=\"" << format << "\">" << std::endl; - mesh->extractAbsVelocityMRF(cellsLvl, jeuDonnees, m_run->m_sources[m_run->m_MRF]); - this->writeDataset(jeuDonnees, fileStream, DOUBLE); + mesh->extractAbsVelocityMRF(cellsLvl, dataset, m_run->m_sources[m_run->m_MRF]); + this->writeDataset(dataset, fileStream, DOUBLE); + fileStream << std::endl; + fileStream << " " << std::endl; + } + else { fileStream << "\"/>" << std::endl; } + } + + //7) Cells' reference length + //-------------------------- + if (m_run->m_extractRefLength) { + fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"Reference_length\""; + if (!parallel) { + fileStream << " format=\"" << format << "\">" << std::endl; + mesh->extractReferenceLength(cellsLvl, dataset); + this->writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "\"/>" << std::endl; } } - //7) CPU rank + //8) CPU rank //----------- // if (mesh->getType() == AMR) { //For complete output // int CPUrank = -5; // fileStream << " <" << prefix << "DataArray type=\"Int32\" Name=\"CPUrank\""; // if (!parallel) { // fileStream << " format=\"" << format << "\">" << std::endl; - // mesh->recupereDonnees(cellsLvl, jeuDonnees, 1, CPUrank); - // this->writeDataset(jeuDonnees, fileStream, INT); + // mesh->getData(cellsLvl, dataset, 1, CPUrank); + // this->writeDataset(dataset, fileStream, INT); // fileStream << std::endl; // fileStream << " " << std::endl; // } // else { fileStream << "\"/>" << std::endl; } // } - //8) Morton index + //9) Morton index //--------------- // if (mesh->getType() == AMR) { //For complete output // int MortonIndex = -6; // fileStream << " <" << prefix << "DataArray type=\"Int32\" Name=\"MortonIndex\""; // if (!parallel) { // fileStream << " format=\"" << format << "\">" << std::endl; - // mesh->recupereDonnees(cellsLvl, jeuDonnees, 1, MortonIndex); - // this->writeDataset(jeuDonnees, fileStream, INT); + // mesh->getData(cellsLvl, dataset, 1, MortonIndex); + // this->writeDataset(dataset, fileStream, INT); // fileStream << std::endl; // fileStream << " " << std::endl; // } // else { fileStream << "\"/>" << std::endl; } // } + //9) Writing saturation pressure (specific recording) + //--------------------------------------------------- + if (m_run->m_recordPsat) { + fileStream << " <" << prefix << "DataArray type=\"Float64\" Name=\"Psat\""; + if (!parallel) { + fileStream << " format=\"" << format << "\">" << std::endl; + mesh->getData(cellsLvl, dataset, 1, -7); + this->writeDataset(dataset, fileStream, DOUBLE); + fileStream << std::endl; + fileStream << " " << std::endl; + } + else { fileStream << "\"/>" << std::endl; } + } + //Fin fileStream << " " << std::endl; } //*********************************************************************** -void OutputXML::ecritMeshRectilinearXML(Mesh* mesh, std::ofstream& fileStream, bool parallel) +void OutputXML::writeMeshRectilinearXML(Mesh* mesh, std::ofstream& fileStream, bool parallel) { - std::vector jeuDonnees; + std::vector dataset; std::string prefix; if (parallel) { prefix = "P"; } @@ -556,48 +638,48 @@ void OutputXML::ecritMeshRectilinearXML(Mesh* mesh, std::ofstream& fileStream, b if (!m_writeBinary) fileStream << "LittleEndian\">" << std::endl; else fileStream << m_endianMode.c_str() << "\">" << std::endl; if (!parallel) { - fileStream << " recupereChaineExtent() << "\">" << std::endl; - fileStream << " recupereChaineExtent() << "\">" << std::endl; + fileStream << " getStringExtent() << "\">" << std::endl; + fileStream << " getStringExtent() << "\">" << std::endl; } else { - fileStream << " recupereChaineExtent(true) << "\" GhostLevel=\"0\">" << std::endl; + fileStream << " getStringExtent(true) << "\" GhostLevel=\"0\">" << std::endl; } - //1) Ecriture des Coordonnees des noeuds - //-------------------------------------- + //1) Write node coordinates + //------------------------- fileStream << " <" << prefix << "Coordinates>" << std::endl; - //Coordonnees en X + //Coordinate in X fileStream << " <" << prefix << "DataArray type=\"Float64\" "; if (!parallel) { if (!m_writeBinary) { fileStream << "format=\"ascii\">" << std::endl << " "; } else { fileStream << "format=\"binary\">" << std::endl; } - jeuDonnees.clear(); - mesh->recupereCoord(jeuDonnees, X); - writeDataset(jeuDonnees, fileStream, DOUBLE); + dataset.clear(); + mesh->getCoord(dataset, X); + writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "/>" << std::endl; } - //Coordonnees en Y + //Coordinate in Y fileStream << " <" << prefix << "DataArray type=\"Float64\" "; if (!parallel) { if (!m_writeBinary) { fileStream << "format=\"ascii\">" << std::endl << " "; } else { fileStream << "format=\"binary\">" << std::endl; } - jeuDonnees.clear(); - mesh->recupereCoord(jeuDonnees, Y); - writeDataset(jeuDonnees, fileStream, DOUBLE); + dataset.clear(); + mesh->getCoord(dataset, Y); + writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "/>" << std::endl; } - //Coordonnees en Z + //Coordinate in Z fileStream << " <" << prefix << "DataArray type=\"Float64\" "; if (!parallel) { if (!m_writeBinary) { fileStream << "format=\"ascii\">" << std::endl << " "; } else { fileStream << "format=\"binary\">" << std::endl; } - jeuDonnees.clear(); - mesh->recupereCoord(jeuDonnees, Z); - writeDataset(jeuDonnees, fileStream, DOUBLE); + dataset.clear(); + mesh->getCoord(dataset, Z); + writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } @@ -607,9 +689,9 @@ void OutputXML::ecritMeshRectilinearXML(Mesh* mesh, std::ofstream& fileStream, b //*********************************************************************** -void OutputXML::ecritMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel) +void OutputXML::writeMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel) { - std::vector jeuDonnees; + std::vector dataset; std::string prefix; if (parallel) { prefix = "P"; } @@ -626,36 +708,36 @@ void OutputXML::ecritMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLv } else { fileStream << " " << std::endl; - mesh->ecritHeaderPiece(fileStream, cellsLvl); + mesh->writeHeaderPiece(fileStream, cellsLvl); } - //1) Ecriture des Noeuds - //---------------------- + //1) Write of nodes + //----------------- fileStream << " <" << prefix << "Points>" << std::endl; fileStream << " <" << prefix << "DataArray type=\"Float64\" NumberOfComponents=\"3\" "; if (!parallel) { if (!m_writeBinary) { fileStream << "format=\"ascii\">" << std::endl << " "; } else { fileStream << "format=\"binary\">" << std::endl; } - jeuDonnees.clear(); - mesh->recupereNoeuds(jeuDonnees, cellsLvl); - writeDataset(jeuDonnees, fileStream, DOUBLE); + dataset.clear(); + mesh->getNodes(dataset, cellsLvl); + writeDataset(dataset, fileStream, DOUBLE); fileStream << std::endl; fileStream << " " << std::endl; } else { fileStream << "/>" << std::endl; } fileStream << " " << std::endl; - //2) Ecriture des Cells - //------------------------ + //2) Write des Cells + //------------------ fileStream << " <" << prefix << "Cells>" << std::endl; //Connectivite fileStream << " <" << prefix << "DataArray type=\"Int32\" Name=\"connectivity\" "; if (!parallel) { if (!m_writeBinary) { fileStream << "format=\"ascii\">" << std::endl << " "; } else { fileStream << "format=\"binary\">" << std::endl; } - jeuDonnees.clear(); - mesh->recupereConnectivite(jeuDonnees, cellsLvl); - writeDataset(jeuDonnees, fileStream, INT); + dataset.clear(); + mesh->getConnectivity(dataset, cellsLvl); + writeDataset(dataset, fileStream, INT); fileStream << std::endl; fileStream << " " << std::endl; } @@ -665,9 +747,9 @@ void OutputXML::ecritMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLv if (!parallel) { if (!m_writeBinary) { fileStream << "format=\"ascii\">" << std::endl << " "; } else { fileStream << "format=\"binary\">" << std::endl; } - jeuDonnees.clear(); - mesh->recupereOffsets(jeuDonnees, cellsLvl); - writeDataset(jeuDonnees, fileStream, INT); + dataset.clear(); + mesh->getOffsets(dataset, cellsLvl); + writeDataset(dataset, fileStream, INT); fileStream << std::endl; fileStream << " " << std::endl; } @@ -677,9 +759,9 @@ void OutputXML::ecritMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLv if (!parallel) { if (!m_writeBinary) { fileStream << "format=\"ascii\">" << std::endl << " "; } else { fileStream << "format=\"binary\">" << std::endl; } - jeuDonnees.clear(); - mesh->recupereTypeCell(jeuDonnees, cellsLvl); - writeDataset(jeuDonnees, fileStream, CHAR); + dataset.clear(); + mesh->getTypeCell(dataset, cellsLvl); + writeDataset(dataset, fileStream, CHAR); fileStream << std::endl; fileStream << " " << std::endl; } @@ -689,7 +771,7 @@ void OutputXML::ecritMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLv //*********************************************************************** -void OutputXML::ecritFinFichierRectilinearXML(std::ofstream &fileStream, bool parallel) +void OutputXML::writeFinFichierRectilinearXML(std::ofstream &fileStream, bool parallel) { std::string prefix; if (parallel) { prefix = "P"; } @@ -702,7 +784,7 @@ void OutputXML::ecritFinFichierRectilinearXML(std::ofstream &fileStream, bool pa //*********************************************************************** -void OutputXML::ecritFinFichierUnstructuredXML(std::ofstream &fileStream, bool parallel) +void OutputXML::writeFinFichierUnstructuredXML(std::ofstream &fileStream, bool parallel) { std::string prefix; if (parallel) { prefix = "P"; } @@ -713,196 +795,4 @@ void OutputXML::ecritFinFichierUnstructuredXML(std::ofstream &fileStream, bool p fileStream << "" << std::endl; } -//*********************************************************************** - -//Old - -//*********************************************************************** - -// void OutputXML::ecritMeshPolyDataXML(Mesh *mesh, vector* cellsLvl, std::ofstream &fileStream, const int& lvl, bool parallel) -// { -// vector jeuDonnees; - -// string prefix; -// if (parallel) { prefix = "P"; } -// else { prefix = ""; } - -// //0) Header -// //--------- -// fileStream << "" << endl; -// else fileStream << m_endianMode.c_str() << "\">" << endl; - -// if (parallel) { -// fileStream << " " << endl; -// } -// else { -// fileStream << " " << endl; -// mesh->ecritHeaderPiece(fileStream, cellsLvl, lvl); -// } - -// //1) Ecriture des Noeuds -// //---------------------- -// fileStream << " <" << prefix << "Points>" << endl; -// fileStream << " <" << prefix << "DataArray type=\"Float64\" NumberOfComponents=\"3\" "; -// if (!parallel) { -// if (!m_writeBinary) { fileStream << "format=\"ascii\">" << endl << " "; } -// else { fileStream << "format=\"binary\">" << endl; } -// jeuDonnees.clear(); -// mesh->recupereNoeuds(jeuDonnees, cellsLvl); -// writeDataset(jeuDonnees, fileStream, DOUBLE); -// fileStream << endl; -// fileStream << " " << endl; -// } -// else { fileStream << "/>" << endl; } -// fileStream << " " << endl; - -// //2) Ecriture des Polys -// //--------------------- -// fileStream << " <" << prefix << "Polys>" << endl; -// //Connectivite -// fileStream << " <" << prefix << "DataArray type=\"Int32\" Name=\"connectivity\" "; -// if (!parallel) { -// if (!m_writeBinary) { fileStream << "format=\"ascii\">" << endl << " "; } -// else { fileStream << "format=\"binary\">" << endl; } -// jeuDonnees.clear(); -// mesh->recupereConnectivite(jeuDonnees, lvl); -// writeDataset(jeuDonnees, fileStream, INT); -// fileStream << endl; -// fileStream << " " << endl; -// } -// else { fileStream << "/>" << endl; } -// //Offsets -// fileStream << " <" << prefix << "DataArray type=\"Int32\" Name=\"offsets\" "; -// if (!parallel) { -// if (!m_writeBinary) { fileStream << "format=\"ascii\">" << endl << " "; } -// else { fileStream << "format=\"binary\">" << endl; } -// jeuDonnees.clear(); -// mesh->recupereOffsets(jeuDonnees, lvl); -// writeDataset(jeuDonnees, fileStream, INT); -// fileStream << endl; -// fileStream << " " << endl; -// } -// else { fileStream << "/>" << endl; } -// fileStream << " " << endl; -// } - -// //*********************************************************************** - -// void OutputXML::ecritFinFichierPolyDataXML(std::ofstream &fileStream, bool parallel) -// { -// string prefix; -// if (parallel) { prefix = "P"; } -// else { prefix = ""; } - -// if (!parallel) fileStream << " " << endl; -// fileStream << " " << endl; -// fileStream << "" << endl; -// } - -// //*********************************************************************** - -// void OutputXML::ecritFichierParallelXML(Mesh *mesh, vector* cellsLvl) -// { -// ofstream fileStream; -// stringstream num; - -// bool parallel(true); - -// try { -// //Preparation AMR -// for (int lvl = 0; lvl <= mesh->getLvlMax(); lvl++) { - -// //1) Ouverture / creation file -// //------------------------------- -// if (!m_splitData) { -// if (!m_writeBinary) { num << m_folderDatasets << "/result_" << m_numFichier; } -// else { num << m_folderDatasets << "/resultB64_" << m_numFichier; } -// num << "_lvl" << lvl; -// } -// else { throw ErrorECOGEN("Output::ecritFichierParallelXML : donnees Separees non prevu", __FILE__, __LINE__); } -// switch (mesh->getType()) { -// case REC: -// num << ".pvtr"; break; -// case UNS: -// num << ".pvtu"; break; -// case AMR: -// num << ".pvtu"; break; -// //num << ".pvtp"; break; -// default: -// throw ErrorECOGEN("Output::ecritFichierParallelXML : type mesh inconnu", __FILE__, __LINE__); break; -// } - -// fileStream.open((num.str()).c_str(), ios::trunc); -// if (!fileStream) { throw ErrorECOGEN("Impossible d ouvrir le file " + num.str(), __FILE__, __LINE__); } -// fileStream << "" << endl; - -// //2) Ecriture des infos mesh -// //------------------------------ -// switch (mesh->getType()) { -// case REC: -// ecritMeshRectilinearXML(mesh, fileStream, parallel); break; -// case UNS: -// ecritMeshUnstructuredXML(mesh, cellsLvl, fileStream, lvl, parallel); break; -// case AMR: -// ecritMeshUnstructuredXML(mesh, cellsLvl, fileStream, lvl, parallel); break; -// //ecritMeshPolyDataXML(mesh, cellsLvl, fileStream, lvl, parallel); break; -// default: -// throw ErrorECOGEN("Output::writeResultsXML : type mesh inconnu", __FILE__, __LINE__); break; -// } - -// //3) Ecriture des donnees phases fluids -// //------------------------------------- -// ecritDonneesPhysiquesXML(mesh, cellsLvl, fileStream, lvl, parallel); - -// //4) Ecriture des name des fichiers -// //-------------------------------- -// for (int p = 0; p < Ncpu; p++) -// { -// stringstream fichTemp; -// if (m_writeBinary) { fichTemp << "resultB64_"; } -// else { fichTemp << "result_"; } -// //fichTemp << m_numFichier << "_lvl" << lvl << "_CPU" << rank; -// fichTemp << "CPU" << rankCpu << "_lvl" << lvl << "_" << m_numFichier; - -// switch (mesh->getType()) { -// case REC: -// fichTemp << ".vtr"; -// fileStream << " recupereChaineExtent() << "\" Source=\"" << fichTemp.str() << "\"/>" << endl; -// break; -// case UNS: -// fichTemp << ".vtu"; -// fileStream << " " << endl; -// break; -// case AMR: -// fichTemp << ".vtu"; -// //fichTemp << ".vtp"; -// fileStream << " " << endl; -// break; -// default: -// throw ErrorECOGEN("Output::writeResultsXML : type mesh inconnu", __FILE__, __LINE__); break; -// } -// } - -// //5) Finalisation file -// //----------------------- -// switch (mesh->getType()) { -// case REC: -// ecritFinFichierRectilinearXML(fileStream, parallel); break; -// case UNS: -// ecritFinFichierUnstructuredXML(fileStream, parallel); break; -// case AMR: -// ecritFinFichierUnstructuredXML(fileStream, parallel); break; -// //ecritFinFichierPolyDataXML(fileStream, parallel); break; -// default: -// throw ErrorECOGEN("Output::writeResultsXML : type mesh inconnu", __FILE__, __LINE__); break; -// } -// fileStream.close(); - -// } - -// } //Fin try -// catch (ErrorECOGEN &) { throw; } -// } - -//*********************************************************************** +//*********************************************************************** \ No newline at end of file diff --git a/src/InputOutput/OutputXML.h b/src/InputOutput/OutputXML.h index be8a9bda..a9d9e7bd 100644 --- a/src/InputOutput/OutputXML.h +++ b/src/InputOutput/OutputXML.h @@ -37,33 +37,35 @@ class OutputXML : public Output { public: OutputXML(std::string casTest, std::string run, tinyxml2::XMLElement* element, std::string fileName, Input *entree); + OutputXML(std::string nameRun, int fileNumberRestartMeshMapping, Input *input); virtual ~OutputXML(); virtual void initializeSpecificOutput(); virtual void writeResults(Mesh *mesh, std::vector* cellsLvl); virtual void readResults(Mesh *mesh, std::vector* cellsLvl); + virtual void readResultsCpu(Mesh *mesh, std::vector* cellsLvl, int cpu); protected: - void ReadDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLvl, tinyxml2::XMLElement* nodeCellData, std::string fileName = "Unknown file"); + void ReadPhysicalDataXML(Mesh *mesh, std::vector* cellsLvl, tinyxml2::XMLElement* nodeCellData, std::string fileName = "Unknown file"); std::string createFilenameXML(const char* name, Mesh *mesh=0, int proc=-1, int numFichier=-1, std::string nameVariable ="defaut"); void writeResultsXML(Mesh *mesh, std::vector* cellsLvl); - void ecritCollectionXML(Mesh *mesh); - void ecritDonneesPhysiquesXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel = false); + void writeCollectionXML(Mesh *mesh); + void writePhysicalDataXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel = false); //Dependant du type de mesh - void ecritMeshRectilinearXML(Mesh *mesh, std::ofstream &fileStream, bool parallel = false); - void ecritMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel = false); - void ecritFinFichierRectilinearXML(std::ofstream &fileStream, bool parallel = false); - void ecritFinFichierUnstructuredXML(std::ofstream &fileStream, bool parallel = false); + void writeMeshRectilinearXML(Mesh *mesh, std::ofstream &fileStream, bool parallel = false); + void writeMeshUnstructuredXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, bool parallel = false); + void writeFinFichierRectilinearXML(std::ofstream &fileStream, bool parallel = false); + void writeFinFichierUnstructuredXML(std::ofstream &fileStream, bool parallel = false); //Non used / old - // void ecritFichierParallelXML(Mesh *mesh, std::vector* cellsLvl); - // void ecritFinFichierPolyDataXML(std::ofstream &fileStream, bool parallel = false); - // void ecritMeshPolyDataXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, const int& lvl, bool parallel = false); + // void writeFichierParallelXML(Mesh *mesh, std::vector* cellsLvl); + // void writeFinFichierPolyDataXML(std::ofstream &fileStream, bool parallel = false); + // void writeMeshPolyDataXML(Mesh *mesh, std::vector* cellsLvl, std::ofstream &fileStream, const int& lvl, bool parallel = false); }; #endif //OUTPUTXML_H \ No newline at end of file diff --git a/src/Maths/Coord.cpp b/src/Maths/Coord.cpp index 6208d3a3..c216f336 100644 --- a/src/Maths/Coord.cpp +++ b/src/Maths/Coord.cpp @@ -31,6 +31,8 @@ #include "Coord.h" Coord coordBuff; +Coord velocity; +Coord vFaceToElt; //********************************************************************* @@ -108,6 +110,16 @@ double Coord::scalar(const Coord& a) const //********************************************************************* +Coord Coord::scalar(const Tensor& t) const +{ + coordBuff.m_x = m_x * t.getXX() + m_y * t.getYX() + m_z * t.getZX(); + coordBuff.m_y = m_x * t.getXY() + m_y * t.getYY() + m_z * t.getZY(); + coordBuff.m_z = m_x * t.getXZ() + m_y * t.getYZ() + m_z * t.getZZ(); + return coordBuff; +} + +//********************************************************************* + Coord Coord::cross(const Coord& a) const { coordBuff.m_x = m_y*a.m_z - m_z*a.m_y; @@ -185,8 +197,8 @@ void Coord::normalized() double Coord::determinant(const Coord& v1, const Coord& v2, const Coord& v3) { double det(0.); - det = (v1.getX()*v2.getY()*v3.getZ()) + (v1.getY()*v2.getZ()*v3.getX()) + (v1.getZ()*v2.getX()*v3.getY()); - det -= (v3.getX()*v2.getY()*v1.getZ()) + (v3.getY()*v2.getZ()*v1.getX()) + (v3.getZ()*v2.getX()*v1.getY()); + det = (v1.m_x*v2.m_y*v3.m_z) + (v1.m_y*v2.m_z*v3.m_x) + (v1.m_z*v2.m_x*v3.m_y); + det -= (v3.m_x*v2.m_y*v1.m_z) + (v3.m_y*v2.m_z*v1.m_x) + (v3.m_z*v2.m_x*v1.m_y); return det; } @@ -212,6 +224,18 @@ Coord Coord::sin(const Coord& v1, const Coord& v2) //********************************************************************* +void Coord::buildRelativeVelForRiemannMRF(const Coord &omega, const Coord& normal, const Coord& tangent, const Coord& binormal, const Coord& position) +{ + // Absolute velocity projection into the global frame + this->reverseProjection(normal, tangent, binormal); + // Define relative velocity + *this = *this - omega.cross(position); + // Reprojection of relative velocity in the face frame + this->localProjection(normal, tangent, binormal); +} + +//*********************************************************************** + void Coord::printInfo() const { std::cout << " X = " << m_x << " Y = " << m_y << " Z = " << m_z << std::endl; @@ -229,6 +253,26 @@ Coord& Coord::operator=(const double& scalar) //********************************************************************* +Coord& Coord::operator+= (const double& scalar) +{ + m_x += scalar; + m_y += scalar; + m_z += scalar; + return *this; +} + +//********************************************************************* + +Coord& Coord::operator-= (const double& scalar) +{ + m_x -= scalar; + m_y -= scalar; + m_z -= scalar; + return *this; +} + +//********************************************************************* + Coord& Coord::operator*= (const double& scalar) { m_x *= scalar; @@ -256,7 +300,6 @@ Coord Coord::operator* (const double& scalar) const return copie; } - //********************************************************************* Coord Coord::operator/ (const double& scalar) const @@ -268,7 +311,6 @@ Coord Coord::operator/ (const double& scalar) const //********************************************************************* - Coord& Coord::operator+= (const Coord& a) { m_x += a.m_x; @@ -292,21 +334,27 @@ Coord& Coord::operator-= (const Coord& a) Coord operator* (const double& scalar, const Coord& a) { - Coord copie(a); - copie *= scalar; - return copie; + Coord copy(a); + copy *= scalar; + return copy; } +//********************************************************************* + Coord operator+ (const Coord& a, const Coord& b) { - Coord copie(a); - copie += b; - return copie; + Coord copy(a); + copy += b; + return copy; } +//********************************************************************* + Coord operator- (const Coord& a, const Coord& b) { - Coord copie(a); - copie -= b; - return copie; + Coord copy(a); + copy -= b; + return copy; } + +//********************************************************************* diff --git a/src/Maths/Coord.h b/src/Maths/Coord.h index 49aba70b..29f6f34b 100644 --- a/src/Maths/Coord.h +++ b/src/Maths/Coord.h @@ -34,118 +34,137 @@ #include #include +class Coord; +#include "Tensor.h" + //! \class Coord //! \brief Class for a coordinate system object such as coordinates of the vertex or a vector class Coord { -public: - Coord(); - //! \brief Coord constructor - //! \param x value of the x-direction coordinate - //! \param y value of the y-direction coordinate (if it is not assigned it is set to 0.) - //! \param z value of the z-direction coordinate (if it is not assigned it is set to 0.) - Coord(const double& x, const double& y = 0., const double& z = 0.); - ~Coord(); - //! \brief Default Coord object (const version) - //! \details Used when returning a const Coord& - static const Coord defaultCoord; - //! \brief Default Coord object (non-const version) - //! \details Used when returning a const Coord& - static Coord defaultCoordNonConst; - //! \brief Set the values of the Coord object - //! \param x value of the x-direction coordinate - //! \param y value of the y-direction coordinate - //! \param z value of the z-direction coordinate - void setXYZ(const double& x, const double& y, const double& z); - //! \brief Set the value in the x-direction of the Coord object - //! \param x value of the x-direction coordinate - void setX(const double& x); - //! \brief Set the value in the y-direction of the Coord object - //! \param y value of the y-direction coordinate - void setY(const double& y); - //! \brief Set the value in the z-direction of the Coord object - //! \param z value of the z-direction coordinate - void setZ(const double& z); - //! \brief Return the value in the x-direction of the Coord object - const double& getX() const { return m_x; } - //! \brief Return the value in the y-direction of the Coord object - const double& getY() const { return m_y; } - //! \brief Return the value in the z-direction of the Coord object - const double& getZ() const { return m_z; } - //! \brief Return the value of the norm of the Coord object - double norm() const; - //! \brief Return the value of the squared norm of the Coord object - double squaredNorm() const; - //! \brief Return a Coord object with absolute values of each component - Coord abs() const; + public: + Coord(); + //! \brief Coord constructor + //! \param x value of the x-direction coordinate + //! \param y value of the y-direction coordinate (if it is not assigned it is set to 0.) + //! \param z value of the z-direction coordinate (if it is not assigned it is set to 0.) + Coord(const double& x, const double& y = 0., const double& z = 0.); + ~Coord(); + + //! \brief Default Coord object (const version) + //! \details Used when returning a const Coord& + static const Coord defaultCoord; + //! \brief Default Coord object (non-const version) + //! \details Used when returning a const Coord& + static Coord defaultCoordNonConst; + + //! \brief Set the values of the Coord object + //! \param x value of the x-direction coordinate + //! \param y value of the y-direction coordinate + //! \param z value of the z-direction coordinate + void setXYZ(const double& x, const double& y, const double& z); + //! \brief Set the value in the x-direction of the Coord object + //! \param x value of the x-direction coordinate + void setX(const double& x); + //! \brief Set the value in the y-direction of the Coord object + //! \param y value of the y-direction coordinate + void setY(const double& y); + //! \brief Set the value in the z-direction of the Coord object + //! \param z value of the z-direction coordinate + void setZ(const double& z); + //! \brief Return the value in the x-direction of the Coord object + const double& getX() const { return m_x; } + //! \brief Return the value in the y-direction of the Coord object + const double& getY() const { return m_y; } + //! \brief Return the value in the z-direction of the Coord object + const double& getZ() const { return m_z; } + //! \brief Return the value of the norm of the Coord object + double norm() const; + //! \brief Return the value of the squared norm of the Coord object + double squaredNorm() const; + //! \brief Return a Coord object with absolute values of each component + Coord abs() const; - //! \brief Scalar product between the present vector and vector a - //! \param a vector (Coord) - double scalar(const Coord& a) const; - //! \brief Cross product between the present vector and vector a - //! \param a vector (Coord) - Coord cross(const Coord& a) const; - //! \brief Projection in the local coordinate system which is defined by the transmitted normal, tangent and binormal - //! \param normal normal vector (Coord) - //! \param tangent tangent vector (Coord) - //! \param binormal binormal vector (Coord) - void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); - //! \brief Reverse projection in the absolute Cartesian coordinate system - //! \param normal normal vector (Coord) - //! \param tangent tangent vector (Coord) - //! \param binormal binormal vector (Coord) - void reverseProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); + //! \brief Scalar product between the present vector and vector a + //! \param a vector (Coord) + double scalar(const Coord& a) const; + //! \brief Scalar product between the present vector and a tensor t + //! \param t tensor (tensor) + Coord scalar(const Tensor& t) const; + //! \brief Cross product between the present vector and vector a + //! \param a vector (Coord) + Coord cross(const Coord& a) const; + //! \brief Projection in the local coordinate system which is defined by the transmitted normal, tangent and binormal + //! \param normal normal vector (Coord) + //! \param tangent tangent vector (Coord) + //! \param binormal binormal vector (Coord) + void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); + //! \brief Reverse projection in the absolute Cartesian coordinate system + //! \param normal normal vector (Coord) + //! \param tangent tangent vector (Coord) + //! \param binormal binormal vector (Coord) + void reverseProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); - //! \brief Set a vector from the result of the substraction of the vector a from the vector b - //! \param a vector (Coord) - //! \param b vector (Coord) - void setFromSubtractedVectors(const Coord& a, const Coord& b); - //! \brief Return the scalar product bewteen two vectors - //! \param v1 vector (Coord) - //! \param v2 vector (Coord) - static double scalarProduct(const Coord& v1, const Coord& v2); - //! \brief Return the cross product bewteen two vectors - //! \param v1 vector (Coord) - //! \param v2 vector (Coord) - static Coord crossProduct(const Coord& v1, const Coord& v2); - //! \brief Change the sign if the present vector - void changeSign(); - //! \brief Divide the present vector by its norm - void normalized(); - //! \brief Print the information of the vector - void printInfo() const; + //! \brief Set a vector from the result of the substraction of the vector a from the vector b + //! \param a vector (Coord) + //! \param b vector (Coord) + void setFromSubtractedVectors(const Coord& a, const Coord& b); + //! \brief Return the scalar product bewteen two vectors + //! \param v1 vector (Coord) + //! \param v2 vector (Coord) + static double scalarProduct(const Coord& v1, const Coord& v2); + //! \brief Return the cross product bewteen two vectors + //! \param v1 vector (Coord) + //! \param v2 vector (Coord) + static Coord crossProduct(const Coord& v1, const Coord& v2); + //! \brief Change the sign if the present vector + void changeSign(); + //! \brief Divide the present vector by its norm + void normalized(); + //! \brief Print the information of the vector + void printInfo() const; - //! \brief Compute the determinant of the matrix formed by the vectors v1, v2 and v3 - //! \param v1 vector (Coord) - //! \param v2 vector (Coord) - //! \param v3 vector (Coord) - static double determinant(const Coord& v1, const Coord& v2, const Coord& v3); - - //! \brief Compute some sort of cosinus between two vectors - //! \param v1 vector (Coord) - //! \param v2 vector (Coord) - static double cos(const Coord& v1, const Coord& v2); - //! \brief Compute some sort of sinus between two vectors - //! \param v1 vector (Coord) - //! \param v2 vector (Coord) - static Coord sin(const Coord& v1, const Coord& v2); + //! \brief Compute the determinant of the matrix formed by the vectors v1, v2 and v3 + //! \param v1 vector (Coord) + //! \param v2 vector (Coord) + //! \param v3 vector (Coord) + static double determinant(const Coord& v1, const Coord& v2, const Coord& v3); + + //! \brief Compute some sort of cosinus between two vectors + //! \param v1 vector (Coord) + //! \param v2 vector (Coord) + static double cos(const Coord& v1, const Coord& v2); + //! \brief Compute some sort of sinus between two vectors + //! \param v1 vector (Coord) + //! \param v2 vector (Coord) + static Coord sin(const Coord& v1, const Coord& v2); + //! \brief Build relative velocity from absolute one (relevant with MRF only) + //! \param omega rotating velocity + //! \param normal face normal + //! \param tangent face tangent + //! \param binormal face binormal + //! \param position face position + void buildRelativeVelForRiemannMRF(const Coord &omega, const Coord& normal, const Coord& tangent, const Coord& binormal, const Coord& position); - //Operator surcharges - Coord& operator=(const double& scalar); - Coord& operator*= (const double& scalar); - Coord& operator/= (const double& scalar); - Coord operator* (const double& scalar) const; - Coord operator/ (const double& scalar) const; - Coord& operator+= (const Coord& a); - Coord& operator-= (const Coord& a); + //Operator surcharges + Coord& operator=(const double& scalar); + Coord& operator+= (const double& scalar); + Coord& operator-= (const double& scalar); + Coord& operator*= (const double& scalar); + Coord& operator/= (const double& scalar); + Coord operator* (const double& scalar) const; + Coord operator/ (const double& scalar) const; + Coord& operator+= (const Coord& a); + Coord& operator-= (const Coord& a); -protected: - double m_x; //! Value in the x-direction - double m_y; //! Value in the y-direction - double m_z; //! Value in the z-direction + protected: + double m_x; //! Value in the x-direction + double m_y; //! Value in the y-direction + double m_z; //! Value in the z-direction }; extern Coord coordBuff; +extern Coord velocity; +extern Coord vFaceToElt; //Extern operator surcharges of the class because they take two arguments Coord operator* (const double& scalar, const Coord& a); diff --git a/src/Maths/Tensor.cpp b/src/Maths/Tensor.cpp index 3af1cd30..7d59e78c 100644 --- a/src/Maths/Tensor.cpp +++ b/src/Maths/Tensor.cpp @@ -30,93 +30,572 @@ #include "Tensor.h" -Tensor projectedTensor; +Tensor tensorBuff; +Tensor tensorIdentity; +Tensor tensorCobase; +Tensor tensorNonConsCobase; +Tensor tensorF; +Tensor tensorG; +Tensor tensorG2; +Tensor tensorA; +Tensor tensorEigenvalues; +Tensor tensorP; +Tensor tensorPinverse; +Tensor tensorD; -Tensor::Tensor() : m_xx(0.), m_xy(0.), m_xz(0.), m_yx(0.), m_yy(0.), m_yz(0.), m_zx(0.), m_zy(0.), m_zz(0.) -{} +Tensor::Tensor() +{ + for (int i = 0; i < 9; i++) { + m_array[i] = 0.; + } +} + +//********************************************************************* + +Tensor::Tensor(const Tensor& tensor) +{ + for (int i = 0; i < 9; i++) { + m_array[i] = tensor.m_array[i]; + } +} + +//********************************************************************* Tensor::Tensor(const double& xx, const double& xy, const double& xz, const double& yx, const double& yy, const double& yz, const double& zx, const double& zy, const double& zz) - : m_xx(xx), m_xy(xy), m_xz(xz), m_yx(yx), m_yy(yy), m_yz(yz), m_zx(zx), m_zy(zy), m_zz(zz) -{} +{ + m_array[XX] = xx; + m_array[XY] = xy; + m_array[XZ] = xz; + + m_array[YX] = yx; + m_array[YY] = yy; + m_array[YZ] = yz; + + m_array[ZX] = zx; + m_array[ZY] = zy; + m_array[ZZ] = zz; +} + +//********************************************************************* Tensor::Tensor(const Coord& x, const Coord& y, const Coord& z) { - m_xx = x.getX(); - m_xy = x.getY(); - m_xz = x.getZ(); + m_array[XX] = x.getX(); + m_array[XY] = x.getY(); + m_array[XZ] = x.getZ(); - m_yx = y.getX(); - m_yy = y.getY(); - m_yz = y.getZ(); + m_array[YX] = y.getX(); + m_array[YY] = y.getY(); + m_array[YZ] = y.getZ(); - m_zx = z.getX(); - m_zy = z.getY(); - m_zz = z.getZ(); + m_array[ZX] = z.getX(); + m_array[ZY] = z.getY(); + m_array[ZZ] = z.getZ(); } -Tensor::~Tensor() -{} +//********************************************************************* + +Tensor::~Tensor() {} + +//********************************************************************* + +const Tensor Tensor::defaultTensor = Tensor(); + +//********************************************************************* + +Tensor Tensor::defaultTensorNonConst = Tensor(); + +//********************************************************************* + +void Tensor::setXX(const double& xx) { m_array[XX] = xx; } + +//********************************************************************* + +void Tensor::setXY(const double& xy) { m_array[XY] = xy; } + +//********************************************************************* -void Tensor::scalar(const Coord& a) const +void Tensor::setXZ(const double& xz) { m_array[XZ] = xz; } + +//********************************************************************* + +void Tensor::setYX(const double& yx) { m_array[YX] = yx; } + +//********************************************************************* + +void Tensor::setYY(const double& yy) { m_array[YY] = yy; } + +//********************************************************************* + +void Tensor::setYZ(const double& yz) { m_array[YZ] = yz; } + +//********************************************************************* + +void Tensor::setZX(const double& zx) { m_array[ZX] = zx; } + +//********************************************************************* + +void Tensor::setZY(const double& zy) { m_array[ZY] = zy; } + +//********************************************************************* + +void Tensor::setZZ(const double& zz) { m_array[ZZ] = zz; } + +//********************************************************************* + +void Tensor::setTensor(const Tensor& tensor) +{ + for (int i = 0; i < 9; i++) { + m_array[i] = tensor.m_array[i]; + } +} + +//********************************************************************* + +void Tensor::setTensor(const double& value) { - coordBuff.setX(m_xx * a.getX() + m_xy * a.getY() + m_xz * a.getZ()); - coordBuff.setY(m_yx * a.getX() + m_yy * a.getY() + m_yz * a.getZ()); - coordBuff.setZ(m_zx * a.getX() + m_zy * a.getY() + m_zz * a.getZ()); + for (int i = 0; i < 9; i++) { + m_array[i] = value; + } } +//********************************************************************* + +void Tensor::identity() +{ + m_array[XX] = 1.; + m_array[XY] = 0.; + m_array[XZ] = 0.; + + m_array[YX] = 0.; + m_array[YY] = 1.; + m_array[YZ] = 0.; + + m_array[ZX] = 0.; + m_array[ZY] = 0.; + m_array[ZZ] = 1.; +} + +//********************************************************************* + +void Tensor::correctZeros() +{ + for (int i = 0; i < 9; i++) { + if (std::fabs(m_array[i]) < 1.e-20) m_array[i] = 0.; + } +} + +//********************************************************************* + +Coord Tensor::scalar(const Coord& a) const +{ + coordBuff.setX(m_array[XX] * a.getX() + m_array[XY] * a.getY() + m_array[XZ] * a.getZ()); + coordBuff.setY(m_array[YX] * a.getX() + m_array[YY] * a.getY() + m_array[YZ] * a.getZ()); + coordBuff.setZ(m_array[ZX] * a.getX() + m_array[ZY] * a.getY() + m_array[ZZ] * a.getZ()); + return coordBuff; +} + +//********************************************************************* + void Tensor::localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal) -{ - this->scalar(normal); - projectedTensor.m_xx = coordBuff.getX(); - projectedTensor.m_xy = coordBuff.getY(); - projectedTensor.m_xz = coordBuff.getZ(); +{ + //T = T * L(n,t,b) + tensorBuff.m_array[XX] = m_array[XX] * normal.getX() + m_array[XY] * normal.getY() + m_array[XZ] * normal.getZ(); + tensorBuff.m_array[XY] = m_array[XX] * tangent.getX() + m_array[XY] * tangent.getY() + m_array[XZ] * tangent.getZ(); + tensorBuff.m_array[XZ] = m_array[XX] * binormal.getX() + m_array[XY] * binormal.getY() + m_array[XZ] * binormal.getZ(); + + tensorBuff.m_array[YX] = m_array[YX] * normal.getX() + m_array[YY] * normal.getY() + m_array[YZ] * normal.getZ(); + tensorBuff.m_array[YY] = m_array[YX] * tangent.getX() + m_array[YY] * tangent.getY() + m_array[YZ] * tangent.getZ(); + tensorBuff.m_array[YZ] = m_array[YX] * binormal.getX() + m_array[YY] * binormal.getY() + m_array[YZ] * binormal.getZ(); + + tensorBuff.m_array[ZX] = m_array[ZX] * normal.getX() + m_array[ZY] * normal.getY() + m_array[ZZ] * normal.getZ(); + tensorBuff.m_array[ZY] = m_array[ZX] * tangent.getX() + m_array[ZY] * tangent.getY() + m_array[ZZ] * tangent.getZ(); + tensorBuff.m_array[ZZ] = m_array[ZX] * binormal.getX() + m_array[ZY] * binormal.getY() + m_array[ZZ] * binormal.getZ(); + + *this = tensorBuff; + + //T = L(n,t,b)^T * T + tensorBuff.m_array[XX] = m_array[XX] * normal.getX() + m_array[YX] * normal.getY() + m_array[ZX] * normal.getZ(); + tensorBuff.m_array[XY] = m_array[XY] * normal.getX() + m_array[YY] * normal.getY() + m_array[ZY] * normal.getZ(); + tensorBuff.m_array[XZ] = m_array[XZ] * normal.getX() + m_array[YZ] * normal.getY() + m_array[ZZ] * normal.getZ(); + + tensorBuff.m_array[YX] = m_array[XX] * tangent.getX() + m_array[YX] * tangent.getY() + m_array[ZX] * tangent.getZ(); + tensorBuff.m_array[YY] = m_array[XY] * tangent.getX() + m_array[YY] * tangent.getY() + m_array[ZY] * tangent.getZ(); + tensorBuff.m_array[YZ] = m_array[XZ] * tangent.getX() + m_array[YZ] * tangent.getY() + m_array[ZZ] * tangent.getZ(); + + tensorBuff.m_array[ZX] = m_array[XX] * binormal.getX() + m_array[YX] * binormal.getY() + m_array[ZX] * binormal.getZ(); + tensorBuff.m_array[ZY] = m_array[XY] * binormal.getX() + m_array[YY] * binormal.getY() + m_array[ZY] * binormal.getZ(); + tensorBuff.m_array[ZZ] = m_array[XZ] * binormal.getX() + m_array[YZ] * binormal.getY() + m_array[ZZ] * binormal.getZ(); + + *this = tensorBuff; +} + +//********************************************************************* +void Tensor::reverseProjection(const Coord& normal, const Coord& tangent, const Coord& binormal) +{ + tensorBuff.m_array[XX] = m_array[XX] * normal.getX() + m_array[XY] * tangent.getX() + m_array[XZ] * binormal.getX(); + tensorBuff.m_array[XY] = m_array[XX] * normal.getY() + m_array[XY] * tangent.getY() + m_array[XZ] * binormal.getY(); + tensorBuff.m_array[XZ] = m_array[XX] * normal.getZ() + m_array[XY] * tangent.getZ() + m_array[XZ] * binormal.getZ(); + + tensorBuff.m_array[YX] = m_array[YX] * normal.getX() + m_array[YY] * tangent.getX() + m_array[YZ] * binormal.getX(); + tensorBuff.m_array[YY] = m_array[YX] * normal.getY() + m_array[YY] * tangent.getY() + m_array[YZ] * binormal.getY(); + tensorBuff.m_array[YZ] = m_array[YX] * normal.getZ() + m_array[YY] * tangent.getZ() + m_array[YZ] * binormal.getZ(); + + tensorBuff.m_array[ZX] = m_array[ZX] * normal.getX() + m_array[ZY] * tangent.getX() + m_array[ZZ] * binormal.getX(); + tensorBuff.m_array[ZY] = m_array[ZX] * normal.getY() + m_array[ZY] * tangent.getY() + m_array[ZZ] * binormal.getY(); + tensorBuff.m_array[ZZ] = m_array[ZX] * normal.getZ() + m_array[ZY] * tangent.getZ() + m_array[ZZ] * binormal.getZ(); - this->scalar(tangent); - projectedTensor.m_yx = coordBuff.getX(); - projectedTensor.m_yy = coordBuff.getY(); - projectedTensor.m_yz = coordBuff.getZ(); + *this = tensorBuff; - this->scalar(binormal); - projectedTensor.m_zx = coordBuff.getX(); - projectedTensor.m_zy = coordBuff.getY(); - projectedTensor.m_zz = coordBuff.getZ(); + tensorBuff.m_array[XX] = m_array[XX] * normal.getX() + m_array[YX] * tangent.getX() + m_array[ZX] * binormal.getX(); + tensorBuff.m_array[XY] = m_array[XY] * normal.getX() + m_array[YY] * tangent.getX() + m_array[ZY] * binormal.getX(); + tensorBuff.m_array[XZ] = m_array[XZ] * normal.getX() + m_array[YZ] * tangent.getX() + m_array[ZZ] * binormal.getX(); - *this = projectedTensor; + tensorBuff.m_array[YX] = m_array[XX] * normal.getY() + m_array[YX] * tangent.getY() + m_array[ZX] * binormal.getY(); + tensorBuff.m_array[YY] = m_array[XY] * normal.getY() + m_array[YY] * tangent.getY() + m_array[ZY] * binormal.getY(); + tensorBuff.m_array[YZ] = m_array[XZ] * normal.getY() + m_array[YZ] * tangent.getY() + m_array[ZZ] * binormal.getY(); + + tensorBuff.m_array[ZX] = m_array[XX] * normal.getZ() + m_array[YX] * tangent.getZ() + m_array[ZX] * binormal.getZ(); + tensorBuff.m_array[ZY] = m_array[XY] * normal.getZ() + m_array[YY] * tangent.getZ() + m_array[ZY] * binormal.getZ(); + tensorBuff.m_array[ZZ] = m_array[XZ] * normal.getZ() + m_array[YZ] * tangent.getZ() + m_array[ZZ] * binormal.getZ(); + + *this = tensorBuff; } +//********************************************************************* + void Tensor::setTensorByLines(const Coord& x, const Coord& y, const Coord& z) { - m_xx = x.getX(); - m_xy = x.getY(); - m_xz = x.getZ(); + m_array[XX] = x.getX(); + m_array[XY] = x.getY(); + m_array[XZ] = x.getZ(); - m_yx = y.getX(); - m_yy = y.getY(); - m_yz = y.getZ(); + m_array[YX] = y.getX(); + m_array[YY] = y.getY(); + m_array[YZ] = y.getZ(); - m_zx = z.getX(); - m_zy = z.getY(); - m_zz = z.getZ(); + m_array[ZX] = z.getX(); + m_array[ZY] = z.getY(); + m_array[ZZ] = z.getZ(); } +//********************************************************************* + void Tensor::setTensorByColumns(const Coord& x, const Coord& y, const Coord& z) { - m_xx = x.getX(); - m_yx = x.getY(); - m_zx = x.getZ(); + m_array[XX] = x.getX(); + m_array[YX] = x.getY(); + m_array[ZX] = x.getZ(); + + m_array[XY] = y.getX(); + m_array[YY] = y.getY(); + m_array[ZY] = y.getZ(); + + m_array[XZ] = z.getX(); + m_array[YZ] = z.getY(); + m_array[ZZ] = z.getZ(); +} + +//********************************************************************* + +void Tensor::tensorToCoords(Coord& x, Coord& y, Coord& z) const +{ + x.setXYZ(m_array[XX], m_array[XY], m_array[XZ]); + y.setXYZ(m_array[YX], m_array[YY], m_array[YZ]); + z.setXYZ(m_array[ZX], m_array[ZY], m_array[ZZ]); +} + +//********************************************************************* + +void Tensor::tensorToArray(double* array) const +{ + for (int i = 0; i < 9; i++) { + array[i] = m_array[i]; + } +} + +//********************************************************************* + +void Tensor::arrayToTensor(const double* array) +{ + for (int i = 0; i < 9; i++) { + m_array[i] = array[i]; + } +} + +//********************************************************************* + +void Tensor::transpose(Tensor& transposedTensor) const +{ + transposedTensor.m_array[XX] = m_array[XX]; + transposedTensor.m_array[XY] = m_array[YX]; + transposedTensor.m_array[XZ] = m_array[ZX]; + + transposedTensor.m_array[YX] = m_array[XY]; + transposedTensor.m_array[YY] = m_array[YY]; + transposedTensor.m_array[YZ] = m_array[ZY]; + + transposedTensor.m_array[ZX] = m_array[XZ]; + transposedTensor.m_array[ZY] = m_array[YZ]; + transposedTensor.m_array[ZZ] = m_array[ZZ]; +} + +//********************************************************************* + +void Tensor::matrixProduct(const Tensor& tensor2, Tensor& resultingTensor) const +{ + //Details if made by a loop (high computational cost considering the structure of Tensor instead of a two-dimensional array) + // for (int i = 0; i < 3; i++) { + // for (int j = 0; j < 3; j++) { + // resultingTensor(i, j) = 0.; + // for (int k = 0; k < 3; k++) { + // resultingTensor(i, j) += *this->getElement(i, k) * tensor2.getElement(k, j); + // } + // } + // } + resultingTensor.m_array[XX] = m_array[XX]*tensor2.m_array[XX] + m_array[XY]*tensor2.m_array[YX] + m_array[XZ]*tensor2.m_array[ZX]; + resultingTensor.m_array[XY] = m_array[XX]*tensor2.m_array[XY] + m_array[XY]*tensor2.m_array[YY] + m_array[XZ]*tensor2.m_array[ZY]; + resultingTensor.m_array[XZ] = m_array[XX]*tensor2.m_array[XZ] + m_array[XY]*tensor2.m_array[YZ] + m_array[XZ]*tensor2.m_array[ZZ]; + + resultingTensor.m_array[YX] = m_array[YX]*tensor2.m_array[XX] + m_array[YY]*tensor2.m_array[YX] + m_array[YZ]*tensor2.m_array[ZX]; + resultingTensor.m_array[YY] = m_array[YX]*tensor2.m_array[XY] + m_array[YY]*tensor2.m_array[YY] + m_array[YZ]*tensor2.m_array[ZY]; + resultingTensor.m_array[YZ] = m_array[YX]*tensor2.m_array[XZ] + m_array[YY]*tensor2.m_array[YZ] + m_array[YZ]*tensor2.m_array[ZZ]; - m_xy = y.getX(); - m_yy = y.getY(); - m_zy = y.getZ(); + resultingTensor.m_array[ZX] = m_array[ZX]*tensor2.m_array[XX] + m_array[ZY]*tensor2.m_array[YX] + m_array[ZZ]*tensor2.m_array[ZX]; + resultingTensor.m_array[ZY] = m_array[ZX]*tensor2.m_array[XY] + m_array[ZY]*tensor2.m_array[YY] + m_array[ZZ]*tensor2.m_array[ZY]; + resultingTensor.m_array[ZZ] = m_array[ZX]*tensor2.m_array[XZ] + m_array[ZY]*tensor2.m_array[YZ] + m_array[ZZ]*tensor2.m_array[ZZ]; +} + +//********************************************************************* - m_xz = z.getX(); - m_yz = z.getY(); - m_zz = z.getZ(); +double Tensor::trace() const +{ + return m_array[XX] + m_array[YY] + m_array[ZZ]; } -void Tensor::tensorToCoords(Coord& x, Coord& y, Coord& z) +//********************************************************************* + +double Tensor::determinant() const +{ + return m_array[XX] * (m_array[YY]*m_array[ZZ] - m_array[YZ]*m_array[ZY]) + - m_array[YX] * (m_array[XY]*m_array[ZZ] - m_array[XZ]*m_array[ZY]) + + m_array[ZX] * (m_array[XY]*m_array[YZ] - m_array[XZ]*m_array[YY]); +} + +//********************************************************************* + +void Tensor::inverse(Tensor& inverseTensor) const +{ + inverseTensor.m_array[XX] = m_array[YY] * m_array[ZZ] - m_array[YZ] * m_array[ZY]; + inverseTensor.m_array[XY] = m_array[XZ] * m_array[ZY] - m_array[XY] * m_array[ZZ]; + inverseTensor.m_array[XZ] = m_array[XY] * m_array[YZ] - m_array[XZ] * m_array[YY]; + + inverseTensor.m_array[YX] = m_array[YZ] * m_array[ZX] - m_array[YX] * m_array[ZZ]; + inverseTensor.m_array[YY] = m_array[XX] * m_array[ZZ] - m_array[XZ] * m_array[ZX]; + inverseTensor.m_array[YZ] = m_array[XZ] * m_array[YX] - m_array[XX] * m_array[YZ]; + + inverseTensor.m_array[ZX] = m_array[YX] * m_array[ZY] - m_array[YY] * m_array[ZX]; + inverseTensor.m_array[ZY] = m_array[XY] * m_array[ZX] - m_array[XX] * m_array[ZY]; + inverseTensor.m_array[ZZ] = m_array[XX] * m_array[YY] - m_array[XY] * m_array[YX]; + + double det = this->determinant(); + if (std::fabs(det) > 1.e-10) inverseTensor /= det; + else Errors::errorMessage("Matrix/Tensor is not inversible (det = 0)"); +} + +//********************************************************************* + +bool Tensor::isIdentity() const +{ + if (std::fabs(m_array[XX]) - 1. < 1.e-15 && + std::fabs(m_array[XY]) < 1.e-15 && + std::fabs(m_array[XZ]) < 1.e-15 && + + std::fabs(m_array[YX]) < 1.e-15 && + std::fabs(m_array[YY]) - 1. < 1.e-15 && + std::fabs(m_array[YZ]) < 1.e-15 && + + std::fabs(m_array[ZX]) < 1.e-15 && + std::fabs(m_array[ZY]) < 1.e-15 && + std::fabs(m_array[ZZ]) - 1. < 1.e-15) + return true; + else + return false; +} + +//********************************************************************* + +void Tensor::eigen(Tensor& eigenvalues, Tensor& eigenvectors) const +{ + double abserr(1.e-9); //Abs tolerance [sum of (off-diagonal elements)^2] + + //Initialize eigenvalues and eigenvectors + eigenvalues = *this; + eigenvectors.identity(); + + //Sum of all off-diagonal elements (squared) + double b2(0.); + b2 = m_array[XY]*m_array[XY] + m_array[XZ]*m_array[XZ] + m_array[YZ]*m_array[YZ] + + m_array[YX]*m_array[YX] + m_array[ZX]*m_array[ZX] + m_array[ZY]*m_array[ZY]; + if (b2 <= abserr) return; + + //Average for off-diagonal elements divided by 2: + double bar = 0.5 * b2 / 9.; + + //Compute eigenvalues and eigenvectors + int ii(0), jj(0), ji(0), ik(0), jk(0), ki(0), kj(0); + double beta(0.), coeff(0.), c(0.), s(0.), cs(0.), sc(0.); + while (b2 > abserr) { + for (int i = 0; i < 2; i++) { + for (int j = i + 1; j < 3; j++) { + //Compute element indexes for loop i and j + ii = i*3 + i; + jj = j*3 + j; + ji = j*3 + i; + + //Compute new b2 and bar + if (eigenvalues.m_array[ji] * eigenvalues.m_array[ji] <= bar) continue; //Do not touch small elements + b2 -= 2. * eigenvalues.m_array[ji] * eigenvalues.m_array[ji]; + bar = 0.5 * b2 / 9.; + + //Compute coefficients c and s for Givens matrix + beta = (eigenvalues.m_array[jj] - eigenvalues.m_array[ii]) / (2. * eigenvalues.m_array[ji]); + coeff = 0.5 * beta / sqrt(1. + beta*beta); + s = sqrt(std::max(0.5 + coeff, 0.)); + c = sqrt(std::max(0.5 - coeff, 0.)); + + //Recompute rows i and j of eigenvalues + for (int k = 0; k < 3; k++) { + ik = i*3 + k; + jk = j*3 + k; + cs = c * eigenvalues.m_array[ik] + s * eigenvalues.m_array[jk]; + sc = -s * eigenvalues.m_array[ik] + c * eigenvalues.m_array[jk]; + eigenvalues.m_array[ik] = cs; + eigenvalues.m_array[jk] = sc; + } + + //New eigenvalues and eigenvectors + for (int k = 0; k < 3; k++) { + ki = k*3 + i; + kj = k*3 + j; + cs = c * eigenvalues.m_array[ki] + s * eigenvalues.m_array[kj]; + sc = -s * eigenvalues.m_array[ki] + c * eigenvalues.m_array[kj]; + eigenvalues.m_array[ki] = cs; + eigenvalues.m_array[kj] = sc; + cs = c * eigenvectors.m_array[ki] + s * eigenvectors.m_array[kj]; + sc = -s * eigenvectors.m_array[ki] + c * eigenvectors.m_array[kj]; + eigenvectors.m_array[ki] = cs; + eigenvectors.m_array[kj] = sc; + } + } + } + } +} + +//*******************SURCHARGES OPERATEURS***************************** + +Tensor& Tensor::operator=(const double& scalar) { - x.setXYZ(m_xx, m_xy, m_xz); - y.setXYZ(m_yx, m_yy, m_yz); - z.setXYZ(m_zx, m_zy, m_zz); -} \ No newline at end of file + for (int i = 0; i < 9; i++) { + m_array[i] = scalar; + } + return *this; +} + +//********************************************************************* + +Tensor& Tensor::operator=(const Tensor& a) +{ + for (int i = 0; i < 9; i++) { + m_array[i] = a.m_array[i]; + } + return *this; +} + +//********************************************************************* + +Tensor& Tensor::operator*= (const double& scalar) +{ + for (int i = 0; i < 9; i++) { + m_array[i] *= scalar; + } + return *this; +} + +//********************************************************************* + +Tensor& Tensor::operator/= (const double& scalar) +{ + for (int i = 0; i < 9; i++) { + m_array[i] /= scalar; + } + return *this; +} + +//********************************************************************* + +Tensor Tensor::operator* (const double& scalar) const +{ + Tensor copie(*this); + copie *= scalar; + return copie; +} + +//********************************************************************* + +Tensor Tensor::operator/ (const double& scalar) const +{ + Tensor copie(*this); + copie /= scalar; + return copie; +} + +//********************************************************************* + +Tensor& Tensor::operator+= (const Tensor& a) +{ + for (int i = 0; i < 9; i++) { + m_array[i] += a.m_array[i]; + } + return *this; +} + +//********************************************************************* + +Tensor& Tensor::operator-= (const Tensor& a) +{ + for (int i = 0; i < 9; i++) { + m_array[i] -= a.m_array[i]; + } + return *this; +} + +//********************************************************************* +//Surcharge operateur externe a la classe car prends deux arguments + +Tensor operator* (const double& scalar, const Tensor& a) +{ + Tensor copy(a); + copy *= scalar; + return copy; +} + +//********************************************************************* + +Tensor operator+ (const Tensor& a, const Tensor& b) +{ + Tensor copy(a); + copy += b; + return copy; +} + +//********************************************************************* + +Tensor operator- (const Tensor& a, const Tensor& b) +{ + Tensor copy(a); + copy -= b; + return copy; +} + +//********************************************************************* \ No newline at end of file diff --git a/src/Maths/Tensor.h b/src/Maths/Tensor.h index ddeaf777..87f7df23 100644 --- a/src/Maths/Tensor.h +++ b/src/Maths/Tensor.h @@ -31,35 +31,172 @@ #ifndef TENSOR_H #define TENSOR_H +#include "../Errors.h" +#include + +class Tensor; #include "Coord.h" +//! \brief Enumeration for the tensor elements +enum TensorElement { XX, XY, XZ, YX, YY, YZ, ZX, ZY, ZZ }; + +//! \class Tensor +//! \brief Class for a matrix 3x3 system object class Tensor { public: Tensor(); + Tensor(const Tensor& tensor); Tensor(const double &xx, const double &xy, const double &xz, const double &yx, const double &yy, const double &yz, const double &zx, const double &zy, const double &zz); Tensor(const Coord &x, const Coord &y, const Coord &z); ~Tensor(); - void scalar(const Coord& a) const; + //! \brief Default Tensor object (const version) + //! \details Used when returning a const Tensor& + static const Tensor defaultTensor; + //! \brief Default Tensor object (non-const version) + //! \details Used when returning a const Tensor& + static Tensor defaultTensorNonConst; + + //! \brief Return the value of the specific element of the Tensor object + const double& getElement(const int& element) const { return m_array[element]; } + //! \brief Return the value of the xx-element of the Tensor object + const double& getXX() const { return m_array[XX]; } + //! \brief Return the value of the xy-element of the Tensor object + const double& getXY() const { return m_array[XY]; } + //! \brief Return the value of the xz-element of the Tensor object + const double& getXZ() const { return m_array[XZ]; } + //! \brief Return the value of the yx-element of the Tensor object + const double& getYX() const { return m_array[YX]; } + //! \brief Return the value of the yy-element of the Tensor object + const double& getYY() const { return m_array[YY]; } + //! \brief Return the value of the yz-element of the Tensor object + const double& getYZ() const { return m_array[YZ]; } + //! \brief Return the value of the zx-element of the Tensor object + const double& getZX() const { return m_array[ZX]; } + //! \brief Return the value of the zy-element of the Tensor object + const double& getZY() const { return m_array[ZY]; } + //! \brief Return the value of the zz-element of the Tensor object + const double& getZZ() const { return m_array[ZZ]; } + //! \brief Set the value in the xx-element of the Tensor object + //! \param xx value of the xx-element coordinate + void setXX(const double& xx); + //! \brief Set the value in the xy-element of the Tensor object + //! \param xy value of the xy-element coordinate + void setXY(const double& xy); + //! \brief Set the value in the xz-element of the Tensor object + //! \param xz value of the xz-element coordinate + void setXZ(const double& xz); + //! \brief Set the value in the yx-element of the Tensor object + //! \param xx value of the yx-element coordinate + void setYX(const double& xx); + //! \brief Set the value in the yy-element of the Tensor object + //! \param xy value of the yy-element coordinate + void setYY(const double& xy); + //! \brief Set the value in the yz-element of the Tensor object + //! \param xz value of the yz-element coordinate + void setYZ(const double& xz); + //! \brief Set the value in the zx-element of the Tensor object + //! \param xx value of the zx-element coordinate + void setZX(const double& xx); + //! \brief Set the value in the zy-element of the Tensor object + //! \param xy value of the zy-element coordinate + void setZY(const double& xy); + //! \brief Set the value in the zz-element of the Tensor object + //! \param xz value of the zz-element coordinate + void setZZ(const double& xz); + //! \brief Set the Tensor object + //! \param tensor tensor + void setTensor(const Tensor& tensor); + //! \brief Set all the elements of the Tensor object to a scalar value + //! \param value scalar value to set all elements + void setTensor(const double& value); + //! \brief Set the Tensor object to identity + void identity(); + //! \brief Set to perfect zero each of the epsilon terms + void correctZeros(); + + //! \brief Return the scalar product between the Tensor and the Coord + //! \param a vector (Coord) + Coord scalar(const Coord& a) const; + //! \brief Projection in the local coordinate system which is defined by the transmitted normal, tangent and binormal + //! \param normal normal vector (Coord) + //! \param tangent tangent vector (Coord) + //! \param binormal binormal vector (Coord) void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); + //! \brief Reverse projection in the absolute Cartesian coordinate system + //! \param normal normal vector (Coord) + //! \param tangent tangent vector (Coord) + //! \param binormal binormal vector (Coord) + void reverseProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); void setTensorByLines(const Coord& x, const Coord& y, const Coord& z); void setTensorByColumns(const Coord& x, const Coord& y, const Coord& z); - void tensorToCoords(Coord& x, Coord& y, Coord& z); - - private: - double m_xx; - double m_xy; - double m_xz; - double m_yx; - double m_yy; - double m_yz; - double m_zx; - double m_zy; - double m_zz; + //! \brief Transform the Tensor into Coords (vectors) + //! \param x x vector (Coord) + //! \param y y vector (Coord) + //! \param z z vector (Coord) + void tensorToCoords(Coord& x, Coord& y, Coord& z) const; + //! \brief Transform the Tensor into 1D array (pointer) + //! \param array 1D array (pointer) + void tensorToArray(double* array) const; + //! \brief Transform the 1D array (pointer) into Tensor + //! \param array 1D array (pointer) + void arrayToTensor(const double* array); + + //! \brief Compute the transpose of the tensor + //! \param transposedTensor transposed tensor (Tensor) + void transpose(Tensor& transposedTensor) const; + //! \brief Compute the matrix product of the two tensors + //! \param tensor2 second tensor (Tensor) + //! \param resultingTensor resulting tensor of the product (Tensor) + void matrixProduct(const Tensor& tensor2, Tensor& resultingTensor) const; + //! \brief Return the trace of the tensor + double trace() const; + //! \brief Return the determinant of the tensor + double determinant() const; + //! \brief Compute the inverse of the tensor + //! \param inverseTensor inverse tensor (Tensor) + void inverse(Tensor& inverseTensor) const; + + //! \brief Return true if equal to identity + bool isIdentity() const; + + //! \brief Compute the eigenvalues and eigenvectors of the tensor with Jacobi's algorithm + //! \param eigenvalues tensor whose diagonal elements are eigenvalues (Tensor) + //! \param eigenvectors tensor whose columns are eigenvectors (Tensor) + void eigen(Tensor& eigenvalues, Tensor& eigenvectors) const; + + //Operator surcharges + Tensor& operator=(const double& scalar); + Tensor& operator=(const Tensor& a); + Tensor& operator*= (const double& scalar); + Tensor& operator/= (const double& scalar); + Tensor operator* (const double& scalar) const; + Tensor operator/ (const double& scalar) const; + Tensor& operator+= (const Tensor& a); + Tensor& operator-= (const Tensor& a); + + protected: + std::array m_array; //! Elements of the 3x3 matrix }; -extern Tensor projectedTensor; +extern Tensor tensorBuff; +extern Tensor tensorIdentity; +extern Tensor tensorCobase; +extern Tensor tensorNonConsCobase; +extern Tensor tensorF; +extern Tensor tensorG; +extern Tensor tensorG2; +extern Tensor tensorA; +extern Tensor tensorEigenvalues; +extern Tensor tensorP; +extern Tensor tensorPinverse; +extern Tensor tensorD; + +//Extern operator surcharges of the class because they take two arguments +Tensor operator* (const double& scalar, const Tensor& a); +Tensor operator+ (const Tensor& a, const Tensor& b); +Tensor operator- (const Tensor& a, const Tensor& b); #endif // TENSOR_H diff --git a/src/Meshes/Element.cpp b/src/Meshes/Element.cpp index 713f3199..5c39e36f 100644 --- a/src/Meshes/Element.cpp +++ b/src/Meshes/Element.cpp @@ -40,7 +40,7 @@ Element::~Element(){} //*********************************************************************** -void Element::ecritPos(std::ofstream &fileStream, Axis axis) +void Element::writePos(std::ofstream &fileStream, Axis axis) { switch (axis) { case X: @@ -50,13 +50,13 @@ void Element::ecritPos(std::ofstream &fileStream, Axis axis) case Z: fileStream << m_position.getZ() << " "; break; default: - Errors::errorMessage("Element::ecritPos : Axis unknown"); break; + Errors::errorMessage("Element::writePos : Axis unknown"); break; } } //*********************************************************************** -Coord Element::vecteur(const Element *e) +Coord Element::vector(const Element *e) { Coord vec; vec.setFromSubtractedVectors(m_position, e->m_position); @@ -65,7 +65,7 @@ Coord Element::vecteur(const Element *e) //*********************************************************************** -Coord Element::vecteur(const Face *f) +Coord Element::vector(const Face *f) { Coord vec; vec.setFromSubtractedVectors(m_position, f->getPos()); diff --git a/src/Meshes/Element.h b/src/Meshes/Element.h index 19a794c7..3efa688c 100644 --- a/src/Meshes/Element.h +++ b/src/Meshes/Element.h @@ -68,12 +68,12 @@ class Element virtual void setSize(const double& /*sizeX*/, const double& /*sizeY*/, const double& /*sizeZ*/) { Errors::errorMessage("setSize not available for requested element"); }; virtual void setSize(const Coord& /*size*/) { Errors::errorMessage("setSize not available for requested element"); }; - void ecritPos(std::ofstream& fileStream, Axis axis); + void writePos(std::ofstream& fileStream, Axis axis); virtual void printInfo() const{ Errors::errorMessage("AfficheInfos not available for requested element"); }; - Coord vecteur(const Element* e); /*!< Cree un vecteur a partir des centers d elements */ - Coord vecteur(const Face* f); /*!< Cree un vecteur entre center element et center d une face */ + Coord vector(const Element* e); /*!< Cree un vector a partir des centers d elements */ + Coord vector(const Face* f); /*!< Cree un vector entre center element et center d une face */ double distance(const Element* e); /*!< Calcul de la distance entre center et center d un autre element */ double distanceX(const Element* e); /*!< Calcul de la distance selon x entre center et center d un autre element */ diff --git a/src/Meshes/Face.cpp b/src/Meshes/Face.cpp index a3097775..921f5381 100644 --- a/src/Meshes/Face.cpp +++ b/src/Meshes/Face.cpp @@ -40,7 +40,7 @@ Face::~Face(){} //*********************************************************************** -Coord Face::vecteur(Element *e) +Coord Face::vector(Element *e) { Coord vec; vec.setFromSubtractedVectors(m_position, e->getPosition()); diff --git a/src/Meshes/Face.h b/src/Meshes/Face.h index 40b98d5c..0ffac1ec 100644 --- a/src/Meshes/Face.h +++ b/src/Meshes/Face.h @@ -52,7 +52,7 @@ class Face const Coord& getPos() const { return m_position; }; virtual void setSurface(const double& /*surface*/){ Errors::errorMessage("setSurface not available for requested face"); }; - virtual void initializeAutres(const double& /*surface*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/){ Errors::errorMessage("initializeAutres not available for requested face"); } + virtual void initializeOthers(const double& /*surface*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/){ Errors::errorMessage("initializeOthers not available for requested face"); } virtual void setPos(const double& /*X*/, const double& /*Y*/, const double& /*Z*/) { Errors::errorMessage("setPos not available for requested face"); }; virtual void setNormal(const double& /*X*/, const double& /*Y*/, const double& /*Z*/) { Errors::errorMessage("setNormal not available for requested face"); }; virtual void setTangent(const double& /*X*/, const double& /*Y*/, const double& /*Z*/) { Errors::errorMessage("setTangent not available for requested face"); }; @@ -60,7 +60,7 @@ class Face virtual void setSize(const double& /*sizeX*/, const double& /*sizeY*/, const double& /*sizeZ*/) { Errors::errorMessage("setSize not available for requested face"); }; virtual void setSize(const Coord& /*size*/) { Errors::errorMessage("setSize not available for requested face"); }; - Coord vecteur(Element* e); /*!< Cree vecteur entre center face et center d un element */ + Coord vector(Element* e); /*!< Cree vector entre center face et center d un element */ double distance(Element* e); /*!< Calcul de la distance a un center d element */ virtual void printInfo() const{ Errors::errorMessage("AfficheInfos not available for requested face"); }; diff --git a/src/Meshes/FaceCartesian.cpp b/src/Meshes/FaceCartesian.cpp index 0225a2c4..0686bfe7 100644 --- a/src/Meshes/FaceCartesian.cpp +++ b/src/Meshes/FaceCartesian.cpp @@ -47,7 +47,7 @@ void FaceCartesian::setSurface(const double& surface) //*********************************************************************** -void FaceCartesian::initializeAutres(const double& surface, const Coord& normal, const Coord& tangent, const Coord& binormal) +void FaceCartesian::initializeOthers(const double& surface, const Coord& normal, const Coord& tangent, const Coord& binormal) { m_surface = surface; m_normal = normal; diff --git a/src/Meshes/FaceCartesian.h b/src/Meshes/FaceCartesian.h index 0dc373e3..bcdbc490 100644 --- a/src/Meshes/FaceCartesian.h +++ b/src/Meshes/FaceCartesian.h @@ -39,7 +39,7 @@ class FaceCartesian : public Face virtual ~FaceCartesian(); virtual void setSurface(const double& surface); - virtual void initializeAutres(const double& surface, const Coord& normal, const Coord& tangent, const Coord& binormal); + virtual void initializeOthers(const double& surface, const Coord& normal, const Coord& tangent, const Coord& binormal); virtual void setPos(const double& X, const double& Y, const double& Z); virtual void setNormal(const double& X, const double& Y, const double& Z); virtual void setTangent(const double& X, const double& Y, const double& Z); diff --git a/src/Meshes/Mesh.cpp b/src/Meshes/Mesh.cpp index eb9c1a85..f3b3427c 100644 --- a/src/Meshes/Mesh.cpp +++ b/src/Meshes/Mesh.cpp @@ -43,10 +43,10 @@ Mesh::~Mesh() {} //*********************************************************************** -void Mesh::writeResultsGnuplot(std::vector* cellsLvl, std::ofstream &fileStream, GeometricObject *objet) const +void Mesh::writeResultsGnuplot(std::vector* cellsLvl, std::ofstream &fileStream, GeometricObject *objet, bool recordPsat) const { for (unsigned int c = 0; c < cellsLvl[0].size(); c++) { - if (cellsLvl[0][c]->printGnuplotAMR(fileStream, m_geometrie, objet)) break; + if (cellsLvl[0][c]->printGnuplotAMR(fileStream, m_problemDimension, objet, recordPsat)) break; } } @@ -56,18 +56,39 @@ void Mesh::writeResultsGnuplot(std::vector* cellsLvl, std::ofstream &file void Mesh::initializePersistentCommunications(const TypeMeshContainer& cells, std::string ordreCalcul) { - int numberVariablesPhaseATransmettre = cells[0]->getPhase(0)->numberOfTransmittedVariables(); - numberVariablesPhaseATransmettre *= numberPhases; - int numberVariablesMixtureATransmettre = cells[0]->getMixture()->numberOfTransmittedVariables(); - int m_numberPrimitiveVariables = numberVariablesPhaseATransmettre + numberVariablesMixtureATransmettre + numberTransports; + int numberVariablesPhaseToSend(0); + for (int k = 0; k < numberPhases; k++) { + numberVariablesPhaseToSend += cells[0]->getPhase(k)->numberOfTransmittedVariables(); + } + int numberVariablesMixtureToSend = cells[0]->getMixture()->numberOfTransmittedVariables(); + int m_numberPrimitiveVariables = numberVariablesPhaseToSend + numberVariablesMixtureToSend + numberTransports; int m_numberSlopeVariables(0); if (ordreCalcul == "SECONDORDER") { - int numberSlopesPhaseATransmettre = cells[0]->getPhase(0)->numberOfTransmittedSlopes(); - numberSlopesPhaseATransmettre *= numberPhases; - int numberSlopesMixtureATransmettre = cells[0]->getMixture()->numberOfTransmittedSlopes(); - m_numberSlopeVariables = numberSlopesPhaseATransmettre + numberSlopesMixtureATransmettre + numberTransports + 1 + 1; //+1 for the interface detection + 1 for slope index + + int numberSlopesPhaseToSend(0); + int numberSlopesMixtureToSend(0); + int numberSlopesTransportToSend(0); + + if (this->getType() != TypeM::UNS) { + for (int k = 0; k < numberPhases; k++) { + numberSlopesPhaseToSend += cells[0]->getPhase(k)->numberOfTransmittedSlopes(); + } + numberSlopesMixtureToSend = cells[0]->getMixture()->numberOfTransmittedSlopes(); + m_numberSlopeVariables = 1 + 1; //+1 for the interface detection + 1 for slope index + numberSlopesTransportToSend = numberTransports; + } + else { + for (int k = 0; k < numberPhases; k++) { + numberSlopesPhaseToSend += cells[0]->getGradPhase(k)->numberOfTransmittedGradients(); + } + numberSlopesMixtureToSend = cells[0]->getGradMixture()->numberOfTransmittedGradients(); + for (int t = 0; t < numberTransports; t++) { + numberSlopesTransportToSend += cells[0]->getGradTransport(t)->numberOfTransmittedGradients(); + } + } + m_numberSlopeVariables += numberSlopesPhaseToSend + numberSlopesMixtureToSend + numberSlopesTransportToSend; } - parallel.initializePersistentCommunications(m_numberPrimitiveVariables, m_numberSlopeVariables, numberTransports, m_geometrie); + parallel.initializePersistentCommunications(m_numberPrimitiveVariables, m_numberSlopeVariables, numberTransports, m_problemDimension); } //*********************************************************************** diff --git a/src/Meshes/Mesh.h b/src/Meshes/Mesh.h index d699d452..ac448f1c 100644 --- a/src/Meshes/Mesh.h +++ b/src/Meshes/Mesh.h @@ -34,11 +34,11 @@ #include #include #include "../libTierces/tinyxml2.h" +#include "../Order1/Cell.h" #include "../Order1/CellGhost.h" #include "../Order1/CellInterface.h" -#include "../Order2/CellInterfaceO2.h" -#include "../Order2/CellO2.h" -#include "../Order2/CellO2Ghost.h" +#include "../Order2/CellO2GhostCartesian.h" +#include "../Order2/CellO2GhostNS.h" #include "../BoundConds/HeaderBoundCond.h" #include "../Maths/Coord.h" #include "../Parallel/Parallel.h" @@ -55,14 +55,15 @@ class Mesh Mesh(); virtual ~Mesh(); - virtual void attributLimites(std::vector& boundCond) = 0; + virtual void assignLimits(std::vector& boundCond) = 0; virtual int initializeGeometrie(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, const int& restartSimulation, bool pretraitementParallele = true, std::string ordreCalcul = "FIRSTORDER") = 0; //!< renvoi le number de dimensions (1,2 ou 3) - virtual std::string whoAmI() const { Errors::errorMessage("whoAmI pas prevu pour le mesh demande"); return 0; }; + virtual std::string whoAmI() const { Errors::errorMessage("whoAmI not available for considered mesh"); return 0; }; + virtual void setImmersedBoundaries(TypeMeshContainer* /*cellInterfacesLvl*/, std::string /*ordreCalcul*/) const {}; //Accessors //--------- - const int& getGeometrie() const { return m_geometrie; }; + const int& getProblemDimension() const { return m_problemDimension; }; const int& getNumberCells() const { return m_numberCellsCalcul; }; const int& getNumberCellsTotal() const { return m_numberCellsTotal; }; const int& getNumberFaces() const { return m_numberFacesTotal; }; @@ -77,34 +78,35 @@ class Mesh //Printing //-------- - void writeResultsGnuplot(std::vector* cellsLvl, std::ofstream& fileStream, GeometricObject* objet = 0) const; - virtual void ecritHeaderPiece(std::ofstream& /*fileStream*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("ecritHeaderPiece non prevu pour mesh considere"); }; - virtual std::string recupereChaineExtent(bool /*global*/ = false) const { Errors::errorMessage("recupereChaineExtent non prevu pour mesh considere"); return 0; }; - virtual void recupereCoord(std::vector& /*jeuDonnees*/, Axis /*axis*/) const { Errors::errorMessage("recupereCoord non prevu pour mesh considere"); }; - virtual void recupereNoeuds(std::vector& /*jeuDonnees*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("recupereNoeuds non prevu pour mesh considere"); }; - virtual void recupereConnectivite(std::vector& /*jeuDonnees*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("recupereConnectivite non prevu pour mesh considere"); }; - virtual void recupereOffsets(std::vector& /*jeuDonnees*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("recupereOffsets non prevu pour mesh considere"); }; - virtual void recupereTypeCell(std::vector& /*jeuDonnees*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("recupereTypeCell non prevu pour mesh considere"); }; + void writeResultsGnuplot(std::vector* cellsLvl, std::ofstream& fileStream, GeometricObject* objet = 0, bool recordPsat = false) const; + virtual void writeHeaderPiece(std::ofstream& /*fileStream*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("writeHeaderPiece not available for considered mesh"); }; + virtual std::string getStringExtent(bool /*global*/ = false) const { Errors::errorMessage("getStringExtent not available for considered mesh"); return 0; }; + virtual void getCoord(std::vector& /*dataset*/, Axis /*axis*/) const { Errors::errorMessage("getCoord not available for considered mesh"); }; + virtual void getNodes(std::vector& /*dataset*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("getNodes not available for considered mesh"); }; + virtual void getConnectivity(std::vector& /*dataset*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("getConnectivity not available for considered mesh"); }; + virtual void getOffsets(std::vector& /*dataset*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("getOffsets not available for considered mesh"); }; + virtual void getTypeCell(std::vector& /*dataset*/, std::vector* /*cellsLvl*/) const { Errors::errorMessage("getTypeCell not available for considered mesh"); }; //! \brief Extracting data for printing results //! \details This method enable to extract a set of data for mixture or phase, scalar or vetor //! \param cellsLvl data structure containing pointer to cells //! \param var number of requested varaible to extract (>0 for scalar, <0 for vector) //! \param phase number of requested phase (-1 for mixture, -2 for transport, -3 for xi, -4 for gradient density mixture) - //! \param jeuDonnees double vector containing the extracted data - virtual void recupereDonnees(std::vector* /*cellsLvl*/, std::vector& /*jeuDonnees*/, const int /*var*/, int /*phase*/) const { Errors::errorMessage("recupereDonnees non prevu pour mesh considere"); }; + //! \param dataset double vector containing the extracted data + virtual void getData(std::vector* /*cellsLvl*/, std::vector& /*dataset*/, const int /*var*/, int /*phase*/) const { Errors::errorMessage("getData not available for considered mesh"); }; //! \brief Extracting data for printing results //! \details This method enable to extract a set of data for mixture or phase, scalar or vetor //! \param cellsLvl data structure containing pointer to cells //! \param var number of requested varaible to extract (>0 for scalar, <0 for vector) //! \param phase number of requested phase (-1 for mixture, -2 for transport, -3 for xi, -4 for gradient density mixture) - //! \param jeuDonnees double vector containing the extracted data - virtual void setDataSet(std::vector& /*jeuDonnees*/, std::vector* /*cellsLvl*/, const int /*var*/, int /*phase*/) const { Errors::errorMessage("setDataSet not available for requested mesh"); }; + //! \param dataset double vector containing the extracted data + virtual void setDataSet(std::vector& /*dataset*/, std::vector* /*cellsLvl*/, const int /*var*/, int /*phase*/) const { Errors::errorMessage("setDataSet not available for requested mesh"); }; virtual void refineCellAndCellInterfaces(Cell* /*cell*/, const std::vector& /*addPhys*/, int& /*nbCellsTotalAMR*/) { Errors::errorMessage("refineCellAndCellInterfaces not available for requested mesh"); }; //! \brief Extracting absolute velocity for specific Moving Reference Frame computations //! \param cellsLvl data structure containing pointer to cells //! \param sourceMRF pointer to the corresponding MRF source - //! \param jeuDonnees double vector containing the extracted data - virtual void extractAbsVelocityMRF(std::vector* /*cellsLvl*/, std::vector& /*jeuDonnees*/, Source* /*sourceMRF*/) const { Errors::errorMessage("extractAbsVeloxityMRF non prevu pour mesh considere"); }; + //! \param dataset double vector containing the extracted data + virtual void extractAbsVelocityMRF(std::vector* /*cellsLvl*/, std::vector& /*dataset*/, Source* /*sourceMRF*/) const { Errors::errorMessage("extractAbsVeloxityMRF not available for considered mesh"); }; + virtual void extractReferenceLength(std::vector* /*cellsLvl*/, std::vector& /*dataset*/) const { Errors::errorMessage("extractReferenceLength not available for considered mesh"); }; virtual void printDomainDecomposition(std::ofstream& /*fileStream*/) {}; virtual void readDomainDecomposition(std::ifstream& /*fileStream*/) {}; @@ -112,7 +114,7 @@ class Mesh //---------------------- virtual void procedureRaffinementInitialization(std::vector* /*cellsLvl*/, TypeMeshContainer* /*cellsLvlGhost*/, std::vector* /*cellInterfacesLvl*/, const std::vector& /*addPhys*/, int& nbCellsTotalAMR, - std::vector& /*domains*/, Eos** /*eos*/, const int& /*restartSimulation*/, std::string /*ordreCalcul*/) { nbCellsTotalAMR = m_numberCellsCalcul; }; + std::vector& /*domains*/, Eos** /*eos*/, const int& /*restartSimulation*/, std::string /*ordreCalcul*/, std::vector& /*solidDomains*/) { nbCellsTotalAMR = m_numberCellsCalcul; }; virtual void procedureRaffinement(std::vector* /*cellsLvl*/, TypeMeshContainer* /*cellsLvlGhost*/, std::vector* /*cellInterfacesLvl*/, const int& /*lvl*/, const std::vector& /*addPhys*/, int& /*nbCellsTotalAMR*/, Eos** /*eos*/) {}; @@ -122,13 +124,26 @@ class Mesh virtual void finalizeParallele(const int& lvlMax); virtual void parallelLoadBalancingAMR(std::vector* /*cellsLvl*/, TypeMeshContainer* /*cellsLvlGhost*/, std::vector* /*cellInterfacesLvl*/, std::string /*ordreCalcul*/, - const std::vector& /*addPhys*/, Eos** /*eos*/, int& /*nbCellsTotalAMR*/, bool /*init*/ = false) {}; + const std::vector& /*addPhys*/, Eos** /*eos*/, int& /*nbCellsTotalAMR*/, std::vector& /*solidDomains*/, bool /*init*/ = false) {}; + + //Specific for mesh mapping restart + //--------------------------------- + virtual std::string getMeshExtension() const { Errors::errorMessage("getMeshExtension not available for requested mesh"); return 0; }; + //! \brief Initialize mesh of a single partition for restart with mesh mapping option + //! \details This mesh object has only the elements and nodes filled + virtual void initCpuMeshSequential(TypeMeshContainer& /*cells*/, std::string& /*computeOrder*/) { + Errors::errorMessage("initCpuMeshSequential not available for requested mesh"); + } + //! \brief Initialize mesh of a single partition of a partionned mesh for restart with mesh mapping option + //! \details This mesh object has only the elements and nodes filled + virtual void initCpuMeshParallel(TypeMeshContainer& /*cells*/, std::string& /*computeOrder*/, int /*cpu*/) { + Errors::errorMessage("initCpuMeshParallel not available for requested mesh"); + } - protected: mutable int m_numFichier; - int m_geometrie; /*indicator 1D/2D/3D*/ + int m_problemDimension; /*indicator 1D/2D/3D*/ int m_numberElements; /*Number d'elements au total (cells de computes internes de dimension n + elements limites de dimension n-1 + ghost cells de dimensions n)*/ int m_numberFacesTotal; /*Number de faces entre deux cells ou entre une cell et une limite*/ int m_numberCellsCalcul; /*Number de cells de compute internes au domain*/ diff --git a/src/Meshes/MeshCartesian.cpp b/src/Meshes/MeshCartesian.cpp index f08dc6c1..f0d39df0 100644 --- a/src/Meshes/MeshCartesian.cpp +++ b/src/Meshes/MeshCartesian.cpp @@ -42,10 +42,10 @@ MeshCartesian::MeshCartesian(double lX, int numberCellsX, double lY, int numberC for (unsigned int i = 0; i < stretchZ.size(); i++) { m_stretchZ.push_back(stretchZ[i]); } m_numberCellsCalcul = m_numberCellsXGlobal*m_numberCellsYGlobal*m_numberCellsZGlobal; - m_geometrie = 0; - if (numberCellsX != 1) { m_geometrie += 1; } - if (numberCellsY != 1) { m_geometrie += 1; } - if (numberCellsZ != 1) { m_geometrie += 1; } + m_problemDimension = 0; + if (numberCellsX != 1) { m_problemDimension += 1; } + if (numberCellsY != 1) { m_problemDimension += 1; } + if (numberCellsZ != 1) { m_problemDimension += 1; } m_type = REC; m_numberCpuX = 1; m_numberCpuY = 1; @@ -83,7 +83,7 @@ MeshCartesian::~MeshCartesian(){ //*********************************************************************** -void MeshCartesian::attributLimites(std::vector& boundCond) +void MeshCartesian::assignLimits(std::vector& boundCond) { m_numberBoundCondInit = boundCond.size(); for (int i = 0; i < m_numberBoundCondInit; i++) { @@ -101,7 +101,7 @@ void MeshCartesian::attributLimites(std::vector& boundCond) case 5: m_limZp = boundCond[i]; break; default: - Errors::errorMessage("Probleme de limites dans attributLimites"); break; + Errors::errorMessage("Probleme de limites dans assignLimits"); break; } } @@ -120,14 +120,14 @@ void MeshCartesian::attributLimites(std::vector& boundCond) case 5: m_limZp = new BoundCondNonReflecting(j+1); break; default: - Errors::errorMessage("Probleme de limites dans attributLimites"); break; + Errors::errorMessage("Probleme de limites dans assignLimits"); break; } } } //*********************************************************************** -void MeshCartesian::recupereIJK(const int& index, int& i, int& j, int& k) const +void MeshCartesian::getIJK(const int& index, int& i, int& j, int& k) const { int reste; k = index / (m_numberCellsX*m_numberCellsY); @@ -160,7 +160,7 @@ int MeshCartesian::initializeGeometrie(TypeMeshContainer& cells, TypeMesh { this->initializeGeometrieParallele(cells, cellsGhost, cellInterfaces, ordreCalcul); } - return m_geometrie; + return m_problemDimension; } //*********************************************************************** @@ -218,23 +218,23 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, m_numberCellsZ = m_numberCellsZGlobal; m_numberCellsTotal = m_numberCellsCalcul; - //Declaration du tableau de mailles et d'elements - //----------------------------------------------- + //Declaration array of elements and cells + //--------------------------------------- for (int i = 0; i < m_numberCellsCalcul; i++) { if(ordreCalcul == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2Cartesian); } m_elements.push_back(new ElementCartesian()); cells[i]->setElement(m_elements[i], i); } - //Attribution des donnees geometriques cartesiennes aux mailles - //------------------------------------------------------------- + //Assign Cartesian geometric data to element + //------------------------------------------ Coord tangent, normal, binormal; double surface(1.), volume(0.); double posX, posY, posZ; for (int i = 0; i < m_numberCellsCalcul; i++) { - this->recupereIJK(i, ix, iy, iz); + this->getIJK(i, ix, iy, iz); volume = m_dXi[ix] * m_dYj[iy] * m_dZk[iz]; cells[i]->getElement()->setVolume(volume); @@ -243,41 +243,41 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[ix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[iy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[iz]); } - if (m_geometrie > 1) lCFL *= 0.6; + if (m_problemDimension > 1) lCFL *= 0.6; cells[i]->getElement()->setLCFL(lCFL); cells[i]->getElement()->setPos(m_posXi[ix], m_posYj[iy], m_posZk[iz]); cells[i]->getElement()->setSize(m_dXi[ix], m_dYj[iy], m_dZk[iz]); } - //Attribution des donnees geometriques cartesiennes aux cell interfaces - //--------------------------------------------------------------------- - //Determination du number de faces selon compute 1D/2D/3D - //m_numberFaces : number total de faces - //m_numberFacesLimites : number de faces sur les limites - //numberFacesInternes : number de faces communes a deux mailles + //Assign Cartesian geometric data to faces + //---------------------------------------- + //Determination of number of faces for 1D/2D/3D computation + //m_numberFaces : number total of faces + //numberFacesLimites : number of faces on limits + //numberFacesInternes : number of faces common to two elements m_numberFacesTotal = 0; - int m_numberFacesLimites(0); + // int numberFacesLimites(0); if (m_numberCellsX != 1) { m_numberFacesTotal += (m_numberCellsX + 1)*m_numberCellsY*m_numberCellsZ; - m_numberFacesLimites += 2 * m_numberCellsY*m_numberCellsZ; + // numberFacesLimites += 2 * m_numberCellsY*m_numberCellsZ; } if (m_numberCellsY != 1) { m_numberFacesTotal += (m_numberCellsY + 1)*m_numberCellsX*m_numberCellsZ; - m_numberFacesLimites += 2 * m_numberCellsX*m_numberCellsZ; + // numberFacesLimites += 2 * m_numberCellsX*m_numberCellsZ; } if (m_numberCellsZ != 1) { m_numberFacesTotal += (m_numberCellsZ + 1)*m_numberCellsX*m_numberCellsY; - m_numberFacesLimites += 2 * m_numberCellsX*m_numberCellsY; + // numberFacesLimites += 2 * m_numberCellsX*m_numberCellsY; } - //int numberFacesInternes(m_numberFacesTotal - m_numberFacesLimites); + //int numberFacesInternes(m_numberFacesTotal - numberFacesLimites); //Initialization des faces internes //********************************* - int iMailleG, iMailleD, iFace(0), iTemp; + int iCellL, iCellR, iFace(0), iTemp; //Faces selon X tangent.setXYZ(0., 1., 0.); normal.setXYZ(1., 0., 0.); binormal.setXYZ(0., 0., 1.); for (ix = 0; ix < m_numberCellsX - 1; ix++) @@ -287,16 +287,16 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, for (iz = 0; iz < m_numberCellsZ; iz++) { if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - this->construitIGlobal(ix + 1, iy, iz, iMailleD); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + this->construitIGlobal(ix + 1, iy, iz, iCellR); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); surface = m_dYj[iy] * m_dZk[iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(0., m_dYj[iy], m_dZk[iz]); posX = m_posXi[ix] + 0.5*m_dXi[ix]; posY = m_posYj[iy]; @@ -320,16 +320,16 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, for (iz = 0; iz < m_numberCellsZ; iz++) { if(ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - this->construitIGlobal(ix, iy + 1, iz, iMailleD); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + this->construitIGlobal(ix, iy + 1, iz, iCellR); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[ix] * m_dZk[iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[ix], 0., m_dZk[iz]); posX = m_posXi[ix]; posY = m_posYj[iy] + 0.5*m_dYj[iy]; @@ -353,16 +353,16 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, for (iz = 0; iz < m_numberCellsZ - 1; iz++) { if(ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - this->construitIGlobal(ix, iy, iz + 1, iMailleD); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + this->construitIGlobal(ix, iy, iz + 1, iCellR); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[ix] * m_dYj[iy]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[ix], m_dYj[iy], 0.); posX = m_posXi[ix]; posY = m_posYj[iy]; @@ -392,12 +392,12 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, m_limXm->createBoundary(cellInterfaces); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); surface = m_dYj[iy] * m_dZk[iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); //FP//Q// Interet d'avoir deux fonctions initialize ? + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); //FP//Q// Interet d'avoir deux fonctions initialize ? m_faces[iFace]->setSize(0., m_dYj[iy], m_dZk[iz]); posX = 0.; posY = m_posYj[iy]; @@ -416,12 +416,12 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, m_limXp->createBoundary(cellInterfaces); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); surface = m_dYj[iy] * m_dZk[iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(0., m_dYj[iy], m_dZk[iz]); posX = m_posXi[ix] + 0.5*m_dXi[ix]; posY = m_posYj[iy]; @@ -442,8 +442,8 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; // Hard-coded boundary condition for Blasius test case // --------------------------------------------------- @@ -452,23 +452,23 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, // to define no-slip wall and slipping wall is defined thanks to a // symmetry before a given position. // To comment if not needed and be carefull when using it. - // if (cells[iMailleG]->getPosition().getX() < 0.1) { + // if (cells[iCellL]->getPosition().getX() < 0.1) { // BoundCond* limBuff(new BoundCondSymmetry(4)); // limBuff->createBoundary(cellInterfaces); // } // else { // m_limYm->createBoundary(cellInterfaces); // } - //JC//WARNING This hard-coded boundary condition will not be anymore useful - // when 2nd order on unstructured mesh will be available. + //JC//WARNING This hard-coded boundary condition is not particularly useful anymore + // since the same effect can be achieved with an unstructured mesh. m_limYm->createBoundary(cellInterfaces); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[ix] * m_dZk[iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[ix], 0., m_dZk[iz]); posX = m_posXi[ix]; posY = 0.; @@ -487,12 +487,12 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, m_limYp->createBoundary(cellInterfaces); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[ix] * m_dZk[iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[ix], 0., m_dZk[iz]); posX = m_posXi[ix]; posY = m_posYj[iy] + 0.5*m_dYj[iy]; @@ -516,12 +516,12 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, m_limZm->createBoundary(cellInterfaces); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[ix] * m_dYj[iy]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[ix], m_dYj[iy], 0.); posX = m_posXi[ix]; posY = m_posYj[iy]; @@ -540,12 +540,12 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, m_limZp->createBoundary(cellInterfaces); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[ix] * m_dYj[iy]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[ix], m_dYj[iy], 0.); posX = m_posXi[ix]; posY = m_posYj[iy]; @@ -562,15 +562,15 @@ void MeshCartesian::initializeGeometrieMonoCpu(TypeMeshContainer& cells, void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, std::string ordreCalcul) { int ix, iy, iz; - int compteMaillesParallele(0); + int countParallelCells(0); m_numberCellsX = m_numberCellsXGlobal; m_numberCellsY = m_numberCellsYGlobal; m_numberCellsZ = m_numberCellsZGlobal; - //Declaration du tableau de mailles - //--------------------------------- - //Decoupage parallele du domain geometrique + //Declaration of the cell array + //----------------------------- + //Parallel cutting of the geometric domain this->decoupageParallele(ordreCalcul, cells); //Geometrical data settings for computational cells @@ -580,7 +580,7 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells double posX, posY, posZ; for (int i = 0; i < m_numberCellsCalcul; i++) { - this->recupereIJK(i, ix, iy, iz); + this->getIJK(i, ix, iy, iz); volume = m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz]; cells[i]->getElement()->setVolume(volume); @@ -589,41 +589,41 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[m_offsetX + ix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[m_offsetY + iy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[m_offsetZ + iz]); } - if (m_geometrie > 1) lCFL *= 0.6; + if (m_problemDimension > 1) lCFL *= 0.6; cells[i]->getElement()->setLCFL(lCFL); cells[i]->getElement()->setPos(m_posXi[m_offsetX + ix], m_posYj[m_offsetY + iy], m_posZk[m_offsetZ + iz]); cells[i]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); } - //Attribution des donnees geometriques cartesiennes aux cell interfaces - //--------------------------------------------------------------------- - //Determination du number de faces selon compute 1D/2D/3D - //m_numberFaces : number total de faces - //m_numberFacesLimites : number de faces sur les limites - //numberFacesInternes : number de faces communes a deux mailles + //Assign Cartesian geometric data to faces + //---------------------------------------- + //Determination of number of faces for 1D/2D/3D computation + //m_numberFaces : number total of faces + //numberFacesLimites : number of faces on limits + //numberFacesInternes : number of faces common to two elements m_numberFacesTotal = 0; - int m_numberFacesLimites(0); + // int numberFacesLimites(0); if (m_numberCellsX != 1) { m_numberFacesTotal += (m_numberCellsX + 1)*m_numberCellsY*m_numberCellsZ; - m_numberFacesLimites += 2 * m_numberCellsY*m_numberCellsZ; + // numberFacesLimites += 2 * m_numberCellsY*m_numberCellsZ; } if (m_numberCellsY != 1) { m_numberFacesTotal += (m_numberCellsY + 1)*m_numberCellsX*m_numberCellsZ; - m_numberFacesLimites += 2 * m_numberCellsX*m_numberCellsZ; + // numberFacesLimites += 2 * m_numberCellsX*m_numberCellsZ; } if (m_numberCellsZ != 1) { m_numberFacesTotal += (m_numberCellsZ + 1)*m_numberCellsX*m_numberCellsY; - m_numberFacesLimites += 2 * m_numberCellsX*m_numberCellsY; + // numberFacesLimites += 2 * m_numberCellsX*m_numberCellsY; } - //int numberFacesInternes(m_numberFacesTotal - m_numberFacesLimites); + //int numberFacesInternes(m_numberFacesTotal - numberFacesLimites); //Initialization des faces internes //********************************* - int iMailleG, iMailleD, iFace(0); + int iCellL, iCellR, iFace(0); //Faces selon X tangent.setXYZ(0., 1., 0.); normal.setXYZ(1., 0., 0.); binormal.setXYZ(0., 0., 1.); for (ix = 0; ix < m_numberCellsX - 1; ix++) @@ -633,16 +633,16 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells for (iz = 0; iz < m_numberCellsZ; iz++) { if(ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - this->construitIGlobal(ix + 1, iy, iz, iMailleD); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + this->construitIGlobal(ix + 1, iy, iz, iCellR); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); surface = m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(0., m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); posX = m_posXi[m_offsetX + ix] + 0.5*m_dXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy]; @@ -661,16 +661,16 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells for (iz = 0; iz < m_numberCellsZ; iz++) { if(ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - this->construitIGlobal(ix, iy + 1, iz, iMailleD); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + this->construitIGlobal(ix, iy + 1, iz, iCellR); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[m_offsetX + ix] * m_dZk[m_offsetZ + iz]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[m_offsetX + ix], 0., m_dZk[m_offsetZ + iz]); posX = m_posXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy] + 0.5*m_dYj[m_offsetY + iy]; @@ -689,16 +689,16 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells for (iz = 0; iz < m_numberCellsZ - 1; iz++) { if(ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - this->construitIGlobal(ix, iy, iz, iMailleG); - this->construitIGlobal(ix, iy, iz + 1, iMailleD); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + this->construitIGlobal(ix, iy, iz, iCellL); + this->construitIGlobal(ix, iy, iz + 1, iCellR); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); surface = m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy]; - m_faces[iFace]->initializeAutres(surface, normal, tangent, binormal); + m_faces[iFace]->initializeOthers(surface, normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], 0.); posX = m_posXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy]; @@ -709,7 +709,7 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells } } - compteMaillesParallele = m_numberCellsCalcul; + countParallelCells = m_numberCellsCalcul; //Ghosts cells and cell interfaces initialisation in X direction //************************************************************** @@ -727,40 +727,40 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells if (m_numberCpuX > 1 && m_CpuCoordX > 0) { tangent.setXYZ(0., 1., 0.); normal.setXYZ(1., 0., 0.); //Inversion for neighbour CPU matching //right and Left cells catching - this->construitIGlobal(ix, iy, iz, iMailleD); - iMailleG = compteMaillesParallele++; //Ghost cell number taken in order + this->construitIGlobal(ix, iy, iz, iCellR); + iCellL = countParallelCells++; //Ghost cell number taken in order //setting ghost cell geometry - cells[iMailleG]->getElement()->setPos(cells[iMailleD]->getElement()->getPosition()); - cells[iMailleG]->getElement()->setPosX(m_posXi[m_offsetX - 1]); - cells[iMailleG]->getElement()->setSize(m_dXi[m_offsetX -1], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); - cells[iMailleG]->getElement()->setVolume(m_dXi[m_offsetX - 1] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz]); + cells[iCellL]->getElement()->setPos(cells[iCellR]->getElement()->getPosition()); + cells[iCellL]->getElement()->setPosX(m_posXi[m_offsetX - 1]); + cells[iCellL]->getElement()->setSize(m_dXi[m_offsetX -1], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); + cells[iCellL]->getElement()->setVolume(m_dXi[m_offsetX - 1] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz]); double lCFL(1.e10); if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[m_offsetX - 1]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[m_offsetY + iy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[m_offsetZ + iz]); } - if (m_geometrie > 1) lCFL *= 0.6; - cells[iMailleG]->getElement()->setLCFL(lCFL); + if (m_problemDimension > 1) lCFL *= 0.6; + cells[iCellL]->getElement()->setLCFL(lCFL); //setting boundary if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); } //B) Physical boundary condition treatment //---------------------------------------- else { tangent.setXYZ(0., -1., 0.); normal.setXYZ(-1., 0., 0.); //right and Left cells equals - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; //setting boundary m_limXm->createBoundary(cellInterfaces); } //Common settings - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - m_faces[iFace]->initializeAutres(m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + m_faces[iFace]->initializeOthers(m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); m_faces[iFace]->setSize(0., m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); posX = m_posXi[m_offsetX + ix] - 0.5*m_dXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy]; @@ -776,39 +776,39 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMailleG); + this->construitIGlobal(ix, iy, iz, iCellL); //A) CPU neighbour limits treatment //--------------------------------- if (m_numberCpuX > 1 && m_CpuCoordX < m_numberCpuX - 1) { - iMailleD = compteMaillesParallele++; //Ghost cell number taken in order + iCellR = countParallelCells++; //Ghost cell number taken in order //setting ghost cell geometry - cells[iMailleD]->getElement()->setPos(cells[iMailleG]->getElement()->getPosition()); - cells[iMailleD]->getElement()->setPosX(m_posXi[m_offsetX + ix + 1]); - cells[iMailleD]->getElement()->setSize(m_dXi[m_offsetX + ix + 1], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); - cells[iMailleD]->getElement()->setVolume(m_dXi[m_offsetX + ix + 1] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz]); + cells[iCellR]->getElement()->setPos(cells[iCellL]->getElement()->getPosition()); + cells[iCellR]->getElement()->setPosX(m_posXi[m_offsetX + ix + 1]); + cells[iCellR]->getElement()->setSize(m_dXi[m_offsetX + ix + 1], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); + cells[iCellR]->getElement()->setVolume(m_dXi[m_offsetX + ix + 1] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz]); double lCFL(1.e10); if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[m_offsetX + ix + 1]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[m_offsetY + iy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[m_offsetZ + iz]); } - if (m_geometrie > 1) lCFL *= 0.6; - cells[iMailleD]->getElement()->setLCFL(lCFL); + if (m_problemDimension > 1) lCFL *= 0.6; + cells[iCellR]->getElement()->setLCFL(lCFL); //setting boundary if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); } //B) Physical boundary condition treatment //---------------------------------------- else { m_limXp->createBoundary(cellInterfaces); - iMailleD = iMailleG; + iCellR = iCellL; } //Common settings - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - m_faces[iFace]->initializeAutres(m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + m_faces[iFace]->initializeOthers(m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); m_faces[iFace]->setSize(0., m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz]); posX = m_posXi[m_offsetX + ix] + 0.5*m_dXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy]; @@ -835,31 +835,31 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells if (m_numberCpuY > 1 && m_CpuCoordY > 0) { tangent.setXYZ(-1., 0., 0.); normal.setXYZ(0., 1., 0.); //right and Left cells catching - this->construitIGlobal(ix, iy, iz, iMailleD); - iMailleG = compteMaillesParallele++; //Ghost cell number taken in order + this->construitIGlobal(ix, iy, iz, iCellR); + iCellL = countParallelCells++; //Ghost cell number taken in order //setting ghost cell geometry - cells[iMailleG]->getElement()->setPos(cells[iMailleD]->getElement()->getPosition()); - cells[iMailleG]->getElement()->setPosY(m_posYj[m_offsetY - 1]); - cells[iMailleG]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY - 1], m_dZk[m_offsetZ + iz]); - cells[iMailleG]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY - 1] * m_dZk[m_offsetZ + iz]); + cells[iCellL]->getElement()->setPos(cells[iCellR]->getElement()->getPosition()); + cells[iCellL]->getElement()->setPosY(m_posYj[m_offsetY - 1]); + cells[iCellL]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY - 1], m_dZk[m_offsetZ + iz]); + cells[iCellL]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY - 1] * m_dZk[m_offsetZ + iz]); double lCFL(1.e10); if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[m_offsetX + ix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[m_offsetY - 1]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[m_offsetZ + iz]); } - if (m_geometrie > 1) lCFL *= 0.6; - cells[iMailleG]->getElement()->setLCFL(lCFL); + if (m_problemDimension > 1) lCFL *= 0.6; + cells[iCellL]->getElement()->setLCFL(lCFL); //setting boundary if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); } //B) Physical boundary condition treatment //---------------------------------------- else { tangent.setXYZ(1., 0., 0.); normal.setXYZ(0., -1., 0.); //right and Left cells equals - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; // Hard-coded boundary condition for Blasius test case // --------------------------------------------------- @@ -868,25 +868,25 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells // to define no-slip wall and slipping wall is defined thanks to a // symmetry before a given position. // To comment if not needed and be carefull when using it. - // if (cells[iMailleG]->getPosition().getX() < 0.1) { + // if (cells[iCellL]->getPosition().getX() < 0.1) { // BoundCond* limBuff(new BoundCondSymmetry(4)); // limBuff->createBoundary(cellInterfaces); // } // else { // m_limYm->createBoundary(cellInterfaces); // } - //JC//WARNING This hard-coded boundary condition will not be anymore useful - // when 2nd order on unstructured mesh will be available. + //JC//WARNING This hard-coded boundary condition is not particularly useful anymore + // since the same effect can be achieved with an unstructured mesh. //setting boundary m_limYm->createBoundary(cellInterfaces); } //Common settings - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - m_faces[iFace]->initializeAutres(m_dXi[m_offsetX + ix] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + m_faces[iFace]->initializeOthers(m_dXi[m_offsetX + ix] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[m_offsetX + ix], 0., m_dZk[m_offsetZ + iz]); posX = m_posXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy] - 0.5*m_dYj[m_offsetY + iy]; @@ -902,39 +902,39 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMailleG); + this->construitIGlobal(ix, iy, iz, iCellL); //A) CPU neighbour limits treatment //--------------------------------- if (m_numberCpuY > 1 && m_CpuCoordY < m_numberCpuY - 1) { - iMailleD = compteMaillesParallele++; //Ghost cell number taken in order + iCellR = countParallelCells++; //Ghost cell number taken in order //setting ghost cell geometry - cells[iMailleD]->getElement()->setPos(cells[iMailleG]->getElement()->getPosition()); - cells[iMailleD]->getElement()->setPosY(m_posYj[m_offsetY + iy + 1]); - cells[iMailleD]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy + 1], m_dZk[m_offsetZ + iz]); - cells[iMailleD]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy + 1] * m_dZk[m_offsetZ + iz]); + cells[iCellR]->getElement()->setPos(cells[iCellL]->getElement()->getPosition()); + cells[iCellR]->getElement()->setPosY(m_posYj[m_offsetY + iy + 1]); + cells[iCellR]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy + 1], m_dZk[m_offsetZ + iz]); + cells[iCellR]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy + 1] * m_dZk[m_offsetZ + iz]); double lCFL(1.e10); if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[m_offsetX + ix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[m_offsetY + iy + 1]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[m_offsetZ + iz]); } - if (m_geometrie > 1) lCFL *= 0.6; - cells[iMailleD]->getElement()->setLCFL(lCFL); + if (m_problemDimension > 1) lCFL *= 0.6; + cells[iCellR]->getElement()->setLCFL(lCFL); //setting boundary if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); } //B) Physical boundary condition treatment //---------------------------------------- else { m_limYp->createBoundary(cellInterfaces); - iMailleD = iMailleG; + iCellR = iCellL; } //Common settings - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - m_faces[iFace]->initializeAutres(m_dXi[m_offsetX + ix] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + m_faces[iFace]->initializeOthers(m_dXi[m_offsetX + ix] * m_dZk[m_offsetZ + iz], normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[m_offsetX + ix], 0., m_dZk[m_offsetZ + iz]); posX = m_posXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy] + 0.5*m_dYj[m_offsetY + iy]; @@ -961,40 +961,40 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells if (m_numberCpuZ > 1 && m_CpuCoordZ > 0) { tangent.setXYZ(1., 0., 0.); normal.setXYZ(0., 0., 1.); //Inversion for neighbour CPU matching //right and Left cells catching - this->construitIGlobal(ix, iy, iz, iMailleD); - iMailleG = compteMaillesParallele++; //Ghost cell number taken in order + this->construitIGlobal(ix, iy, iz, iCellR); + iCellL = countParallelCells++; //Ghost cell number taken in order //setting ghost cell geometry - cells[iMailleG]->getElement()->setPos(cells[iMailleD]->getElement()->getPosition()); - cells[iMailleG]->getElement()->setPosZ(m_posZk[m_offsetZ - 1]); - cells[iMailleG]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ - 1]); - cells[iMailleG]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ - 1]); + cells[iCellL]->getElement()->setPos(cells[iCellR]->getElement()->getPosition()); + cells[iCellL]->getElement()->setPosZ(m_posZk[m_offsetZ - 1]); + cells[iCellL]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ - 1]); + cells[iCellL]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ - 1]); double lCFL(1.e10); if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[m_offsetX + ix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[m_offsetY + iy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[m_offsetZ - 1]); } - if (m_geometrie > 1) lCFL *= 0.6; - cells[iMailleG]->getElement()->setLCFL(lCFL); + if (m_problemDimension > 1) lCFL *= 0.6; + cells[iCellL]->getElement()->setLCFL(lCFL); //setting boundary if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); } //B) Physical boundary condition treatment //---------------------------------------- else { tangent.setXYZ(-1., 0., 0.); normal.setXYZ(0., 0., -1.); //right and Left cells equals - this->construitIGlobal(ix, iy, iz, iMailleG); - iMailleD = iMailleG; + this->construitIGlobal(ix, iy, iz, iCellL); + iCellR = iCellL; //setting boundary m_limZm->createBoundary(cellInterfaces); } //Common settings - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - m_faces[iFace]->initializeAutres(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy], normal, tangent, binormal); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + m_faces[iFace]->initializeOthers(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy], normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], 0.); posX = m_posXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy]; @@ -1010,39 +1010,39 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells { for (iy = 0; iy < m_numberCellsY; iy++) { - this->construitIGlobal(ix, iy, iz, iMailleG); + this->construitIGlobal(ix, iy, iz, iCellL); //A) CPU neighbour limits treatment //--------------------------------- if (m_numberCpuZ > 1 && m_CpuCoordZ < m_numberCpuZ - 1) { - iMailleD = compteMaillesParallele++; //Ghost cell number taken in order + iCellR = countParallelCells++; //Ghost cell number taken in order //setting ghost cell geometry - cells[iMailleD]->getElement()->setPos(cells[iMailleG]->getElement()->getPosition()); - cells[iMailleD]->getElement()->setPosZ(m_posZk[m_offsetZ + iz + 1]); - cells[iMailleD]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz + 1]); - cells[iMailleD]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz + 1]); + cells[iCellR]->getElement()->setPos(cells[iCellL]->getElement()->getPosition()); + cells[iCellR]->getElement()->setPosZ(m_posZk[m_offsetZ + iz + 1]); + cells[iCellR]->getElement()->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], m_dZk[m_offsetZ + iz + 1]); + cells[iCellR]->getElement()->setVolume(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy] * m_dZk[m_offsetZ + iz + 1]); double lCFL(1.e10); if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[m_offsetX + ix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[m_offsetY + iy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[m_offsetZ + iz + 1]); } - if (m_geometrie > 1) lCFL *= 0.6; - cells[iMailleD]->getElement()->setLCFL(lCFL); + if (m_problemDimension > 1) lCFL *= 0.6; + cells[iCellR]->getElement()->setLCFL(lCFL); //setting boundary if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } - cells[iMailleD]->addCellInterface(cellInterfaces[iFace]); + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } + cells[iCellR]->addCellInterface(cellInterfaces[iFace]); } //B) Physical boundary condition treatment //---------------------------------------- else { m_limZp->createBoundary(cellInterfaces); - iMailleD = iMailleG; + iCellR = iCellL; } //Common settings - cells[iMailleG]->addCellInterface(cellInterfaces[iFace]); + cells[iCellL]->addCellInterface(cellInterfaces[iFace]); m_faces.push_back(new FaceCartesian()); cellInterfaces[iFace]->setFace(m_faces[iFace]); - cellInterfaces[iFace]->initialize(cells[iMailleG], cells[iMailleD]); - m_faces[iFace]->initializeAutres(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy], normal, tangent, binormal); + cellInterfaces[iFace]->initialize(cells[iCellL], cells[iCellR]); + m_faces[iFace]->initializeOthers(m_dXi[m_offsetX + ix] * m_dYj[m_offsetY + iy], normal, tangent, binormal); m_faces[iFace]->setSize(m_dXi[m_offsetX + ix], m_dYj[m_offsetY + iy], 0.); posX = m_posXi[m_offsetX + ix]; posY = m_posYj[m_offsetY + iy]; @@ -1063,33 +1063,33 @@ void MeshCartesian::initializeGeometrieParallele(TypeMeshContainer& cells void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContainer& cells) { int ix, iy, iz; - int maille_par_cpu, reste, iMaille, neighbour; - int numberElements, compteMaillesParallele(0), countElements(0); + int cellPerCpu, reste, iCell, neighbour; + int numberElements, countParallelCells(0); - if (m_geometrie == 1) { + if (m_problemDimension == 1) { //1D Cartesian Processor Topology //------------------------------- m_numberCpuX = Ncpu; m_CpuCoordX = rankCpu; - maille_par_cpu = m_numberCellsXGlobal / Ncpu; + cellPerCpu = m_numberCellsXGlobal / Ncpu; reste = m_numberCellsXGlobal % Ncpu; - if (rankCpu < reste){ ++maille_par_cpu; } - m_numberCellsX = maille_par_cpu; + if (rankCpu < reste){ ++cellPerCpu; } + m_numberCellsX = cellPerCpu; m_numberCellsY = m_numberCellsYGlobal; m_numberCellsZ = m_numberCellsZGlobal; - m_offsetX = rankCpu * maille_par_cpu; + m_offsetX = rankCpu * cellPerCpu; if (rankCpu >= reste) { m_offsetX += reste; } - //Number de mailles sur ce Cpu; + //Number of cells on this CPU m_numberCellsCalcul = m_numberCellsX*m_numberCellsY*m_numberCellsZ; //Determination du number d'element a envoyer/recevoir numberElements = m_numberCellsY*m_numberCellsZ; - //Number de mailles total en comptant les mailles necessaires au parallele; + //Number of total cells counting the cells necessary for parallel; if (rankCpu > 0 && rankCpu < Ncpu - 1){ m_numberCellsTotal = m_numberCellsCalcul + 2 * numberElements; } else{ m_numberCellsTotal = m_numberCellsCalcul + numberElements; } @@ -1097,24 +1097,23 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine //Generating cells for (int i = 0; i < m_numberCellsCalcul; i++) { if (ordreCalcul == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2Cartesian); } m_elements.push_back(new ElementCartesian()); cells[i]->setElement(m_elements[i], i); } for (int i = m_numberCellsCalcul; i < m_numberCellsTotal; i++) { if (ordreCalcul == "FIRSTORDER") { cells.push_back(new CellGhost); } - else { cells.push_back(new CellO2Ghost); } + else { cells.push_back(new CellO2GhostCartesian); } m_elements.push_back(new ElementCartesian()); cells[i]->setElement(m_elements[i], i); cells[i]->pushBackSlope(); } - ////***************Table de connectivite********** + ////***************Connectivity table********** - //Le number des mailles paralleles est situe en dehors du number de maille "vraies" - //donc commence a numberCells - compteMaillesParallele = m_numberCellsCalcul; - countElements = 0; + //The number of parallel cells is located apart from of the "true" cells + //so we start at numberCells + countParallelCells = m_numberCellsCalcul; if (rankCpu > 0) { neighbour = rankCpu - 1; @@ -1124,18 +1123,16 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } - countElements = 0; if (rankCpu < Ncpu - 1) { neighbour = rankCpu + 1; @@ -1145,20 +1142,19 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } } - else if (m_geometrie == 2) { + else if (m_problemDimension == 2) { //2D Cartesian Processor Topology //------------------------------- @@ -1238,13 +1234,13 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine //Generating cells for (int i = 0; i < m_numberCellsCalcul; i++) { if (ordreCalcul == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2Cartesian); } m_elements.push_back(new ElementCartesian()); cells[i]->setElement(m_elements[i], i); } for (int i = m_numberCellsCalcul; i < m_numberCellsTotal; i++) { if (ordreCalcul == "FIRSTORDER") { cells.push_back(new CellGhost); } - else { cells.push_back(new CellO2Ghost); } + else { cells.push_back(new CellO2GhostCartesian); } m_elements.push_back(new ElementCartesian()); cells[i]->setElement(m_elements[i], i); cells[i]->pushBackSlope(); @@ -1252,10 +1248,9 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine //Connectivity table //The number of the ghost cells is located apart from the number of "true" cells, hence start at m_numberCellsCalcul - compteMaillesParallele = m_numberCellsCalcul; + countParallelCells = m_numberCellsCalcul; int neighbourCpuCoordX, neighbourCpuCoordY; //In the x-direction - countElements = 0; if (m_CpuCoordX > 0) { neighbourCpuCoordX = m_CpuCoordX - 1; @@ -1269,18 +1264,16 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } - countElements = 0; if (m_CpuCoordX < m_numberCpuX - 1) { neighbourCpuCoordX = m_CpuCoordX + 1; @@ -1294,19 +1287,17 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } //In the y-direction - countElements = 0; if (m_CpuCoordY > 0) { neighbourCpuCoordX = m_CpuCoordX; @@ -1320,18 +1311,16 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } - countElements = 0; if (m_CpuCoordY < m_numberCpuY - 1) { neighbourCpuCoordX = m_CpuCoordX; @@ -1345,14 +1334,13 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } @@ -1458,13 +1446,13 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine //Generating cells for (int i = 0; i < m_numberCellsCalcul; i++) { if (ordreCalcul == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2Cartesian); } m_elements.push_back(new ElementCartesian()); cells[i]->setElement(m_elements[i], i); } for (int i = m_numberCellsCalcul; i < m_numberCellsTotal; i++) { if (ordreCalcul == "FIRSTORDER") { cells.push_back(new CellGhost); } - else { cells.push_back(new CellO2Ghost); } + else { cells.push_back(new CellO2GhostCartesian); } m_elements.push_back(new ElementCartesian()); cells[i]->setElement(m_elements[i], i); cells[i]->pushBackSlope(); @@ -1472,10 +1460,9 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine //Connectivity table //The number of the ghost cells is located apart from the number of "true" cells, hence start at m_numberCellsCalcul - compteMaillesParallele = m_numberCellsCalcul; + countParallelCells = m_numberCellsCalcul; int neighbourCpuCoordX, neighbourCpuCoordY, neighbourCpuCoordZ; //In the x-direction - countElements = 0; if (m_CpuCoordX > 0) { neighbourCpuCoordX = m_CpuCoordX - 1; @@ -1491,18 +1478,16 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } - countElements = 0; if (m_CpuCoordX < m_numberCpuX - 1) { neighbourCpuCoordX = m_CpuCoordX + 1; @@ -1518,19 +1503,17 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } //In the y-direction - countElements = 0; if (m_CpuCoordY > 0) { neighbourCpuCoordX = m_CpuCoordX; @@ -1546,18 +1529,16 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } - countElements = 0; if (m_CpuCoordY < m_numberCpuY - 1) { neighbourCpuCoordX = m_CpuCoordX; @@ -1573,19 +1554,17 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iz = 0; iz < m_numberCellsZ; iz++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } //In the z-direction - countElements = 0; if (m_CpuCoordZ > 0) { neighbourCpuCoordX = m_CpuCoordX; @@ -1601,18 +1580,16 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iy = 0; iy < m_numberCellsY; iy++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } - countElements = 0; if (m_CpuCoordZ < m_numberCpuZ - 1) { neighbourCpuCoordX = m_CpuCoordX; @@ -1628,14 +1605,13 @@ void MeshCartesian::decoupageParallele(std::string ordreCalcul, TypeMeshContaine { for (iy = 0; iy < m_numberCellsY; iy++) { - this->construitIGlobal(ix, iy, iz, iMaille); - parallel.addElementToSend(neighbour, cells[iMaille]); - parallel.addElementToReceive(neighbour, cells[compteMaillesParallele]); + this->construitIGlobal(ix, iy, iz, iCell); + parallel.addElementToSend(neighbour, cells[iCell]); + parallel.addElementToReceive(neighbour, cells[countParallelCells]); parallel.addSlopesToSend(neighbour); parallel.addSlopesToReceive(neighbour); - cells[compteMaillesParallele]->setRankOfNeighborCPU(neighbour); - ++countElements; - ++compteMaillesParallele; + cells[countParallelCells]->setRankOfNeighborCPU(neighbour); + ++countParallelCells; } } } @@ -1649,13 +1625,146 @@ std::string MeshCartesian::whoAmI() const return "CARTESIAN"; } +//*********************************************************************** + +void MeshCartesian::setImmersedBoundaries(TypeMeshContainer* cellInterfacesLvl, std::string ordreCalcul) const +{ + for (unsigned int i = 0; i < cellInterfacesLvl[0].size(); i++) { + // N'est pas une CL + if(cellInterfacesLvl[0][i]->whoAmI()==0){ + + //2 murs + if(cellInterfacesLvl[0][i]->getCellLeft()->getWall() && cellInterfacesLvl[0][i]->getCellRight()->getWall()){ + int b(0); + for(b=0; b < cellInterfacesLvl[0][i]->getCellRight()->getCellInterfacesSize(); b++){ + if(cellInterfacesLvl[0][i]->getCellRight()->getCellInterface(b) == cellInterfacesLvl[0][i]) break; + } + cellInterfacesLvl[0][i]->getCellRight()->deleteInterface(b); + for(b=0; b < cellInterfacesLvl[0][i]->getCellLeft()->getCellInterfacesSize(); b++){ + if(cellInterfacesLvl[0][i]->getCellLeft()->getCellInterface(b) == cellInterfacesLvl[0][i]) break; + } + cellInterfacesLvl[0][i]->getCellLeft()->deleteInterface(b); + //Traitement particulier pour remove les communications si un des murs apparait en bord de domaine communicant + if(cellInterfacesLvl[0][i]->getCellLeft()->isCellGhost()){ + parallel.deleteSlopesToSend(cellInterfacesLvl[0][i]->getCellLeft()->getRankOfNeighborCPU()); + parallel.deleteSlopesToReceive(cellInterfacesLvl[0][i]->getCellLeft()->getRankOfNeighborCPU()); + cellInterfacesLvl[0][i]->getCellLeft()->popBackSlope(); + } + if(cellInterfacesLvl[0][i]->getCellRight()->isCellGhost()){ + parallel.deleteSlopesToSend(cellInterfacesLvl[0][i]->getCellRight()->getRankOfNeighborCPU()); + parallel.deleteSlopesToReceive(cellInterfacesLvl[0][i]->getCellRight()->getRankOfNeighborCPU()); + cellInterfacesLvl[0][i]->getCellRight()->popBackSlope(); + } + delete cellInterfacesLvl[0][i]; + cellInterfacesLvl[0].erase(cellInterfacesLvl[0].begin()+i); i--; + } + + //mur a droite + else if(cellInterfacesLvl[0][i]->getCellRight()->getWall()){ + Cell* buffCell= cellInterfacesLvl[0][i]->getCellLeft(); + Face* newFace = new FaceCartesian(*(static_cast(cellInterfacesLvl[0][i]->getFace()))); + int b(0); + for(b=0; b < cellInterfacesLvl[0][i]->getCellRight()->getCellInterfacesSize(); b++){ + if(cellInterfacesLvl[0][i]->getCellRight()->getCellInterface(b) == cellInterfacesLvl[0][i]) break; + } + cellInterfacesLvl[0][i]->getCellRight()->deleteInterface(b); + + for(b=0; b < buffCell->getCellInterfacesSize(); b++){ + if(buffCell->getCellInterface(b) == cellInterfacesLvl[0][i]) break; + } + + if(cellInterfacesLvl[0][i]->getCellRight()->isCellGhost()){ + parallel.deleteSlopesToSend(cellInterfacesLvl[0][i]->getCellRight()->getRankOfNeighborCPU()); + parallel.deleteSlopesToReceive(cellInterfacesLvl[0][i]->getCellRight()->getRankOfNeighborCPU()); + cellInterfacesLvl[0][i]->getCellRight()->popBackSlope(); + } + + if(cellInterfacesLvl[0][i]->getCellLeft()->isCellGhost()){ + parallel.deleteSlopesToSend(cellInterfacesLvl[0][i]->getCellLeft()->getRankOfNeighborCPU()); + parallel.deleteSlopesToReceive(cellInterfacesLvl[0][i]->getCellLeft()->getRankOfNeighborCPU()); + cellInterfacesLvl[0][i]->getCellLeft()->popBackSlope(); + cellInterfacesLvl[0][i]->getCellLeft()->deleteInterface(b); + delete cellInterfacesLvl[0][i]; + cellInterfacesLvl[0].erase(cellInterfacesLvl[0].begin()+i); i--; + } + else{ + delete cellInterfacesLvl[0][i]; + if (ordreCalcul == "FIRSTORDER") { cellInterfacesLvl[0][i] = new BoundCondWall(-1); } + else { cellInterfacesLvl[0][i] = new BoundCondWallO2Cartesian(-1); } + cellInterfacesLvl[0][i]->setFace(newFace); + cellInterfacesLvl[0][i]->initialize(buffCell,buffCell); + buffCell->setCellInterface(b,cellInterfacesLvl[0][i]); + int allocateSlopeLocal = 0; + cellInterfacesLvl[0][i]->allocateSlopes(allocateSlopeLocal); + } + } + + //mur a gauche + else if(cellInterfacesLvl[0][i]->getCellLeft()->getWall()){ + Cell* buffCell= cellInterfacesLvl[0][i]->getCellRight(); + Face* newFace = new FaceCartesian(*(static_cast(cellInterfacesLvl[0][i]->getFace()))); + int b(0); + for(b=0; b < cellInterfacesLvl[0][i]->getCellLeft()->getCellInterfacesSize(); b++){ + if(cellInterfacesLvl[0][i]->getCellLeft()->getCellInterface(b) == cellInterfacesLvl[0][i]) break; + } + cellInterfacesLvl[0][i]->getCellLeft()->deleteInterface(b); + for(b=0; b < buffCell->getCellInterfacesSize(); b++){ + if(buffCell->getCellInterface(b) == cellInterfacesLvl[0][i]) break; + } + + if(cellInterfacesLvl[0][i]->getCellLeft()->isCellGhost()){ + parallel.deleteSlopesToSend(cellInterfacesLvl[0][i]->getCellLeft()->getRankOfNeighborCPU()); + parallel.deleteSlopesToReceive(cellInterfacesLvl[0][i]->getCellLeft()->getRankOfNeighborCPU()); + cellInterfacesLvl[0][i]->getCellLeft()->popBackSlope(); + } + + if(cellInterfacesLvl[0][i]->getCellRight()->isCellGhost()){ + parallel.deleteSlopesToSend(cellInterfacesLvl[0][i]->getCellRight()->getRankOfNeighborCPU()); + parallel.deleteSlopesToReceive(cellInterfacesLvl[0][i]->getCellRight()->getRankOfNeighborCPU()); + cellInterfacesLvl[0][i]->getCellRight()->popBackSlope(); + cellInterfacesLvl[0][i]->getCellRight()->deleteInterface(b); + delete cellInterfacesLvl[0][i]; + cellInterfacesLvl[0].erase(cellInterfacesLvl[0].begin()+i); i--; + } + else{ + delete cellInterfacesLvl[0][i]; + if (ordreCalcul == "FIRSTORDER") { cellInterfacesLvl[0][i] = new BoundCondWall(-1); } + else { cellInterfacesLvl[0][i] = new BoundCondWallO2Cartesian(-1); } + cellInterfacesLvl[0][i]->setFace(newFace); + cellInterfacesLvl[0][i]->getFace()->setNormal(-newFace->getNormal().getX(), + -newFace->getNormal().getY(), -newFace->getNormal().getZ()); + cellInterfacesLvl[0][i]->getFace()->setTangent(-newFace->getTangent().getX(), + -newFace->getTangent().getY(), -newFace->getTangent().getZ()); + cellInterfacesLvl[0][i]->initialize(buffCell,buffCell); + buffCell->setCellInterface(b,cellInterfacesLvl[0][i]); + int allocateSlopeLocal = 0; + cellInterfacesLvl[0][i]->allocateSlopes(allocateSlopeLocal); + } + } + } + + //mur a gauche d'une CL + else{ + if(cellInterfacesLvl[0][i]->getCellLeft()->getWall()){ + int b(0); + for(b=0; b < cellInterfacesLvl[0][i]->getCellLeft()->getCellInterfacesSize(); b++){ + if(cellInterfacesLvl[0][i]->getCellLeft()->getCellInterface(b) == cellInterfacesLvl[0][i]) break; + } + cellInterfacesLvl[0][i]->getCellLeft()->deleteInterface(b); + delete cellInterfacesLvl[0][i]; + cellInterfacesLvl[0].erase(cellInterfacesLvl[0].begin()+i); i--; + } + } + } +} + //************************************************************************** //******************************** PRINTING ******************************** //************************************************************************** //************************************************************************** -std::string MeshCartesian::recupereChaineExtent(bool global) const +std::string MeshCartesian::getStringExtent(bool global) const { std::stringstream chaineExtent; @@ -1679,101 +1788,104 @@ std::string MeshCartesian::recupereChaineExtent(bool global) const //**************************************************************************** -void MeshCartesian::recupereCoord(std::vector& jeuDonnees, Axis axis) const +void MeshCartesian::getCoord(std::vector& dataset, Axis axis) const { switch (axis) { case X: for (int i = 0; i < m_numberCellsX; i++) { - jeuDonnees.push_back(m_posXi[m_offsetX + i] - 0.5*m_dXi[m_offsetX + i]); + dataset.push_back(m_posXi[m_offsetX + i] - 0.5*m_dXi[m_offsetX + i]); } - jeuDonnees.push_back(m_posXi[m_offsetX + m_numberCellsX - 1] + 0.5*m_dXi[m_offsetX + m_numberCellsX - 1]); + dataset.push_back(m_posXi[m_offsetX + m_numberCellsX - 1] + 0.5*m_dXi[m_offsetX + m_numberCellsX - 1]); break; case Y: for (int j = 0; j < m_numberCellsY; j++) { - jeuDonnees.push_back(m_posYj[m_offsetY + j] - 0.5*m_dYj[m_offsetY + j]); + dataset.push_back(m_posYj[m_offsetY + j] - 0.5*m_dYj[m_offsetY + j]); } - jeuDonnees.push_back(m_posYj[m_offsetY + m_numberCellsY - 1] + 0.5*m_dYj[m_offsetY + m_numberCellsY - 1]); + dataset.push_back(m_posYj[m_offsetY + m_numberCellsY - 1] + 0.5*m_dYj[m_offsetY + m_numberCellsY - 1]); break; case Z: for (int k = 0; k < m_numberCellsZ; k++) { - jeuDonnees.push_back(m_posZk[m_offsetZ + k] - 0.5*m_dZk[m_offsetZ + k]); + dataset.push_back(m_posZk[m_offsetZ + k] - 0.5*m_dZk[m_offsetZ + k]); } - jeuDonnees.push_back(m_posZk[m_offsetZ + m_numberCellsZ - 1] + 0.5*m_dZk[m_offsetZ + m_numberCellsZ - 1]); + dataset.push_back(m_posZk[m_offsetZ + m_numberCellsZ - 1] + 0.5*m_dZk[m_offsetZ + m_numberCellsZ - 1]); break; } } //**************************************************************************** -void MeshCartesian::recupereDonnees(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, const int var, int phase) const +void MeshCartesian::getData(TypeMeshContainer* cellsLvl, std::vector& dataset, const int var, int phase) const { - jeuDonnees.clear(); + dataset.clear(); int numCell; double transport(0.); for (int k = 0; k < m_numberCellsZ; k++) { for (int j = 0; j < m_numberCellsY; j++) { for (int i = 0; i < m_numberCellsX; i++) { construitIGlobal(i, j, k, numCell); - if (var > 0) { //On veut recuperer les donnees scalars - if (phase >= 0) { jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnScalar(var)); } //Donnees de phases - else if (phase == -1) { jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnScalar(var)); } //Donnees de mixture + if (var > 0) { //We want to get the scalar data + if (phase >= 0) { dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnScalar(var)); } //data de phases + else if (phase == -1) { dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnScalar(var)); } //data de mixture else if (phase == -2) { transport = cellsLvl[0][numCell]->getTransport(var - 1).getValue(); if (transport < 1.e-20) { transport = 0.; } - jeuDonnees.push_back(transport); + dataset.push_back(transport); + } + else if (phase == -3) { dataset.push_back(cellsLvl[0][numCell]->getXi()); } + else if (phase == -4) { dataset.push_back(cellsLvl[0][numCell]->getDensityGradient()); } + else if (phase == -7) { // Saturation pressure + dataset.push_back(cellsLvl[0][numCell]->getPsat()); } - else if (phase == -3) { jeuDonnees.push_back(cellsLvl[0][numCell]->getXi()); } - else if (phase == -4) { jeuDonnees.push_back(cellsLvl[0][numCell]->getDensityGradient()); } - else { Errors::errorMessage("MeshCartesian::recupereDonnees: unknown number of phase: ", phase); } + else { Errors::errorMessage("MeshCartesian::getData: unknown number of phase: ", phase); } } - else { //On veut recuperer les donnees vectorielles - if (phase >= 0) { //Donnees de phases - jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getX()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getY()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getZ()); + else { //We want to get the vector data + if (phase >= 0) { //data de phases + dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getX()); + dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getY()); + dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getZ()); } - else if (phase == -1) { //Donnees de mixture - jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getX()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getY()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getZ()); + else if (phase == -1) { //data de mixture + dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getX()); + dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getY()); + dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getZ()); } - else { Errors::errorMessage("MeshCartesian::recupereDonnees: unknown number of phase: ", phase); } - } //Fin vecteur - } // Fin X - } //Fin Y - } //Fin Z + else { Errors::errorMessage("MeshCartesian::getData: unknown number of phase: ", phase); } + } //End vector + } // End X + } //End Y + } //End Z } //**************************************************************************** -void MeshCartesian::setDataSet(std::vector& jeuDonnees, TypeMeshContainer* cellsLvl, const int var, int phase) const +void MeshCartesian::setDataSet(std::vector& dataset, TypeMeshContainer* cellsLvl, const int var, int phase) const { int iterDataSet(0); Coord vec; for (unsigned int i = 0; i < cellsLvl[0].size(); i++) { if (var > 0) { //Scalars data are first set - if (phase >= 0) { cellsLvl[0][i]->getPhase(phase)->setScalar(var, jeuDonnees[iterDataSet++]); } //phases data - else if (phase == -1) { cellsLvl[0][i]->getMixture()->setScalar(var, jeuDonnees[iterDataSet++]); } //mixture data - else if (phase == -2) { cellsLvl[0][i]->getTransport(var - 1).setValue(jeuDonnees[iterDataSet++]); } //transport data - else if (phase == -3) { cellsLvl[0][i]->setXi(jeuDonnees[iterDataSet++]); } //xi indicator + if (phase >= 0) { cellsLvl[0][i]->getPhase(phase)->setScalar(var, dataset[iterDataSet++]); } //phases data + else if (phase == -1) { cellsLvl[0][i]->getMixture()->setScalar(var, dataset[iterDataSet++]); } //mixture data + else if (phase == -2) { cellsLvl[0][i]->getTransport(var - 1).setValue(dataset[iterDataSet++]); } //transport data + else if (phase == -3) { cellsLvl[0][i]->setXi(dataset[iterDataSet++]); } //xi indicator else { Errors::errorMessage("MeshCartesian::setDataSet: unknown phase number: ", phase); } } - else { //On veut recuperer les donnees vectorielles + else { //We want to get the vector data if (phase >= 0) { //Phases data - vec.setXYZ(jeuDonnees[iterDataSet], jeuDonnees[iterDataSet + 1], jeuDonnees[iterDataSet + 2]); + vec.setXYZ(dataset[iterDataSet], dataset[iterDataSet + 1], dataset[iterDataSet + 2]); cellsLvl[0][i]->getPhase(phase)->setVector(-var, vec); iterDataSet += 3; } else if (phase == -1) { //Mixture data - vec.setXYZ(jeuDonnees[iterDataSet], jeuDonnees[iterDataSet + 1], jeuDonnees[iterDataSet + 2]); + vec.setXYZ(dataset[iterDataSet], dataset[iterDataSet + 1], dataset[iterDataSet + 2]); cellsLvl[0][i]->getMixture()->setVector(-var, vec); iterDataSet += 3; } else { Errors::errorMessage("MeshCartesian::setDataSet: unknown phase number: ", phase); } - } //Fin vecteur + } //End vector } } diff --git a/src/Meshes/MeshCartesian.h b/src/Meshes/MeshCartesian.h index e5a73ccd..0822cbd1 100644 --- a/src/Meshes/MeshCartesian.h +++ b/src/Meshes/MeshCartesian.h @@ -35,6 +35,9 @@ #include "ElementCartesian.h" #include "FaceCartesian.h" #include "stretchZone.h" +#include "../Order2/CellInterfaceO2Cartesian.h" +#include "../Order2/CellO2Cartesian.h" +#include "../Order2/CellO2GhostCartesian.h" #include "../Parallel/decomposition.hpp" class MeshCartesian : public Mesh @@ -44,8 +47,8 @@ class MeshCartesian : public Mesh std::vector stretchX, std::vector stretchY, std::vector stretchZ); virtual ~MeshCartesian(); - virtual void attributLimites(std::vector& boundCond); - void recupereIJK(const int& index, int& i, int& j, int& k) const; + virtual void assignLimits(std::vector& boundCond); + void getIJK(const int& index, int& i, int& j, int& k) const; void construitIGlobal(const int& i, const int& j, const int& k, int& index) const; virtual int initializeGeometrie(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, const int& /*restartSimulation*/, bool /*pretraitementParallele*/, std::string ordreCalcul); @@ -54,6 +57,7 @@ class MeshCartesian : public Mesh void initializeGeometrieParallele(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, std::string ordreCalcul); void decoupageParallele(std::string ordreCalcul, TypeMeshContainer& cells); virtual std::string whoAmI() const; + virtual void setImmersedBoundaries(TypeMeshContainer* cellInterfacesLvl, std::string ordreCalcul) const; //Accessors //--------- @@ -62,10 +66,10 @@ class MeshCartesian : public Mesh //Printing / Reading //------------------ - virtual std::string recupereChaineExtent(bool global = false) const; - virtual void recupereCoord(std::vector& jeuDonnees, Axis axis) const; - virtual void recupereDonnees(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, const int var, int phase) const; - virtual void setDataSet(std::vector& jeuDonnees, TypeMeshContainer* cellsLvl, const int var, int phase) const; + virtual std::string getStringExtent(bool global = false) const; + virtual void getCoord(std::vector& dataset, Axis axis) const; + virtual void getData(TypeMeshContainer* cellsLvl, std::vector& dataset, const int var, int phase) const; + virtual void setDataSet(std::vector& dataset, TypeMeshContainer* cellsLvl, const int var, int phase) const; protected: TypeMeshContainer m_elements; //!& cells, TypeM { this->meshStretching(); this->initializeGeometrieAMR(cells, cellsGhost, cellInterfaces, restartSimulation, ordreCalcul); - return m_geometrie; + return m_problemDimension; } @@ -74,17 +74,17 @@ void MeshCartesianAMR::initializeGeometrieAMR(TypeMeshContainer& cells, T else { m_decomp.updatePhysicalDomainSizes(physicalDomainSizes); } auto keys = m_decomp.initialize(Ncpu, rankCpu, restartSimulation); + //Create cells and elements + //------------------------- for(unsigned int i = 0; i < keys.size(); ++i) { if (ordreCalcul == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2Cartesian); } m_elements.push_back(new ElementCartesian()); m_elements[i]->setKey(keys[i]); cells[i]->setElement(m_elements[i], i); } - //Create cells and elements - //------------------------- this->assignElementProperties(cells, keys); //Create cell interfaces, faces and ghost cells @@ -118,7 +118,7 @@ void MeshCartesianAMR::assignElementProperties(TypeMeshContainer& cells, if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[ix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[iy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[iz]); } - if (m_geometrie > 1) lCFL *= 0.6; + if (m_problemDimension > 1) lCFL *= 0.6; cells[i]->getElement()->setLCFL(lCFL); cells[i]->getElement()->setPos(m_posXi[ix], m_posYj[iy], m_posZk[iz]); @@ -153,7 +153,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) { const auto coord = cells[i]->getElement()->getKey().coordinate(); const auto ix = coord.x(), iy = coord.y(), iz = coord.z(); - for (int idx = 0; idx < 2*m_geometrie; idx++) + for (int idx = 0; idx < 2*m_problemDimension; idx++) { const auto offset=offsets[idx]; @@ -228,17 +228,17 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) if (offset[0]) { m_faces.back()->setSize(0.0, m_dYj[iy], m_dZk[iz]); - m_faces.back()->initializeAutres(m_dYj[iy] * m_dZk[iz], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dYj[iy] * m_dZk[iz], normal, tangent, binormal); } if (offset[1]) { m_faces.back()->setSize(m_dXi[ix], 0.0, m_dZk[iz]); - m_faces.back()->initializeAutres(m_dXi[ix] * m_dZk[iz], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dXi[ix] * m_dZk[iz], normal, tangent, binormal); } if (offset[2]) { m_faces.back()->setSize(m_dXi[ix], m_dYj[iy], 0.0); - m_faces.back()->initializeAutres(m_dYj[iy] * m_dXi[ix], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dYj[iy] * m_dXi[ix], normal, tangent, binormal); } m_faces.back()->setPos(posX, posY, posZ); @@ -248,12 +248,11 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) //Get neighbor key auto nKey = cells[i]->getElement()->getKey().neighbor(offset); int neighbour = m_decomp.get_rank(nKey); - if (offset[0]>0 || offset[1]>0 || offset[2]>0) //Positive offset { //Create cell interface if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces.back()->setFace(m_faces.back()); @@ -261,17 +260,17 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) if (offset[0]) { m_faces.back()->setSize(0.0, m_dYj[iy], m_dZk[iz]); - m_faces.back()->initializeAutres(m_dYj[iy] * m_dZk[iz], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dYj[iy] * m_dZk[iz], normal, tangent, binormal); } if (offset[1]) { m_faces.back()->setSize(m_dXi[ix], 0.0, m_dZk[iz]); - m_faces.back()->initializeAutres(m_dXi[ix] * m_dZk[iz], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dXi[ix] * m_dZk[iz], normal, tangent, binormal); } if (offset[2]) { m_faces.back()->setSize(m_dXi[ix], m_dYj[iy], 0.0); - m_faces.back()->initializeAutres(m_dYj[iy] * m_dXi[ix], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dYj[iy] * m_dXi[ix], normal, tangent, binormal); } m_faces.back()->setPos(posX, posY, posZ); @@ -299,7 +298,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) { //Create ghost cell and update cell interface if (ordreCalcul == "FIRSTORDER") { cellsGhost.push_back(new CellGhost); } - else { cellsGhost.push_back(new CellO2Ghost); } + else { cellsGhost.push_back(new CellO2GhostCartesian); } m_elements.push_back(new ElementCartesian()); m_elements.back()->setKey(nKey); cellsGhost.back()->setElement(m_elements.back(), cellsGhost.size()-1); @@ -334,7 +333,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[nix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[niy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[niz]); } - if (m_geometrie > 1) lCFL *= 0.6; + if (m_problemDimension > 1) lCFL *= 0.6; cellsGhost.back()->getElement()->setLCFL(lCFL); cellsGhost.back()->getElement()->setPos(m_posXi[nix], m_posYj[niy], m_posZk[niz]); @@ -377,7 +376,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) { //Create cell interface related to the ghost cell if (ordreCalcul == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2Cartesian); } m_faces.push_back(new FaceCartesian()); cellInterfaces.back()->setFace(m_faces.back()); @@ -388,7 +387,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) tangent.setXYZ( 0.,1.,0.); binormal.setXYZ(0.,0.,1.); m_faces.back()->setSize(0.0, m_dYj[iy], m_dZk[iz]); - m_faces.back()->initializeAutres(m_dYj[iy] * m_dZk[iz], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dYj[iy] * m_dZk[iz], normal, tangent, binormal); } if (offset[1]) { @@ -396,7 +395,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) tangent.setXYZ( -1.,0.,0.); binormal.setXYZ(0.,0.,1.); m_faces.back()->setSize(m_dXi[ix], 0.0, m_dZk[iz]); - m_faces.back()->initializeAutres(m_dXi[ix] * m_dZk[iz], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dXi[ix] * m_dZk[iz], normal, tangent, binormal); } if (offset[2]) { @@ -404,7 +403,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) tangent.setXYZ( 1.,0.,0.); binormal.setXYZ(0.,1.,0.); m_faces.back()->setSize(m_dXi[ix], m_dYj[iy], 0.0); - m_faces.back()->initializeAutres(m_dYj[iy] * m_dXi[ix], normal, tangent, binormal); + m_faces.back()->initializeOthers(m_dYj[iy] * m_dXi[ix], normal, tangent, binormal); } m_faces.back()->setPos(posX, posY, posZ); @@ -418,7 +417,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) { //Create ghost cell if (ordreCalcul == "FIRSTORDER") { cellsGhost.push_back(new CellGhost); } - else { cellsGhost.push_back(new CellO2Ghost); } + else { cellsGhost.push_back(new CellO2GhostCartesian); } m_elements.push_back(new ElementCartesian()); m_elements.back()->setKey(nKey); cellsGhost.back()->setElement(m_elements.back(), cellsGhost.size()-1); @@ -451,7 +450,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) if (m_numberCellsX != 1) { lCFL = std::min(lCFL, m_dXi[nix]); } if (m_numberCellsY != 1) { lCFL = std::min(lCFL, m_dYj[niy]); } if (m_numberCellsZ != 1) { lCFL = std::min(lCFL, m_dZk[niz]); } - if (m_geometrie > 1) lCFL *= 0.6; + if (m_problemDimension > 1) lCFL *= 0.6; cellsGhost.back()->getElement()->setLCFL(lCFL); cellsGhost.back()->getElement()->setPos(m_posXi[nix], m_posYj[niy], m_posZk[niz]); @@ -509,7 +508,7 @@ TypeMeshContainer& cellInterfaces, std::string ordreCalcul) void MeshCartesianAMR::procedureRaffinementInitialization(TypeMeshContainer* cellsLvl, TypeMeshContainer* cellsLvlGhost, TypeMeshContainer* cellInterfacesLvl, const std::vector& addPhys, int& nbCellsTotalAMR, - std::vector& domains, Eos** eos, const int& restartSimulation, std::string ordreCalcul) + std::vector& domains, Eos** eos, const int& restartSimulation, std::string ordreCalcul, std::vector& solidDomains) { nbCellsTotalAMR = m_numberCellsCalcul; @@ -535,7 +534,7 @@ void MeshCartesianAMR::procedureRaffinementInitialization(TypeMeshContainergetSplit()) { cellsLvl[lvl][i]->completeFulfillState(); } } } - if (Ncpu > 1) { this->parallelLoadBalancingAMR(cellsLvl, cellsLvlGhost, cellInterfacesLvl, ordreCalcul, addPhys, eos, nbCellsTotalAMR, true); } + if (Ncpu > 1) { this->parallelLoadBalancingAMR(cellsLvl, cellsLvlGhost, cellInterfacesLvl, ordreCalcul, addPhys, eos, nbCellsTotalAMR, solidDomains, true); } } } @@ -596,7 +595,7 @@ void MeshCartesianAMR::procedureRaffinement(TypeMeshContainer* cellsLvl, if (Ncpu > 1) { //5) Raffinement et deraffinement des cells fantomes //----------------------------------------------------- - //Communication split + Raffinement et deraffinement des cells fantomes + Reconstruction du tableau de cells fantomes de niveau lvl + 1 + //Communication split + Raffinement et deraffinement des cells fantomes + Reconstruction du array de cells fantomes de niveau lvl + 1 parallel.communicationsSplit(lvl); cellsLvlGhost[lvlPlus1].clear(); for (unsigned int i = 0; i < cellsLvlGhost[lvl].size(); i++) { cellsLvlGhost[lvl][i]->chooseRefineDeraffineGhost(m_numberCellsY, m_numberCellsZ, addPhys, cellsLvlGhost); } @@ -606,15 +605,15 @@ void MeshCartesianAMR::procedureRaffinement(TypeMeshContainer* cellsLvl, //6) Mise a jour des communications persistantes au niveau lvl + 1 //---------------------------------------------------------------- parallel.communicationsNumberGhostCells(lvlPlus1); //Communication des numbers d'elements a envoyer et a recevoir de chaque cote de la limite parallele - parallel.updatePersistentCommunicationsLvlAMR(lvlPlus1, m_geometrie); + parallel.updatePersistentCommunicationsLvlAMR(lvlPlus1, m_problemDimension); } - //7) Reconstruction des tableaux de cells et cell interfaces lvl + 1 - //------------------------------------------------------------------ + //7) Reconstruction des arrays de cells et cell interfaces lvl + 1 + //---------------------------------------------------------------- cellsLvl[lvlPlus1].clear(); cellInterfacesLvl[lvlPlus1].clear(); for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { cellsLvl[lvl][i]->buildLvlCellsAndLvlInternalCellInterfacesArrays(cellsLvl, cellInterfacesLvl); } - for (unsigned int i = 0; i < cellInterfacesLvl[lvl].size(); i++) { cellInterfacesLvl[lvl][i]->constructionTableauCellInterfacesExternesLvl(cellInterfacesLvl); } + for (unsigned int i = 0; i < cellInterfacesLvl[lvl].size(); i++) { cellInterfacesLvl[lvl][i]->constructionArrayExternalCellInterfacesLvl(cellInterfacesLvl); } } } @@ -629,9 +628,9 @@ std::string MeshCartesianAMR::whoAmI() const //******************************** PRINTING ******************************** //************************************************************************** -void MeshCartesianAMR::ecritHeaderPiece(std::ofstream &fileStream, TypeMeshContainer* cellsLvl) const +void MeshCartesianAMR::writeHeaderPiece(std::ofstream &fileStream, TypeMeshContainer* cellsLvl) const { - int numberCells = 0, numberPointsParMaille = 4; + int numberCells = 0, numberPointsPerCell = 4; for (int lvl = 0; lvl <= m_lvlMax; lvl++) { for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { if (!cellsLvl[lvl][i]->getSplit()) { @@ -639,14 +638,14 @@ void MeshCartesianAMR::ecritHeaderPiece(std::ofstream &fileStream, TypeMeshConta } } } - if (m_numberCellsZ > 1) { numberPointsParMaille = 8; } + if (m_numberCellsZ > 1) { numberPointsPerCell = 8; } - fileStream << " " << std::endl; + fileStream << " " << std::endl; } //*********************************************************************** -void MeshCartesianAMR::recupereNoeuds(std::vector& jeuDonnees, std::vector* cellsLvl) const +void MeshCartesianAMR::getNodes(std::vector& dataset, std::vector* cellsLvl) const { int dimZ = 0; if (m_numberCellsZ > 1) dimZ = 1; @@ -660,62 +659,62 @@ void MeshCartesianAMR::recupereNoeuds(std::vector& jeuDonnees, std::vect dYsur2 = 0.5*cellsLvl[lvl][i]->getSizeY(); dZsur2 = 0.5*cellsLvl[lvl][i]->getSizeZ(); //Point 0 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); //Point 1 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); //Point 2 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); //Point 3 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() - dZsur2*dimZ); if (dimZ > 0.99) { //Point 4 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); //Point 5 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() - dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); //Point 6 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() + dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); //Point 7 - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getX() - dXsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getY() + dYsur2); + dataset.push_back(cellsLvl[lvl][i]->getPosition().getZ() + dZsur2); } - } //Fin cell non split - } //Fin Cells - } //Fin Levels + } //End cell non split + } //End Cells + } //End Levels } //*********************************************************************** -void MeshCartesianAMR::recupereConnectivite(std::vector& jeuDonnees, std::vector* cellsLvl) const +void MeshCartesianAMR::getConnectivity(std::vector& dataset, std::vector* cellsLvl) const { int dimZ(0); - int numberPointsParMaille(4); - if (m_numberCellsZ > 1) { dimZ = 1; numberPointsParMaille = 8; } + int numberPointsPerCell(4); + if (m_numberCellsZ > 1) { dimZ = 1; numberPointsPerCell = 8; } if (dimZ < 0.99) { int numCell(0); for (int lvl = 0; lvl <= m_lvlMax; lvl++) { for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { if (!cellsLvl[lvl][i]->getSplit()) { - jeuDonnees.push_back(numCell*numberPointsParMaille); - jeuDonnees.push_back(numCell*numberPointsParMaille+1); - jeuDonnees.push_back(numCell*numberPointsParMaille+2); - jeuDonnees.push_back(numCell*numberPointsParMaille+3); + dataset.push_back(numCell*numberPointsPerCell); + dataset.push_back(numCell*numberPointsPerCell+1); + dataset.push_back(numCell*numberPointsPerCell+2); + dataset.push_back(numCell*numberPointsPerCell+3); numCell++; } } @@ -726,14 +725,14 @@ void MeshCartesianAMR::recupereConnectivite(std::vector& jeuDonnees, std for (int lvl = 0; lvl <= m_lvlMax; lvl++) { for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { if (!cellsLvl[lvl][i]->getSplit()) { - jeuDonnees.push_back(numCell*numberPointsParMaille); - jeuDonnees.push_back(numCell*numberPointsParMaille + 1); - jeuDonnees.push_back(numCell*numberPointsParMaille + 2); - jeuDonnees.push_back(numCell*numberPointsParMaille + 3); - jeuDonnees.push_back(numCell*numberPointsParMaille + 4); - jeuDonnees.push_back(numCell*numberPointsParMaille + 5); - jeuDonnees.push_back(numCell*numberPointsParMaille + 6); - jeuDonnees.push_back(numCell*numberPointsParMaille + 7); + dataset.push_back(numCell*numberPointsPerCell); + dataset.push_back(numCell*numberPointsPerCell + 1); + dataset.push_back(numCell*numberPointsPerCell + 2); + dataset.push_back(numCell*numberPointsPerCell + 3); + dataset.push_back(numCell*numberPointsPerCell + 4); + dataset.push_back(numCell*numberPointsPerCell + 5); + dataset.push_back(numCell*numberPointsPerCell + 6); + dataset.push_back(numCell*numberPointsPerCell + 7); numCell++; } } @@ -743,15 +742,15 @@ void MeshCartesianAMR::recupereConnectivite(std::vector& jeuDonnees, std //*********************************************************************** -void MeshCartesianAMR::recupereOffsets(std::vector& jeuDonnees, std::vector* cellsLvl) const +void MeshCartesianAMR::getOffsets(std::vector& dataset, std::vector* cellsLvl) const { - int numberPointsParMaille(4); - if (m_numberCellsZ > 1) { numberPointsParMaille = 8; } + int numberPointsPerCell(4); + if (m_numberCellsZ > 1) { numberPointsPerCell = 8; } int numCell(0); for (int lvl = 0; lvl <= m_lvlMax; lvl++) { for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { if (!cellsLvl[lvl][i]->getSplit()) { - jeuDonnees.push_back((numCell + 1)*numberPointsParMaille); + dataset.push_back((numCell + 1)*numberPointsPerCell); numCell++; } } @@ -760,16 +759,14 @@ void MeshCartesianAMR::recupereOffsets(std::vector& jeuDonnees, std::vec //**************************************************************************** -void MeshCartesianAMR::recupereTypeCell(std::vector& jeuDonnees, std::vector* cellsLvl) const +void MeshCartesianAMR::getTypeCell(std::vector& dataset, std::vector* cellsLvl) const { int type(9); if (m_numberCellsZ > 1) { type = 12; } - int numCell(0); for (int lvl = 0; lvl <= m_lvlMax; lvl++) { for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { if (!cellsLvl[lvl][i]->getSplit()) { - jeuDonnees.push_back(type); - numCell++; + dataset.push_back(type); } } } @@ -777,48 +774,51 @@ void MeshCartesianAMR::recupereTypeCell(std::vector& jeuDonnees, std::ve //*********************************************************************** -void MeshCartesianAMR::recupereDonnees(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, const int var, int phase) const +void MeshCartesianAMR::getData(TypeMeshContainer* cellsLvl, std::vector& dataset, const int var, int phase) const { - jeuDonnees.clear(); + dataset.clear(); double transport(0.); for (int lvl = 0; lvl <= m_lvlMax; lvl++) { for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { if (!cellsLvl[lvl][i]->getSplit()) { - if (var > 0) { //On veut recuperer les donnees scalars - if (phase >= 0) { jeuDonnees.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnScalar(var)); } //Donnees de phases - else if (phase == -1) { jeuDonnees.push_back(cellsLvl[lvl][i]->getMixture()->returnScalar(var)); } //Donnees de mixture + if (var > 0) { //We want to get the scalar data + if (phase >= 0) { dataset.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnScalar(var)); } //data de phases + else if (phase == -1) { dataset.push_back(cellsLvl[lvl][i]->getMixture()->returnScalar(var)); } //data de mixture else if (phase == -2) { transport = cellsLvl[lvl][i]->getTransport(var - 1).getValue(); if (transport < 1.e-20) { transport = 0.; } - jeuDonnees.push_back(transport); + dataset.push_back(transport); + } + else if (phase == -3) { dataset.push_back(cellsLvl[lvl][i]->getXi()); } + else if (phase == -4) { dataset.push_back(cellsLvl[lvl][i]->getDensityGradient()); } + else if (phase == -5) { dataset.push_back(static_cast(rankCpu)); } + else if (phase == -6) { dataset.push_back(static_cast(cellsLvl[lvl][i]->getElement()->getKey().getIndex())); } + else if (phase == -7) { // Saturation pressure + dataset.push_back(cellsLvl[lvl][i]->getPsat()); } - else if (phase == -3) { jeuDonnees.push_back(cellsLvl[lvl][i]->getXi()); } - else if (phase == -4) { jeuDonnees.push_back(cellsLvl[lvl][i]->getDensityGradient()); } - else if (phase == -5) { jeuDonnees.push_back(static_cast(rankCpu)); } - else if (phase == -6) { jeuDonnees.push_back(static_cast(cellsLvl[lvl][i]->getElement()->getKey().getIndex())); } - else { Errors::errorMessage("MeshCartesianAMR::recupereDonnees: unknown number of phase: ", phase); } + else { Errors::errorMessage("MeshCartesianAMR::getData: unknown number of phase: ", phase); } } - else { //On veut recuperer les donnees vectorielles - if (phase >= 0) { //Donnees de phases - jeuDonnees.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnVector(-var).getX()); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnVector(-var).getY()); - jeuDonnees.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnVector(-var).getZ()); + else { //We want to get the vector data + if (phase >= 0) { //data de phases + dataset.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnVector(-var).getX()); + dataset.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnVector(-var).getY()); + dataset.push_back(cellsLvl[lvl][i]->getPhase(phase)->returnVector(-var).getZ()); } - else if (phase == -1){ //Donnees de mixture - jeuDonnees.push_back(cellsLvl[lvl][i]->getMixture()->returnVector(-var).getX()); - jeuDonnees.push_back(cellsLvl[lvl][i]->getMixture()->returnVector(-var).getY()); - jeuDonnees.push_back(cellsLvl[lvl][i]->getMixture()->returnVector(-var).getZ()); + else if (phase == -1){ //data de mixture + dataset.push_back(cellsLvl[lvl][i]->getMixture()->returnVector(-var).getX()); + dataset.push_back(cellsLvl[lvl][i]->getMixture()->returnVector(-var).getY()); + dataset.push_back(cellsLvl[lvl][i]->getMixture()->returnVector(-var).getZ()); } - else { Errors::errorMessage("MeshCartesianAMR::recupereDonnees: unknown number of phase: ", phase); } - } //Fin vecteur - } //Fin split - } //fin lvl - } //fin levels + else { Errors::errorMessage("MeshCartesianAMR::getData: unknown number of phase: ", phase); } + } //End vector + } //End split + } //End lvl + } //End levels } //**************************************************************************** -void MeshCartesianAMR::setDataSet(std::vector& jeuDonnees, TypeMeshContainer* cellsLvl, const int var, int phase) const +void MeshCartesianAMR::setDataSet(std::vector& dataset, TypeMeshContainer* cellsLvl, const int var, int phase) const { int iterDataSet(0); Coord vec; @@ -826,28 +826,28 @@ void MeshCartesianAMR::setDataSet(std::vector& jeuDonnees, TypeMeshConta for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { if (!cellsLvl[lvl][i]->getSplit()) { if (var > 0) { //Scalars data are first set - if (phase >= 0) { cellsLvl[lvl][i]->getPhase(phase)->setScalar(var, jeuDonnees[iterDataSet++]); } //phases data - else if (phase == -1) { cellsLvl[lvl][i]->getMixture()->setScalar(var, jeuDonnees[iterDataSet++]); } //mixture data - else if (phase == -2) { cellsLvl[lvl][i]->getTransport(var - 1).setValue(jeuDonnees[iterDataSet++]); } //transport data - else if (phase == -3) { cellsLvl[lvl][i]->setXi(jeuDonnees[iterDataSet++]); } //xi indicator + if (phase >= 0) { cellsLvl[lvl][i]->getPhase(phase)->setScalar(var, dataset[iterDataSet++]); } //phases data + else if (phase == -1) { cellsLvl[lvl][i]->getMixture()->setScalar(var, dataset[iterDataSet++]); } //mixture data + else if (phase == -2) { cellsLvl[lvl][i]->getTransport(var - 1).setValue(dataset[iterDataSet++]); } //transport data + else if (phase == -3) { cellsLvl[lvl][i]->setXi(dataset[iterDataSet++]); } //xi indicator else { Errors::errorMessage("MeshCartesianAMR::setDataSet: unknown phase number: ", phase); } } - else { //On veut recuperer les donnees vectorielles + else { //We want to get the vector data if (phase >= 0) { //Phases data - vec.setXYZ(jeuDonnees[iterDataSet], jeuDonnees[iterDataSet + 1], jeuDonnees[iterDataSet + 2]); + vec.setXYZ(dataset[iterDataSet], dataset[iterDataSet + 1], dataset[iterDataSet + 2]); cellsLvl[lvl][i]->getPhase(phase)->setVector(-var, vec); iterDataSet += 3; } else if (phase == -1) { //Mixture data - vec.setXYZ(jeuDonnees[iterDataSet], jeuDonnees[iterDataSet + 1], jeuDonnees[iterDataSet + 2]); + vec.setXYZ(dataset[iterDataSet], dataset[iterDataSet + 1], dataset[iterDataSet + 2]); cellsLvl[lvl][i]->getMixture()->setVector(-var, vec); iterDataSet += 3; } else { Errors::errorMessage("MeshCartesianAMR::setDataSet: unknown phase number: ", phase); } - } //Fin vecteur - } // Fin split - } // Fin lvl - } // Fin levels + } //End vector + } // End split + } // End lvl + } // End levels } //*********************************************************************** @@ -881,18 +881,22 @@ void MeshCartesianAMR::readDomainDecomposition(std::ifstream &fileStream) void MeshCartesianAMR::initializePersistentCommunications(const TypeMeshContainer& cells, std::string ordreCalcul) { - int numberVariablesPhaseATransmettre = cells[0]->getPhase(0)->numberOfTransmittedVariables(); - numberVariablesPhaseATransmettre *= numberPhases; - int numberVariablesMixtureATransmettre = cells[0]->getMixture()->numberOfTransmittedVariables(); - int m_numberPrimitiveVariables = numberVariablesPhaseATransmettre + numberVariablesMixtureATransmettre + numberTransports; + int numberVariablesPhaseToSend(0); + for (int k = 0; k < numberPhases; k++) { + numberVariablesPhaseToSend += cells[0]->getPhase(k)->numberOfTransmittedVariables(); + } + int numberVariablesMixtureToSend = cells[0]->getMixture()->numberOfTransmittedVariables(); + int m_numberPrimitiveVariables = numberVariablesPhaseToSend + numberVariablesMixtureToSend + numberTransports; int m_numberSlopeVariables(0); if (ordreCalcul == "SECONDORDER") { - int numberSlopesPhaseATransmettre = cells[0]->getPhase(0)->numberOfTransmittedSlopes(); - numberSlopesPhaseATransmettre *= numberPhases; - int numberSlopesMixtureATransmettre = cells[0]->getMixture()->numberOfTransmittedSlopes(); - m_numberSlopeVariables = numberSlopesPhaseATransmettre + numberSlopesMixtureATransmettre + numberTransports + 1 + 1; //+1 for the interface detection + 1 for slope index + int numberSlopesPhaseToSend(0); + for (int k = 0; k < numberPhases; k++) { + numberSlopesPhaseToSend += cells[0]->getPhase(k)->numberOfTransmittedSlopes(); + } + int numberSlopesMixtureToSend = cells[0]->getMixture()->numberOfTransmittedSlopes(); + m_numberSlopeVariables = numberSlopesPhaseToSend + numberSlopesMixtureToSend + numberTransports + 1 + 1; //+1 for the interface detection + 1 for slope index } - parallel.initializePersistentCommunicationsAMR(m_numberPrimitiveVariables, m_numberSlopeVariables, numberTransports, m_geometrie, m_lvlMax); + parallel.initializePersistentCommunicationsAMR(m_numberPrimitiveVariables, m_numberSlopeVariables, numberTransports, m_problemDimension, m_lvlMax); } //*********************************************************************** @@ -906,7 +910,7 @@ void MeshCartesianAMR::finalizeParallele(const int& lvlMax) void MeshCartesianAMR::parallelLoadBalancingAMR(TypeMeshContainer* cellsLvl, TypeMeshContainer* cellsLvlGhost, TypeMeshContainer* cellInterfacesLvl, std::string ordreCalcul, - const std::vector& addPhys, Eos** eos, int& nbCellsTotalAMR, bool init) + const std::vector& addPhys, Eos** eos, int& nbCellsTotalAMR, std::vector& solidDomains, bool init) { bool balance(false); do { @@ -924,13 +928,13 @@ void MeshCartesianAMR::parallelLoadBalancingAMR(TypeMeshContainer* cellsL if (balance) { this->balance(cellsLvl, cellsLvlGhost, cellInterfacesLvl, ordreCalcul, addPhys, eos, - nbCellsTotalAMR, indicesSendStartGlobal, indicesSendEndGlobal, indicesReceiveStartGlobal, indicesReceiveEndGlobal); + nbCellsTotalAMR, indicesSendStartGlobal, indicesSendEndGlobal, indicesReceiveStartGlobal, indicesReceiveEndGlobal, solidDomains); } } while (balance); //Update gradients for level max only (others are updated within the recursive time-stepping loop) for (unsigned int i = 0; i < cellsLvl[m_lvlMax].size(); i++) { if (!cellsLvl[m_lvlMax][i]->getSplit()) { cellsLvl[m_lvlMax][i]->prepareAddPhys(); } } - for (unsigned int pa = 0; pa < addPhys.size(); pa++) { addPhys[pa]->communicationsAddPhys(m_geometrie, m_lvlMax); } + for (unsigned int pa = 0; pa < addPhys.size(); pa++) { addPhys[pa]->communicationsAddPhys(m_problemDimension, m_lvlMax); } } //*********************************************************************** @@ -1153,7 +1157,8 @@ void MeshCartesianAMR::computePotentialBalancing(TypeMeshContainer* cells void MeshCartesianAMR::balance(TypeMeshContainer* cellsLvl, TypeMeshContainer* cellsLvlGhost, TypeMeshContainer* cellInterfacesLvl, std::string ordreCalcul, const std::vector& addPhys, Eos** eos, int& nbCellsTotalAMR, std::vector::value_type>& indicesSendStartGlobal, std::vector::value_type>& indicesSendEndGlobal, - std::vector::value_type>& indicesReceiveStartGlobal, std::vector::value_type>& indicesReceiveEndGlobal) + std::vector::value_type>& indicesReceiveStartGlobal, std::vector::value_type>& indicesReceiveEndGlobal, + std::vector& solidDomains) { int counter(0), counterSplit(0); MPI_Request req_neighborP1; @@ -1182,7 +1187,7 @@ void MeshCartesianAMR::balance(TypeMeshContainer* cellsLvl, TypeMeshConta m_elements.clear(); for(unsigned int i = 0; i < numberOfCellsToReceiveStartGlobal; ++i) { if (ordreCalcul == "FIRSTORDER") { bufferReceiveCellsStart[i] = new Cell; } - else { bufferReceiveCellsStart[i] = new CellO2; } + else { bufferReceiveCellsStart[i] = new CellO2Cartesian; } m_elements.push_back(new ElementCartesian()); keysReceiveStart[i] = decomposition::Key<3>(indicesReceiveStartGlobal[i]); m_elements.back()->setKey(keysReceiveStart[i]); @@ -1190,7 +1195,7 @@ void MeshCartesianAMR::balance(TypeMeshContainer* cellsLvl, TypeMeshConta } for(unsigned int i = 0; i < numberOfCellsToReceiveEndGlobal; ++i) { if (ordreCalcul == "FIRSTORDER") { bufferReceiveCellsEnd[i] = new Cell; } - else { bufferReceiveCellsEnd[i] = new CellO2; } + else { bufferReceiveCellsEnd[i] = new CellO2Cartesian; } m_elements.push_back(new ElementCartesian()); keysReceiveEnd[i] = decomposition::Key<3>(indicesReceiveEndGlobal[i]); m_elements.back()->setKey(keysReceiveEnd[i]); @@ -1213,7 +1218,6 @@ void MeshCartesianAMR::balance(TypeMeshContainer* cellsLvl, TypeMeshConta //2) Erase the pointers to the corresponding base cells from cellsLvl (cells are not deleted yet) //----------------------------------------------------------------------------------------------- - TypeMeshContainer bufferSendCellsStart(numberOfCellsToSendStartGlobal); TypeMeshContainer bufferSendCellsEnd(numberOfCellsToSendEndGlobal); TypeMeshContainer bufferSendCells; @@ -1304,7 +1308,14 @@ void MeshCartesianAMR::balance(TypeMeshContainer* cellsLvl, TypeMeshConta cellInterfacesLvl[0][b]->allocateSlopes(allocateSlopeLocal); } - //6) Send/Receive physical values of cells lvl >= 0 and create new cells and new internal cell interfaces of lvl > 0 + //6) Set immersed boundaries + //-------------------------- + for (unsigned int i = 0; i < cellsLvl[0].size(); i++) { cellsLvl[0][i]->fill(solidDomains, m_lvlMax); } + for (unsigned int i = 0; i < cellsLvlGhost[0].size(); i++) { cellsLvlGhost[0][i]->fill(solidDomains, m_lvlMax); } + this->setImmersedBoundaries(cellInterfacesLvl, ordreCalcul); + m_numberFacesTotal = cellInterfacesLvl[0].size(); + + //7) Send/Receive physical values of cells lvl >= 0 and create new cells and new internal cell interfaces of lvl > 0 //------------------------------------------------------------------------------------------------------------------ //Count and communicate number of data (physical values and cell trees) to send/receive + fill corresponding vectors int numberSendStart(0), numberSendEnd(0), numberReceiveStart(0), numberReceiveEnd(0); @@ -1394,17 +1405,22 @@ void MeshCartesianAMR::balance(TypeMeshContainer* cellsLvl, TypeMeshConta } } + //Updating complete thermodynamic state after immersed boundaries setting + for (unsigned int i = 0; i < cellsLvl[0].size(); i++) { + if(cellsLvl[0][i]->getWall()) cellsLvl[0][i]->completeFulfillState(); + } + //Delete sent cells for (unsigned int i = 0; i < bufferSendCells.size(); i++) { delete bufferSendCells[i]; } - //7) Update persistent communications of cells lvl 0 + //8) Update persistent communications of cells lvl 0 //-------------------------------------------------- int dim(1); if (m_numberCellsZ != 1) { dim = 3; } else if (m_numberCellsY != 1) { dim = 2; } parallel.updatePersistentCommunicationsAMR(dim); - //8) Refine external cell interfaces, refine ghost cells and update persistent communications of lvl > 0 + //9) Refine external cell interfaces, refine ghost cells and update persistent communications of lvl > 0 //------------------------------------------------------------------------------------------------------ for (int lvl = 0; lvl < m_lvlMax; lvl++) { //Refine external cell interfaces @@ -1429,13 +1445,13 @@ void MeshCartesianAMR::balance(TypeMeshContainer* cellsLvl, TypeMeshConta //Update of persistent communications of cells lvl + 1 parallel.communicationsNumberGhostCells(lvl + 1); - parallel.updatePersistentCommunicationsLvlAMR(lvl + 1, m_geometrie); + parallel.updatePersistentCommunicationsLvlAMR(lvl + 1, m_problemDimension); //Reconstruction of the arrays of cells and cell interfaces of lvl + 1 cellsLvl[lvl + 1].clear(); cellInterfacesLvl[lvl + 1].clear(); for (unsigned int i = 0; i < cellsLvl[lvl].size(); i++) { cellsLvl[lvl][i]->buildLvlCellsAndLvlInternalCellInterfacesArrays(cellsLvl, cellInterfacesLvl); } - for (unsigned int i = 0; i < cellInterfacesLvl[lvl].size(); i++) { cellInterfacesLvl[lvl][i]->constructionTableauCellInterfacesExternesLvl(cellInterfacesLvl); } + for (unsigned int i = 0; i < cellInterfacesLvl[lvl].size(); i++) { cellInterfacesLvl[lvl][i]->constructionArrayExternalCellInterfacesLvl(cellInterfacesLvl); } } parallel.communicationsPrimitives(eos, m_lvlMax); nbCellsTotalAMR = 0; diff --git a/src/Meshes/MeshCartesianAMR.h b/src/Meshes/MeshCartesianAMR.h index f2af07a1..a20dcf80 100644 --- a/src/Meshes/MeshCartesianAMR.h +++ b/src/Meshes/MeshCartesianAMR.h @@ -49,19 +49,19 @@ class MeshCartesianAMR : public MeshCartesian void createCellInterfacesFacesAndGhostCells(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, std::string ordreCalcul); virtual void procedureRaffinementInitialization(TypeMeshContainer* cellsLvl, TypeMeshContainer* cellsLvlGhost, TypeMeshContainer* cellInterfacesLvl, const std::vector& addPhys, int& nbCellsTotalAMR, std::vector& domains, - Eos** eos, const int& restartSimulation, std::string ordreCalcul); + Eos** eos, const int& restartSimulation, std::string ordreCalcul, std::vector& solidDomains); virtual void procedureRaffinement(TypeMeshContainer* cellsLvl, TypeMeshContainer* cellsLvlGhost, TypeMeshContainer* cellInterfacesLvl, const int& lvl, const std::vector& addPhys, int& nbCellsTotalAMR, Eos** eos); virtual std::string whoAmI() const; //Printing / Reading - virtual void ecritHeaderPiece(std::ofstream& fileStream, TypeMeshContainer* cellsLvl) const; - virtual void recupereNoeuds(std::vector& jeuDonnees, std::vector* cellsLvl) const; - virtual void recupereConnectivite(std::vector& jeuDonnees, std::vector* cellsLvl) const; - virtual void recupereOffsets(std::vector& jeuDonnees, std::vector* cellsLvl) const; - virtual void recupereTypeCell(std::vector& jeuDonnees, std::vector* cellsLvl) const; - virtual void recupereDonnees(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, const int var, int phase) const; - virtual void setDataSet(std::vector& jeuDonnees, TypeMeshContainer* cellsLvl, const int var, int phase) const; + virtual void writeHeaderPiece(std::ofstream& fileStream, TypeMeshContainer* cellsLvl) const; + virtual void getNodes(std::vector& dataset, std::vector* cellsLvl) const; + virtual void getConnectivity(std::vector& dataset, std::vector* cellsLvl) const; + virtual void getOffsets(std::vector& dataset, std::vector* cellsLvl) const; + virtual void getTypeCell(std::vector& dataset, std::vector* cellsLvl) const; + virtual void getData(TypeMeshContainer* cellsLvl, std::vector& dataset, const int var, int phase) const; + virtual void setDataSet(std::vector& dataset, TypeMeshContainer* cellsLvl, const int var, int phase) const; virtual void refineCellAndCellInterfaces(Cell* cell, const std::vector& addPhys, int& nbCellsTotalAMR); virtual void printDomainDecomposition(std::ofstream& fileStream); virtual void readDomainDecomposition(std::ifstream& fileStream); @@ -74,7 +74,7 @@ class MeshCartesianAMR : public MeshCartesian virtual void finalizeParallele(const int& lvlMax); virtual void parallelLoadBalancingAMR(TypeMeshContainer* cellsLvl, TypeMeshContainer* cellsLvlGhost, TypeMeshContainer* cellInterfacesLvl, std::string ordreCalcul, - const std::vector& addPhys, Eos** eos, int& nbCellsTotalAMR, bool init = false); + const std::vector& addPhys, Eos** eos, int& nbCellsTotalAMR, std::vector& solidDomains, bool init = false); virtual void computePotentialBalancing(TypeMeshContainer* cellsLvl, bool init, int lvl, bool& balance, std::vector::value_type>& indicesSendStartGlobal, std::vector::value_type>& indicesSendEndGlobal, std::vector::value_type>& indicesReceiveStartGlobal, std::vector::value_type>& indicesReceiveEndGlobal); @@ -82,13 +82,14 @@ class MeshCartesianAMR : public MeshCartesian TypeMeshContainer* cellInterfacesLvl, std::string ordreCalcul, const std::vector& addPhys, Eos** eos, int& nbCellsTotalAMR, std::vector::value_type>& indicesSendStartGlobal, std::vector::value_type>& indicesSendEndGlobal, - std::vector::value_type>& indicesReceiveStartGlobal, std::vector::value_type>& indicesReceiveEndGlobal); + std::vector::value_type>& indicesReceiveStartGlobal, std::vector::value_type>& indicesReceiveEndGlobal, + std::vector& solidDomains); private: int m_lvlMax; //!& boundCond) +void MeshUnStruct::assignLimits(std::vector& boundCond) { // Look for highest boundary physic number int maxNumLim(0); @@ -133,7 +137,7 @@ int MeshUnStruct::initializeGeometrie(TypeMeshContainer& cells, TypeMeshC } this->initGeometryParallel(cells, cellsGhost, cellInterfaces, ordreCalcul); } - return m_geometrie; + return m_problemDimension; } catch (ErrorECOGEN &) { throw; } } @@ -197,37 +201,37 @@ void MeshUnStruct::writeMeshInfoData() const } //************************************************************************** -//******************************** ECRITURE ******************************** +//******************************** WRITING ********************************* //************************************************************************** -void MeshUnStruct::ecritHeaderPiece(std::ofstream& fileStream, TypeMeshContainer* /*cellsLvl*/) const +void MeshUnStruct::writeHeaderPiece(std::ofstream& fileStream, TypeMeshContainer* /*cellsLvl*/) const { fileStream << " " << std::endl; } //**************************************************************************** -void MeshUnStruct::recupereNoeuds(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const +void MeshUnStruct::getNodes(std::vector& dataset, std::vector* /*cellsLvl*/) const { - for (int noeud = 0; noeud < m_numberNodes; noeud++) + for (int node = 0; node < m_numberNodes; node++) { - jeuDonnees.push_back(m_nodes[noeud].getX()); - jeuDonnees.push_back(m_nodes[noeud].getY()); - jeuDonnees.push_back(m_nodes[noeud].getZ()); + dataset.push_back(m_nodes[node].getX()); + dataset.push_back(m_nodes[node].getY()); + dataset.push_back(m_nodes[node].getZ()); } } //**************************************************************************** -void MeshUnStruct::recupereConnectivite(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const +void MeshUnStruct::getConnectivity(std::vector& dataset, std::vector* /*cellsLvl*/) const { for (int i = m_numberBoundFaces; i < m_numberInnerElements; i++) { if (!m_elements[i]->isFantome()) { - for (int noeud = 0; noeud < m_elements[i]->getNumberNoeuds(); noeud++) + for (int node = 0; node < m_elements[i]->getNumberNodes(); node++) { - jeuDonnees.push_back(m_elements[i]->getNumNoeud(noeud)); + dataset.push_back(m_elements[i]->getNumNode(node)); } } } @@ -235,37 +239,37 @@ void MeshUnStruct::recupereConnectivite(std::vector& jeuDonnees, std::ve //**************************************************************************** -void MeshUnStruct::recupereOffsets(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const +void MeshUnStruct::getOffsets(std::vector& dataset, std::vector* /*cellsLvl*/) const { int offset(0); for (int i = m_numberBoundFaces; i < m_numberInnerElements; i++) { if (!m_elements[i]->isFantome()) { - offset += m_elements[i]->getNumberNoeuds(); - jeuDonnees.push_back(offset); + offset += m_elements[i]->getNumberNodes(); + dataset.push_back(offset); } } } //**************************************************************************** -void MeshUnStruct::recupereTypeCell(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const +void MeshUnStruct::getTypeCell(std::vector& dataset, std::vector* /*cellsLvl*/) const { for (int i = m_numberBoundFaces; i < m_numberInnerElements; i++) { if (!m_elements[i]->isFantome()) { - jeuDonnees.push_back(m_elements[i]->getTypeVTK()); + dataset.push_back(m_elements[i]->getTypeVTK()); } } } //**************************************************************************** -void MeshUnStruct::recupereDonnees(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, const int var, int phase) const +void MeshUnStruct::getData(TypeMeshContainer* cellsLvl, std::vector& dataset, const int var, int phase) const { - jeuDonnees.clear(); + dataset.clear(); int numCell; double transport(0.); for (int i = m_numberBoundFaces; i < m_numberInnerElements; i++) @@ -273,38 +277,41 @@ void MeshUnStruct::recupereDonnees(TypeMeshContainer* cellsLvl, std::vect if (!m_elements[i]->isFantome()) { numCell = m_elements[i]->getNumCellAssociee(); - if (var > 0) { //On veut recuperer les donnees scalars - if (phase >= 0) { jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnScalar(var)); } //Donnees de phases - else if (phase == -1) { jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnScalar(var)); } //Donnees de mixture + if (var > 0) { //We want to get the scalar data + if (phase >= 0) { dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnScalar(var)); } //data de phases + else if (phase == -1) { dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnScalar(var)); } //data de mixture else if (phase == -2) { transport = cellsLvl[0][numCell]->getTransport(var-1).getValue(); if (transport < 1.e-20) { transport = 0.; } - jeuDonnees.push_back(transport); + dataset.push_back(transport); } - else if (phase == -3) { jeuDonnees.push_back(cellsLvl[0][numCell]->getXi()); } - else if (phase == -4) { jeuDonnees.push_back(cellsLvl[0][numCell]->getDensityGradient()); } - else { Errors::errorMessage("MeshUnStruct::recupereDonnees: unknown number of phase: ", phase); } + else if (phase == -3) { dataset.push_back(cellsLvl[0][numCell]->getXi()); } + else if (phase == -4) { dataset.push_back(cellsLvl[0][numCell]->getDensityGradient()); } + else if (phase == -7) { // Saturation pressure + dataset.push_back(cellsLvl[0][numCell]->getPsat()); + } + else { Errors::errorMessage("MeshUnStruct::getData: unknown number of phase: ", phase); } } - else { //On veut recuperer les donnees vectorielles + else { //We want to get the vector data if (phase >= 0) { //Phases data - jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getX()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getY()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getZ()); + dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getX()); + dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getY()); + dataset.push_back(cellsLvl[0][numCell]->getPhase(phase)->returnVector(-var).getZ()); } else if(phase == -1){ //Mixture data - jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getX()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getY()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getZ()); + dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getX()); + dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getY()); + dataset.push_back(cellsLvl[0][numCell]->getMixture()->returnVector(-var).getZ()); } - else { Errors::errorMessage("MeshUnStruct::recupereDonnees: unknown number of phase: ", phase); } - } //Fin vecteur + else { Errors::errorMessage("MeshUnStruct::getData: unknown number of phase: ", phase); } + } //End vector } } } //**************************************************************************** -void MeshUnStruct::setDataSet(std::vector& jeuDonnees, TypeMeshContainer* cellsLvl, const int var, int phase) const +void MeshUnStruct::setDataSet(std::vector& dataset, TypeMeshContainer* cellsLvl, const int var, int phase) const { int iterDataSet(0); int numCell; @@ -315,33 +322,33 @@ void MeshUnStruct::setDataSet(std::vector& jeuDonnees, TypeMeshContainer { numCell = m_elements[i]->getNumCellAssociee(); if (var > 0) { //Scalars data are first set - if (phase >= 0) { cellsLvl[0][numCell]->getPhase(phase)->setScalar(var, jeuDonnees[iterDataSet++]); } //phases data - else if (phase == -1) { cellsLvl[0][numCell]->getMixture()->setScalar(var, jeuDonnees[iterDataSet++]); } //mixture data - else if (phase == -2) { cellsLvl[0][numCell]->getTransport(var - 1).setValue(jeuDonnees[iterDataSet++]); } //transport data + if (phase >= 0) { cellsLvl[0][numCell]->getPhase(phase)->setScalar(var, dataset[iterDataSet++]); } //phases data + else if (phase == -1) { cellsLvl[0][numCell]->getMixture()->setScalar(var, dataset[iterDataSet++]); } //mixture data + else if (phase == -2) { cellsLvl[0][numCell]->getTransport(var - 1).setValue(dataset[iterDataSet++]); } //transport data else { Errors::errorMessage("MeshUnStruct::setDataSet: unknown phase number: ", phase); } } - else { //On veut recuperer les donnees vectorielles + else { //We want to get the vector data if (phase >= 0) { //Phases data - vec.setXYZ(jeuDonnees[iterDataSet], jeuDonnees[iterDataSet+1], jeuDonnees[iterDataSet+2]); + vec.setXYZ(dataset[iterDataSet], dataset[iterDataSet+1], dataset[iterDataSet+2]); cellsLvl[0][numCell]->getPhase(phase)->setVector(-var, vec); iterDataSet += 3; } else if (phase == -1) { //Mixture data - vec.setXYZ(jeuDonnees[iterDataSet], jeuDonnees[iterDataSet+1], jeuDonnees[iterDataSet+2]); + vec.setXYZ(dataset[iterDataSet], dataset[iterDataSet+1], dataset[iterDataSet+2]); cellsLvl[0][numCell]->getMixture()->setVector(-var, vec); iterDataSet += 3; } else { Errors::errorMessage("MeshUnStruct::setDataSet: unknown phase number: ", phase); } - } //Fin vecteur + } //End vector } } } //**************************************************************************** -void MeshUnStruct::extractAbsVelocityMRF(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, Source *sourceMRF) const +void MeshUnStruct::extractAbsVelocityMRF(TypeMeshContainer* cellsLvl, std::vector& dataset, Source *sourceMRF) const { - jeuDonnees.clear(); + dataset.clear(); int numCell; for (int i = m_numberBoundFaces; i < m_numberInnerElements; i++) { @@ -351,15 +358,15 @@ void MeshUnStruct::extractAbsVelocityMRF(TypeMeshContainer* cellsLvl, std // Absolute velocity is built on the specific region rotating or when whole geometry is rotating. if (sourceMRF->getPhysicalEntity() == cellsLvl[0][numCell]->getElement()->getAppartenancePhysique() || sourceMRF->getPhysicalEntity() == 0) { Coord absoluteVelocity = sourceMRF->computeAbsVelocity(cellsLvl[0][numCell]->getVelocity(), cellsLvl[0][numCell]->getPosition()); - jeuDonnees.push_back(absoluteVelocity.getX()); - jeuDonnees.push_back(absoluteVelocity.getY()); - jeuDonnees.push_back(absoluteVelocity.getZ()); + dataset.push_back(absoluteVelocity.getX()); + dataset.push_back(absoluteVelocity.getY()); + dataset.push_back(absoluteVelocity.getZ()); } // If the region is not rotating absolute velocity = relative velocity else { - jeuDonnees.push_back(cellsLvl[0][numCell]->getVelocity().getX()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getVelocity().getY()); - jeuDonnees.push_back(cellsLvl[0][numCell]->getVelocity().getZ()); + dataset.push_back(cellsLvl[0][numCell]->getVelocity().getX()); + dataset.push_back(cellsLvl[0][numCell]->getVelocity().getY()); + dataset.push_back(cellsLvl[0][numCell]->getVelocity().getZ()); } } } @@ -367,172 +374,18 @@ void MeshUnStruct::extractAbsVelocityMRF(TypeMeshContainer* cellsLvl, std //*********************************************************************** -// void MeshUnStruct::rechercheElementsArrieres(ElementNS *element, FaceNS *face, CellInterface* cellInterface, std::vector voisins, Cell** cells) const -// { -// //int index(element->getIndex() - m_numberBoundFaces); -// //Coord vG = element->vecteur(face); -// //ElementNS *eT; //Element a tester -// ////1) Recherche du premier element arriere gauche BG1M -// ////--------------------------------------------------- -// //double cos(0.); -// //for (unsigned int v = 0; v < voisins.size(); v++) { -// // eT = voisins[v]; -// // Coord vT = eT->vecteur(element); -// // double cosTemp(Coord::cos(vT, vG)); -// // if (cosTemp >= cos) { -// // cos = cosTemp; -// // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL -// // cellInterface->setB(BG1M, 0); -// // } -// // else { //Sinon on met a jour avec la maille la plus loin -// // Cell* c(cells[eT->getNumCellAssociee()]); -// // cellInterface->setB(BG1M, c); -// // } -// // } -// //} -// ////2) Recherche du second element arriere gauche BG2M -// ////--------------------------------------------------- -// //cos = 0.; -// //if (cellInterface->getB(BG1M) != 0) { //Cas non cellInterface -// // Element *e1(cellInterface->getB(BG1M)->getElement()); -// // Coord v1 = e1->vecteur(element); -// // Coord sin1(Coord::sin(v1, vG)); -// // if (std::fabs(sin1.norm()) <= 1e-8) { -// // cellInterface->setB(BG2M, cellInterface->getB(BG1M)); // Si le cos est nul, meme cell pour B1 et B2 -// // } -// // else { -// // for (unsigned int v = 0; v < voisins.size(); v++) { -// // eT = voisins[v]; -// // if (eT == e1) continue; // voisin suivant si voisin deja utilise -// // Coord vT = eT->vecteur(element); -// // Coord sinTemp(Coord::sin(vT, vG)); - -// // if (sinTemp.scalar(sin1) <= 0.) { -// // double cosTemp(Coord::cos(vT, vG)); -// // if (cosTemp >= cos) { -// // cos = cosTemp; -// // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL -// // cellInterface->setB(BG2M, 0); -// // } -// // else { //Sinon on met a jour avec la 2 eme maille la plus loin -// // Cell* c(cells[eT->getNumCellAssociee()]); -// // cellInterface->setB(BG2M, c); -// // } -// // } -// // } //fin sin*sin <0 -// // } //fin boucle voisins -// // } //fin if -// //} //Fin if cellInterface - -// // //Determination des ponderations arrieres -// //Coord MB1; if (cellInterface->getB(BG1M) != 0) { MB1.setFromSubtractedVectors(face->getPos(), cellInterface->getB(BG1M)->getPosition()); } -// //Coord MB2; if (cellInterface->getB(BG2M) != 0) { MB2.setFromSubtractedVectors(face->getPos(), cellInterface->getB(BG2M)->getPosition()); } -// //Coord MB; MB.setFromSubtractedVectors(face->getPos(), element->getPosition()); -// //double a, b, beta1(1.), beta2(0.); -// //a = (MB1.vectoriel(MB)).norm() / MB.norm(); -// //b = (MB2.vectoriel(MB)).norm() / MB.norm(); -// //if (std::fabs(a + b) > 1e-8) { beta1 = b / (a + b); beta2 = 1. - beta1; } -// //cellInterface->setBeta(betaG1M, beta1); -// //cellInterface->setBeta(betaG2M, beta2); -// ////Calcul de la distance du vertex M (cell interface) au vertex H (barycenter) -// //if (cellInterface->getB(BG1M) != 0) { -// // cos = Coord::cos(MB, MB1); -// // double d, e, c; -// // d = cos*MB1.norm(); -// // Coord B1B2; B1B2 = MB1 - MB2; -// // e = B1B2.norm()*beta1; -// // c = sqrt(e*e - a*a); -// // d += c; -// // cellInterface->setDistanceH(distanceHGM, d); -// //} -// //cout << eG->getIndex() << " : " << endl; -// //if (cellInterfaces[i]->getB(BG1M) != 0) cout << "BG1M = " << cellInterfaces[i]->getB(BG1M)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGM) << endl; -// //if (cellInterfaces[i]->getB(BG2M) != 0) cout << "BG2M = " << cellInterfaces[i]->getB(BG2M)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGM) << endl; -// } - -//*********************************************************************** - -// void MeshUnStruct::rechercheElementsAvants(ElementNS *element, FaceNS *face, CellInterface* cellInterface, std::vector voisins, Cell** cells) const -// { -// int index(element->getIndex() - m_numberBoundFaces); -// Coord vG = element->vecteur(face); -// //ElementNS *eT; //Element a tester -// ////1) Recherche du premier element arriere gauche BG1P -// ////--------------------------------------------------- -// //double cos(0.); -// //for (unsigned int v = 0; v < voisins.size(); v++) { -// // eT = voisins[v]; -// // Coord vT = eT->vecteur(element); -// // double cosTemp(Coord::cos(vT, vG)); -// // if (cosTemp <= cos) { -// // cos = cosTemp; -// // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1P a NULL -// // cellInterface->setB(BG1P, 0); -// // } -// // else { //Sinon on met a jour avec la maille la plus loin -// // Cell* c(cells[eT->getNumCellAssociee()]); -// // cellInterface->setB(BG1P, c); -// // } -// // } -// //} -// ////2) Recherche du second element arriere gauche BG2P -// ////--------------------------------------------------- -// //cos = 0.; -// //if (cellInterface->getB(BG1P) != 0) { //Cas non cellInterface -// // Element *e1(cellInterface->getB(BG1P)->getElement()); -// // Coord v1 = e1->vecteur(element); -// // Coord sin1(Coord::sin(v1, vG)); -// // if (std::fabs(sin1.norm()) <= 1e-8) { -// // cellInterface->setB(BG2P, cellInterface->getB(BG1P)); // Si le cos est nul, meme cell pour B1 et B2 -// // } -// // else { -// // for (unsigned int v = 0; v < voisins.size(); v++) { -// // eT = voisins[v]; -// // if (eT == e1) continue; // voisin suivant si voisin deja utilise -// // Coord vT = eT->vecteur(element); -// // Coord sinTemp(Coord::sin(vT, vG)); - -// // if (sinTemp.scalar(sin1) <= 0.) { -// // double cosTemp(Coord::cos(vT, vG)); -// // if (cosTemp <= cos) { -// // cos = cosTemp; -// // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG2P a NULL -// // cellInterface->setB(BG2P, 0); -// // } -// // else { //Sinon on met a jour avec la 2 eme maille la plus loin -// // Cell* c(cells[eT->getNumCellAssociee()]); -// // cellInterface->setB(BG2P, c); -// // } -// // } -// // } //fin sin*sin <0 -// // } //fin boucle voisins -// // } //fin if -// //} //Fin if cellInterface - -// // //Determination des ponderations arrieres -// //Coord MB1; if (cellInterface->getB(BG1P) != 0) { MB1.setFromSubtractedVectors(face->getPos(), cellInterface->getB(BG1P)->getPosition()); } -// //Coord MB2; if (cellInterface->getB(BG2P) != 0) { MB2.setFromSubtractedVectors(face->getPos(), cellInterface->getB(BG1P)->getPosition()); } -// //Coord MB; MB.setFromSubtractedVectors(face->getPos(), element->getPosition()); -// //double a, b, beta1(1.), beta2(0.); -// //a = (MB1.vectoriel(MB)).norm() / MB.norm(); -// //b = (MB2.vectoriel(MB)).norm() / MB.norm(); -// //if (std::fabs(a + b) > 1e-8) { beta1 = b / (a + b); beta2 = 1. - beta1; } -// //cellInterface->setBeta(betaG1P, beta1); -// //cellInterface->setBeta(betaG2P, beta2); -// ////Calcul de la distance du vertex M (cellInterface de maille) au vertex H (barycenter) -// //if (cellInterface->getB(BG1P) != 0) { -// // cos = Coord::cos(MB, -1.*MB1); -// // double d, e, c; -// // d = cos*MB1.norm(); -// // Coord B1B2; B1B2 = MB1 - MB2; -// // e = B1B2.norm()*beta1; -// // c = sqrt(e*e - a*a); -// // d += c; -// // cellInterface->setDistanceH(distanceHGP, d); -// //} -// //cout << eG->getIndex() << " : " << endl; -// //if (cellInterfaces[i]->getB(BG1P) != 0) cout << "BG1P = " << cellInterfaces[i]->getB(BG1P)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGP) << endl; -// //if (cellInterfaces[i]->getB(BG2P) != 0) cout << "BG2P = " << cellInterfaces[i]->getB(BG2P)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGP) << endl; -// } +void MeshUnStruct::extractReferenceLength(std::vector* cellsLvl, std::vector& dataset) const +{ + dataset.clear(); + int numCell; + for (int i = m_numberBoundFaces; i < m_numberInnerElements; i++) + { + if (!m_elements[i]->isFantome()) + { + numCell = m_elements[i]->getNumCellAssociee(); + dataset.push_back(cellsLvl[0][numCell]->getElement()->getLCFL()); + } + } +} -//*********************************************************************** +//*********************************************************************** \ No newline at end of file diff --git a/src/Meshes/MeshUnStruct.h b/src/Meshes/MeshUnStruct.h index 3f3ca8ed..3e8de81d 100644 --- a/src/Meshes/MeshUnStruct.h +++ b/src/Meshes/MeshUnStruct.h @@ -33,6 +33,8 @@ #include "Mesh.h" #include "MeshUnStruct/MUSGmsh/HeaderElements.h" +#include "../Order2/CellInterfaceO2NS.h" +#include "../Order2/CellO2NS.h" #include "../InputOutput/IO.h" class MeshUnStruct : public Mesh @@ -44,7 +46,7 @@ class MeshUnStruct : public Mesh static std::string readMeshFileExtension(const std::string& meshFile); // --- Mesh virtual member functions --- - virtual void attributLimites(std::vector& boundCond); + virtual void assignLimits(std::vector& boundCond); virtual int initializeGeometrie(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, const int& /*restartSimulation*/, bool pretraitementParallele = true, std::string ordreCalcul = "FIRSTORDER"); virtual std::string whoAmI() const { return 0; }; @@ -62,18 +64,21 @@ class MeshUnStruct : public Mesh virtual void initGeometryParallel(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, std::string computeOrder = "FIRSTORDER") = 0; //! \brief split original mesh file for computation on several CPUs virtual void preProcessMeshFileForParallel() = 0; + virtual void initCpuMeshSequential(TypeMeshContainer& cells, std::string &computeOrder) = 0; + virtual void initCpuMeshParallel(TypeMeshContainer& cells, std::string &computeOrder, int cpu) = 0; // Printing / Reading //! \brief write monocpu mesh information void writeMeshInfoData() const; - virtual void ecritHeaderPiece(std::ofstream& fileStream, TypeMeshContainer* /*cellsLvl*/) const; - virtual void recupereNoeuds(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const; - virtual void recupereConnectivite(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const; - virtual void recupereOffsets(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const; - virtual void recupereTypeCell(std::vector& jeuDonnees, std::vector* /*cellsLvl*/) const; - virtual void recupereDonnees(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, const int var, int phase) const; - virtual void setDataSet(std::vector& jeuDonnees, TypeMeshContainer* cellsLvl, const int var, int phase) const; - virtual void extractAbsVelocityMRF(TypeMeshContainer* cellsLvl, std::vector& jeuDonnees, Source* sourceMRF) const; + virtual void writeHeaderPiece(std::ofstream& fileStream, TypeMeshContainer* /*cellsLvl*/) const; + virtual void getNodes(std::vector& dataset, std::vector* /*cellsLvl*/) const; + virtual void getConnectivity(std::vector& dataset, std::vector* /*cellsLvl*/) const; + virtual void getOffsets(std::vector& dataset, std::vector* /*cellsLvl*/) const; + virtual void getTypeCell(std::vector& dataset, std::vector* /*cellsLvl*/) const; + virtual void getData(TypeMeshContainer* cellsLvl, std::vector& dataset, const int var, int phase) const; + virtual void setDataSet(std::vector& dataset, TypeMeshContainer* cellsLvl, const int var, int phase) const; + virtual void extractAbsVelocityMRF(TypeMeshContainer* cellsLvl, std::vector& dataset, Source* sourceMRF) const; + virtual void extractReferenceLength(std::vector* cellsLvl, std::vector& dataset) const; protected: std::string m_meshFile; //!< Name of the mesh file read diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.cpp index 06e012ba..51d7f5be 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.cpp @@ -50,7 +50,7 @@ ElementHexahedron::~ElementHexahedron(){} void ElementHexahedron::computeVolume(const Coord* nodes) { // Volume of hexahedron = volume of 6 tetrahedron - //JC can be done with only 5 tetrahedron + //JC//REMARK can be done with only 5 tetrahedron Coord v1, v2, v3; m_volume = 0.; // Volume of hexahedron // v1.setFromSubtractedVectors(nodes[0], nodes[1]); v2.setFromSubtractedVectors(nodes[0], nodes[3]); v3.setFromSubtractedVectors(nodes[0], nodes[4]); @@ -106,18 +106,18 @@ void ElementHexahedron::construitFaces(const Coord* nodes, FaceNS** faces, int& { //6 faces a traiter de type quadrangle int indexFaceExiste(-1); - int noeudAutre; + int nodeAutre; int currentFaceNodes[4]; // buffer array of node used to create current face for (int i = 0; i < NUMBERFACES; i++) { switch (i) { - case 0: currentFaceNodes[0] = m_numNoeuds[0]; currentFaceNodes[1] = m_numNoeuds[1]; currentFaceNodes[2] = m_numNoeuds[2]; currentFaceNodes[3] = m_numNoeuds[3]; noeudAutre = 4; break; - case 1: currentFaceNodes[0] = m_numNoeuds[4]; currentFaceNodes[1] = m_numNoeuds[5]; currentFaceNodes[2] = m_numNoeuds[6]; currentFaceNodes[3] = m_numNoeuds[7]; noeudAutre = 0; break; - case 2: currentFaceNodes[0] = m_numNoeuds[0]; currentFaceNodes[1] = m_numNoeuds[3]; currentFaceNodes[2] = m_numNoeuds[7]; currentFaceNodes[3] = m_numNoeuds[4]; noeudAutre = 1; break; - case 3: currentFaceNodes[0] = m_numNoeuds[1]; currentFaceNodes[1] = m_numNoeuds[2]; currentFaceNodes[2] = m_numNoeuds[6]; currentFaceNodes[3] = m_numNoeuds[5]; noeudAutre = 0; break; - case 4: currentFaceNodes[0] = m_numNoeuds[0]; currentFaceNodes[1] = m_numNoeuds[1]; currentFaceNodes[2] = m_numNoeuds[5]; currentFaceNodes[3] = m_numNoeuds[4]; noeudAutre = 2; break; - case 5: currentFaceNodes[0] = m_numNoeuds[3]; currentFaceNodes[1] = m_numNoeuds[2]; currentFaceNodes[2] = m_numNoeuds[6]; currentFaceNodes[3] = m_numNoeuds[7]; noeudAutre = 0; break; + case 0: currentFaceNodes[0] = m_numNodes[0]; currentFaceNodes[1] = m_numNodes[1]; currentFaceNodes[2] = m_numNodes[2]; currentFaceNodes[3] = m_numNodes[3]; nodeAutre = 4; break; + case 1: currentFaceNodes[0] = m_numNodes[4]; currentFaceNodes[1] = m_numNodes[5]; currentFaceNodes[2] = m_numNodes[6]; currentFaceNodes[3] = m_numNodes[7]; nodeAutre = 0; break; + case 2: currentFaceNodes[0] = m_numNodes[0]; currentFaceNodes[1] = m_numNodes[3]; currentFaceNodes[2] = m_numNodes[7]; currentFaceNodes[3] = m_numNodes[4]; nodeAutre = 1; break; + case 3: currentFaceNodes[0] = m_numNodes[1]; currentFaceNodes[1] = m_numNodes[2]; currentFaceNodes[2] = m_numNodes[6]; currentFaceNodes[3] = m_numNodes[5]; nodeAutre = 0; break; + case 4: currentFaceNodes[0] = m_numNodes[0]; currentFaceNodes[1] = m_numNodes[1]; currentFaceNodes[2] = m_numNodes[5]; currentFaceNodes[3] = m_numNodes[4]; nodeAutre = 2; break; + case 5: currentFaceNodes[0] = m_numNodes[3]; currentFaceNodes[1] = m_numNodes[2]; currentFaceNodes[2] = m_numNodes[6]; currentFaceNodes[3] = m_numNodes[7]; nodeAutre = 0; break; } for(int n=0; n<4; n++){ facesBuff[iMax][n] = currentFaceNodes[n]; } // Filling facesBuff array before sorting sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1] + facesBuff[iMax][2] + facesBuff[iMax][3]; @@ -125,15 +125,15 @@ void ElementHexahedron::construitFaces(const Coord* nodes, FaceNS** faces, int& // Checking face existence indexFaceExiste = FaceNS::searchFace(facesBuff[iMax],sumNodesBuff[iMax],facesBuff,sumNodesBuff,4,iMax); //Creation face ou rattachement - if (indexFaceExiste==-1) // on fill simultanement le tableau faces et le tableau facesBuff + if (indexFaceExiste==-1) // on fill simultanement le array faces et le array facesBuff { faces[iMax] = new FaceQuadrangle(currentFaceNodes[0], currentFaceNodes[1], currentFaceNodes[2], currentFaceNodes[3], 1); // Nodes ordering of quadrangle matters - faces[iMax]->construitFace(nodes, m_numNoeuds[noeudAutre], this); + faces[iMax]->construitFace(nodes, m_numNodes[nodeAutre], this); iMax++; } else { - faces[indexFaceExiste]->ajouteElementVoisin(this); + faces[indexFaceExiste]->addElementNeighbor(this); } } } @@ -148,12 +148,12 @@ void ElementHexahedron::construitFacesSimplifie(int& iMax, int** facesBuff, int* { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[2]; facesBuff[iMax][3] = m_numNoeuds[3]; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[4]; facesBuff[iMax][1] = m_numNoeuds[5]; facesBuff[iMax][2] = m_numNoeuds[6]; facesBuff[iMax][3] = m_numNoeuds[7]; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[3]; facesBuff[iMax][2] = m_numNoeuds[7]; facesBuff[iMax][3] = m_numNoeuds[4]; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[6]; facesBuff[iMax][3] = m_numNoeuds[5]; break; - case 4: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[5]; facesBuff[iMax][3] = m_numNoeuds[4]; break; - case 5: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[6]; facesBuff[iMax][3] = m_numNoeuds[7]; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[2]; facesBuff[iMax][3] = m_numNodes[3]; break; + case 1: facesBuff[iMax][0] = m_numNodes[4]; facesBuff[iMax][1] = m_numNodes[5]; facesBuff[iMax][2] = m_numNodes[6]; facesBuff[iMax][3] = m_numNodes[7]; break; + case 2: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[3]; facesBuff[iMax][2] = m_numNodes[7]; facesBuff[iMax][3] = m_numNodes[4]; break; + case 3: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[6]; facesBuff[iMax][3] = m_numNodes[5]; break; + case 4: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[5]; facesBuff[iMax][3] = m_numNodes[4]; break; + case 5: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[6]; facesBuff[iMax][3] = m_numNodes[7]; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1] + facesBuff[iMax][2] + facesBuff[iMax][3]; std::sort(facesBuff[iMax], facesBuff[iMax] + 4); //Tri des nodes @@ -169,66 +169,66 @@ void ElementHexahedron::construitFacesSimplifie(int& iMax, int** facesBuff, int* //*********************************************************************** -void ElementHexahedron::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes) +void ElementHexahedron::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal) { int indexFaceExiste(0); //Verification face 1 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[3] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[2], m_numNoeuds[3]); + FaceQuadrangle face(m_numNodes[0], m_numNodes[1], m_numNodes[2], m_numNodes[3]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 2 : - if (m_numNoeuds[4] < numberNoeudsInternes && m_numNoeuds[5] < numberNoeudsInternes && m_numNoeuds[6] < numberNoeudsInternes && m_numNoeuds[7] < numberNoeudsInternes) + if (m_numNodes[4] < numberNodesInternal && m_numNodes[5] < numberNodesInternal && m_numNodes[6] < numberNodesInternal && m_numNodes[7] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[4], m_numNoeuds[5], m_numNoeuds[6], m_numNoeuds[7]); + FaceQuadrangle face(m_numNodes[4], m_numNodes[5], m_numNodes[6], m_numNodes[7]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 3 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[7] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[3] < numberNodesInternal && m_numNodes[7] < numberNodesInternal && m_numNodes[4] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[0], m_numNoeuds[3], m_numNoeuds[7], m_numNoeuds[4]); + FaceQuadrangle face(m_numNodes[0], m_numNodes[3], m_numNodes[7], m_numNodes[4]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 4 : - if (m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[6] < numberNoeudsInternes && m_numNoeuds[5] < numberNoeudsInternes) + if (m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[6] < numberNodesInternal && m_numNodes[5] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[1], m_numNoeuds[2], m_numNoeuds[6], m_numNoeuds[5]); + FaceQuadrangle face(m_numNodes[1], m_numNodes[2], m_numNodes[6], m_numNodes[5]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 5 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[5] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal && m_numNodes[5] < numberNodesInternal && m_numNodes[4] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[5], m_numNoeuds[4]); + FaceQuadrangle face(m_numNodes[0], m_numNodes[1], m_numNodes[5], m_numNodes[4]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 6 : - if (m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[6] < numberNoeudsInternes && m_numNoeuds[7] < numberNoeudsInternes) + if (m_numNodes[3] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[6] < numberNodesInternal && m_numNodes[7] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[3], m_numNoeuds[2], m_numNoeuds[6], m_numNoeuds[7]); + FaceQuadrangle face(m_numNodes[3], m_numNodes[2], m_numNodes[6], m_numNodes[7]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } @@ -245,12 +245,12 @@ int ElementHexahedron::compteFaceCommunicante(std::vector& facesBuff, std: { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[2]; face[3] = m_numNoeuds[3]; break; - case 1: face[0] = m_numNoeuds[4]; face[1] = m_numNoeuds[5]; face[2] = m_numNoeuds[6]; face[3] = m_numNoeuds[7]; break; - case 2: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[3]; face[2] = m_numNoeuds[7]; face[3] = m_numNoeuds[4]; break; - case 3: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[6]; face[3] = m_numNoeuds[5]; break; - case 4: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[5]; face[3] = m_numNoeuds[4]; break; - case 5: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[6]; face[3] = m_numNoeuds[7]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[2]; face[3] = m_numNodes[3]; break; + case 1: face[0] = m_numNodes[4]; face[1] = m_numNodes[5]; face[2] = m_numNodes[6]; face[3] = m_numNodes[7]; break; + case 2: face[0] = m_numNodes[0]; face[1] = m_numNodes[3]; face[2] = m_numNodes[7]; face[3] = m_numNodes[4]; break; + case 3: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[6]; face[3] = m_numNodes[5]; break; + case 4: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[5]; face[3] = m_numNodes[4]; break; + case 5: face[0] = m_numNodes[3]; face[1] = m_numNodes[2]; face[2] = m_numNodes[6]; face[3] = m_numNodes[7]; break; } int iMax = sumNodesBuff.size(); sumNodes = face[0] + face[1] + face[2] + face[3]; @@ -276,12 +276,12 @@ int ElementHexahedron::compteFaceCommunicante(int& iMax, int** facesBuff, int* s { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[2]; face[3] = m_numNoeuds[3]; break; - case 1: face[0] = m_numNoeuds[4]; face[1] = m_numNoeuds[5]; face[2] = m_numNoeuds[6]; face[3] = m_numNoeuds[7]; break; - case 2: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[3]; face[2] = m_numNoeuds[7]; face[3] = m_numNoeuds[4]; break; - case 3: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[6]; face[3] = m_numNoeuds[5]; break; - case 4: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[5]; face[3] = m_numNoeuds[4]; break; - case 5: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[6]; face[3] = m_numNoeuds[7]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[2]; face[3] = m_numNodes[3]; break; + case 1: face[0] = m_numNodes[4]; face[1] = m_numNodes[5]; face[2] = m_numNodes[6]; face[3] = m_numNodes[7]; break; + case 2: face[0] = m_numNodes[0]; face[1] = m_numNodes[3]; face[2] = m_numNodes[7]; face[3] = m_numNodes[4]; break; + case 3: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[6]; face[3] = m_numNodes[5]; break; + case 4: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[5]; face[3] = m_numNodes[4]; break; + case 5: face[0] = m_numNodes[3]; face[1] = m_numNodes[2]; face[2] = m_numNodes[6]; face[3] = m_numNodes[7]; break; } sumNodes = face[0] + face[1] + face[2] + face[3]; std::sort(face, face + 4); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.h index 2c7dc8c9..18f9fac7 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementHexahedron.h @@ -42,7 +42,7 @@ class ElementHexahedron : public ElementNS virtual void construitFaces(const Coord* nodes, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); virtual void construitFacesSimplifie(int& iMax, int** facesBuff, int* sumNodesBuff); - virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes); + virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal); virtual int compteFaceCommunicante(std::vector& faces, std::vector& sumNodesBuff); virtual int compteFaceCommunicante(int& iMax, int** faces, int* sumNodesBuff); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.cpp index 493411cc..4ed599e5 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.cpp @@ -36,38 +36,38 @@ ElementNS::ElementNS(){} //*********************************************************************** -ElementNS::ElementNS(const int& typeGmsh, const int& numberNoeuds, const int& numberFaces, const int& typeVTK) : +ElementNS::ElementNS(const int& typeGmsh, const int& numberNodes, const int& numberFaces, const int& typeVTK) : m_typeGmsh(typeGmsh), m_typeVTK(typeVTK), -m_numberNoeuds(numberNoeuds), +m_numberNodes(numberNodes), m_numberFaces(numberFaces), m_isFantome(false), m_isCommunicant(false), -m_autresCPU(0) +m_otherCPU(0) { - m_numNoeuds = new int[numberNoeuds]; + m_numNodes = new int[numberNodes]; } //*********************************************************************** ElementNS::~ElementNS() { - delete[] m_numNoeuds; - if (m_autresCPU != 0) delete[] m_autresCPU; + delete[] m_numNodes; + if (m_otherCPU != 0) delete[] m_otherCPU; } //*********************************************************************** -void ElementNS::construitElement(const int* numNoeuds, const Coord* nodes, const int numberEntitePhysique, const int numberEntiteGeometrique, int& indexElement) +void ElementNS::construitElement(const int* numNodes, const Coord* nodes, const int numberEntitePhysique, const int numberEntiteGeometrique, int& indexElement) { m_index = indexElement; - //Attribution des number de noeud vis a vis du tableau de noeud global et compute position du Centre de l'element + //Attribution des number de node vis a vis du array de node global et compute position du Centre de l'element m_position = 0.; - for (int i = 0; i < m_numberNoeuds; i++){ - m_numNoeuds[i] = numNoeuds[i]; + for (int i = 0; i < m_numberNodes; i++){ + m_numNodes[i] = numNodes[i]; m_position += nodes[i]; } - m_position /= static_cast(m_numberNoeuds); + m_position /= static_cast(m_numberNodes); m_appartenancePhysique = numberEntitePhysique; m_appartenanceGeometrique = numberEntiteGeometrique; @@ -81,19 +81,19 @@ void ElementNS::construitElement(const int* numNoeuds, const Coord* nodes, const void ElementNS::construitElementParallele(const Coord* nodes) { - Coord* noeudslocal = new Coord[m_numberNoeuds]; - for (int i = 0; i < m_numberNoeuds; i++){ noeudslocal[i] = nodes[m_numNoeuds[i]]; } + Coord* nodeslocal = new Coord[m_numberNodes]; + for (int i = 0; i < m_numberNodes; i++){ nodeslocal[i] = nodes[m_numNodes[i]]; } - //Attribution des number de noeud vis a vis du tableau de noeud global et compute position du Centre de l'element - for (int i = 0; i < m_numberNoeuds; i++) + //Attribution des number de node vis a vis du array de node global et compute position du Centre de l'element + for (int i = 0; i < m_numberNodes; i++) { - m_position += noeudslocal[i]; + m_position += nodeslocal[i]; } - m_position /= static_cast(m_numberNoeuds); + m_position /= static_cast(m_numberNodes); //Calculs des proprietes de l'element - this->computeVolume(noeudslocal); - this->computeLCFL(noeudslocal); + this->computeVolume(nodeslocal); + this->computeLCFL(nodeslocal); } //*********************************************************************** @@ -112,16 +112,16 @@ void ElementNS::setAppartenancePhysique(int& appartenancePhysique) //*********************************************************************** -void ElementNS::setNumNoeud(int* numNoeuds) +void ElementNS::setNumNode(int* numNodes) { - for (int i = 0; i < m_numberNoeuds; i++){ m_numNoeuds[i] = numNoeuds[i]; } + for (int i = 0; i < m_numberNodes; i++){ m_numNodes[i] = numNodes[i]; } } //*********************************************************************** -void ElementNS::setNumNoeud(int& noeud, int& numNoeud) +void ElementNS::setNumNode(int& node, int& numNode) { - m_numNoeuds[noeud] = numNoeud; + m_numNodes[node] = numNode; } //*********************************************************************** @@ -143,60 +143,60 @@ void ElementNS::setIsCommunicant(bool isCommunicant) void ElementNS::setAppartenanceCPU(const int* numCPU, const int& numberCPU) { m_CPU = numCPU[0] - 1; - m_numberautresCPU = numberCPU - 1; - m_autresCPU = new int[m_numberautresCPU]; + m_numberOtherCPU = numberCPU - 1; + m_otherCPU = new int[m_numberOtherCPU]; for (int i = 1; i < numberCPU; i++) { - m_autresCPU[i - 1] = -numCPU[i] - 1; + m_otherCPU[i - 1] = -numCPU[i] - 1; } } //*********************************************************************** -void ElementNS::enleveCPUAutres(std::vector& numCPU) +void ElementNS::removeCPUOthers(std::vector& numCPU) { - //if (numCPU >= m_numberautresCPU){ Errors::errorMessage("Probleme dans enleveCPUAutres"); } + //if (numCPU >= m_numberOtherCPU){ Errors::errorMessage("Probleme dans removeCPUOthers"); } //Copie des anciens - int* autresCPUTemp = new int[m_numberautresCPU]; - for (int i = 0; i < m_numberautresCPU; i++) + int* otherCPUTemp = new int[m_numberOtherCPU]; + for (int i = 0; i < m_numberOtherCPU; i++) { - autresCPUTemp[i] = m_autresCPU[i]; + otherCPUTemp[i] = m_otherCPU[i]; } - //reperage des CPU a enlever - bool *enleveCPU = new bool[m_numberautresCPU]; - for (int i = 0; i < m_numberautresCPU; i++) + //reperage des CPU a remove + bool *removeCPU = new bool[m_numberOtherCPU]; + for (int i = 0; i < m_numberOtherCPU; i++) { - enleveCPU[i] = false; + removeCPU[i] = false; for (unsigned int p = 0; p < numCPU.size(); p++) { - if (i == numCPU[p]){ enleveCPU[i] = true; break; } + if (i == numCPU[p]){ removeCPU[i] = true; break; } } } //Construction nouveau - delete[] m_autresCPU; - m_autresCPU = new int[m_numberautresCPU - numCPU.size()]; + delete[] m_otherCPU; + m_otherCPU = new int[m_numberOtherCPU - numCPU.size()]; int indexNouveau(0); - for (int i = 0; i < m_numberautresCPU; i++) + for (int i = 0; i < m_numberOtherCPU; i++) { - if (!enleveCPU[i]){ m_autresCPU[indexNouveau++] = autresCPUTemp[i]; } + if (!removeCPU[i]){ m_otherCPU[indexNouveau++] = otherCPUTemp[i]; } } - m_numberautresCPU = indexNouveau; + m_numberOtherCPU = indexNouveau; - delete[] autresCPUTemp; - delete[] enleveCPU; + delete[] otherCPUTemp; + delete[] removeCPU; } //*********************************************************************** const int& ElementNS::getAutreCPU(const int& autreCPU) const { - if (sizeof(m_autresCPU) <= (unsigned int)autreCPU) + if (sizeof(m_otherCPU) <= (unsigned int)autreCPU) { - Errors::errorMessage("probleme de dimension dans m_autresCPU"); + Errors::errorMessage("probleme de dimension dans m_otherCPU"); } - return m_autresCPU[autreCPU]; + return m_otherCPU[autreCPU]; } //*********************************************************************** @@ -205,15 +205,15 @@ void ElementNS::printInfo() const { std::cout << "-------------" << std::endl; //cout << "Infos Element" << endl; - //for (int i = 0; i < m_numberNoeuds; i++) - // cout << " " << m_numNoeuds[i]; + //for (int i = 0; i < m_numberNodes; i++) + // cout << " " << m_numNodes[i]; //cout << endl; std::cout << "center : " << m_position.getX() << " " << m_position.getY() << " " << m_position.getZ() << std::endl; //cout << " volume : " << m_volume << endl; //cout << " lCfl : " << m_lCFL << endl; //cout << " CPU n : " << m_CPU << endl; - //for (int i = 0; i < m_numberautresCPU; i++) - // cout << " autre CPU : " << m_autresCPU[i] << endl; + //for (int i = 0; i < m_numberOtherCPU; i++) + // cout << " autre CPU : " << m_otherCPU[i] << endl; } //*********************************************************************** \ No newline at end of file diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.h index 311581d5..ffb5d967 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementNS.h @@ -40,39 +40,39 @@ class ElementNS : public Element { public: ElementNS(); - ElementNS(const int& typeGmsh, const int& numberNoeuds, const int& numberFaces, const int& typeVTK); + ElementNS(const int& typeGmsh, const int& numberNodes, const int& numberFaces, const int& typeVTK); virtual ~ElementNS(); - void construitElement(const int* numNoeuds, const Coord* nodes, const int numberEntitePhysique, const int numberEntiteGeometrique, int& indexElement); /*Calcul des proprietes de l element*/ + void construitElement(const int* numNodes, const Coord* nodes, const int numberEntitePhysique, const int numberEntiteGeometrique, int& indexElement); /*Calcul des proprietes de l element*/ void construitElementParallele(const Coord* nodes); /*Calcul des proprietes de l element*/ virtual void attributFaceLimite(FaceNS** /*faces*/, const int& /*indexMaxFaces*/) { Errors::errorMessage("attributFaceLimite non prevu pour le type d element demande"); }; - virtual void attributFaceCommunicante(FaceNS** /*faces*/, const int& /*indexMaxFaces*/, const int& /*numberNoeudsInternes*/) { Errors::errorMessage("attributFaceCommunicante non prevu pour le type d element demande"); }; + virtual void attributFaceCommunicante(FaceNS** /*faces*/, const int& /*indexMaxFaces*/, const int& /*numberNodesInternal*/) { Errors::errorMessage("attributFaceCommunicante non prevu pour le type d element demande"); }; virtual void construitFaces(const Coord* /*nodes*/, FaceNS** /*faces*/, int& /*indexMaxFaces*/, int** /*facesBuff*/, int* /*sumNodesBuff*/) { Errors::errorMessage("construitFaces non prevu pour le type d element demande"); }; //Pour tests virtual void construitFacesSimplifie(int& /*iMax*/, int** /*facesBuff*/, int* /*sumNodesBuff*/) { Errors::errorMessage("construitFacesSimplifie non prevu pour le type d element demande"); }; virtual int compteFaceCommunicante(std::vector& /*faces*/, std::vector& /*sumNodesBuff*/) { Errors::errorMessage("compteFaceCommunicante non prevu pour le type d element demande"); return 0; }; virtual int compteFaceCommunicante(int& /*iMax*/, int** /*faces*/, int* /*sumNodesBuff*/) { Errors::errorMessage("compteFaceCommunicante non prevu pour le type d element demande"); return 0; }; - /* void enleveCPUAutres(const int& numCPU);*/ - void enleveCPUAutres(std::vector& numCPU); + /* void removeCPUOthers(const int& numCPU);*/ + void removeCPUOthers(std::vector& numCPU); //Accesseurs void setIndex(int& index); void setAppartenancePhysique(int& appartenancePhysique); - void setNumNoeud(int* numNoeuds); - void setNumNoeud(int& noeud, int& numNoeud); + void setNumNode(int* numNodes); + void setNumNode(int& node, int& numNode); void setIsFantome(bool isFantome); void setIsCommunicant(bool isCommunicant); void setAppartenanceCPU(const int* numCPU, const int& numberCPU); virtual const int& getIndex() const { return m_index; }; - const int& getNumberNoeuds() const { return m_numberNoeuds; }; + const int& getNumberNodes() const { return m_numberNodes; }; const int& getNumberFaces() const { return m_numberFaces; }; const int& getTypeGmsh() const { return m_typeGmsh; }; const int& getTypeVTK() const { return m_typeVTK; }; - const int& getNumNoeud(int& noeud) const { return m_numNoeuds[noeud]; }; + const int& getNumNode(int& node) const { return m_numNodes[node]; }; virtual const int& getAppartenancePhysique() const { return m_appartenancePhysique; }; const int& getAppartenanceGeometrique() const { return m_appartenanceGeometrique; }; const int& getCPU() const { return m_CPU; }; - const int& getNumberAutresCPU() const { return m_numberautresCPU; }; + const int& getNumberOthersCPU() const { return m_numberOtherCPU; }; const int& getAutreCPU(const int& autreCPU) const; void printInfo() const; @@ -87,16 +87,16 @@ class ElementNS : public Element int m_typeGmsh; int m_typeVTK; - int m_numberNoeuds; + int m_numberNodes; int m_numberFaces; int m_appartenancePhysique; int m_appartenanceGeometrique; bool m_isFantome; bool m_isCommunicant; int m_CPU; /*Number du CPU sur lequel l'element est present physiquement*/ - int m_numberautresCPU; - int* m_autresCPU; /*Number des CPU sur lesquels l'element est present en tant que fantome*/ - int* m_numNoeuds; /*Correspondance avec le tableau de nodes du mesh*/ + int m_numberOtherCPU; + int* m_otherCPU; /*Number des CPU sur lesquels l'element est present en tant que fantome*/ + int* m_numNodes; /*Correspondance avec le array de nodes du mesh*/ }; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPoint.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPoint.cpp index ce7e4e49..9f7a1b41 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPoint.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPoint.cpp @@ -64,10 +64,10 @@ void ElementPoint::computeLCFL(const Coord* /*nodes*/) void ElementPoint::attributFaceLimite(FaceNS** faces, const int& indexMaxFaces) { int indexFaceExiste(0); - FacePoint face(m_numNoeuds[0]); + FacePoint face(m_numNodes[0]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); } else { diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.cpp index 4133df04..df0924c5 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.cpp @@ -83,17 +83,17 @@ void ElementPrism::construitFaces(const Coord* nodes, FaceNS** faces, int& iMax, { // 3 faces are quadrangles and 2 faces are triangles int indexFaceExists(-1); - int noeudAutre; + int nodeAutre; int currentFaceNodes[4]; // Buffer array of nodes used to create current face for (int i = 0; i < NUMBERFACES; i++) { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[4]; facesBuff[iMax][3] = m_numNoeuds[3]; noeudAutre = 2; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[5]; facesBuff[iMax][3] = m_numNoeuds[3]; noeudAutre = 1; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[5]; facesBuff[iMax][3] = m_numNoeuds[4]; noeudAutre = 0; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[2]; noeudAutre = 3; break; - case 4: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[4]; facesBuff[iMax][2] = m_numNoeuds[5]; noeudAutre = 0; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[4]; facesBuff[iMax][3] = m_numNodes[3]; nodeAutre = 2; break; + case 1: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[5]; facesBuff[iMax][3] = m_numNodes[3]; nodeAutre = 1; break; + case 2: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[5]; facesBuff[iMax][3] = m_numNodes[4]; nodeAutre = 0; break; + case 3: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[2]; nodeAutre = 3; break; + case 4: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[4]; facesBuff[iMax][2] = m_numNodes[5]; nodeAutre = 0; break; } if (i < 3) // Faces Quadrangles { @@ -106,12 +106,12 @@ void ElementPrism::construitFaces(const Coord* nodes, FaceNS** faces, int& iMax, if (indexFaceExists==-1) // faces and facesBuff arrays are filled simultaneously { faces[iMax] = new FaceQuadrangle(currentFaceNodes[0], currentFaceNodes[1], currentFaceNodes[2], currentFaceNodes[3], 1); // Nodes ordering of quadrangle matters - faces[iMax]->construitFace(nodes, m_numNoeuds[noeudAutre], this); + faces[iMax]->construitFace(nodes, m_numNodes[nodeAutre], this); iMax++; } else { - faces[indexFaceExists]->ajouteElementVoisin(this); + faces[indexFaceExists]->addElementNeighbor(this); } } else // Faces triangles @@ -124,12 +124,12 @@ void ElementPrism::construitFaces(const Coord* nodes, FaceNS** faces, int& iMax, if (indexFaceExists==-1) { faces[iMax] = new FaceTriangle(facesBuff[iMax][0], facesBuff[iMax][1], facesBuff[iMax][2], 0); // Nodes ordering does not matter for triangle - faces[iMax]->construitFace(nodes, m_numNoeuds[noeudAutre], this); + faces[iMax]->construitFace(nodes, m_numNodes[nodeAutre], this); iMax++; } else { - faces[indexFaceExists]->ajouteElementVoisin(this); + faces[indexFaceExists]->addElementNeighbor(this); } } // End if } // End loop faces @@ -145,11 +145,11 @@ void ElementPrism::construitFacesSimplifie(int& iMax, int** facesBuff, int* sumN { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[4]; facesBuff[iMax][3] = m_numNoeuds[3]; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[5]; facesBuff[iMax][3] = m_numNoeuds[3]; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[5]; facesBuff[iMax][3] = m_numNoeuds[4]; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[2]; break; - case 4: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[4]; facesBuff[iMax][2] = m_numNoeuds[5]; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[4]; facesBuff[iMax][3] = m_numNodes[3]; break; + case 1: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[5]; facesBuff[iMax][3] = m_numNodes[3]; break; + case 2: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[5]; facesBuff[iMax][3] = m_numNodes[4]; break; + case 3: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[2]; break; + case 4: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[4]; facesBuff[iMax][2] = m_numNodes[5]; break; } if(i<3) { @@ -165,7 +165,7 @@ void ElementPrism::construitFacesSimplifie(int& iMax, int** facesBuff, int* sumN std::sort(facesBuff[iMax],facesBuff[iMax]+3); //Tri des nodes // Checking face existence indexFaceExists = FaceNS::searchFace(facesBuff[iMax],sumNodesBuff[iMax],facesBuff,sumNodesBuff,3,iMax); - } //Fin if + } //End if if (indexFaceExists == -1) { iMax++; @@ -175,56 +175,56 @@ void ElementPrism::construitFacesSimplifie(int& iMax, int** facesBuff, int* sumN //*********************************************************************** -void ElementPrism::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes) +void ElementPrism::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal) { int indexFaceExists(0); //Verification face 1 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal && m_numNodes[4] < numberNodesInternal && m_numNodes[3] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[4], m_numNoeuds[3]); + FaceQuadrangle face(m_numNodes[0], m_numNodes[1], m_numNodes[4], m_numNodes[3]); if (face.faceExists(faces, indexMaxFaces, indexFaceExists)) { - faces[indexFaceExists]->ajouteElementVoisinLimite(this); + faces[indexFaceExists]->addElementNeighborLimite(this); faces[indexFaceExists]->setEstComm(true); } } //Verification face 2 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[5] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[5] < numberNodesInternal && m_numNodes[3] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[0], m_numNoeuds[2], m_numNoeuds[5], m_numNoeuds[3]); + FaceQuadrangle face(m_numNodes[0], m_numNodes[2], m_numNodes[5], m_numNodes[3]); if (face.faceExists(faces, indexMaxFaces, indexFaceExists)) { - faces[indexFaceExists]->ajouteElementVoisinLimite(this); + faces[indexFaceExists]->addElementNeighborLimite(this); faces[indexFaceExists]->setEstComm(true); } } //Verification face 3 : - if (m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[5] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes) + if (m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[5] < numberNodesInternal && m_numNodes[4] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[1], m_numNoeuds[2], m_numNoeuds[5], m_numNoeuds[4]); + FaceQuadrangle face(m_numNodes[1], m_numNodes[2], m_numNodes[5], m_numNodes[4]); if (face.faceExists(faces, indexMaxFaces, indexFaceExists)) { - faces[indexFaceExists]->ajouteElementVoisinLimite(this); + faces[indexFaceExists]->addElementNeighborLimite(this); faces[indexFaceExists]->setEstComm(true); } } //Verification face 4 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[2]); + FaceTriangle face(m_numNodes[0], m_numNodes[1], m_numNodes[2]); if (face.faceExists(faces, indexMaxFaces, indexFaceExists)) { - faces[indexFaceExists]->ajouteElementVoisinLimite(this); + faces[indexFaceExists]->addElementNeighborLimite(this); faces[indexFaceExists]->setEstComm(true); } } //Verification face 5 : - if (m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes && m_numNoeuds[5] < numberNoeudsInternes) + if (m_numNodes[3] < numberNodesInternal && m_numNodes[4] < numberNodesInternal && m_numNodes[5] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[3], m_numNoeuds[4], m_numNoeuds[5]); + FaceTriangle face(m_numNodes[3], m_numNodes[4], m_numNodes[5]); if (face.faceExists(faces, indexMaxFaces, indexFaceExists)) { - faces[indexFaceExists]->ajouteElementVoisinLimite(this); + faces[indexFaceExists]->addElementNeighborLimite(this); faces[indexFaceExists]->setEstComm(true); } } @@ -241,11 +241,11 @@ int ElementPrism::compteFaceCommunicante(std::vector& facesBuff, std::vect { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[4]; face[3] = m_numNoeuds[3]; break; - case 1: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[5]; face[3] = m_numNoeuds[3]; break; - case 2: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[5]; face[3] = m_numNoeuds[4]; break; - case 3: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[2]; break; - case 4: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[4]; face[2] = m_numNoeuds[5]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[4]; face[3] = m_numNodes[3]; break; + case 1: face[0] = m_numNodes[0]; face[1] = m_numNodes[2]; face[2] = m_numNodes[5]; face[3] = m_numNodes[3]; break; + case 2: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[5]; face[3] = m_numNodes[4]; break; + case 3: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[2]; break; + case 4: face[0] = m_numNodes[3]; face[1] = m_numNodes[4]; face[2] = m_numNodes[5]; break; } int iMax = sumNodesBuff.size(); if(i<3) @@ -281,11 +281,11 @@ int ElementPrism::compteFaceCommunicante(int& iMax, int** facesBuff, int* sumNod { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[4]; face[3] = m_numNoeuds[3]; break; - case 1: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[5]; face[3] = m_numNoeuds[3]; break; - case 2: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[5]; face[3] = m_numNoeuds[4]; break; - case 3: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[2]; break; - case 4: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[4]; face[2] = m_numNoeuds[5]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[4]; face[3] = m_numNodes[3]; break; + case 1: face[0] = m_numNodes[0]; face[1] = m_numNodes[2]; face[2] = m_numNodes[5]; face[3] = m_numNodes[3]; break; + case 2: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[5]; face[3] = m_numNodes[4]; break; + case 3: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[2]; break; + case 4: face[0] = m_numNodes[3]; face[1] = m_numNodes[4]; face[2] = m_numNodes[5]; break; } if(i<3) { diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.h index e9f9182e..11527a65 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPrism.h @@ -41,15 +41,15 @@ class ElementPrism : public ElementNS ElementPrism(); virtual ~ElementPrism(); - virtual void construitFaces(const Coord* noeuds, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); + virtual void construitFaces(const Coord* nodes, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); virtual void construitFacesSimplifie(int& iMax, int** facesBuff, int* sumNodesBuff); - virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes); + virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal); virtual int compteFaceCommunicante(std::vector& faces, std::vector& sumNodesBuff); virtual int compteFaceCommunicante(int& iMax, int** faces, int* sumNodesBuff); private: - virtual void computeVolume(const Coord* noeuds); - virtual void computeLCFL(const Coord* noeuds); + virtual void computeVolume(const Coord* nodes); + virtual void computeLCFL(const Coord* nodes); static const int TYPEGMSH; static const int NUMBERNODES; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.cpp index d8c3a9b7..94deffb0 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.cpp @@ -86,10 +86,10 @@ void ElementPyramid::construitFaces(const Coord* nodes, FaceNS** faces, int& iMa // Building quadrangle as basis of pyramid // --------------------------------------- int currentFaceNodes[4]; // Buffer array of node used to create current face (nodes ordering matters for quadrangle's face) - currentFaceNodes[0] = m_numNoeuds[0]; - currentFaceNodes[1] = m_numNoeuds[1]; - currentFaceNodes[2] = m_numNoeuds[2]; - currentFaceNodes[3] = m_numNoeuds[3]; + currentFaceNodes[0] = m_numNodes[0]; + currentFaceNodes[1] = m_numNodes[1]; + currentFaceNodes[2] = m_numNodes[2]; + currentFaceNodes[3] = m_numNodes[3]; otherNode = 4; for(int n=0; n<4; n++){ facesBuff[iMax][n] = currentFaceNodes[n]; } // Filling facesBuff array before sorting @@ -101,12 +101,12 @@ void ElementPyramid::construitFaces(const Coord* nodes, FaceNS** faces, int& iMa if (indexFaceExiste==-1) // faces and facesBuff arrays are filled simultaneously { faces[iMax] = new FaceQuadrangle(currentFaceNodes[0], currentFaceNodes[1], currentFaceNodes[2], currentFaceNodes[3], 1); // Nodes ordering of quadrangle matters - faces[iMax]->construitFace(nodes, m_numNoeuds[otherNode], this); + faces[iMax]->construitFace(nodes, m_numNodes[otherNode], this); iMax++; } else { - faces[indexFaceExiste]->ajouteElementVoisin(this); + faces[indexFaceExiste]->addElementNeighbor(this); } // Building the 4 triangular faces @@ -115,10 +115,10 @@ void ElementPyramid::construitFaces(const Coord* nodes, FaceNS** faces, int& iMa { switch (i) { - case 1: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[4]; otherNode = 2; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[4]; otherNode = 3; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[3]; facesBuff[iMax][2] = m_numNoeuds[4]; otherNode = 0; break; - case 4: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[0]; facesBuff[iMax][2] = m_numNoeuds[4]; otherNode = 1; break; + case 1: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[4]; otherNode = 2; break; + case 2: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[4]; otherNode = 3; break; + case 3: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[3]; facesBuff[iMax][2] = m_numNodes[4]; otherNode = 0; break; + case 4: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[0]; facesBuff[iMax][2] = m_numNodes[4]; otherNode = 1; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1] + facesBuff[iMax][2]; std::sort(facesBuff[iMax],facesBuff[iMax]+3); // Nodes ordering @@ -128,12 +128,12 @@ void ElementPyramid::construitFaces(const Coord* nodes, FaceNS** faces, int& iMa if (indexFaceExiste==-1) { faces[iMax] = new FaceTriangle(facesBuff[iMax][0], facesBuff[iMax][1], facesBuff[iMax][2], 0); // No need to sort nodes to build triangle's face - faces[iMax]->construitFace(nodes, m_numNoeuds[otherNode], this); + faces[iMax]->construitFace(nodes, m_numNodes[otherNode], this); iMax++; } else { - faces[indexFaceExiste]->ajouteElementVoisin(this); + faces[indexFaceExiste]->addElementNeighbor(this); } } @@ -148,10 +148,10 @@ void ElementPyramid::construitFacesSimplifie(int& iMax, int** facesBuff, int* su // Building quadrangle as basis of pyramid // --------------------------------------- - facesBuff[iMax][0] = m_numNoeuds[0]; - facesBuff[iMax][1] = m_numNoeuds[1]; - facesBuff[iMax][2] = m_numNoeuds[2]; - facesBuff[iMax][3] = m_numNoeuds[3]; + facesBuff[iMax][0] = m_numNodes[0]; + facesBuff[iMax][1] = m_numNodes[1]; + facesBuff[iMax][2] = m_numNodes[2]; + facesBuff[iMax][3] = m_numNodes[3]; sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1] + facesBuff[iMax][2] + facesBuff[iMax][3]; std::sort(facesBuff[iMax],facesBuff[iMax]+4); // Nodes ordering // Checking face existence @@ -168,10 +168,10 @@ void ElementPyramid::construitFacesSimplifie(int& iMax, int** facesBuff, int* su { switch (i) { - case 1: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[4]; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[4]; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[3]; facesBuff[iMax][2] = m_numNoeuds[4]; break; - case 4: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[0]; facesBuff[iMax][2] = m_numNoeuds[4]; break; + case 1: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[4]; break; + case 2: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[4]; break; + case 3: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[3]; facesBuff[iMax][2] = m_numNodes[4]; break; + case 4: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[0]; facesBuff[iMax][2] = m_numNodes[4]; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1] + facesBuff[iMax][2]; std::sort(facesBuff[iMax],facesBuff[iMax]+3); // Nodes ordering @@ -187,56 +187,56 @@ void ElementPyramid::construitFacesSimplifie(int& iMax, int** facesBuff, int* su //*********************************************************************** -void ElementPyramid::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes) +void ElementPyramid::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal) { int indexFaceExiste(0); // Verification face Quadrangle: - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[3] < numberNodesInternal) { - FaceQuadrangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[2], m_numNoeuds[3]); + FaceQuadrangle face(m_numNodes[0], m_numNodes[1], m_numNodes[2], m_numNodes[3]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } // Verification face Triangle 1: - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal && m_numNodes[4] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[4]); + FaceTriangle face(m_numNodes[0], m_numNodes[1], m_numNodes[4]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } // Verification face Triangle 2: - if (m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes) + if (m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[4] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[1], m_numNoeuds[2], m_numNoeuds[4]); + FaceTriangle face(m_numNodes[1], m_numNodes[2], m_numNodes[4]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } // Verification face Triangle 3: - if (m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes) + if (m_numNodes[2] < numberNodesInternal && m_numNodes[3] < numberNodesInternal && m_numNodes[4] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[2], m_numNoeuds[3], m_numNoeuds[4]); + FaceTriangle face(m_numNodes[2], m_numNodes[3], m_numNodes[4]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } // Verification face Triangle 4: - if (m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[4] < numberNoeudsInternes) + if (m_numNodes[3] < numberNodesInternal && m_numNodes[0] < numberNodesInternal && m_numNodes[4] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[3], m_numNoeuds[0], m_numNoeuds[4]); + FaceTriangle face(m_numNodes[3], m_numNodes[0], m_numNodes[4]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } @@ -251,10 +251,10 @@ int ElementPyramid::compteFaceCommunicante(std::vector& facesBuff, std::ve int face[4], sumNodes, iMax; // 1 quadrangular face - face[0] = m_numNoeuds[0]; - face[1] = m_numNoeuds[1]; - face[2] = m_numNoeuds[2]; - face[3] = m_numNoeuds[3]; + face[0] = m_numNodes[0]; + face[1] = m_numNodes[1]; + face[2] = m_numNodes[2]; + face[3] = m_numNodes[3]; iMax = sumNodesBuff.size(); sumNodes = face[0] + face[1] + face[2] + face[3]; std::sort(face, face + 4); @@ -270,10 +270,10 @@ int ElementPyramid::compteFaceCommunicante(std::vector& facesBuff, std::ve { switch (i) { - case 1: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[4]; break; - case 2: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[4]; break; - case 3: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[3]; face[2] = m_numNoeuds[4]; break; - case 4: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[0]; face[2] = m_numNoeuds[4]; break; + case 1: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[4]; break; + case 2: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[4]; break; + case 3: face[0] = m_numNodes[2]; face[1] = m_numNodes[3]; face[2] = m_numNodes[4]; break; + case 4: face[0] = m_numNodes[3]; face[1] = m_numNodes[0]; face[2] = m_numNodes[4]; break; } iMax = sumNodesBuff.size(); sumNodes = face[0]+face[1]+face[2]; @@ -296,10 +296,10 @@ int ElementPyramid::compteFaceCommunicante(int& iMax, int** facesBuff, int* sumN int face[4], sumNodes; //1 quadrangle face - face[0] = m_numNoeuds[0]; - face[1] = m_numNoeuds[1]; - face[2] = m_numNoeuds[2]; - face[3] = m_numNoeuds[3]; + face[0] = m_numNodes[0]; + face[1] = m_numNodes[1]; + face[2] = m_numNodes[2]; + face[3] = m_numNodes[3]; sumNodes = face[0] + face[1] + face[2] + face[3]; std::sort(face, face + 4); // Checking face existence @@ -314,10 +314,10 @@ int ElementPyramid::compteFaceCommunicante(int& iMax, int** facesBuff, int* sumN { switch (i) { - case 1: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[4]; break; - case 2: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[4]; break; - case 3: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[3]; face[2] = m_numNoeuds[4]; break; - case 4: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[0]; face[2] = m_numNoeuds[4]; break; + case 1: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[4]; break; + case 2: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[4]; break; + case 3: face[0] = m_numNodes[2]; face[1] = m_numNodes[3]; face[2] = m_numNodes[4]; break; + case 4: face[0] = m_numNodes[3]; face[1] = m_numNodes[0]; face[2] = m_numNodes[4]; break; } sumNodes = face[0]+face[1]+face[2]; std::sort(face, face+3); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.h index f9239dbd..c34c7360 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementPyramid.h @@ -40,15 +40,15 @@ class ElementPyramid : public ElementNS public: ElementPyramid(); virtual ~ElementPyramid(); - virtual void construitFaces(const Coord* noeuds, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); + virtual void construitFaces(const Coord* nodes, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); virtual void construitFacesSimplifie(int& iMax, int** facesBuff, int* sumNodesBuff); - virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes); + virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal); virtual int compteFaceCommunicante(std::vector& faces, std::vector& sumNodesBuff); virtual int compteFaceCommunicante(int& iMax, int** faces, int* sumNodesBuff); private: - virtual void computeVolume(const Coord* noeuds); - virtual void computeLCFL(const Coord* noeuds); + virtual void computeVolume(const Coord* nodes); + virtual void computeLCFL(const Coord* nodes); static const int TYPEGMSH; static const int NUMBERNODES; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.cpp index 20390dc5..520ccd7f 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.cpp @@ -89,15 +89,15 @@ void ElementQuadrangle::construitFaces(const Coord* nodes, FaceNS** faces, int& { //4 faces a traiter de type segment int indexFaceExiste(-1); - int noeudAutre; + int nodeAutre; for (int i = 0; i < NUMBERFACES; i++) { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; noeudAutre = 2; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; noeudAutre = 3; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[3]; noeudAutre = 0; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[0]; noeudAutre = 1; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; nodeAutre = 2; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; nodeAutre = 3; break; + case 2: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[3]; nodeAutre = 0; break; + case 3: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[0]; nodeAutre = 1; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1]; std::sort(facesBuff[iMax],facesBuff[iMax]+2); //Tri des nodes @@ -107,12 +107,12 @@ void ElementQuadrangle::construitFaces(const Coord* nodes, FaceNS** faces, int& if (indexFaceExiste==-1) { faces[iMax] = new FaceSegment(facesBuff[iMax][0], facesBuff[iMax][1], 0); //pas besoin du tri ici - faces[iMax]->construitFace(nodes, m_numNoeuds[noeudAutre], this); + faces[iMax]->construitFace(nodes, m_numNodes[nodeAutre], this); iMax++; } else { - faces[indexFaceExiste]->ajouteElementVoisin(this); + faces[indexFaceExiste]->addElementNeighbor(this); } } } @@ -127,10 +127,10 @@ void ElementQuadrangle::construitFacesSimplifie(int& iMax, int** facesBuff, int* { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[3]; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[0]; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; break; + case 2: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[3]; break; + case 3: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[0]; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1]; std::sort(facesBuff[iMax],facesBuff[iMax]+2); //Tri des nodes @@ -149,10 +149,10 @@ void ElementQuadrangle::construitFacesSimplifie(int& iMax, int** facesBuff, int* void ElementQuadrangle::attributFaceLimite(FaceNS** faces, const int& indexMaxFaces) { int indexFaceExiste(0); - FaceQuadrangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[2], m_numNoeuds[3]); + FaceQuadrangle face(m_numNodes[0], m_numNodes[1], m_numNodes[2], m_numNodes[3]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); } else { @@ -162,46 +162,46 @@ void ElementQuadrangle::attributFaceLimite(FaceNS** faces, const int& indexMaxFa //*********************************************************************** -void ElementQuadrangle::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes) +void ElementQuadrangle::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal) { int indexFaceExiste(0); //Verification face 1 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal) { - FaceSegment face(m_numNoeuds[0], m_numNoeuds[1]); + FaceSegment face(m_numNodes[0], m_numNodes[1]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 2 : - if (m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes) + if (m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal) { - FaceSegment face(m_numNoeuds[1], m_numNoeuds[2]); + FaceSegment face(m_numNodes[1], m_numNodes[2]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 3 : - if (m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes) + if (m_numNodes[2] < numberNodesInternal && m_numNodes[3] < numberNodesInternal) { - FaceSegment face(m_numNoeuds[2], m_numNoeuds[3]); + FaceSegment face(m_numNodes[2], m_numNodes[3]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 4 : - if (m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[0] < numberNoeudsInternes) + if (m_numNodes[3] < numberNodesInternal && m_numNodes[0] < numberNodesInternal) { - FaceSegment face(m_numNoeuds[3], m_numNoeuds[0]); + FaceSegment face(m_numNodes[3], m_numNodes[0]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } @@ -218,10 +218,10 @@ int ElementQuadrangle::compteFaceCommunicante(std::vector& facesBuff, std: { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; break; - case 1: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; break; - case 2: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[3]; break; - case 3: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[0]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; break; + case 1: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; break; + case 2: face[0] = m_numNodes[2]; face[1] = m_numNodes[3]; break; + case 3: face[0] = m_numNodes[3]; face[1] = m_numNodes[0]; break; } int iMax = sumNodesBuff.size(); sumNodes = face[0]+face[1]; @@ -247,10 +247,10 @@ int ElementQuadrangle::compteFaceCommunicante(int& iMax, int** facesBuff, int* s { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; break; - case 1: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; break; - case 2: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[3]; break; - case 3: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[0]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; break; + case 1: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; break; + case 2: face[0] = m_numNodes[2]; face[1] = m_numNodes[3]; break; + case 3: face[0] = m_numNodes[3]; face[1] = m_numNodes[0]; break; } sumNodes = face[0]+face[1]; std::sort(face, face+2); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.h index ce028b95..4abd1368 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementQuadrangle.h @@ -44,7 +44,7 @@ class ElementQuadrangle : public ElementNS virtual void construitFaces(const Coord* nodes, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); virtual void construitFacesSimplifie(int& iMax, int** facesBuff, int* sumNodesBuff); virtual void attributFaceLimite(FaceNS** faces, const int& indexMaxFaces); - virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes); + virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal); virtual int compteFaceCommunicante(std::vector& faces, std::vector& sumNodesBuff); virtual int compteFaceCommunicante(int& iMax, int** faces, int* sumNodesBuff); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.cpp index 8ebabc3f..a5f262b2 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.cpp @@ -47,31 +47,31 @@ ElementSegment::~ElementSegment(){} //*********************************************************************** -void ElementSegment::computeVolume(const Coord* noeuds) +void ElementSegment::computeVolume(const Coord* nodes) { - m_volume = (noeuds[1] - noeuds[0]).norm(); //longueur du segment + m_volume = (nodes[1] - nodes[0]).norm(); //longueur du segment } //*********************************************************************** -void ElementSegment::computeLCFL(const Coord* noeuds) +void ElementSegment::computeLCFL(const Coord* nodes) { - m_lCFL = (noeuds[1] - noeuds[0]).norm()/2.0; //demi longueur du segment + m_lCFL = (nodes[1] - nodes[0]).norm()/2.0; //demi longueur du segment } //*********************************************************************** -void ElementSegment::construitFaces(const Coord* noeuds, FaceNS** faces, int& iMax, int** facesBuff, int* sumNodesBuff) +void ElementSegment::construitFaces(const Coord* nodes, FaceNS** faces, int& iMax, int** facesBuff, int* sumNodesBuff) { //2 faces a traiter de type vertex int indexFaceExiste(-1); - int noeudAutre; + int nodeAutre; for (int i = 0; i < NUMBERFACES; i++) { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; noeudAutre = 1; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; noeudAutre = 0; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; nodeAutre = 1; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; nodeAutre = 0; break; } sumNodesBuff[iMax] = facesBuff[iMax][0]; // Checking face existence @@ -80,12 +80,12 @@ void ElementSegment::construitFaces(const Coord* noeuds, FaceNS** faces, int& iM if (indexFaceExiste==-1) { faces[iMax] = new FacePoint(facesBuff[iMax][0]); //pas besoin du tri ici - faces[iMax]->construitFace(noeuds, m_numNoeuds[noeudAutre], this); + faces[iMax]->construitFace(nodes, m_numNodes[nodeAutre], this); iMax++; } else { - faces[indexFaceExiste]->ajouteElementVoisin(this); + faces[indexFaceExiste]->addElementNeighbor(this); } } } @@ -100,8 +100,8 @@ void ElementSegment::construitFacesSimplifie(int& iMax, int** facesBuff, int* su { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; break; } sumNodesBuff[iMax] = facesBuff[iMax][0]; // Checking face existence @@ -119,10 +119,10 @@ void ElementSegment::construitFacesSimplifie(int& iMax, int** facesBuff, int* su void ElementSegment::attributFaceLimite(FaceNS** faces, const int& indexMaxFaces) { int indexFaceExiste(0); - FaceSegment face(m_numNoeuds[0], m_numNoeuds[1]); + FaceSegment face(m_numNodes[0], m_numNodes[1]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); } else { @@ -132,26 +132,26 @@ void ElementSegment::attributFaceLimite(FaceNS** faces, const int& indexMaxFaces //*********************************************************************** -void ElementSegment::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes) +void ElementSegment::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal) { int indexFaceExiste(0); //Verification face 1 : - if (m_numNoeuds[0] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal) { - FacePoint face(m_numNoeuds[0]); + FacePoint face(m_numNodes[0]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 2 : - if (m_numNoeuds[1] < numberNoeudsInternes) + if (m_numNodes[1] < numberNodesInternal) { - FacePoint face(m_numNoeuds[1]); + FacePoint face(m_numNodes[1]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } @@ -168,8 +168,8 @@ int ElementSegment::compteFaceCommunicante(std::vector& facesBuff, std::ve { switch (i) { - case 0: vertex = m_numNoeuds[0]; break; - case 1: vertex = m_numNoeuds[1]; break; + case 0: vertex = m_numNodes[0]; break; + case 1: vertex = m_numNodes[1]; break; } int iMax = sumNodesBuff.size(); //Recherche existance faces @@ -193,8 +193,8 @@ int ElementSegment::compteFaceCommunicante(int& iMax, int** facesBuff, int* sumN { switch (i) { - case 0: vertex = m_numNoeuds[0]; break; - case 1: vertex = m_numNoeuds[1]; break; + case 0: vertex = m_numNodes[0]; break; + case 1: vertex = m_numNodes[1]; break; } //Recherche existance faces indexFaceExiste = FaceNS::searchFace(&vertex, vertex, facesBuff, sumNodesBuff, 1, iMax); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.h index 57d7c23e..01af454c 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementSegment.h @@ -41,16 +41,16 @@ class ElementSegment : public ElementNS ElementSegment(); virtual ~ElementSegment(); - virtual void construitFaces(const Coord* noeuds, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); + virtual void construitFaces(const Coord* nodes, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); virtual void construitFacesSimplifie(int& iMax, int** facesBuff, int* sumNodesBuff); virtual void attributFaceLimite(FaceNS** faces, const int& indexMaxFaces); - virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes); + virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal); virtual int compteFaceCommunicante(std::vector& faces, std::vector& sumNodesBuff); virtual int compteFaceCommunicante(int& iMax, int** faces, int* sumNodesBuff); private: - virtual void computeVolume(const Coord* noeuds); - virtual void computeLCFL(const Coord* noeuds); + virtual void computeVolume(const Coord* nodes); + virtual void computeLCFL(const Coord* nodes); static const int TYPEGMSH; static const int NUMBERNODES; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.cpp index 097535bb..af13b869 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.cpp @@ -74,15 +74,15 @@ void ElementTetrahedron::construitFaces(const Coord* nodes, FaceNS** faces, int& { //4 faces a traiter de type triangle int indexFaceExiste(-1); - int noeudAutre; + int nodeAutre; for (int i = 0; i < NUMBERFACES; i++) { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[2]; noeudAutre = 3; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[3]; noeudAutre = 0; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[3]; facesBuff[iMax][2] = m_numNoeuds[0]; noeudAutre = 1; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[0]; facesBuff[iMax][2] = m_numNoeuds[1]; noeudAutre = 2; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[2]; nodeAutre = 3; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[3]; nodeAutre = 0; break; + case 2: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[3]; facesBuff[iMax][2] = m_numNodes[0]; nodeAutre = 1; break; + case 3: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[0]; facesBuff[iMax][2] = m_numNodes[1]; nodeAutre = 2; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1] + facesBuff[iMax][2]; std::sort(facesBuff[iMax],facesBuff[iMax]+3); //Tri des nodes @@ -92,12 +92,12 @@ void ElementTetrahedron::construitFaces(const Coord* nodes, FaceNS** faces, int& if (indexFaceExiste==-1) { faces[iMax] = new FaceTriangle(facesBuff[iMax][0], facesBuff[iMax][1], facesBuff[iMax][2], 0); //pas besoin du tri ici - faces[iMax]->construitFace(nodes, m_numNoeuds[noeudAutre], this); + faces[iMax]->construitFace(nodes, m_numNodes[nodeAutre], this); iMax++; } else { - faces[indexFaceExiste]->ajouteElementVoisin(this); + faces[indexFaceExiste]->addElementNeighbor(this); } } } @@ -112,10 +112,10 @@ void ElementTetrahedron::construitFacesSimplifie(int& iMax, int** facesBuff, int { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; facesBuff[iMax][2] = m_numNoeuds[2]; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; facesBuff[iMax][2] = m_numNoeuds[3]; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[3]; facesBuff[iMax][2] = m_numNoeuds[0]; break; - case 3: facesBuff[iMax][0] = m_numNoeuds[3]; facesBuff[iMax][1] = m_numNoeuds[0]; facesBuff[iMax][2] = m_numNoeuds[1]; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; facesBuff[iMax][2] = m_numNodes[2]; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; facesBuff[iMax][2] = m_numNodes[3]; break; + case 2: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[3]; facesBuff[iMax][2] = m_numNodes[0]; break; + case 3: facesBuff[iMax][0] = m_numNodes[3]; facesBuff[iMax][1] = m_numNodes[0]; facesBuff[iMax][2] = m_numNodes[1]; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1] + facesBuff[iMax][2]; std::sort(facesBuff[iMax],facesBuff[iMax]+3); //Tri des nodes @@ -131,46 +131,46 @@ void ElementTetrahedron::construitFacesSimplifie(int& iMax, int** facesBuff, int //*********************************************************************** -void ElementTetrahedron::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes) +void ElementTetrahedron::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal) { int indexFaceExiste(0); //Verification face 1 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[2]); + FaceTriangle face(m_numNodes[0], m_numNodes[1], m_numNodes[2]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 2 : - if (m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes) + if (m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal && m_numNodes[3] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[1], m_numNoeuds[2], m_numNoeuds[3]); + FaceTriangle face(m_numNodes[1], m_numNodes[2], m_numNodes[3]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 3 : - if (m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[0] < numberNoeudsInternes) + if (m_numNodes[2] < numberNodesInternal && m_numNodes[3] < numberNodesInternal && m_numNodes[0] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[2], m_numNoeuds[3], m_numNoeuds[0]); + FaceTriangle face(m_numNodes[2], m_numNodes[3], m_numNodes[0]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 4 : - if (m_numNoeuds[3] < numberNoeudsInternes && m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes) + if (m_numNodes[3] < numberNodesInternal && m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal) { - FaceTriangle face(m_numNoeuds[3], m_numNoeuds[0], m_numNoeuds[1]); + FaceTriangle face(m_numNodes[3], m_numNodes[0], m_numNodes[1]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } @@ -187,10 +187,10 @@ int ElementTetrahedron::compteFaceCommunicante(std::vector& facesBuff, std { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[2]; break; - case 1: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[3]; break; - case 2: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[3]; face[2] = m_numNoeuds[0]; break; - case 3: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[0]; face[2] = m_numNoeuds[1]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[2]; break; + case 1: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[3]; break; + case 2: face[0] = m_numNodes[2]; face[1] = m_numNodes[3]; face[2] = m_numNodes[0]; break; + case 3: face[0] = m_numNodes[3]; face[1] = m_numNodes[0]; face[2] = m_numNodes[1]; break; } int iMax = sumNodesBuff.size(); sumNodes = face[0]+face[1]+face[2]; @@ -216,10 +216,10 @@ int ElementTetrahedron::compteFaceCommunicante(int& iMax, int** facesBuff, int* { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; face[2] = m_numNoeuds[2]; break; - case 1: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; face[2] = m_numNoeuds[3]; break; - case 2: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[3]; face[2] = m_numNoeuds[0]; break; - case 3: face[0] = m_numNoeuds[3]; face[1] = m_numNoeuds[0]; face[2] = m_numNoeuds[1]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; face[2] = m_numNodes[2]; break; + case 1: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; face[2] = m_numNodes[3]; break; + case 2: face[0] = m_numNodes[2]; face[1] = m_numNodes[3]; face[2] = m_numNodes[0]; break; + case 3: face[0] = m_numNodes[3]; face[1] = m_numNodes[0]; face[2] = m_numNodes[1]; break; } sumNodes = face[0]+face[1]+face[2]; std::sort(face, face+3); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.h index fcf58721..5c226a63 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTetrahedron.h @@ -44,7 +44,7 @@ class ElementTetrahedron : public ElementNS virtual void construitFaces(const Coord* nodes, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); virtual void construitFacesSimplifie(int& iMax, int** facesBuff, int* sumNodesBuff); - virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes); + virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal); virtual int compteFaceCommunicante(std::vector& faces, std::vector& sumNodesBuff); virtual int compteFaceCommunicante(int& iMax, int** faces, int* sumNodesBuff); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.cpp index 39cb193f..283f4dd5 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.cpp @@ -83,14 +83,14 @@ void ElementTriangle::construitFaces(const Coord* nodes, FaceNS** faces, int& iM { //3 faces a traiter de type segment int indexFaceExiste(-1); - int noeudAutre; + int nodeAutre; for (int i = 0; i < NUMBERFACES; i++) { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; noeudAutre = 2; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; noeudAutre = 0; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[0]; noeudAutre = 1; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; nodeAutre = 2; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; nodeAutre = 0; break; + case 2: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[0]; nodeAutre = 1; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1]; std::sort(facesBuff[iMax],facesBuff[iMax]+2); //Tri des nodes @@ -100,12 +100,12 @@ void ElementTriangle::construitFaces(const Coord* nodes, FaceNS** faces, int& iM if (indexFaceExiste==-1) { faces[iMax] = new FaceSegment(facesBuff[iMax][0], facesBuff[iMax][1], 0); //pas besoin du tri ici - faces[iMax]->construitFace(nodes, m_numNoeuds[noeudAutre], this); + faces[iMax]->construitFace(nodes, m_numNodes[nodeAutre], this); iMax++; } else { - faces[indexFaceExiste]->ajouteElementVoisin(this); + faces[indexFaceExiste]->addElementNeighbor(this); } } } @@ -120,9 +120,9 @@ void ElementTriangle::construitFacesSimplifie(int& iMax, int** facesBuff, int* s { switch (i) { - case 0: facesBuff[iMax][0] = m_numNoeuds[0]; facesBuff[iMax][1] = m_numNoeuds[1]; break; - case 1: facesBuff[iMax][0] = m_numNoeuds[1]; facesBuff[iMax][1] = m_numNoeuds[2]; break; - case 2: facesBuff[iMax][0] = m_numNoeuds[2]; facesBuff[iMax][1] = m_numNoeuds[0]; break; + case 0: facesBuff[iMax][0] = m_numNodes[0]; facesBuff[iMax][1] = m_numNodes[1]; break; + case 1: facesBuff[iMax][0] = m_numNodes[1]; facesBuff[iMax][1] = m_numNodes[2]; break; + case 2: facesBuff[iMax][0] = m_numNodes[2]; facesBuff[iMax][1] = m_numNodes[0]; break; } sumNodesBuff[iMax] = facesBuff[iMax][0] + facesBuff[iMax][1]; std::sort(facesBuff[iMax],facesBuff[iMax]+2); //Tri des nodes @@ -141,10 +141,10 @@ void ElementTriangle::construitFacesSimplifie(int& iMax, int** facesBuff, int* s void ElementTriangle::attributFaceLimite(FaceNS** faces, const int& indexMaxFaces) { int indexFaceExiste(0); - FaceTriangle face(m_numNoeuds[0], m_numNoeuds[1], m_numNoeuds[2]); + FaceTriangle face(m_numNodes[0], m_numNodes[1], m_numNodes[2]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); } else { @@ -154,36 +154,36 @@ void ElementTriangle::attributFaceLimite(FaceNS** faces, const int& indexMaxFace //*********************************************************************** -void ElementTriangle::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes) +void ElementTriangle::attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal) { int indexFaceExiste(0); //Verification face 1 : - if (m_numNoeuds[0] < numberNoeudsInternes && m_numNoeuds[1] < numberNoeudsInternes) + if (m_numNodes[0] < numberNodesInternal && m_numNodes[1] < numberNodesInternal) { - FaceSegment face(m_numNoeuds[0], m_numNoeuds[1]); + FaceSegment face(m_numNodes[0], m_numNodes[1]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 2 : - if (m_numNoeuds[1] < numberNoeudsInternes && m_numNoeuds[2] < numberNoeudsInternes) + if (m_numNodes[1] < numberNodesInternal && m_numNodes[2] < numberNodesInternal) { - FaceSegment face(m_numNoeuds[1], m_numNoeuds[2]); + FaceSegment face(m_numNodes[1], m_numNodes[2]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } //Verification face 3 : - if (m_numNoeuds[2] < numberNoeudsInternes && m_numNoeuds[0] < numberNoeudsInternes) + if (m_numNodes[2] < numberNodesInternal && m_numNodes[0] < numberNodesInternal) { - FaceSegment face(m_numNoeuds[2], m_numNoeuds[0]); + FaceSegment face(m_numNodes[2], m_numNodes[0]); if (face.faceExists(faces, indexMaxFaces, indexFaceExiste)) { - faces[indexFaceExiste]->ajouteElementVoisinLimite(this); + faces[indexFaceExiste]->addElementNeighborLimite(this); faces[indexFaceExiste]->setEstComm(true); } } @@ -200,9 +200,9 @@ int ElementTriangle::compteFaceCommunicante(std::vector& facesBuff, std::v { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; break; - case 1: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; break; - case 2: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[0]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; break; + case 1: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; break; + case 2: face[0] = m_numNodes[2]; face[1] = m_numNodes[0]; break; } int iMax = sumNodesBuff.size(); sumNodes = face[0]+face[1]; @@ -228,9 +228,9 @@ int ElementTriangle::compteFaceCommunicante(int& iMax, int** facesBuff, int* sum { switch (i) { - case 0: face[0] = m_numNoeuds[0]; face[1] = m_numNoeuds[1]; break; - case 1: face[0] = m_numNoeuds[1]; face[1] = m_numNoeuds[2]; break; - case 2: face[0] = m_numNoeuds[2]; face[1] = m_numNoeuds[0]; break; + case 0: face[0] = m_numNodes[0]; face[1] = m_numNodes[1]; break; + case 1: face[0] = m_numNodes[1]; face[1] = m_numNodes[2]; break; + case 2: face[0] = m_numNodes[2]; face[1] = m_numNodes[0]; break; } sumNodes = face[0]+face[1]; std::sort(face, face+2); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.h b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.h index 08791cec..2d34539b 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/ElementTriangle.h @@ -44,7 +44,7 @@ class ElementTriangle : public ElementNS virtual void construitFaces(const Coord* nodes, FaceNS** faces, int& indexMaxFaces, int** facesBuff, int* sumNodesBuff); virtual void construitFacesSimplifie(int& iMax, int** facesBuff, int* sumNodesBuff); virtual void attributFaceLimite(FaceNS** faces, const int& indexMaxFaces); - virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNoeudsInternes); + virtual void attributFaceCommunicante(FaceNS** faces, const int& indexMaxFaces, const int& numberNodesInternal); virtual int compteFaceCommunicante(std::vector& faces, std::vector& sumNodesBuff); virtual int compteFaceCommunicante(int& iMax, int** faces, int* sumNodesBuff); diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.cpp index 57d09732..af19be9a 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.cpp @@ -36,22 +36,22 @@ FaceNS::FaceNS(){} //*********************************************************************** -FaceNS::FaceNS(const int& numberNoeuds) : +FaceNS::FaceNS(const int& numberNodes) : Face(), -m_numberNoeuds(numberNoeuds), +m_numberNodes(numberNodes), m_limite(false), m_comm(false), m_elementGauche(0), m_elementDroite(0) { - m_numNoeuds = new int[numberNoeuds]; + m_numNodes = new int[numberNodes]; } //*********************************************************************** FaceNS::~FaceNS() { - delete[] m_numNoeuds; + delete[] m_numNodes; } //*********************************************************************** @@ -70,16 +70,16 @@ ElementNS *FaceNS::getElementDroite() const //*********************************************************************** -void FaceNS::construitFace(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin) +void FaceNS::construitFace(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor) { //Calcul position du center de face m_position = 0.; - for (int i = 0; i < m_numberNoeuds; i++){ m_position += noeuds[m_numNoeuds[i]]; } - m_position /= static_cast(m_numberNoeuds); + for (int i = 0; i < m_numberNodes; i++){ m_position += nodes[m_numNodes[i]]; } + m_position /= static_cast(m_numberNodes); //Calculs des proprietes de la face - this->computeSurface(noeuds); - this->computeRepere(noeuds, numNoeudAutre, elementVoisin); + this->computeSurface(nodes); + this->computeRepere(nodes, numNodeOther, elementNeighbor); } //*********************************************************************** @@ -92,12 +92,12 @@ bool FaceNS::faceExists(FaceNS** faces, const int& indexMaxFaces, int& indexFace { //1) Sans passer par operateur de comparaison //------------------------------------------- - if (faces[i]->m_sommeNumNoeuds != m_sommeNumNoeuds){continue;}; - //Verification noeud par noeud + if (faces[i]->m_sumNumNodes != m_sumNumNodes){continue;}; + //Verification node par node faceTrouvee = 1; - for (int n = 0; n < m_numberNoeuds; n++) + for (int n = 0; n < m_numberNodes; n++) { - if (m_numNoeuds[n] != faces[i]->getNumNoeud(n)){ faceTrouvee = 0; break; } + if (m_numNodes[n] != faces[i]->getNumNode(n)){ faceTrouvee = 0; break; } } if(faceTrouvee) { @@ -114,21 +114,21 @@ bool FaceNS::faceExists(FaceNS** faces, const int& indexMaxFaces, int& indexFace //*********************************************************************** -void FaceNS::ajouteElementVoisin(ElementNS *elementVoisin) +void FaceNS::addElementNeighbor(ElementNS *elementNeighbor) { if (m_elementGauche == 0) { - m_elementGauche = elementVoisin; + m_elementGauche = elementNeighbor; } else { - m_elementDroite = elementVoisin; + m_elementDroite = elementNeighbor; } } //*********************************************************************** -void FaceNS::ajouteElementVoisinLimite(ElementNS *elementVoisin) +void FaceNS::addElementNeighborLimite(ElementNS *elementNeighbor) { if (m_elementGauche == 0) { @@ -137,7 +137,7 @@ void FaceNS::ajouteElementVoisinLimite(ElementNS *elementVoisin) m_normal.changeSign(); m_binormal = Coord::crossProduct(m_normal, m_tangent); } - m_elementDroite = elementVoisin; + m_elementDroite = elementNeighbor; m_limite = true; } @@ -157,13 +157,13 @@ void FaceNS::setEstComm(const bool &estComm) //*********************************************************************** -void FaceNS::getInfoNoeuds(int* numNoeuds, int& sommeNumNoeuds) const +void FaceNS::getInfoNodes(int* numNodes, int& sumNumNodes) const { - for(int i=0; i=0; i--) { int existe = 1; - //On utilise la somme des number des noeuds pour faire un premier tri : permet d accelerer la recherche - if (tableauSommeNoeuds[i] != sumNodes){ continue; }; - //Verification noeud par noeud - for (int n=0; n tableauFaces, std::vector tableauSommeNoeuds, int numberNoeuds, int& indexMaxFaces) +int FaceNS::searchFace(int* face, int& sumNodes, std::vector arrayFaces, std::vector arraySumNodes, int numberNodes, int& indexMaxFaces) { for (int i = indexMaxFaces-1; i>=0; i--) { int existe = 1; - //On utilise la somme des number des noeuds pour faire un premier tri : permet d accelerer la recherche - if (tableauSommeNoeuds[i] != sumNodes){ continue; }; - //Verification noeud par noeud - for (int n=0; n tableauFaces, bool operator==(const FaceNS &a, const FaceNS &b) { - //Sortie directe si m_sommeNumNoeuds differents - if (a.getSommeNumNoeuds() != b.getSommeNumNoeuds()){ return false; } - //Sortie directe si number noeuds differents - if (a.getNumberNoeuds() != b.getNumberNoeuds()){ return false; } - //Verification noeud par noeud - for (int i = 0; i < a.getNumberNoeuds(); i++) + //Sortie directe si m_sumNumNodes differents + if (a.getSumNumNodes() != b.getSumNumNodes()){ return false; } + //Sortie directe si number nodes differents + if (a.getNumberNodes() != b.getNumberNodes()){ return false; } + //Verification node par node + for (int i = 0; i < a.getNumberNodes(); i++) { - if (a.getNumNoeud(i) != b.getNumNoeud(i)){ return false; } + if (a.getNumNode(i) != b.getNumNode(i)){ return false; } } //Par defaut : il sont identiques return true; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.h b/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.h index 64bc24a0..67e2f3a2 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceNS.h @@ -40,13 +40,13 @@ class FaceNS : public Face { public: FaceNS(); - FaceNS(const int& numberNoeuds); + FaceNS(const int& numberNodes); virtual ~FaceNS(); - void construitFace(const Coord* noeuds, const int& numNoeudAutre, ElementNS* elementVoisin); + void construitFace(const Coord* nodes, const int& numNodeOther, ElementNS* elementNeighbor); bool faceExists(FaceNS** faces, const int& indexMaxFaces, int& indexFaceExiste); - void ajouteElementVoisin(ElementNS* elementVoisin); - void ajouteElementVoisinLimite(ElementNS* elementVoisin); + void addElementNeighbor(ElementNS* elementNeighbor); + void addElementNeighborLimite(ElementNS* elementNeighbor); //Accesseurs ElementNS *getElementGauche() const; @@ -54,24 +54,24 @@ class FaceNS : public Face void setEstLimite(const bool& estLimite); void setEstComm(const bool& estComm); const bool& getEstComm() const { return m_comm; }; - const int& getSommeNumNoeuds() const { return m_sommeNumNoeuds; }; + const int& getSumNumNodes() const { return m_sumNumNodes; }; - const int& getNumberNoeuds() const { return m_numberNoeuds; }; - const int& getNumNoeud(const int& numNoeud) const { return m_numNoeuds[numNoeud]; }; - void getInfoNoeuds(int* numNoeuds, int& sommeNumNoeuds) const; + const int& getNumberNodes() const { return m_numberNodes; }; + const int& getNumNode(const int& numNode) const { return m_numNodes[numNode]; }; + void getInfoNodes(int* numNodes, int& sumNumNodes) const; const bool& getEstLimite() const { return m_limite; }; - void afficheNoeuds() const; + void printNodes() const; virtual void printInfo() const; - static int searchFace(int* face, int& sumNodes, int** tableauFaces, int* tableauSommeNoeuds, int numberNoeuds, int& indexMaxFaces); // Recherche si face appartient au tableau tableauFaces : renvoi le number ou -1 si absence - static int searchFace(int* face, int& sumNodes, std::vector tableauFaces, std::vector tableauSommeNoeuds, int numberNoeuds, int& indexMaxFaces); // Recherche si face appartient au tableau tableauFaces : renvoi le number ou -1 si absence. Utilise seulement sur ancienne version + static int searchFace(int* face, int& sumNodes, int** arrayFaces, int* arraySumNodes, int numberNodes, int& indexMaxFaces); // Recherche si face appartient au array arrayFaces : renvoi le number ou -1 si absence + static int searchFace(int* face, int& sumNodes, std::vector arrayFaces, std::vector arraySumNodes, int numberNodes, int& indexMaxFaces); // Recherche si face appartient au array arrayFaces : renvoi le number ou -1 si absence. Utilise seulement sur ancienne version protected: - virtual void computeSurface(const Coord* /*noeuds*/){}; - virtual void computeRepere(const Coord* /*noeuds*/, const int& /*numNoeudAutre*/, ElementNS* /*elementVoisin*/){}; + virtual void computeSurface(const Coord* /*nodes*/){}; + virtual void computeRepere(const Coord* /*nodes*/, const int& /*numNodeOther*/, ElementNS* /*elementNeighbor*/){}; - int m_numberNoeuds; /*!< Number de noeuds de la face */ - int* m_numNoeuds; /*!< Number des noeud relatif au tableau de noeuds global */ - int m_sommeNumNoeuds; + int m_numberNodes; /*!< Number de nodes de la face */ + int* m_numNodes; /*!< Number des node relatif au array de nodes global */ + int m_sumNumNodes; bool m_limite; bool m_comm; ElementNS* m_elementGauche; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.cpp index ae8b3c98..15ebc7e2 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.cpp @@ -34,11 +34,11 @@ const int FacePoint::NUMBERNODES = 1; //*********************************************************************** -FacePoint::FacePoint(const int& numNoeud1) : +FacePoint::FacePoint(const int& numNode1) : FaceNS(NUMBERNODES) { - m_numNoeuds[0] = numNoeud1; - m_sommeNumNoeuds = m_numNoeuds[0]; + m_numNodes[0] = numNode1; + m_sumNumNodes = m_numNodes[0]; } //*********************************************************************** @@ -47,21 +47,21 @@ FacePoint::~FacePoint(){} //*********************************************************************** -void FacePoint::computeSurface(const Coord* /*noeuds*/) +void FacePoint::computeSurface(const Coord* /*nodes*/) { m_surface = 1.0; //unite } //*********************************************************************** -void FacePoint::computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin) +void FacePoint::computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor) { - Coord v1; v1.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[numNoeudAutre]); + Coord v1; v1.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[numNodeOther]); m_normal = v1 / v1.norm(); m_binormal.setXYZ(0., 0., 1.); m_tangent = Coord::crossProduct(m_binormal, m_normal); - m_elementDroite = elementVoisin; + m_elementDroite = elementNeighbor; m_elementGauche = 0; } diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.h b/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.h index 5a50cb62..0a5419fb 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FacePoint.h @@ -36,12 +36,12 @@ class FacePoint : public FaceNS { public: - FacePoint(const int& numNoeud1); + FacePoint(const int& numNode1); virtual ~FacePoint(); private: - virtual void computeSurface(const Coord* /*noeuds*/); - virtual void computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS* elementVoisin); + virtual void computeSurface(const Coord* /*nodes*/); + virtual void computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS* elementNeighbor); static const int NUMBERNODES; }; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.cpp index dd9810eb..a2b9badb 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.cpp @@ -34,44 +34,44 @@ const int FaceQuadrangle::NUMBERNODES = 4; //*********************************************************************** -FaceQuadrangle::FaceQuadrangle(const int& numNoeud1, const int& numNoeud2, const int& numNoeud3, const int& numNoeud4, int tri) : +FaceQuadrangle::FaceQuadrangle(const int& numNode1, const int& numNode2, const int& numNode3, const int& numNode4, int tri) : FaceNS(NUMBERNODES) { //Sauvegarde ordre initial - m_numNoeudsOrigine = new int[4]; - m_numNoeudsOrigine[0] = numNoeud1; - m_numNoeudsOrigine[1] = numNoeud2; - m_numNoeudsOrigine[2] = numNoeud3; - m_numNoeudsOrigine[3] = numNoeud4; + m_numNodesOrigine = new int[4]; + m_numNodesOrigine[0] = numNode1; + m_numNodesOrigine[1] = numNode2; + m_numNodesOrigine[2] = numNode3; + m_numNodesOrigine[3] = numNode4; - m_numNoeuds[0] = numNoeud1; - m_numNoeuds[1] = numNoeud2; - m_numNoeuds[2] = numNoeud3; - m_numNoeuds[3] = numNoeud4; - if(tri) std::sort(m_numNoeuds, m_numNoeuds+4); - m_sommeNumNoeuds = m_numNoeuds[0] + m_numNoeuds[1] + m_numNoeuds[2] + m_numNoeuds[3]; + m_numNodes[0] = numNode1; + m_numNodes[1] = numNode2; + m_numNodes[2] = numNode3; + m_numNodes[3] = numNode4; + if(tri) std::sort(m_numNodes, m_numNodes+4); + m_sumNumNodes = m_numNodes[0] + m_numNodes[1] + m_numNodes[2] + m_numNodes[3]; } //*********************************************************************** FaceQuadrangle::~FaceQuadrangle() { - delete[] m_numNoeudsOrigine; + delete[] m_numNodesOrigine; } //*********************************************************************** -void FaceQuadrangle::computeSurface(const Coord* noeuds) +void FaceQuadrangle::computeSurface(const Coord* nodes) { - //Atention utilisation des numbering de noeud d origin pour assurer le compute des surfaces + //Atention utilisation des numbering de node d origin pour assurer le compute des surfaces //une diagonale : - Coord v0(noeuds[m_numNoeudsOrigine[2]] - noeuds[m_numNoeudsOrigine[0]]); + Coord v0(nodes[m_numNodesOrigine[2]] - nodes[m_numNodesOrigine[0]]); double diagonale(v0.norm()); //Les 4 cotes : - Coord v1(noeuds[m_numNoeudsOrigine[1]] - noeuds[m_numNoeudsOrigine[0]]); - Coord v2(noeuds[m_numNoeudsOrigine[2]] - noeuds[m_numNoeudsOrigine[1]]); - Coord v3(noeuds[m_numNoeudsOrigine[3]] - noeuds[m_numNoeudsOrigine[2]]); - Coord v4(noeuds[m_numNoeudsOrigine[0]] - noeuds[m_numNoeudsOrigine[3]]); + Coord v1(nodes[m_numNodesOrigine[1]] - nodes[m_numNodesOrigine[0]]); + Coord v2(nodes[m_numNodesOrigine[2]] - nodes[m_numNodesOrigine[1]]); + Coord v3(nodes[m_numNodesOrigine[3]] - nodes[m_numNodesOrigine[2]]); + Coord v4(nodes[m_numNodesOrigine[0]] - nodes[m_numNodesOrigine[3]]); double a(v1.norm()); double b(v2.norm()); double c(v3.norm()); double d(v4.norm()); //Aire premier triangle double dp1 = 0.5*(a + b + diagonale); @@ -85,25 +85,25 @@ void FaceQuadrangle::computeSurface(const Coord* noeuds) //*********************************************************************** -void FaceQuadrangle::computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin) +void FaceQuadrangle::computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor) { - Coord v1; v1.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[m_numNoeuds[1]]); - Coord v2; v2.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[m_numNoeuds[2]]); + Coord v1; v1.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[m_numNodes[1]]); + Coord v2; v2.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[m_numNodes[2]]); m_tangent = v1 / v1.norm(); Coord v1v2; v1v2 = Coord::crossProduct(v1, v2); m_normal = v1v2 / v1v2.norm(); m_binormal = Coord::crossProduct(m_normal, m_tangent); - Coord v3; v3.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[numNoeudAutre]); + Coord v3; v3.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[numNodeOther]); if (v3.scalar(m_normal) > 0.) { - m_elementDroite = elementVoisin; + m_elementDroite = elementNeighbor; m_elementGauche = 0; } else { - m_elementGauche = elementVoisin; + m_elementGauche = elementNeighbor; m_elementDroite = 0; } } diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.h b/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.h index 18c5c957..b123216e 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceQuadrangle.h @@ -36,15 +36,15 @@ class FaceQuadrangle : public FaceNS { public: - FaceQuadrangle(const int& numNoeud1, const int& numNoeud2, const int& numNoeud3, const int& numNoeud4, int tri=1); + FaceQuadrangle(const int& numNode1, const int& numNode2, const int& numNode3, const int& numNode4, int tri=1); virtual ~FaceQuadrangle(); private: - virtual void computeSurface(const Coord* noeuds); - virtual void computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin); + virtual void computeSurface(const Coord* nodes); + virtual void computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor); static const int NUMBERNODES; - int* m_numNoeudsOrigine; + int* m_numNodesOrigine; }; #endif // FACEQUADRANGLE_H \ No newline at end of file diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.cpp index b0982775..f52e69c3 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.cpp @@ -34,13 +34,13 @@ const int FaceSegment::NUMBERNODES = 2; //*********************************************************************** -FaceSegment::FaceSegment(const int& numNoeud1, const int& numNoeud2, int tri) : +FaceSegment::FaceSegment(const int& numNode1, const int& numNode2, int tri) : FaceNS(NUMBERNODES) { - m_numNoeuds[0] = numNoeud1; - m_numNoeuds[1] = numNoeud2; - if(tri) std::sort(m_numNoeuds, m_numNoeuds+2); - m_sommeNumNoeuds = m_numNoeuds[0] + m_numNoeuds[1]; + m_numNodes[0] = numNode1; + m_numNodes[1] = numNode2; + if(tri) std::sort(m_numNodes, m_numNodes+2); + m_sumNumNodes = m_numNodes[0] + m_numNodes[1]; } //*********************************************************************** @@ -49,29 +49,29 @@ FaceSegment::~FaceSegment(){} //*********************************************************************** -void FaceSegment::computeSurface(const Coord* noeuds) +void FaceSegment::computeSurface(const Coord* nodes) { - m_surface = (noeuds[m_numNoeuds[1]] - noeuds[m_numNoeuds[0]]).norm(); //Longeur du segment + m_surface = (nodes[m_numNodes[1]] - nodes[m_numNodes[0]]).norm(); //Longeur du segment } //*********************************************************************** -void FaceSegment::computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin) +void FaceSegment::computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor) { - Coord v1; v1.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[m_numNoeuds[1]]); + Coord v1; v1.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[m_numNodes[1]]); m_tangent = v1 / v1.norm(); m_binormal.setXYZ(0., 0., 1.); m_normal = Coord::crossProduct(m_tangent, m_binormal); - Coord v2; v2.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[numNoeudAutre]); + Coord v2; v2.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[numNodeOther]); if (v2.scalar(m_normal) > 0.) { - m_elementDroite = elementVoisin; + m_elementDroite = elementNeighbor; m_elementGauche = 0; } else { - m_elementGauche = elementVoisin; + m_elementGauche = elementNeighbor; m_elementDroite = 0; } } diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.h b/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.h index cd32cde3..f90acb9c 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceSegment.h @@ -36,12 +36,12 @@ class FaceSegment : public FaceNS { public: - FaceSegment(const int& numNoeud1, const int& numNoeud2, int tri=1); + FaceSegment(const int& numNode1, const int& numNode2, int tri=1); virtual ~FaceSegment(); private: - virtual void computeSurface(const Coord* noeuds); - virtual void computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin); + virtual void computeSurface(const Coord* nodes); + virtual void computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor); static const int NUMBERNODES; }; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.cpp index 9aa620d5..33194c8d 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.cpp @@ -34,14 +34,14 @@ const int FaceTriangle::NUMBERNODES=3; //*********************************************************************** -FaceTriangle::FaceTriangle(const int& numNoeud1, const int& numNoeud2, const int& numNoeud3, int tri) : +FaceTriangle::FaceTriangle(const int& numNode1, const int& numNode2, const int& numNode3, int tri) : FaceNS(NUMBERNODES) { - m_numNoeuds[0] = numNoeud1; - m_numNoeuds[1] = numNoeud2; - m_numNoeuds[2] = numNoeud3; - if(tri) std::sort(m_numNoeuds, m_numNoeuds+3); - m_sommeNumNoeuds = m_numNoeuds[0] + m_numNoeuds[1] + m_numNoeuds[2]; + m_numNodes[0] = numNode1; + m_numNodes[1] = numNode2; + m_numNodes[2] = numNode3; + if(tri) std::sort(m_numNodes, m_numNodes+3); + m_sumNumNodes = m_numNodes[0] + m_numNodes[1] + m_numNodes[2]; } //*********************************************************************** @@ -50,11 +50,11 @@ FaceTriangle::~FaceTriangle(){} //*********************************************************************** -void FaceTriangle::computeSurface(const Coord* noeuds) +void FaceTriangle::computeSurface(const Coord* nodes) { - Coord v1(noeuds[m_numNoeuds[1]] - noeuds[m_numNoeuds[0]]); - Coord v2(noeuds[m_numNoeuds[2]] - noeuds[m_numNoeuds[1]]); - Coord v3(noeuds[m_numNoeuds[0]] - noeuds[m_numNoeuds[2]]); + Coord v1(nodes[m_numNodes[1]] - nodes[m_numNodes[0]]); + Coord v2(nodes[m_numNodes[2]] - nodes[m_numNodes[1]]); + Coord v3(nodes[m_numNodes[0]] - nodes[m_numNodes[2]]); double a(v1.norm()), b(v2.norm()), c(v3.norm()); double dp = 0.5*(a + b + c); m_surface = sqrt(dp*(dp - a)*(dp - b)*(dp - c)); @@ -62,25 +62,25 @@ void FaceTriangle::computeSurface(const Coord* noeuds) //*********************************************************************** -void FaceTriangle::computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin) +void FaceTriangle::computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor) { - Coord v1; v1.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[m_numNoeuds[1]]); - Coord v2; v2.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[m_numNoeuds[2]]); + Coord v1; v1.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[m_numNodes[1]]); + Coord v2; v2.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[m_numNodes[2]]); m_tangent = v1 / v1.norm(); Coord v1v2; v1v2 = Coord::crossProduct(v1, v2); m_normal = v1v2 / v1v2.norm(); m_binormal = Coord::crossProduct(m_normal, m_tangent); - Coord v3; v3.setFromSubtractedVectors(noeuds[m_numNoeuds[0]], noeuds[numNoeudAutre]); + Coord v3; v3.setFromSubtractedVectors(nodes[m_numNodes[0]], nodes[numNodeOther]); if (v3.scalar(m_normal) > 0.) { - m_elementDroite = elementVoisin; + m_elementDroite = elementNeighbor; m_elementGauche = 0; } else { - m_elementGauche = elementVoisin; + m_elementGauche = elementNeighbor; m_elementDroite = 0; } } diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.h b/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.h index d4f14886..3c603583 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/FaceTriangle.h @@ -36,12 +36,12 @@ class FaceTriangle : public FaceNS { public: - FaceTriangle(const int& numNoeud1, const int& numNoeud2, const int& numNoeud3, int tri=1); + FaceTriangle(const int& numNode1, const int& numNode2, const int& numNode3, int tri=1); virtual ~FaceTriangle(); private: - virtual void computeSurface(const Coord* noeuds); - virtual void computeRepere(const Coord* noeuds, const int& numNoeudAutre, ElementNS *elementVoisin); + virtual void computeSurface(const Coord* nodes); + virtual void computeRepere(const Coord* nodes, const int& numNodeOther, ElementNS *elementNeighbor); static const int NUMBERNODES; }; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/HeaderElements.h b/src/Meshes/MeshUnStruct/MUSGmsh/HeaderElements.h index 26add4d3..14f7f354 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/HeaderElements.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/HeaderElements.h @@ -39,6 +39,6 @@ #include "ElementHexahedron.h" #include "ElementPrism.h" #include "ElementPyramid.h" -//Ajouter ici les entetes des elements du mesh +//Add here headers of new elements #endif // HEADERELEMENTS_H \ No newline at end of file diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/HeaderFaces.h b/src/Meshes/MeshUnStruct/MUSGmsh/HeaderFaces.h index db40bd28..e648e7fd 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/HeaderFaces.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/HeaderFaces.h @@ -35,6 +35,6 @@ #include "FaceSegment.h" #include "FaceTriangle.h" #include "FaceQuadrangle.h" -//Ajouter ici les entetes des faces du mesh +//Add here headers of new faces #endif // HEADERFACES_H \ No newline at end of file diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.cpp index 495de38d..b81e1ec9 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.cpp @@ -47,19 +47,30 @@ std::string MUSGmsh::readVersion(const std::string& meshFile) std::string pathMeshFile(meshFile); std::string currentLine; std::ifstream mesh(pathMeshFile.c_str(), std::ios::in); - if (!mesh) { throw ErrorXML("mesh file not found : " + pathMeshFile, __FILE__, __LINE__); } - - getline(mesh, currentLine); // read $MeshFormat - - std::stringstream lineToTreat; + if (!mesh) { throw ErrorMeshNS("mesh file not found : " + pathMeshFile, __FILE__, __LINE__); } + + // Exclusion of unwanted sections std::string fileVersion; - getline(mesh, currentLine); - lineToTreat << currentLine; - lineToTreat >> fileVersion; + while(currentLine != "$MeshFormat") { + std::stringstream lineToTreat; + getline(mesh, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (mesh.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + meshFile, __FILE__, __LINE__); + } + } + + // Get file version + std::stringstream lineToTreat; + mesh >> currentLine; + lineToTreat << currentLine; + lineToTreat >> fileVersion; //To exclude the newline caracter + mesh.close(); return fileVersion; } - catch (ErrorXML&) { throw; } + catch (ErrorMeshNS&) { throw; } } //*********************************************************************** diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.h b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.h index caae1db0..81cca8af 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmsh.h @@ -47,6 +47,10 @@ class MUSGmsh : public MeshUnStruct virtual void initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshContainer& cellInterfaces, std::string computeOrder = "FIRSTORDER") = 0; virtual void initGeometryParallel(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, std::string computeOrder = "FIRSTORDER") = 0; virtual void preProcessMeshFileForParallel() = 0; + virtual void initCpuMeshSequential(TypeMeshContainer& cells, std::string& computeOrder) = 0; + virtual void initCpuMeshParallel(TypeMeshContainer& cells, std::string& computeOrder, int cpu) = 0; + + virtual std::string getMeshExtension() const { return "msh"; }; private: }; diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.cpp index e9e96a81..fc916802 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.cpp @@ -58,19 +58,19 @@ void MUSGmshV2::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon { m_numberCellsCalcul = m_numberElements1D; m_numberBoundFaces = m_numberElements0D; - m_geometrie = 1; + m_problemDimension = 1; } else if (m_numberElements3D == 0) // 2D case { m_numberCellsCalcul = m_numberElements2D; m_numberBoundFaces = m_numberElements1D; - m_geometrie = 2; + m_problemDimension = 2; } else // 3D case { m_numberCellsCalcul = m_numberElements3D; m_numberBoundFaces = m_numberElements2D; - m_geometrie = 3; + m_problemDimension = 3; } m_numberCellsTotal = m_numberCellsCalcul; @@ -95,7 +95,7 @@ void MUSGmshV2::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon for (int i = 0; i < m_numberCellsCalcul; i++) { if (computeOrder == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2NS); } cells[i]->setElement(m_elements[i + m_numberBoundFaces], i); m_numberInnerFaces += m_elements[i + m_numberBoundFaces]->getNumberFaces(); } @@ -109,22 +109,22 @@ void MUSGmshV2::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon //std::cout << "el " << i + m_numberBoundFaces << " : " ; //std::vector neighbors; // Temporary vector of neighbors //1) Building vector of neighbors - for (int n = 0; n < e->getNumberNoeuds(); n++) { // Node loop of element e - int numNoeud = e->getNumNoeud(n); - for (unsigned int v = 0; v < neighborNodes[numNoeud].size(); v++) { // Loop neighborNodes of node n + for (int n = 0; n < e->getNumberNodes(); n++) { // Node loop of element e + int numNode = e->getNumNode(n); + for (unsigned int v = 0; v < neighborNodes[numNode].size(); v++) { // Loop neighborNodes of node n bool add(true); - if (neighborNodes[numNoeud][v]->getIndex() == e->getIndex()) add = false; - //else if(neighborNodes[numNoeud][v]->getIndex() < m_numberBoundFaces) add = false; + if (neighborNodes[numNode][v]->getIndex() == e->getIndex()) add = false; + //else if(neighborNodes[numNode][v]->getIndex() < m_numberBoundFaces) add = false; else { for (unsigned int vo = 0; vo < neighbors[i].size(); vo++) { - if (neighborNodes[numNoeud][v]->getIndex() == neighbors[i][vo]->getIndex()) { + if (neighborNodes[numNode][v]->getIndex() == neighbors[i][vo]->getIndex()) { add = false; break; } } } if (add) { - neighbors[i].push_back(neighborNodes[numNoeud][v]); - //std::cout << neighborNodes[numNoeud][v]->getIndex() << " "; + neighbors[i].push_back(neighborNodes[numNode][v]); + //std::cout << neighborNodes[numNode][v]->getIndex() << " "; } } } @@ -198,7 +198,7 @@ void MUSGmshV2::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon // Link Geometry/cellInterfaces of compute std::cout << " 3/Linking Geometries -> Physics ..." << std::endl; tTemp = clock(); - int iMailleG, iMailleD; + int iCellL, iCellR; for (int i = 0; i < m_numberFacesTotal; i++) { if (m_faces[i]->getEstLimite()) // Physical boundary faces @@ -207,377 +207,22 @@ void MUSGmshV2::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon if (appPhys >= static_cast(m_bound.size()) || appPhys < 0) { Errors::errorMessage("Number of boundary conditions not suited"); } m_bound[appPhys]->createBoundary(cellInterfaces); cellInterfaces[i]->setFace(m_faces[i]); - iMailleG = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; - iMailleD = iMailleG; - cells[iMailleG]->addCellInterface(cellInterfaces[i]); + iCellL = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; + iCellR = iCellL; + cells[iCellL]->addCellInterface(cellInterfaces[i]); } // Inner faces of domain else { if (computeOrder == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2NS); } cellInterfaces[i]->setFace(m_faces[i]); - iMailleG = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; - iMailleD = m_faces[i]->getElementDroite()->getIndex() - m_numberBoundFaces; - cells[iMailleG]->addCellInterface(cellInterfaces[i]); - cells[iMailleD]->addCellInterface(cellInterfaces[i]); + iCellL = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; + iCellR = m_faces[i]->getElementDroite()->getIndex() - m_numberBoundFaces; + cells[iCellL]->addCellInterface(cellInterfaces[i]); + cells[iCellR]->addCellInterface(cellInterfaces[i]); } - cellInterfaces[i]->initialize(cells[iMailleG], cells[iMailleD]); - - //-------------Ici il faut trouver les mailles voisines pour le compute ordre 2 multislopes ------------ - if (computeOrder != "FIRSTORDER") { - - //GAUCHE) Recherche des mailles a gauche - //************************************** - //ElementNS *eG(m_faces[i]->getElementGauche()); //Element a gauche - //int index(eG->getIndex() - m_numberBoundFaces); - - - //MeshUnStruct::rechercheElementsArrieres(eG,m_faces[i], cellInterfaces[i], neighbors[index], *cells); - //MeshUnStruct::rechercheElementsAvants(eG, m_faces[i], cellInterfaces[i], neighbors[index], *cells); - // - // - ////A enlever a terme... - //double cos(0.),a,b,beta1,beta2; - //ElementNS *eT; - //Coord vG = eG->vecteur(m_faces[i]); - //Coord MB1, MB2, MB; - - - - //Coord vG = eG->vecteur(m_faces[i]); - //ElementNS *eT; //Element a tester - ////1) Recherche du premier element arriere gauche BG1M - ////--------------------------------------------------- - //double cos(0.); - //for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // Coord vT = eT->vecteur(eG); - // double cosTemp(Coord::cos(vT, vG)); - // if (cosTemp >= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL - // cellInterfaces[i]->setB(BG1M, 0); - // } - // else { //Sinon on met a jour avec la maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BG1M, c); - // } - // } - //} - ////2) Recherche du second element arriere gauche BG2M - ////--------------------------------------------------- - //cos = 0.; - //if (cellInterfaces[i]->getB(BG1M) != 0) { //Cas non cellInterface - // Element *e1(cellInterfaces[i]->getB(BG1M)->getElement()); - // Coord v1 = e1->vecteur(eG); - // Coord sin1(Coord::sin(v1, vG)); - // if (std::fabs(sin1.norm()) <= 1e-8) { - // cellInterfaces[i]->setB(BG2M, cellInterfaces[i]->getB(BG1M)); // Si le cos est nul, meme cell pour B1 et B2 - // } - // else { - // for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // if (eT == e1) continue; // voisin suivant si voisin deja utilise - // Coord vT = eT->vecteur(eG); - // Coord sinTemp(Coord::sin(vT, vG)); - - // if (sinTemp.scalar(sin1) <= 0.) { - // double cosTemp(Coord::cos(vT, vG)); - // if (cosTemp >= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL - // cellInterfaces[i]->setB(BG2M, 0); - // } - // else { //Sinon on met a jour avec la 2 eme maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BG2M, c); - // } - // } - // } //fin sin*sin <0 - // } //fin boucle neighbors - // } //fin if - //} //Fin if cellInterface - - ////Determination des ponderations arrieres - //Coord MB1; if (cellInterfaces[i]->getB(BG1M) != 0) { MB1.setFromSubtractedVectors(m_faces[i]->getPos(), cellInterfaces[i]->getB(BG1M)->getPosition()); } - //Coord MB2; if (cellInterfaces[i]->getB(BG2M) != 0) { MB2.setFromSubtractedVectors(m_faces[i]->getPos(), cellInterfaces[i]->getB(BG2M)->getPosition()); } - //Coord MB; MB.setFromSubtractedVectors(m_faces[i]->getPos(), eG->getPosition()); - //double a, b, beta1(1.), beta2(0.); - //a = (MB1.vectoriel(MB)).norm() / MB.norm(); - //b = (MB2.vectoriel(MB)).norm() / MB.norm(); - //if (std::fabs(a + b) > 1e-8) { beta1 = b / (a + b); beta2 = 1. - beta1; } - //cellInterfaces[i]->setBeta(betaG1M, beta1); - //cellInterfaces[i]->setBeta(betaG2M, beta2); - ////Calcul de la distance du vertex M (cellInterface de maille) au vertex H (barycenter) - //if (cellInterfaces[i]->getB(BG1M) != 0) { - // cos = Coord::cos(MB, MB1); - // double d, e, c; - // d = cos*MB1.norm(); - // Coord B1B2; B1B2 = MB1 - MB2; - // e = B1B2.norm()*beta1; - // c = sqrt(e*e - a*a); - // d += c; - // cellInterfaces[i]->setDistanceH(distanceHGM, d); - //} - ////cout << eG->getIndex() << " : " << endl; - ////if (cellInterfaces[i]->getB(BG1M) != 0) cout << "BG1M = " << cellInterfaces[i]->getB(BG1M)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGM) << endl; - ////if (cellInterfaces[i]->getB(BG2M) != 0) cout << "BG2M = " << cellInterfaces[i]->getB(BG2M)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGM) << endl; - - ////3) Recherche du premier element avant gauche BG1P - ////------------------------------------------------- - //cos = 0.; - //for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // Coord vT = eT->vecteur(eG); - // double cosTemp(Coord::cos(vT, vG)); - // if (cosTemp <= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1P a NULL - // cellInterfaces[i]->setB(BG1P, 0); - // } - // else { //Sinon on met a jour avec la maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BG1P, c); - // } - // } - //} - ////4) Recherche du second element avant gauche BG2P - ////------------------------------------------------ - //cos = 0.; - //if (cellInterfaces[i]->getB(BG1P) != 0) { //Cas non cellInterface - // Element *e1(cellInterfaces[i]->getB(BG1P)->getElement()); - // Coord v1 = e1->vecteur(eG); - // Coord sin1(Coord::sin(v1, vG)); - // if (std::fabs(sin1.norm()) <= 1e-8) { - // cellInterfaces[i]->setB(BG2P, cellInterfaces[i]->getB(BG1P)); // Si le cos est nul, meme cell pour B1 et B2 - // } - // else { - // for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // if (eT == e1) continue; // voisin suivant si voisin deja utilise - // Coord vT = eT->vecteur(eG); - // Coord sinTemp(Coord::sin(vT, vG)); - - // if (sinTemp.scalar(sin1) <= 0.) { - // double cosTemp(Coord::cos(vT, vG)); - // if (cosTemp <= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG2P a NULL - // cellInterfaces[i]->setB(BG2P, 0); - // } - // else { //Sinon on met a jour avec la 2 eme maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BG2P, c); - // } - // } - // } //fin sin*sin <0 - // } //fin boucle neighbors - // } //fin if - //} //Fin if cellInterface - - ////Determination des ponderations avant - //MB1 = 0.; if (cellInterfaces[i]->getB(BG1P) != 0) { MB1.setFromSubtractedVectors(cellInterfaces[i]->getB(BG1P)->getPosition(), m_faces[i]->getPos()); } - //MB2 = 0.; if (cellInterfaces[i]->getB(BG2P) != 0) { MB2.setFromSubtractedVectors(cellInterfaces[i]->getB(BG2P)->getPosition(), m_faces[i]->getPos()); } - //MB.setFromSubtractedVectors(eG->getPosition(), m_faces[i]->getPos()); - //beta1 = 1., beta2 = 0.; - //a = (MB1.vectoriel(MB)).norm() / MB.norm(); - //b = (MB2.vectoriel(MB)).norm() / MB.norm(); - //if (std::fabs(a + b) > 1e-8) { beta1 = b / (a + b); beta2 = 1. - beta1; } - //cellInterfaces[i]->setBeta(betaG1P, beta1); - //cellInterfaces[i]->setBeta(betaG2P, beta2); - ////Calcul de la distance du vertex M (cellInterface de maille) au vertex H (barycenter) - //if (cellInterfaces[i]->getB(BG1P) != 0) { - // cos = Coord::cos(MB, -1.*MB1); - // double d, e, c; - // d = cos*MB1.norm(); - // Coord B1B2; B1B2 = MB1 - MB2; - // e = B1B2.norm()*beta1; - // c = sqrt(e*e - a*a); - // d += c; - // cellInterfaces[i]->setDistanceH(distanceHGP, d); - //} - ////cout << eG->getIndex() << " : " << endl; - ////if (cellInterfaces[i]->getB(BG1P) != 0) cout << "BG1P = " << cellInterfaces[i]->getB(BG1P)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGP) << endl; - ////if (cellInterfaces[i]->getB(BG2P) != 0) cout << "BG2P = " << cellInterfaces[i]->getB(BG2P)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHGP) << endl; - - - ////DROITE) Recherche des mailles a droite - ////************************************** - //ElementNS *eD(m_faces[i]->getElementDroite()); //Element a droite - //index = eD->getIndex() - m_numberBoundFaces; - //if (index >= 0) { - // Coord vD = eD->vecteur(m_faces[i]); - // //1) Recherche du premier element arriere droite BD1M - // //--------------------------------------------------- - // cos = 0.; - // for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // Coord vT = eT->vecteur(eD); - // double cosTemp(Coord::cos(vT, vD)); - // if (cosTemp >= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL - // cellInterfaces[i]->setB(BD1M, 0); - // } - // else { //Sinon on met a jour avec la maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BD1M, c); - // } - // } - // } - // //2) Recherche du second element arriere droite BD2M - // //--------------------------------------------------- - // cos = 0.; - // if (cellInterfaces[i]->getB(BD1M) != 0) { //Cas non cellInterface - // Element *e1(cellInterfaces[i]->getB(BD1M)->getElement()); - // Coord v1 = e1->vecteur(eD); - // Coord sin1(Coord::sin(v1, vD)); - // if (std::fabs(sin1.norm()) <= 1e-8) { - // cellInterfaces[i]->setB(BD2M, cellInterfaces[i]->getB(BD1M)); // Si le cos est nul, meme cell pour B1 et B2 - // } - // else { - // for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // if (eT == e1) continue; // voisin suivant si voisin deja utilise - // Coord vT = eT->vecteur(eD); - // Coord sinTemp(Coord::sin(vT, vD)); - - // if (sinTemp.scalar(sin1) <= 0.) { - // double cosTemp(Coord::cos(vT, vD)); - // if (cosTemp >= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL - // cellInterfaces[i]->setB(BD2M, 0); - // } - // else { //Sinon on met a jour avec la 2 eme maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BD2M, c); - // } - // } - // } //fin sin*sin <0 - // } //fin boucle neighbors - // } //fin if - // } //Fin if cellInterface - - // //Determination des ponderations arrieres - // MB1 = 0.; if (cellInterfaces[i]->getB(BD1M) != 0) { MB1.setFromSubtractedVectors(m_faces[i]->getPos(), cellInterfaces[i]->getB(BD1M)->getPosition()); } - // MB2 = 0.; if (cellInterfaces[i]->getB(BD2M) != 0) { MB2.setFromSubtractedVectors(m_faces[i]->getPos(), cellInterfaces[i]->getB(BD2M)->getPosition()); } - // MB.setFromSubtractedVectors(m_faces[i]->getPos(), eD->getPosition()); - // beta1 = 1.; beta2 = 0.; - // a = (MB1.vectoriel(MB)).norm() / MB.norm(); - // b = (MB2.vectoriel(MB)).norm() / MB.norm(); - // if (std::fabs(a + b) > 1e-8) { beta1 = b / (a + b); beta2 = 1. - beta1; } - // cellInterfaces[i]->setBeta(betaD1M, beta1); - // cellInterfaces[i]->setBeta(betaD2M, beta2); - // //Calcul de la distance du vertex M (cellInterface de maille) au vertex H (barycenter) - // if (cellInterfaces[i]->getB(BD1M) != 0) { - // cos = Coord::cos(MB, MB1); - // double d, e, c; - // d = cos*MB1.norm(); - // Coord B1B2; B1B2 = MB1 - MB2; - // e = B1B2.norm()*beta1; - // c = sqrt(e*e - a*a); - // d += c; - // cellInterfaces[i]->setDistanceH(distanceHDM, d); - // } - // //cout << eD->getIndex() << " : " << endl; - // //if (cellInterfaces[i]->getB(BD1M) != 0) cout << "BD1M = " << cellInterfaces[i]->getB(BD1M)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHDM) << endl; - // //if (cellInterfaces[i]->getB(BD2M) != 0) cout << "BD2M = " << cellInterfaces[i]->getB(BD2M)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHDM) << endl; - - // //3) Recherche du premier element avant droite BD1P - // //------------------------------------------------- - // cos = 0.; - // for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // Coord vT = eT->vecteur(eD); - // double cosTemp(Coord::cos(vT, vD)); - // if (cosTemp <= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL - // cellInterfaces[i]->setB(BD1P, 0); - // } - // else { //Sinon on met a jour avec la maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BD1P, c); - // } - // } - // } - // //4) Recherche du second element avant droite BD2P - // //------------------------------------------------ - // cos = 0.; - // if (cellInterfaces[i]->getB(BD1P) != 0) { //Cas non cellInterface - // Element *e1(cellInterfaces[i]->getB(BD1P)->getElement()); - // Coord v1 = e1->vecteur(eD); - // Coord sin1(Coord::sin(v1, vD)); - // if (std::fabs(sin1.norm()) <= 1e-8) { - // cellInterfaces[i]->setB(BD2P, cellInterfaces[i]->getB(BD1P)); // Si le cos est nul, meme cell pour B1 et B2 - // } - // else { - // for (unsigned int v = 0; v < neighbors[index].size(); v++) { - // eT = neighbors[index][v]; - // if (eT == e1) continue; // voisin suivant si voisin deja utilise - // Coord vT = eT->vecteur(eD); - // Coord sinTemp(Coord::sin(vT, vD)); - - // if (sinTemp.scalar(sin1) <= 0.) { - // double cosTemp(Coord::cos(vT, vD)); - // if (cosTemp <= cos) { - // cos = cosTemp; - // if (eT->getIndex() < m_numberBoundFaces) { //Si c est une limite on remet BG1M a NULL - // cellInterfaces[i]->setB(BD2P, 0); - // } - // else { //Sinon on met a jour avec la 2 eme maille la plus loin - // Cell* c(cells[eT->getNumCellAssociee()]); - // cellInterfaces[i]->setB(BD2P, c); - // } - // } - // } //fin sin*sin <0 - // } //fin boucle neighbors - // } //fin if - // } //Fin if cellInterface - //} //Fin si limite - - ////Determination des ponderations avant - //MB1 = 0.; if (cellInterfaces[i]->getB(BD1P) != 0) { MB1.setFromSubtractedVectors(cellInterfaces[i]->getB(BD1P)->getPosition(), m_faces[i]->getPos()); } - //MB2 = 0.; if (cellInterfaces[i]->getB(BD2P) != 0) { MB2.setFromSubtractedVectors(cellInterfaces[i]->getB(BD2P)->getPosition(), m_faces[i]->getPos()); } - //MB.setFromSubtractedVectors(eD->getPosition(), m_faces[i]->getPos()); - //beta1 = 1., beta2 = 0.; - //a = (MB1.vectoriel(MB)).norm() / MB.norm(); - //b = (MB2.vectoriel(MB)).norm() / MB.norm(); - //if (std::fabs(a + b) > 1e-8) { beta1 = b / (a + b); beta2 = 1. - beta1; } - //cellInterfaces[i]->setBeta(betaD1P, beta1); - //cellInterfaces[i]->setBeta(betaD2P, beta2); - ////Calcul de la distance du vertex M (cellInterface de maille) au vertex H (barycenter) - //if (cellInterfaces[i]->getB(BD1P) != 0) { - // cos = Coord::cos(MB, -1.*MB1); - // double d, e, c; - // d = cos*MB1.norm(); - // Coord B1B2; B1B2 = MB1 - MB2; - // e = B1B2.norm()*beta1; - // c = sqrt(e*e - a*a); - // d += c; - // cellInterfaces[i]->setDistanceH(distanceHDP, d); - //} - //cout << eD->getIndex() << " : " << endl; - //if (cellInterfaces[i]->getB(BD1P) != 0) cout << "BD1P = " << cellInterfaces[i]->getB(BD1P)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHDP) << endl; - //if (cellInterfaces[i]->getB(BD2P) != 0) cout << "BD2P = " << cellInterfaces[i]->getB(BD2P)->getElement()->getIndex() << " " << cellInterfaces[i]->getDistanceH(distanceHDP) << endl; - - - - //cout << "******" << endl; - //cout << eG->getIndex() << " " << eD->getIndex() << " : " << endl; - //if (cellInterfaces[i]->getB(BG1M) != 0) cout << "BG1M = " << cellInterfaces[i]->getB(BG1M)->getElement()->getIndex() << endl; - //if (cellInterfaces[i]->getB(BG2M) != 0) cout << "BG2M = " << cellInterfaces[i]->getB(BG2M)->getElement()->getIndex() << endl; - //if (cellInterfaces[i]->getB(BG1P) != 0) cout << "BG1P = " << cellInterfaces[i]->getB(BG1P)->getElement()->getIndex() << endl; - //if (cellInterfaces[i]->getB(BG2P) != 0) cout << "BG2P = " << cellInterfaces[i]->getB(BG2P)->getElement()->getIndex() << endl; - //if (cellInterfaces[i]->getB(BD1M) != 0) cout << "BD1M = " << cellInterfaces[i]->getB(BD1M)->getElement()->getIndex() << endl; - //if (cellInterfaces[i]->getB(BD2M) != 0) cout << "BD2M = " << cellInterfaces[i]->getB(BD2M)->getElement()->getIndex() << endl; - //if (cellInterfaces[i]->getB(BD1P) != 0) cout << "BD1P = " << cellInterfaces[i]->getB(BD1P)->getElement()->getIndex() << endl; - //if (cellInterfaces[i]->getB(BD2P) != 0) cout << "BD2P = " << cellInterfaces[i]->getB(BD2P)->getElement()->getIndex() << endl; - - } //Fin preparation neighbors ordre 2 - //--------------------------------------------------------------------------------------- + cellInterfaces[i]->initialize(cells[iCellL], cells[iCellR]); } // End face tTemp = clock() - tTemp; t1 = static_cast(tTemp) / CLOCKS_PER_SEC; @@ -588,7 +233,7 @@ void MUSGmshV2::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon delete[] neighbors; delete[] neighborNodes; } - catch (ErrorECOGEN &) { throw; } + catch (ErrorMeshNS &) { throw; } } //*********************************************************************** @@ -602,15 +247,21 @@ void MUSGmshV2::readMeshMonoCPU(std::vector** neighborNodes) std::cout << "------------------------------------------------------" << std::endl; std::cout << " C) READING MESH FILE " + m_meshFile + " IN PROGRESS ..." << std::endl; std::ifstream meshFile(m_meshFile.c_str(), std::ios::in); - if (!meshFile){ throw ErrorECOGEN("mesh file not found : " + m_meshFile, __FILE__, __LINE__); } + if (!meshFile){ throw ErrorMeshNS("mesh file not found : " + m_meshFile, __FILE__, __LINE__); } std::string currentLine; // Skiping Gmsh version + go to nodes // ----------------------------------- - getline(meshFile, currentLine); - getline(meshFile, currentLine); - getline(meshFile, currentLine); - getline(meshFile, currentLine); + currentLine = ""; + while(currentLine != "$Nodes") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } // 2) Filling m_nodes array // ------------------------ @@ -626,8 +277,17 @@ void MUSGmshV2::readMeshMonoCPU(std::vector** neighborNodes) m_nodes[i].setXYZ(x, y, z); } meshFile.ignore(10, '\n'); - getline(meshFile, currentLine); // Skip keyword $EndNodes - getline(meshFile, currentLine); // Skip keyword $Elements + // Skip keyword $EndNodes $Elements and others if necessary + currentLine = ""; + while(currentLine != "$Elements") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } std::cout << "OK" << std::endl; // 3) 1D/2D/3D elements are stored in m_elements array / counting @@ -647,10 +307,10 @@ void MUSGmshV2::readMeshMonoCPU(std::vector** neighborNodes) else if (m_elements[i]->getTypeGmsh() == 1) { m_numberElements1D++; } else if (m_elements[i]->getTypeGmsh() <= 3) { m_numberElements2D++; m_totalSurface += m_elements[i]->getVolume(); } else if (m_elements[i]->getTypeGmsh() <= 7) { m_numberElements3D++; m_totalVolume += m_elements[i]->getVolume(); } - else { throw ErrorECOGEN("Element type of .msh not handled by ECOGEN", __FILE__, __LINE__); } + else { throw ErrorMeshNS("Element type of .msh not handled by ECOGEN", __FILE__, __LINE__); } // Assignment element i neighbor for concerned nodes (2nd order muiltislopes) - for (int n = 0; n < m_elements[i]->getNumberNoeuds(); n++) { - nodeG = m_elements[i]->getNumNoeud(n); + for (int n = 0; n < m_elements[i]->getNumberNodes(); n++) { + nodeG = m_elements[i]->getNumNode(n); (*neighborNodes)[nodeG].push_back(m_elements[i]); } } @@ -663,14 +323,221 @@ void MUSGmshV2::readMeshMonoCPU(std::vector** neighborNodes) // std::cout << std::endl; //} } - catch (ErrorECOGEN &) { throw; } + catch (ErrorMeshNS &) { throw; } +} + +//*********************************************************************** + +void MUSGmshV2::initCpuMeshSequential(TypeMeshContainer& cells, std::string &computeOrder) +{ + try { + // 1) Opening cpu mesh file + // ------------------------ + std::ifstream meshFile(m_meshFile.c_str(), std::ios::in); + if (!meshFile) { throw ErrorMeshNS("Mesh file not found: " + m_meshFile, __FILE__, __LINE__); } + std::string currentLine; + + // Skiping Gmsh version + go to nodes + // ----------------------------------- + currentLine = ""; + while(currentLine != "$Nodes") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } + + // 2) Filling m_nodes array + // ------------------------ + meshFile >> m_numberNodes; + meshFile.ignore(10, '\n'); + m_nodes = new Coord[m_numberNodes]; + int useless(0); double x, y, z; + for (int i = 0; i < m_numberNodes; i++) + { + meshFile >> useless >> x >> y >> z; + m_nodes[i].setXYZ(x, y, z); + } + meshFile.ignore(10, '\n'); + // Skip keyword $EndNodes $Elements and others if necessary + currentLine = ""; + while(currentLine != "$Elements") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } + + // 3) 1D/2D/3D elements are stored in m_elements array / counting + // -------------------------------------------------------------- + meshFile >> m_numberElements; + meshFile.ignore(10, '\n'); + // Allocation array of elements + m_elements = new ElementNS*[m_numberElements]; + // Reading elements and assigning geometric properties + m_numberElements1D = 0, m_numberElements2D = 0, m_numberElements3D = 0; + for (int i = 0; i < m_numberElements; i++) { + this->readElement(m_nodes, meshFile, &m_elements[i]); + if (m_elements[i]->getTypeGmsh() == 15) { m_numberElements0D++; } + else if (m_elements[i]->getTypeGmsh() == 1) { m_numberElements1D++; } + else if (m_elements[i]->getTypeGmsh() <= 3) { m_numberElements2D++; m_totalSurface += m_elements[i]->getVolume(); } + else if (m_elements[i]->getTypeGmsh() <= 7) { m_numberElements3D++; m_totalVolume += m_elements[i]->getVolume(); } + else { throw ErrorMeshNS("Element type of .msh not handled by ECOGEN", __FILE__, __LINE__); } + } + m_numberInnerElements = m_numberElements; + + // 4) Cells and boundary counting + // ------------------------------ + if (m_numberElements3D == 0 && m_numberElements2D == 0) // 1D case + { + m_numberCellsCalcul = m_numberElements1D; + m_numberBoundFaces = m_numberElements0D; + m_problemDimension = 1; + } + else if (m_numberElements3D == 0) // 2D case + { + m_numberCellsCalcul = m_numberElements2D; + m_numberBoundFaces = m_numberElements1D; + m_problemDimension = 2; + } + else // 3D case + { + m_numberCellsCalcul = m_numberElements3D; + m_numberBoundFaces = m_numberElements2D; + m_problemDimension = 3; + } + m_numberCellsTotal = m_numberCellsCalcul; + + // 5) Set elements to cells + // ------------------------ + for (int i = 0; i < m_numberCellsCalcul; i++) + { + if (computeOrder == "FIRSTORDER") { cells.push_back(new Cell); } + else { cells.push_back(new CellO2NS); } + cells[i]->setElement(m_elements[i + m_numberBoundFaces], i); + } + } + catch (ErrorMeshNS &) { throw; } +} + +//*********************************************************************** + +void MUSGmshV2::initCpuMeshParallel(TypeMeshContainer& cells, std::string &computeOrder, int cpu) +{ + try { + // 1) Opening cpu mesh file + // ------------------------ + std::ifstream meshFile(m_meshFile.c_str(), std::ios::in); + if (!meshFile) { throw ErrorMeshNS("Mesh file not found: " + m_meshFile, __FILE__, __LINE__); } + std::string currentLine; + + // Skiping Gmsh version + go to nodes + // ---------------------------------- + currentLine = ""; + while(currentLine != "$Nodes") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } + + // 2) Filling m_nodes array + // ------------------------ + meshFile >> m_numberNodes; + meshFile.ignore(10, '\n'); + m_nodes = new Coord[m_numberNodes]; + int useless(0); double x, y, z; + for (int i = 0; i < m_numberNodes; i++) + { + meshFile >> useless >> x >> y >> z; + m_nodes[i].setXYZ(x, y, z); + } + meshFile.ignore(10, '\n'); + // Skip keyword $EndNodes $Elements and others if necessary + currentLine = ""; + while(currentLine != "$Elements") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } + + // 3) 1D/2D/3D elements are stored in m_elements array / counting + // -------------------------------------------------------------- + meshFile >> m_numberElements; + meshFile.ignore(10, '\n'); + // Allocation array of elements + m_elements = new ElementNS*[m_numberElements]; + // Reading elements and assigning geometric properties + m_numberElements1D = 0, m_numberElements2D = 0, m_numberElements3D = 0; + for (int i = 0; i < m_numberElements; i++) + { + this->readElement(m_nodes, meshFile, &m_elements[i]); + if (m_elements[i]->getCPU() == cpu) + { + if (m_elements[i]->getTypeGmsh() == 1) { m_numberElements1D++; } + else if (m_elements[i]->getTypeGmsh() <= 3) { m_numberElements2D++; m_totalSurface += m_elements[i]->getVolume(); } + else if (m_elements[i]->getTypeGmsh() <= 7) { m_numberElements3D++; m_totalVolume += m_elements[i]->getVolume(); } + else { throw ErrorMeshNS("Element type of .msh not handled by ECOGEN", __FILE__, __LINE__); } + } + else { m_numberGhostElements++; } + } + // Calculation of the number of elements belonging to the CPU + m_numberInnerElements = m_numberElements - m_numberGhostElements; + + // 4) Cells and boundary counting + // ------------------------------ + if (m_numberElements3D == 0 && m_numberElements2D == 0) // 1D case + { + m_numberCellsCalcul = m_numberElements1D; + m_numberBoundFaces = m_numberElements0D; + m_problemDimension = 1; + } + else if (m_numberElements3D == 0) // 2D case + { + m_numberCellsCalcul = m_numberElements2D; + m_numberBoundFaces = m_numberElements1D; + m_problemDimension = 2; + } + else // 3D case + { + m_numberCellsCalcul = m_numberElements3D; + m_numberBoundFaces = m_numberElements2D; + m_problemDimension = 3; + } + // Sizing array of cells + m_numberCellsTotal = m_numberCellsCalcul + m_numberGhostElements; + + // 5) Set elements to cells + // ------------------------ + for (int i = 0; i < m_numberCellsTotal; i++) + { + if (computeOrder == "FIRSTORDER") { cells.push_back(new Cell); } + else { cells.push_back(new CellO2NS); } + cells[i]->setElement(m_elements[i + m_numberBoundFaces], i); + } + // Update of cellsGhost + cells.erase(cells.begin()+m_numberCellsCalcul, cells.end()); + } + catch (ErrorMeshNS &) { throw; } } //*********************************************************************** void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, std::string computeOrder) { - //KS//FP//DEV// Distinction between cells and cellsGhost not done here. To do in the future. clock_t totalTime(clock()); try { // 1) Reading nodes and elements @@ -689,19 +556,19 @@ void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshCo { m_numberCellsCalcul = m_numberElements1D; m_numberBoundFaces = m_numberElements0D; - m_geometrie = 1; + m_problemDimension = 1; } else if (m_numberElements3D == 0) // 2D case { m_numberCellsCalcul = m_numberElements2D; m_numberBoundFaces = m_numberElements1D; - m_geometrie = 2; + m_problemDimension = 2; } else // 3D case { m_numberCellsCalcul = m_numberElements3D; m_numberBoundFaces = m_numberElements2D; - m_geometrie = 3; + m_problemDimension = 3; } // Sizing array of cells @@ -719,13 +586,20 @@ void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshCo // Assignment of cells to elements and counting inner faces m_numberInnerFaces = 0; - for (int i = 0; i < m_numberCellsTotal; i++) + for (int i = 0; i < m_numberCellsCalcul; i++) { if (computeOrder == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2NS); } cells[i]->setElement(m_elements[i + m_numberBoundFaces], i); if (i < m_numberCellsCalcul) { m_numberInnerFaces += m_elements[i + m_numberBoundFaces]->getNumberFaces(); } } + for (int i = m_numberCellsCalcul; i < m_numberCellsTotal; i++) + { + if (computeOrder == "FIRSTORDER") { cells.push_back(new CellGhost); } + else { cells.push_back(new CellO2GhostNS); } + cells[i]->setElement(m_elements[i + m_numberBoundFaces], i); + } + m_numberInnerFaces -= m_numberBoundFaces + m_numberFacesParallel; // We remove the boundaries and communicating faces m_numberInnerFaces /= 2; // The internal faces are all counted twice => we restore the truth m_numberFacesTotal = m_numberInnerFaces + m_numberBoundFaces + m_numberFacesParallel; @@ -744,7 +618,10 @@ void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshCo { if (m_numberQuadrangles != 0) { sizeFace = 4; } else if (m_numberTriangles != 0) { sizeFace = 3; } - else { Errors::errorMessage("Issue in initGeometryMonoCPU for initialization of facesBuff array"); } + // else { Errors::errorMessage("Issue in initGeometryParallel for initialization of facesBuff array"); } + //JC//REMARK When a mesh file is partionned on an important number of CPUs it is highly possible that + // a given CPU has no boundary and therefore only 3D elements. In this case, the loop on boundaries is + // not executed and is not a problem. } else if (m_numberElements2D != 0) { sizeFace = 2; } for (int i = 0; i < m_numberFacesTotal + 1; i++) // +1 is used for the search for the existence of faces @@ -833,7 +710,7 @@ void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshCo std::cout << " 4/Linking Geometries -> Physics ..." << std::endl; printFrequency = std::max(m_numberFacesTotal / 10, 1); } - int iMailleG, iMailleD; + int iCellL, iCellR; for (int i = 0; i < m_numberFacesTotal; i++) { @@ -845,37 +722,37 @@ void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshCo if (m_faces[i]->getEstComm()) { if (computeOrder == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2NS); } cellInterfaces[i]->setFace(m_faces[i]); - iMailleG = m_faces[i]->getElementGauche()->getNumCellAssociee(); - iMailleD = m_faces[i]->getElementDroite()->getNumCellAssociee(); - cells[iMailleG]->addCellInterface(cellInterfaces[i]); - cells[iMailleD]->addCellInterface(cellInterfaces[i]); + iCellL = m_faces[i]->getElementGauche()->getNumCellAssociee(); + iCellR = m_faces[i]->getElementDroite()->getNumCellAssociee(); + cells[iCellL]->addCellInterface(cellInterfaces[i]); + cells[iCellR]->addCellInterface(cellInterfaces[i]); } // Physical boundary else { int appPhys(m_faces[i]->getElementDroite()->getAppartenancePhysique() - 1); // (appartenance - 1) for array starting at zero - if (appPhys >= static_cast(m_bound.size()) || appPhys < 0) { throw ErrorECOGEN("Number of boundary conditions not suited", __FILE__, __LINE__); } + if (appPhys >= static_cast(m_bound.size()) || appPhys < 0) { throw ErrorMeshNS("Number of boundary conditions not suited", __FILE__, __LINE__); } m_bound[appPhys]->createBoundary(cellInterfaces); cellInterfaces[i]->setFace(m_faces[i]); - iMailleG = m_faces[i]->getElementGauche()->getNumCellAssociee(); - iMailleD = iMailleG; - cells[iMailleG]->addCellInterface(cellInterfaces[i]); + iCellL = m_faces[i]->getElementGauche()->getNumCellAssociee(); + iCellR = iCellL; + cells[iCellL]->addCellInterface(cellInterfaces[i]); } } // Inner faces of domain else { if (computeOrder == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2NS); } cellInterfaces[i]->setFace(m_faces[i]); - iMailleG = m_faces[i]->getElementGauche()->getNumCellAssociee(); - iMailleD = m_faces[i]->getElementDroite()->getNumCellAssociee(); - cells[iMailleG]->addCellInterface(cellInterfaces[i]); - cells[iMailleD]->addCellInterface(cellInterfaces[i]); + iCellL = m_faces[i]->getElementGauche()->getNumCellAssociee(); + iCellR = m_faces[i]->getElementDroite()->getNumCellAssociee(); + cells[iCellL]->addCellInterface(cellInterfaces[i]); + cells[iCellR]->addCellInterface(cellInterfaces[i]); } - cellInterfaces[i]->initialize(cells[iMailleG], cells[iMailleD]); + cellInterfaces[i]->initialize(cells[iCellL], cells[iCellR]); } MPI_Barrier(MPI_COMM_WORLD); if (rankCpu == 0) @@ -903,7 +780,7 @@ void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshCo for (int i = m_numberBoundFaces; i < m_numberElements; i++) { - int numberOtherCPUs = m_elements[i]->getNumberAutresCPU(); + int numberOtherCPUs = m_elements[i]->getNumberOthersCPU(); if (numberOtherCPUs != 0) // Elements that communicate { if (m_elements[i]->getCPU() == rankCpu) // The element belongs to the CPU @@ -930,12 +807,14 @@ void MUSGmshV2::initGeometryParallel(TypeMeshContainer& cells, TypeMeshCo for(int i=0;i& cells, TypeMeshCo cellsGhost.insert(cellsGhost.begin(), cells.begin()+m_numberCellsCalcul, cells.end()); cells.erase(cells.begin()+m_numberCellsCalcul, cells.end()); } - catch (ErrorECOGEN &) { throw; } + catch (ErrorMeshNS &) { throw; } } //*********************************************************************** @@ -976,15 +855,21 @@ void MUSGmshV2::readMeshParallel() flux << rankCpu; m_meshFile = m_nameMesh + "_CPU" + flux.str() + ".msh"; std::ifstream meshFile(m_meshFile.c_str(), std::ios::in); - if (!meshFile) { throw ErrorECOGEN("file mesh absent :" + m_meshFile, __FILE__, __LINE__); } + if (!meshFile) { throw ErrorMeshNS("file mesh absent :" + m_meshFile, __FILE__, __LINE__); } std::string currentLine; // Skiping Gmsh version + go to nodes // ---------------------------------- - getline(meshFile, currentLine); - getline(meshFile, currentLine); - getline(meshFile, currentLine); - getline(meshFile, currentLine); + currentLine = ""; + while(currentLine != "$Nodes") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } // 2) Filling m_nodes array // ------------------------ @@ -1000,8 +885,17 @@ void MUSGmshV2::readMeshParallel() m_nodes[i].setXYZ(x, y, z); } meshFile.ignore(10, '\n'); - getline(meshFile, currentLine); // Skip keyword $EndNodes - getline(meshFile, currentLine); // Skip keyword $Elements + // Skip keyword $EndNodes $Elements and others if necessary + currentLine = ""; + while(currentLine != "$Elements") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } if (rankCpu == 0) { std::cout << "OK" << std::endl; } // 3) 1D/2D/3D elements are stored in m_elements array / counting @@ -1023,7 +917,7 @@ void MUSGmshV2::readMeshParallel() if (m_elements[i]->getTypeGmsh() == 1) { m_numberElements1D++; } else if (m_elements[i]->getTypeGmsh() <= 3) { m_numberElements2D++; m_totalSurface += m_elements[i]->getVolume(); } else if (m_elements[i]->getTypeGmsh() <= 7) { m_numberElements3D++; m_totalVolume += m_elements[i]->getVolume(); } - else { throw ErrorECOGEN("Element type of .msh not handled by ECOGEN", __FILE__, __LINE__); } + else { throw ErrorMeshNS("Element type of .msh not handled by ECOGEN", __FILE__, __LINE__); } } else { m_numberGhostElements++; } } @@ -1040,7 +934,7 @@ void MUSGmshV2::readMeshParallel() m_numberInnerElements = m_numberElements - m_numberGhostElements; if (rankCpu == 0) { std::cout << "OK" << std::endl; } } - catch (ErrorECOGEN &) { throw; } + catch (ErrorMeshNS &) { throw; } } //*********************************************************************** @@ -1060,15 +954,21 @@ void MUSGmshV2::preProcessMeshFileForParallel() std::cout << " C0) MESH FILE PRETRAITEMENT " + m_meshFile + " IN PROGRESS ..." << std::endl; clock_t totalTime(clock()); std::ifstream meshFile(m_meshFile.c_str(), std::ios::in); - if (!meshFile) { throw ErrorECOGEN("mesh file not found :" + m_meshFile, __FILE__, __LINE__); } + if (!meshFile) { throw ErrorMeshNS("mesh file not found :" + m_meshFile, __FILE__, __LINE__); } std::string currentLine; // Skiping Gmsh version + go to nodes // ---------------------------------- - getline(meshFile, currentLine); - getline(meshFile, currentLine); - getline(meshFile, currentLine); - getline(meshFile, currentLine); + currentLine = ""; + while(currentLine != "$Nodes") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } // 1) Storing the vertex grid in a temporary array of nodes // -------------------------------------------------------- @@ -1083,8 +983,17 @@ void MUSGmshV2::preProcessMeshFileForParallel() nodesGlobal[i].setXYZ(x, y, z); } meshFile.ignore(10, '\n'); - getline(meshFile, currentLine); - getline(meshFile, currentLine); + // Skip keyword $EndNodes $Elements and others if necessary + currentLine = ""; + while(currentLine != "$Elements") { + std::stringstream lineToTreat; + getline(meshFile, currentLine); + lineToTreat << currentLine; + lineToTreat >> currentLine; //To exclude the newline caracter + if (meshFile.eof()) { + throw ErrorMeshNS("mesh file format is not compatible, see mesh file: " + m_meshFile, __FILE__, __LINE__); + } + } std::cout << "OK" << std::endl; // 2) 1D/2D/3D elements are stored in temporary elements array / counting @@ -1146,9 +1055,9 @@ void MUSGmshV2::preProcessMeshFileForParallel() numCPU = elementsGlobal[i]->getCPU(); if (numCPU > numCPUMax) numCPUMax = numCPU; elementsCPU[numCPU].push_back(i); // Filling number of CPU-specific elements - for (int n = 0; n < elementsGlobal[i]->getNumberNoeuds(); n++) + for (int n = 0; n < elementsGlobal[i]->getNumberNodes(); n++) { - nodeCurrent = elementsGlobal[i]->getNumNoeud(n); + nodeCurrent = elementsGlobal[i]->getNumNode(n); nodeExist = false; for (unsigned int j = 0; j < nodesCPU[numCPU].size(); j++) { @@ -1165,7 +1074,7 @@ void MUSGmshV2::preProcessMeshFileForParallel() tTemp = clock() - tTemp; t1 = static_cast(tTemp) / CLOCKS_PER_SEC; std::cout << " OK in " << t1 << " seconds" << std::endl; // Checking if mesh matches with CPUs used - if (numCPUMax != Ncpu - 1) throw ErrorECOGEN("mesh file .msh not suited with the number of CPUs used - Generate the mesh and restard the test case", __FILE__, __LINE__); + if (numCPUMax != Ncpu - 1) throw ErrorMeshNS("mesh file .msh not suited with the number of CPUs used - Generate the mesh and restard the test case", __FILE__, __LINE__); // 4) Creating array of faces // -------------------------- @@ -1214,25 +1123,25 @@ void MUSGmshV2::preProcessMeshFileForParallel() for (int i = 0; i < numberElementsGlobal; i++) { if (i%printFrequency == 0) { std::cout << " " << (100 * i / numberElementsGlobal) << "% ... " << std::endl; } - if (elementsGlobal[i]->getNumberAutresCPU() != 0) + if (elementsGlobal[i]->getNumberOthersCPU() != 0) { - std::vector CPUAEnlever; - for (int p = 0; p < elementsGlobal[i]->getNumberAutresCPU(); p++) + std::vector CPUToRemove; + for (int p = 0; p < elementsGlobal[i]->getNumberOthersCPU(); p++) { int numCPU(elementsGlobal[i]->getAutreCPU(p)); // Checking if the element is communicating from a face // **************************************************** - int numberNoeuds(elementsGlobal[i]->getNumberNoeuds()); - bool *isNoeudInterne = new bool[numberNoeuds]; - for (int n = 0; n < numberNoeuds; n++) + int numberNodes(elementsGlobal[i]->getNumberNodes()); + bool *isNodeInternal = new bool[numberNodes]; + for (int n = 0; n < numberNodes; n++) { - isNoeudInterne[n] = false; - nodeCurrent = elementsGlobal[i]->getNumNoeud(n); + isNodeInternal[n] = false; + nodeCurrent = elementsGlobal[i]->getNumNode(n); for (int j = 0; j < numberInnerNodes[numCPU]; j++) { if (nodesCPU[numCPU][j] == nodeCurrent) { - isNoeudInterne[n] = true; + isNodeInternal[n] = true; break; } } @@ -1245,20 +1154,20 @@ void MUSGmshV2::preProcessMeshFileForParallel() { // The element is communicating, we add it as well as his nodes elementsCPU[numCPU].push_back(i); - for (int n = 0; n < numberNoeuds; n++) + for (int n = 0; n < numberNodes; n++) { - if (!isNoeudInterne[n]) { nodesCPU[numCPU].push_back(elementsGlobal[i]->getNumNoeud(n)); } + if (!isNodeInternal[n]) { nodesCPU[numCPU].push_back(elementsGlobal[i]->getNumNode(n)); } } numberFacesCommunicatingCPU[numCPU] += numberFacesCommunicating; } else { - CPUAEnlever.push_back(p); + CPUToRemove.push_back(p); } - delete[] isNoeudInterne; + delete[] isNodeInternal; } // End CPU - elementsGlobal[i]->enleveCPUAutres(CPUAEnlever); + elementsGlobal[i]->removeCPUOthers(CPUToRemove); } } tTemp = clock() - tTemp; t1 = static_cast(tTemp) / CLOCKS_PER_SEC; @@ -1289,7 +1198,7 @@ void MUSGmshV2::preProcessMeshFileForParallel() fileStream << "2.2 0 8" << std::endl; fileStream << "$EndMeshFormat" << std::endl; fileStream << "$Nodes" << std::endl; - //Reordonne les noeuds + //Reordonne les nodes //sort(nodesCPU[p].begin(), nodesCPU[p].end()); fileStream << nodesCPU[p].size() << std::endl; for (unsigned int i = 0; i < nodesCPU[p].size(); i++) @@ -1303,19 +1212,19 @@ void MUSGmshV2::preProcessMeshFileForParallel() { int e(elementsCPU[p][i]); fileStream << i + 1 << " " << elementsGlobal[e]->getTypeGmsh(); - fileStream << " " << 2 + 1 + 1 + elementsGlobal[e]->getNumberAutresCPU(); + fileStream << " " << 2 + 1 + 1 + elementsGlobal[e]->getNumberOthersCPU(); fileStream << " " << elementsGlobal[e]->getAppartenancePhysique(); fileStream << " " << elementsGlobal[e]->getAppartenanceGeometrique(); - fileStream << " " << elementsGlobal[e]->getNumberAutresCPU() + 1; + fileStream << " " << elementsGlobal[e]->getNumberOthersCPU() + 1; fileStream << " " << elementsGlobal[e]->getCPU() + 1; - for (int cpuAutre = 0; cpuAutre < elementsGlobal[e]->getNumberAutresCPU(); cpuAutre++) + for (int cpuAutre = 0; cpuAutre < elementsGlobal[e]->getNumberOthersCPU(); cpuAutre++) { fileStream << " " << -(elementsGlobal[e]->getAutreCPU(cpuAutre) + 1); } - for (int n = 0; n < elementsGlobal[e]->getNumberNoeuds(); n++) + for (int n = 0; n < elementsGlobal[e]->getNumberNodes(); n++) { // Renumbering locale - nodeCurrent = elementsGlobal[e]->getNumNoeud(n); + nodeCurrent = elementsGlobal[e]->getNumNode(n); for (int j = 0; j < static_cast(nodesCPU[p].size()); j++) { if (nodesCPU[p][j] == nodeCurrent) @@ -1352,7 +1261,7 @@ void MUSGmshV2::preProcessMeshFileForParallel() delete[] numberFacesCommunicatingCPU; } - catch (ErrorECOGEN &) { throw; } + catch (ErrorMeshNS &) { throw; } } //*********************************************************************** @@ -1422,9 +1331,9 @@ void MUSGmshV2::readElement(const Coord* nodesTable, std::ifstream &meshFile, El // 3) Building the element and its properties // ------------------------------------------ int currentNode; - int* numNode = new int[(*element)->getNumberNoeuds()]; - Coord* node = new Coord[(*element)->getNumberNoeuds()]; - for (int i = 0; i < (*element)->getNumberNoeuds(); i++) + int* numNode = new int[(*element)->getNumberNodes()]; + Coord* node = new Coord[(*element)->getNumberNodes()]; + for (int i = 0; i < (*element)->getNumberNodes(); i++) { meshFile >> currentNode; numNode[i] = currentNode - 1; // Offset because array start at 0 @@ -1445,3 +1354,4 @@ void MUSGmshV2::readElement(const Coord* nodesTable, std::ifstream &meshFile, El delete[] numNode; } +//*********************************************************************** \ No newline at end of file diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.h b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.h index 6e5d0083..97804ce5 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV2/MUSGmshV2.h @@ -43,6 +43,8 @@ class MUSGmshV2 : public MUSGmsh virtual void initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshContainer& cellInterfaces, std::string computeOrder = "FIRSTORDER"); virtual void initGeometryParallel(TypeMeshContainer& cells, TypeMeshContainer& cellsGhost, TypeMeshContainer& cellInterfaces, std::string computeOrder = "FIRSTORDER"); virtual void preProcessMeshFileForParallel(); + virtual void initCpuMeshSequential(TypeMeshContainer& cells, std::string &computeOrder); + virtual void initCpuMeshParallel(TypeMeshContainer& cells, std::string &computeOrder, int cpu); private: // --- Gmsh v2 related member functions --- diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.cpp b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.cpp index 6a34fa55..f68cb071 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.cpp +++ b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.cpp @@ -59,19 +59,19 @@ void MUSGmshV4::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon { m_numberCellsCalcul = m_numberElements1D; m_numberBoundFaces = m_numberElements0D; - m_geometrie = 1; + m_problemDimension = 1; } else if (m_numberElements3D == 0) // 2D case { m_numberCellsCalcul = m_numberElements2D; m_numberBoundFaces = m_numberElements1D; - m_geometrie = 2; + m_problemDimension = 2; } else // 3D case { m_numberCellsCalcul = m_numberElements3D; m_numberBoundFaces = m_numberElements2D; - m_geometrie = 3; + m_problemDimension = 3; } m_numberCellsTotal = m_numberCellsCalcul; @@ -96,7 +96,7 @@ void MUSGmshV4::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon for (int i = 0; i < m_numberCellsCalcul; i++) { if (computeOrder == "FIRSTORDER") { cells.push_back(new Cell); } - else { cells.push_back(new CellO2); } + else { cells.push_back(new CellO2NS); } cells[i]->setElement(m_elements[i + m_numberBoundFaces], i); m_numberInnerFaces += m_elements[i + m_numberBoundFaces]->getNumberFaces(); } @@ -168,7 +168,7 @@ void MUSGmshV4::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon // Link Geometry/cellInterfaces of compute std::cout << " 3/Linking Geometries -> Physics ..." << std::endl; tTemp = clock(); - int iMailleG, iMailleD; + int iCellL, iCellR; for (int i = 0; i < m_numberFacesTotal; i++) { if (m_faces[i]->getEstLimite()) // Physical boundary faces @@ -177,21 +177,21 @@ void MUSGmshV4::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon if (appPhys >= static_cast(m_bound.size()) || appPhys < 0) { Errors::errorMessage("Number of boundary conditions not suited"); } m_bound[appPhys]->createBoundary(cellInterfaces); cellInterfaces[i]->setFace(m_faces[i]); - iMailleG = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; - iMailleD = iMailleG; + iCellL = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; + iCellR = iCellL; } // Inner faces of domain else { if (computeOrder == "FIRSTORDER") { cellInterfaces.push_back(new CellInterface); } - else { cellInterfaces.push_back(new CellInterfaceO2); } + else { cellInterfaces.push_back(new CellInterfaceO2NS); } cellInterfaces[i]->setFace(m_faces[i]); - iMailleG = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; - iMailleD = m_faces[i]->getElementDroite()->getIndex() - m_numberBoundFaces; + iCellL = m_faces[i]->getElementGauche()->getIndex() - m_numberBoundFaces; + iCellR = m_faces[i]->getElementDroite()->getIndex() - m_numberBoundFaces; } - cellInterfaces[i]->initialize(cells[iMailleG], cells[iMailleD]); - cells[iMailleG]->addCellInterface(cellInterfaces[i]); - cells[iMailleD]->addCellInterface(cellInterfaces[i]); + cellInterfaces[i]->initialize(cells[iCellL], cells[iCellR]); + cells[iCellL]->addCellInterface(cellInterfaces[i]); + cells[iCellR]->addCellInterface(cellInterfaces[i]); } // End face tTemp = clock() - tTemp; t1 = static_cast(tTemp) / CLOCKS_PER_SEC; @@ -204,6 +204,7 @@ void MUSGmshV4::initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshCon //*********************************************************************** +//JC//COMMENT The code below is not working and require more investigation //void MUSGmshV4::preProcessMeshFileForParallel() //{ // ElementNS** elementsGlobal; @@ -662,9 +663,9 @@ void MUSGmshV4::readElement(const Coord* nodesTable, std::ifstream& meshFile, El // 3) Building the element and its properties // ------------------------------------------ int currentNode(0); - int* numNode = new int[(*element)->getNumberNoeuds()]; - Coord* node = new Coord[(*element)->getNumberNoeuds()]; - for (int i = 0; i < (*element)->getNumberNoeuds(); i++) + int* numNode = new int[(*element)->getNumberNodes()]; + Coord* node = new Coord[(*element)->getNumberNodes()]; + for (int i = 0; i < (*element)->getNumberNodes(); i++) { meshFile >> currentNode; numNode[i] = currentNode - 1; // Offset because array start at 0 @@ -675,4 +676,6 @@ void MUSGmshV4::readElement(const Coord* nodesTable, std::ifstream& meshFile, El delete[] node; delete[] numNode; -} \ No newline at end of file +} + +//*********************************************************************** \ No newline at end of file diff --git a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.h b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.h index f3d5bd9e..920dc476 100644 --- a/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.h +++ b/src/Meshes/MeshUnStruct/MUSGmsh/MUSGmshV4/MUSGmshV4.h @@ -43,8 +43,18 @@ class MUSGmshV4 : public MUSGmsh // --- MeshUnStruct virtual member functions --- virtual void initGeometryMonoCPU(TypeMeshContainer& cells, TypeMeshContainer& cellInterfaces, std::string computeOrder = "FIRSTORDER"); //TODO// Reading partitioned mesh file for parallel computation - virtual void initGeometryParallel(TypeMeshContainer& /*cells*/, TypeMeshContainer& /*cellsGhost*/, TypeMeshContainer& /*cellInterfaces*/, std::string /*computeOrder*/ = "FIRSTORDER") { Errors::errorMessage("reading partitioned Gmsh v4.x mesh file for parallel computation not avalaible in ECOGEN"); }; + virtual void initGeometryParallel(TypeMeshContainer& /*cells*/, + TypeMeshContainer& /*cellsGhost*/, TypeMeshContainer& /*cellInterfaces*/, + std::string /*computeOrder*/ = "FIRSTORDER") { + Errors::errorMessage("reading partitioned Gmsh v4.x mesh file for parallel computation not avalaible in ECOGEN"); + }; virtual void preProcessMeshFileForParallel() { Errors::errorMessage("reading partitioned Gmsh v4.x mesh file for parallel computation not avalaible in ECOGEN"); }; + virtual void initCpuMeshSequential(TypeMeshContainer& /*cells*/, std::string& /*computeOrder*/) { + Errors::errorMessage("initCpuMeshSequential not available for requested mesh"); + } + virtual void initCpuMeshParallel(TypeMeshContainer& /*cells*/, std::string& /*computeOrder*/, int /*cpu*/) { + Errors::errorMessage("initCpuMeshParallel not available for requested mesh"); + } private: // --- Member functions --- diff --git a/src/Models/Euler/FluxEuler.cpp b/src/Models/Euler/FluxEuler.cpp index d6d50115..cb32e15e 100644 --- a/src/Models/Euler/FluxEuler.cpp +++ b/src/Models/Euler/FluxEuler.cpp @@ -85,6 +85,24 @@ void FluxEuler::multiply(double scalar) //*********************************************************************** +void FluxEuler::addFluxRotatingRegion(double coefA) +{ + m_mass += coefA*static_cast (fluxBuffMRF)->m_mass; + m_momentum += coefA*static_cast (fluxBuffMRF)->m_momentum; + m_energ += coefA*static_cast (fluxBuffMRF)->m_energ; +} + +//*********************************************************************** + +void FluxEuler::subtractFluxRotatingRegion(double coefA) +{ + m_mass -= coefA*static_cast (fluxBuffMRF)->m_mass; + m_momentum -= coefA*static_cast (fluxBuffMRF)->m_momentum; + m_energ -= coefA*static_cast (fluxBuffMRF)->m_energ; +} + +//*********************************************************************** + void FluxEuler::setBufferFlux(Cell& cell) { static_cast (fluxBuff)->buildCons(cell.getPhases(), cell.getMixture()); @@ -226,4 +244,4 @@ void FluxEuler::setCons(const Flux* cons) m_energ = cons->getEnergyMix(); } -//*********************************************************************** \ No newline at end of file +//*********************************************************************** diff --git a/src/Models/Euler/FluxEuler.h b/src/Models/Euler/FluxEuler.h index d2992b8c..24d4ef41 100644 --- a/src/Models/Euler/FluxEuler.h +++ b/src/Models/Euler/FluxEuler.h @@ -45,13 +45,15 @@ class FluxEuler : public Flux virtual void addFlux(double coefA); virtual void addFlux(Flux* flux); virtual void subtractFlux(double coefA); + virtual void addFluxRotatingRegion(double coefA); + virtual void subtractFluxRotatingRegion(double coefA); virtual void multiply(double scalar); virtual void setBufferFlux(Cell& cell); virtual void buildCons(Phase** phase, Mixture* /*mixture*/); virtual void buildPrim(Phase** phase, Mixture* /*mixture*/); virtual void setToZero(); - virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/) {}; - virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/) {}; + virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; + virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; virtual void addFluxSmooth1D(double coefA, const Coord& normal, Cell* cell); virtual void substractFluxSmooth1D(double coefA, const Coord& normal, Cell* cell); @@ -61,6 +63,9 @@ class FluxEuler : public Flux virtual void prepSourceTermsHeating(const double& q); virtual void prepSourceTermsMRF(Cell* cell, const Coord& omega); + //Moving Reference Frame + virtual void addNonConsMrfFlux(Phase** /*phases*/){}; + // Accessors //---------- virtual const Coord& getMomentum() const { return m_momentum; }; diff --git a/src/Models/Euler/GradMixEuler.h b/src/Models/Euler/GradMixEuler.h new file mode 100644 index 00000000..dace1871 --- /dev/null +++ b/src/Models/Euler/GradMixEuler.h @@ -0,0 +1,58 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADMIXEULER_H +#define GRADMIXEULER_H + +#include "../GradMixture.h" + +//! \class GradMixEuler +//! \brief Mixture variable gradients for Euler model. Stored for 2nd-order computation on unstructured mesh (O2 NS) +//! \details No variables stored here since this model is for single-phase flows. + +class GradMixEuler : public GradMixture +{ +public: + GradMixEuler() {}; + virtual ~GradMixEuler() {}; + + virtual void initializeGradientVectors() {}; + + virtual void computeGradients(Cell* /*cell*/) {}; + virtual void computeDistanceGradientScalarProduct(Coord const& /*distance*/, Mixture* /*mixture*/) const {}; + virtual void limitGradients(const Mixture& /*gradientLimiter*/) {}; + + // -- O2 parallel -- + virtual int numberOfTransmittedGradients() const { return 0; }; + virtual void getBufferGradients(double * /*buffer*/, int& /*counter*/) {}; + virtual void fillBufferGradients(double * /*buffer*/, int& /*counter*/) {}; +}; + +#endif \ No newline at end of file diff --git a/src/Models/Euler/GradPhaseEuler.cpp b/src/Models/Euler/GradPhaseEuler.cpp new file mode 100644 index 00000000..ccc1f5b1 --- /dev/null +++ b/src/Models/Euler/GradPhaseEuler.cpp @@ -0,0 +1,77 @@ +#include "GradPhaseEuler.h" + +//*************************************************************************** + +GradPhaseEuler::GradPhaseEuler() +{ + m_grads.resize(5); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } +} + +//*************************************************************************** + +GradPhaseEuler::~GradPhaseEuler() +{ +} + +//*************************************************************************** + +void GradPhaseEuler::initializeGradientVectors() +{ + this->initializeGradsVariablesNamesNumerators(); + + variableNamesPhases[VarLocal::density] = Variable::density; + variableNamesPhases[VarLocal::pressure] = Variable::pressure; + variableNamesPhases[VarLocal::velocityU] = Variable::velocityU; + variableNamesPhases[VarLocal::velocityV] = Variable::velocityV; + variableNamesPhases[VarLocal::velocityW] = Variable::velocityW; +} + +//*************************************************************************** + +void GradPhaseEuler::computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const +{ + static_cast (phase)->setDensity(distance.scalar(m_grads[VarLocal::density])); + static_cast (phase)->setPressure(distance.scalar(m_grads[VarLocal::pressure])); + static_cast (phase)->setVelocity(distance.scalar(m_grads[VarLocal::velocityU]), + distance.scalar(m_grads[VarLocal::velocityV]), + distance.scalar(m_grads[VarLocal::velocityW])); +} + +//**************************************************************************** + +void GradPhaseEuler::limitGradients(const Phase& gradientLimiter) +{ + m_grads[VarLocal::density].setX(m_grads[VarLocal::density].getX() * gradientLimiter.getDensity()); + m_grads[VarLocal::density].setY(m_grads[VarLocal::density].getY() * gradientLimiter.getDensity()); + m_grads[VarLocal::density].setZ(m_grads[VarLocal::density].getZ() * gradientLimiter.getDensity()); + + m_grads[VarLocal::pressure].setX(m_grads[VarLocal::pressure].getX() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setY(m_grads[VarLocal::pressure].getY() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setZ(m_grads[VarLocal::pressure].getZ() * gradientLimiter.getPressure()); + + m_grads[VarLocal::velocityU].setX(m_grads[VarLocal::velocityU].getX() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setY(m_grads[VarLocal::velocityU].getY() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setZ(m_grads[VarLocal::velocityU].getZ() * gradientLimiter.getVelocity().getX()); + + m_grads[VarLocal::velocityV].setX(m_grads[VarLocal::velocityV].getX() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setY(m_grads[VarLocal::velocityV].getY() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setZ(m_grads[VarLocal::velocityV].getZ() * gradientLimiter.getVelocity().getY()); + + m_grads[VarLocal::velocityW].setX(m_grads[VarLocal::velocityW].getX() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setY(m_grads[VarLocal::velocityW].getY() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setZ(m_grads[VarLocal::velocityW].getZ() * gradientLimiter.getVelocity().getZ()); +} + +//**************************************************************************** +//************************** ORDER 2 PARALLEL ******************************** +//**************************************************************************** + +int GradPhaseEuler::numberOfTransmittedGradients() const +{ + return 15; +} + +//**************************************************************************** \ No newline at end of file diff --git a/src/Models/Euler/GradPhaseEuler.h b/src/Models/Euler/GradPhaseEuler.h new file mode 100644 index 00000000..2ae0fc1e --- /dev/null +++ b/src/Models/Euler/GradPhaseEuler.h @@ -0,0 +1,60 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADPHASEEULER_H +#define GRADPHASEEULER_H + +#include "../GradPhase.h" +#include "PhaseEuler.h" + +class Phase; + +//! \class GradPhaseEuler +//! \brief Phase variable gradients for Euler model. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradPhaseEuler : public GradPhase +{ +public: + GradPhaseEuler(); + virtual ~GradPhaseEuler(); + + virtual void initializeGradientVectors(); + + virtual void computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const; + virtual void limitGradients(const Phase& gradientLimiter); + + virtual int numberOfTransmittedGradients() const; + +protected: + //! \brief Enumeration for the phase flow variables, specific to Euler + enum VarLocal { density, pressure, velocityU, velocityV, velocityW }; +}; + +#endif \ No newline at end of file diff --git a/src/Models/Euler/MixEuler.h b/src/Models/Euler/MixEuler.h index 916aa691..dbc25be6 100644 --- a/src/Models/Euler/MixEuler.h +++ b/src/Models/Euler/MixEuler.h @@ -49,7 +49,7 @@ class MixEuler : public Mixture virtual double computeFrozenSoundSpeed(const double* /*Yk*/, const double* /*ck*/) { return 0.; }; virtual void computeMixtureVariables(Phase** /*vecPhase*/) {}; - virtual void internalEnergyToTotalEnergy(std::vector& /*vecGPA*/) {}; + virtual void computeTotalEnergy(std::vector& /*vecGPA*/) {}; virtual void totalEnergyToInternalEnergy(std::vector& /*vecGPA*/) {}; virtual void localProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; @@ -76,8 +76,12 @@ class MixEuler : public Mixture //--------------------------------- virtual void computeSlopesMixture(const Mixture& /*sLeft*/, const Mixture& /*sRight*/, const double& /*distance*/) {}; virtual void setToZero() {}; + virtual void setToMax() {}; virtual void extrapolate(const Mixture& /*slope*/, const double& /*distance*/) {}; virtual void limitSlopes(const Mixture& /*slopeGauche*/, const Mixture& /*slopeDroite*/, Limiter& /*globalLimiter*/) {}; + virtual void setMin(const Mixture& /*mixture1*/, const Mixture& /*mixture2*/) {}; + virtual void setMax(const Mixture& /*mixture1*/, const Mixture& /*mixture2*/) {}; + virtual void computeGradientLimiter(const Limiter& /*globalLimiter*/, const Mixture& /*mixture*/, const Mixture& /*mixtureMin*/, const Mixture& /*mixtureMax*/, const Mixture& /*slope*/) {}; //Specific methods for parallele computing at second order //-------------------------------------------------------- diff --git a/src/Models/Euler/ModEuler.cpp b/src/Models/Euler/ModEuler.cpp index 60193193..7e2afbf9 100644 --- a/src/Models/Euler/ModEuler.cpp +++ b/src/Models/Euler/ModEuler.cpp @@ -29,7 +29,6 @@ // If not, see . #include "ModEuler.h" -#include "PhaseEuler.h" const std::string ModEuler::NAME = "EULER"; @@ -39,6 +38,7 @@ ModEuler::ModEuler(const int& numbTransports) : Model(NAME, numbTransports) { fluxBuff = new FluxEuler(); + fluxBuffMRF = new FluxEuler(); for (int i = 0; i < 4; i++) { sourceCons.push_back(new FluxEuler()); } @@ -49,6 +49,7 @@ ModEuler::ModEuler(const int& numbTransports) : ModEuler::~ModEuler() { delete fluxBuff; + delete fluxBuffMRF; for (int i = 0; i < 4; i++) { delete sourceCons[i]; } @@ -78,15 +79,27 @@ void ModEuler::allocateMixture(Mixture** mixture) //*********************************************************************** -void ModEuler::fulfillState(Phase** phases, Mixture* /*mixture*/) +void ModEuler::allocatePhaseGradient(GradPhase** phase) { - phases[0]->extendedCalculusPhase(phases[0]->getVelocity()); + *phase = new GradPhaseEuler; +} + +//*********************************************************************** + +void ModEuler::allocateMixtureGradient(GradMixture** mixture) +{ + *mixture = new GradMixEuler; } //*********************************************************************** +void ModEuler::fulfillState(Phase** phases, Mixture* /*mixture*/) +{ + phases[0]->extendedCalculusPhase(phases[0]->getVelocity()); +} + //**************************************************************************** -//********************* Cell to cell Riemann solvers** *********************** +//********************* Cell to cell Riemann solvers ************************* //**************************************************************************** void ModEuler::solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, std::vector &boundData) const @@ -207,6 +220,147 @@ void ModEuler::solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& static_cast (fluxBuff)->m_sM = sM; } +//**************************************************************************** +//*** Half Riemann solver for MRF interface between static/rotating region *** +//**************************************************************************** + +void ModEuler::solveRiemannInternMRF(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, const Coord& omega, const Coord& normal, const Coord& tangent, const Coord& binormal, const Coord& position) const +{ + double cL, cR, sL, sR; + double uL, uR, vL, vR, wL, wR, pL, pR, rhoL, rhoR, EL, ER; + Coord velocityStar; + + Phase* phaseLeft(0), *phaseRight(0); + phaseLeft = cellLeft.getPhase(0); + phaseRight = cellRight.getPhase(0); + + uL = phaseLeft->getU(); vL = phaseLeft->getV(); wL = phaseLeft->getW(); + pL = phaseLeft->getPressure(); + rhoL = phaseLeft->getDensity(); + cL = phaseLeft->getSoundSpeed(); + EL = phaseLeft->getTotalEnergy(); + + uR = phaseRight->getU(); vR = phaseRight->getV(); wR = phaseRight->getW(); + pR = phaseRight->getPressure(); + rhoR = phaseRight->getDensity(); + cR = phaseRight->getSoundSpeed(); + ER = phaseRight->getTotalEnergy(); + + // Low-Mach preconditioning + double machRefMin(1.); // Default value without low-Mach preco. + if(m_lowMach){ + lowMachSoundSpeed(machRefMin, uL, cL, uR, cR); + } + + sL = std::min(uL - cL, uR - cR); + sR = std::max(uR + cR, uL + cL); + + // For low-Mach (for general purpose machRefMin set to 1) + if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); + if (std::fabs(sR)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxRight / std::fabs(sR)); + + //compute left and right mass flow rates and sM + double mL(rhoL*(sL - uL)), mR(rhoR*(sR - uR)); + double sM((pR - pL + mL*uL - mR*uR) / (mL - mR)); + if (std::fabs(sM)<1.e-8) sM = 0.; + + if (sL > 0.){ + // Flux for static region + static_cast (fluxBuff)->m_mass = rhoL*uL; + static_cast (fluxBuff)->m_momentum.setX(rhoL*uL*uL + pL); + static_cast (fluxBuff)->m_momentum.setY(rhoL*vL*uL); + static_cast (fluxBuff)->m_momentum.setZ(rhoL*wL*uL); + static_cast (fluxBuff)->m_energ = (rhoL*EL + pL)*uL; + + // Flux for rotating region + velocityStar.setXYZ(uL, vL, wL); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + static_cast (fluxBuffMRF)->m_mass = rhoL*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoL*velocityStar.getX()*velocityStar.getX() + pL); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoL*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoL*velocityStar.getZ()*velocityStar.getX()); + EL = phaseLeft->getEnergy() + 0.5 * velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_energ = (rhoL*EL + pL)*velocityStar.getX(); + } + else if (sR < 0.){ + // Flux for static region + static_cast (fluxBuff)->m_mass = rhoR*uR; + static_cast (fluxBuff)->m_momentum.setX(rhoR*uR*uR + pR); + static_cast (fluxBuff)->m_momentum.setY(rhoR*vR*uR); + static_cast (fluxBuff)->m_momentum.setZ(rhoR*wR*uR); + static_cast (fluxBuff)->m_energ = (rhoR*ER + pR)*uR; + + // Flux for rotating region + velocityStar.setXYZ(uR, vR, wR); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + static_cast (fluxBuffMRF)->m_mass = rhoR*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoR*velocityStar.getX()*velocityStar.getX() + pR); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoR*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoR*velocityStar.getZ()*velocityStar.getX()); + ER = phaseRight->getEnergy() + 0.5 * velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_energ = (rhoR*ER + pR)*velocityStar.getX(); + } + + ////1) Option HLL + //else if (std::fabs(sR - sL)>1.e-3) + //{ + // static_cast (fluxBuff)->m_mass = (rhoR*uR*sL - rhoL*uL*sR + sL*sR*(rhoL - rhoR)) / (sL - sR); + // static_cast (fluxBuff)->m_momentum.setX(((rhoR*uR*uR + pR)*sL - (rhoL*uL*uL + pL)*sR + sL*sR*(rhoL*uL - rhoR*uR)) / (sL - sR)); + // static_cast (fluxBuff)->m_momentum.setY((rhoR*uR*vR*sL - rhoL*uL*vL*sR + sL*sR*(rhoL*vL - rhoR*vR)) / (sL - sR)); + // static_cast (fluxBuff)->m_momentum.setZ((rhoR*uR*wR*sL - rhoL*uL*wL*sR + sL*sR*(rhoL*wL - rhoR*wR)) / (sL - sR)); + // static_cast (fluxBuff)->m_energ = ((rhoR*ER + pR)*uR*sL - (rhoL*EL + pL)*uL*sR + sL*sR*(rhoL*EL - rhoR*ER)) / (sL - sR); + //} + + //2) Option HLLC + else if (sM >= 0.) { + // Flux for static region + double pStar = mL*(sM - uL) + pL; + double rhoStar = mL / (sL - sM); + double Estar = EL + (sM - uL)*(sM + pL / mL); + static_cast (fluxBuff)->m_mass = rhoStar*sM; + static_cast (fluxBuff)->m_momentum.setX(rhoStar*sM*sM+pStar); + static_cast (fluxBuff)->m_momentum.setY(rhoStar*sM*vL); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar*sM*wL); + static_cast (fluxBuff)->m_energ = (rhoStar*Estar + pStar)*sM; + + // Flux for rotating region + velocityStar.setXYZ(sM, vL, wL); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + static_cast (fluxBuffMRF)->m_mass = rhoStar*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoStar*velocityStar.getX()*velocityStar.getX() + pStar); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoStar*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoStar*velocityStar.getZ()*velocityStar.getX()); + Estar = Estar - 0.5 * (sM*sM+vL*vL+wL*wL); + Estar += 0.5*velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_energ = (rhoStar*Estar + pStar)*velocityStar.getX(); + } + else { + // Flux for static region + double pStar = mR*(sM - uR) + pR; + double rhoStar = mR / (sR - sM); + double Estar = ER + (sM - uR)*(sM + pR / mR); + static_cast (fluxBuff)->m_mass = rhoStar*sM; + static_cast (fluxBuff)->m_momentum.setX(rhoStar*sM*sM + pStar); + static_cast (fluxBuff)->m_momentum.setY(rhoStar*sM*vR); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar*sM*wR); + static_cast (fluxBuff)->m_energ = (rhoStar*Estar + pStar)*sM; + + // Flux for rotating region + velocityStar.setXYZ(sM, vR, wR); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + static_cast (fluxBuffMRF)->m_mass = rhoStar*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoStar*velocityStar.getX()*velocityStar.getX() + pStar); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoStar*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoStar*velocityStar.getZ()*velocityStar.getX()); + Estar = Estar - 0.5 * (sM*sM+vR*vR+wR*wR); + Estar += 0.5*velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_energ = (rhoStar*Estar + pStar)*velocityStar.getX(); + } + + //Contact discontinuity velocity + static_cast (fluxBuff)->m_sM = sM; +} + //**************************************************************************** //************** Half Riemann solvers for boundary conditions** ************** //**************************************************************************** @@ -256,7 +410,145 @@ void ModEuler::solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dt //**************************************************************************** -void ModEuler::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* /*ak0*/, const double* rhok0, const double* pk0, std::vector &boundData) const +void ModEuler::solveRiemannInletTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* /*ak0*/, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const +{ + Eos* eos; + + double cL, sL, zL; + double uL, pL, rhoL, vL, wL; + double uStar(0.), rhoStar(0.), pStar(0.), eStar(0.), vStar(0.), wStar(0.); + + Phase* phaseLeft(0); + phaseLeft = cellLeft.getPhase(0); + + eos = phaseLeft->getEos(); + uL = phaseLeft->getU(); + vL = phaseLeft->getV(); + wL = phaseLeft->getW(); + pL = phaseLeft->getPressure(); + rhoL = phaseLeft->getDensity(); + cL = phaseLeft->getSoundSpeed(); + + // Low-Mach preconditioning + double machRefMin(1.); // Default value without low-Mach preco. + if(m_lowMach){ + lowMachSoundSpeed(machRefMin, uL, cL); + } + + zL = rhoL*cL; + + //Left wave velocity estimation using pStar = p0 + //---------------------------------------------- + pStar = p0; + double v(0.), vmv0, mL, u; + v = 1./eos->computeDensityIsentropic(pL, rhoL, pStar); + //v = 1. / eos->computeDensityHugoniot(pL, rhoL, pStar); //Other possibility + vmv0 = v - 1. / rhoL; + if (std::fabs(vmv0) > 1e-10) { mL = sqrt((pL - p0) / vmv0); } + else { mL = zL; } + sL = uL - mL / rhoL; + // For low-Mach (for general purpose machRefMin set to 1) + if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); + u = uL + mL*vmv0; + + //Pathologic cases + //---------------- + if (sL >= 0.) { //supersonic outflow => left state solution + uStar = uL; + pStar = pL; + rhoStar = rhoL; + vStar = vL; + wStar = wL; + } + else if (u >= -1e-3) { //subsonic outflow => star left state solution + uStar = u; + pStar = p0; + rhoStar = 1. / v; + vStar = vL; + wStar = wL; + } + //Tank case + //--------- + else { //tank inflow => star right state solution + //Total enthalpy in tank state + double H0(0.); + double v0 = 0.; + H0 = eos->computeTotalEnthalpy(rhok0[0], p0, v0); + + //ITERATIVE PROCESS FOR PRESSURE DETERMINATION + //-------------------------------------------- + int iteration(0); + double p(0.5*p0); + double f(0.), df(1.); + double dv, h, dh, drho; + double uStarR(0.), duStarR(0.), uStarL(0.), duStarL(0.); + do { + p -= f / df; iteration++; + if (iteration > 50) Errors::errorMessage("solveRiemannInletTank not converged in modEuler"); + //Physical pressure ? + eos->verifyAndModifyPressure(p); + if (p > p0) { p = p0 - 1e-6; } + + //Tank rekations in the right (H=cte et s=cste) + rhoStar = eos->computeDensityIsentropic(p0, rhok0[0], p); + h = eos->computeEnthalpyIsentropic(p0, rhok0[0], p, &dh); + uStarR = -sqrt(2.*(H0 - h)); + duStarR = -dh / uStarR; ; + + //Isentropic relations on the left //FP//DEV// chocs a mettre + double dmL; + v = 1.0 / eos->computeDensityIsentropic(pL, rhoL, p, &drho); + //v = 1.0 / eos->computeDensityHugoniot(pL, rhoL, p, &drho); //Other possibility + dv = - v*v*drho; + vmv0 = v - 1. / rhoL; + if (std::fabs(vmv0) > 1e-10) { + mL = sqrt((pL - p) / vmv0); + dmL = 0.5*(-vmv0 + (p - pL)*dv) / (vmv0*vmv0) / mL; + } + else { //if limit density overpassed under shock => acoustic relations instead + mL = zL; + dmL = 0.; + } + sL = uL - mL / rhoL; + // For low-Mach (for general purpose machRefMin set to 1) + if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); + uStarL = uL + mL*vmv0; + duStarL = dmL*vmv0 + mL*dv; + + //solved function + f = uStarR - uStarL; + df = duStarR - duStarL; + + } while (std::fabs(f)>1e-3); + + pStar = p; + uStar = 0.5*(uStarL + uStarR); + vStar = 0.; + wStar = 0.; + } + + eStar = eos->computeEnergy(rhoStar, pStar); + + static_cast (fluxBuff)->m_mass = rhoStar*uStar; + static_cast (fluxBuff)->m_momentum.setX(rhoStar*uStar*uStar + pStar); + static_cast (fluxBuff)->m_momentum.setY(rhoStar*uStar*vStar); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar*uStar*wStar); + static_cast (fluxBuff)->m_energ = (rhoStar*(eStar + 0.5*(uStar*uStar + vStar*vStar + wStar*wStar)) + pStar)*uStar; + + //Contact discontinuity velocity + static_cast (fluxBuff)->m_sM = uStar; + + // Boundary data for output + boundData[VarBoundary::p] = pStar; + boundData[VarBoundary::rho] = rhoStar; + boundData[VarBoundary::velU] = uStar; + boundData[VarBoundary::velV] = vStar; + boundData[VarBoundary::velW] = wStar; +} + +//**************************************************************************** + +void ModEuler::solveRiemannInletInjStagState(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* /*ak0*/, const double* rhok0, const double* pk0, std::vector &boundData) const { Eos* eos; double H0, u0; @@ -315,7 +607,7 @@ void ModEuler::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& double u, du, v, dv, h; do { pStar -= f / df; iteration++; - if (iteration > 50) Errors::errorMessage("solveRimannInflow not converged in modEuler"); + if (iteration > 50) Errors::errorMessage("solveRiemannInflow not converged in modEuler"); //physical pressure ? eos->verifyAndModifyPressure(pStar); //Acoustic relation in the left (can be modified by shock relations) @@ -372,7 +664,7 @@ void ModEuler::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& //**************************************************************************** -void ModEuler::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* /*ak0*/, std::vector &boundData) const +void ModEuler::solveRiemannInletInjTemp(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* /*ak0*/, std::vector &boundData) const { Eos* eos; Phase* leftPhase(0); @@ -407,7 +699,7 @@ void ModEuler::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& do { p -= f / df; it++; - if (it > 50) Errors::errorMessage("solveRiemannSubInj not converged in modEuler"); + if (it > 50) Errors::errorMessage("solveRiemannInletInjTemp not converged in modEuler"); eos->verifyAndModifyPressure(p); // Left intermediate state @@ -461,25 +753,22 @@ void ModEuler::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& //**************************************************************************** -void ModEuler::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* /*ak0*/, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const +void ModEuler::solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const { - Eos* eos; - double cL, sL, zL; double uL, pL, rhoL, vL, wL; - double uStar(0.), rhoStar(0.), pStar(0.), eStar(0.), vStar(0.), wStar(0.); + double uStar(0.), rhoStar(0.), pStar(p0), eStar(0.); Phase* phaseLeft(0); phaseLeft = cellLeft.getPhase(0); - - eos = phaseLeft->getEos(); + uL = phaseLeft->getU(); vL = phaseLeft->getV(); wL = phaseLeft->getW(); pL = phaseLeft->getPressure(); rhoL = phaseLeft->getDensity(); cL = phaseLeft->getSoundSpeed(); - + // Low-Mach preconditioning double machRefMin(1.); // Default value without low-Mach preco. if(m_lowMach){ @@ -488,103 +777,45 @@ void ModEuler::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dt zL = rhoL*cL; - //Left wave velocity estimation using pStar = p0 - //---------------------------------------------- - pStar = p0; - double v(0.), vmv0, mL, u; - v = 1./eos->computeDensityIsentropic(pL, rhoL, pStar); - //v = 1. / eos->computeDensityHugoniot(pL, rhoL, pStar); //Other possibility - vmv0 = v - 1. / rhoL; - if (std::fabs(vmv0) > 1e-10) { mL = sqrt((pL - p0) / vmv0); } + // Perturbed state + double vStar(0.), vSmvL(0.), mL(zL), sM(0.); + //rhoStar = TB->eos[0]->computeDensityIsentropic(pL, rhoL, pStar); // Isentropic relations if needed + rhoStar = TB->eos[0]->computeDensityHugoniot(pL, rhoL, pStar); + vStar = 1. / std::max(rhoStar, 1e-10); + vSmvL = vStar - 1. / rhoL; + + // Jump accross left wave is described by RH or acoustic relations (if specific volume jump is small) + if (std::abs(vSmvL) > 1e-10) { mL = sqrt((pL - pStar) / vSmvL); } else { mL = zL; } sL = uL - mL / rhoL; // For low-Mach (for general purpose machRefMin set to 1) - if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - u = uL + mL*vmv0; + if (std::fabs(sL) > 1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - //Pathologic cases - //---------------- - if (sL >= 0.) { //supersonic outflow => left state solution + sM = uL + mL * vSmvL; + + // Pathologic case I: sL>0 + if (sL >= 0.) { //Supersonic outflow => Left state solution uStar = uL; pStar = pL; rhoStar = rhoL; - vStar = vL; - wStar = wL; } - else if (u >= -1e-3) { //subsonic outflow => star left state solution - uStar = u; - pStar = p0; - rhoStar = 1. / v; - vStar = vL; - wStar = wL; + // Pathologic case II: inflow conditions, we temporarly keep the specific mass + else if (sM < 0) { + uStar = sM; + rhoStar = rhoL; } - //Tank case - //--------- - else { //tank inflow => star right state solution - //Total enthalpy in tank state - double H0(0.); - double v0 = 0.; - H0 = eos->computeTotalEnthalpy(rhok0[0], p0, v0); - - //ITERATIVE PROCESS FOR PRESSURE DETERMINATION - //-------------------------------------------- - int iteration(0); - double p(0.5*p0); - double f(0.), df(1.); - double dv, h, dh, drho; - double uStarR(0.), duStarR(0.), uStarL(0.), duStarL(0.); - do { - p -= f / df; iteration++; - if (iteration > 50) Errors::errorMessage("solveRiemannTank not converged in modEuler"); - //Physical pressure ? - eos->verifyAndModifyPressure(p); - if (p > p0) { p = p0 - 1e-6; } - - //Tank rekations in the right (H=cte et s=cste) - rhoStar = eos->computeDensityIsentropic(p0, rhok0[0], p); - h = eos->computeEnthalpyIsentropic(p0, rhok0[0], p, &dh); - uStarR = -sqrt(2.*(H0 - h)); - duStarR = -dh / uStarR; ; - - //Isentropic relations on the left //FP//DEV// chocs a mettre - double dmL; - v = 1.0 / eos->computeDensityIsentropic(pL, rhoL, p, &drho); - //v = 1.0 / eos->computeDensityHugoniot(pL, rhoL, p, &drho); //Other possibility - dv = - v*v*drho; - vmv0 = v - 1. / rhoL; - if (std::fabs(vmv0) > 1e-10) { - mL = sqrt((pL - p) / vmv0); - dmL = 0.5*(-vmv0 + (p - pL)*dv) / (vmv0*vmv0) / mL; - } - else { //if limit density overpassed under shock => acoustic relations instead - mL = zL; - dmL = 0.; - } - sL = uL - mL / rhoL; - // For low-Mach (for general purpose machRefMin set to 1) - if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - uStarL = uL + mL*vmv0; - duStarL = dmL*vmv0 + mL*dv; - - //solved function - f = uStarR - uStarL; - df = duStarR - duStarL; - - } while (std::fabs(f)>1e-3); - - pStar = p; - uStar = 0.5*(uStarL + uStarR); - vStar = 0.; - wStar = 0.; + // Imposed pressure outflow + else { + uStar = sM; } - eStar = eos->computeEnergy(rhoStar, pStar); - + // Flux completion + eStar = TB->eos[0]->computeEnergy(rhoStar, pStar); static_cast (fluxBuff)->m_mass = rhoStar*uStar; static_cast (fluxBuff)->m_momentum.setX(rhoStar*uStar*uStar + pStar); - static_cast (fluxBuff)->m_momentum.setY(rhoStar*uStar*vStar); - static_cast (fluxBuff)->m_momentum.setZ(rhoStar*uStar*wStar); - static_cast (fluxBuff)->m_energ = (rhoStar*(eStar + 0.5*(uStar*uStar + vStar*vStar + wStar*wStar)) + pStar)*uStar; + static_cast (fluxBuff)->m_momentum.setY(rhoStar*uStar*vL); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar*uStar*wL); + static_cast (fluxBuff)->m_energ = (rhoStar*(eStar + 0.5*(uStar*uStar + vL*vL + wL*wL)) + pStar)*uStar; //Contact discontinuity velocity static_cast (fluxBuff)->m_sM = uStar; @@ -593,77 +824,106 @@ void ModEuler::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dt boundData[VarBoundary::p] = pStar; boundData[VarBoundary::rho] = rhoStar; boundData[VarBoundary::velU] = uStar; - boundData[VarBoundary::velV] = vStar; - boundData[VarBoundary::velW] = wStar; + boundData[VarBoundary::velV] = vL; + boundData[VarBoundary::velW] = wL; } //**************************************************************************** -void ModEuler::solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const +void ModEuler::solveRiemannOutletMassflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, std::vector& boundData) const { + Eos* eos; + Phase* leftPhase(0); + double uL, vL, wL, pL, rhoL; double cL, sL, zL; - double uL, pL, rhoL, vL, wL; - double uStar(0.), rhoStar(0.), pStar(p0), eStar(0.); - Phase* phaseLeft(0); - phaseLeft = cellLeft.getPhase(0); - - uL = phaseLeft->getU(); - vL = phaseLeft->getV(); - wL = phaseLeft->getW(); - pL = phaseLeft->getPressure(); - rhoL = phaseLeft->getDensity(); - cL = phaseLeft->getSoundSpeed(); - + leftPhase = cellLeft.getPhase(0); + eos = leftPhase->getEos(); + uL = leftPhase->getU(); + vL = leftPhase->getV(); + wL = leftPhase->getW(); + pL = leftPhase->getPressure(); + rhoL = leftPhase->getDensity(); + cL = leftPhase->getSoundSpeed(); + // Low-Mach preconditioning double machRefMin(1.); // Default value without low-Mach preco. if(m_lowMach){ lowMachSoundSpeed(machRefMin, uL, cL); } - zL = rhoL*cL; + zL = rhoL * cL; - // Perturbed state - double vStar(0.), vSmvL(0.), mL(zL), sM(0.); - //rhoStar = TB->eos[0]->computeDensityIsentropic(pL, rhoL, pStar); // Isentropic relations if needed - rhoStar = TB->eos[0]->computeDensityHugoniot(pL, rhoL, pStar); - vStar = 1. / std::max(rhoStar, 1e-10); - vSmvL = vStar - 1. / rhoL; + int it(0); + double p(0.8*pL), u(0.), du(0.), f(0.), df(1.); + double mL(zL), dmL(0.), vSmvL(0.); + double rhoStarL(0.), drhoStarL(0.), vStarL(0.), dvStarL(0.); + double eStar(0.), rhoStar(0.), pStar(0.), uStar(0.); + + // ITERATIVE PROCESS FOR PRESSURE DETERMINATION + // -------------------------------------------- + do { + p -= f / df; + it++; + if (it > 50) { + warnings.push_back(Errors("solveRiemannOutletMassflow not converged in ModEuler", __FILE__, __LINE__)); + } + // Check physical pressure + eos->verifyAndModifyPressure(p); + + // Left intermediate state + // rhoStarL = eos->computeDensityIsentropic(pL, rhoL, p, &drhoStarL); + rhoStarL = eos->computeDensityHugoniot(pL, rhoL, p, &drhoStarL); + vStarL = 1. / rhoStarL; + dvStarL = - drhoStarL / (rhoStarL * rhoStarL); + vSmvL = vStarL - 1. / rhoL; + if (std::fabs(vSmvL) > 1.e-10) { // Rankine-Hugoniot + mL = std::sqrt((pL - p) / vSmvL); + dmL = 0.5 * (- vSmvL + (p - pL) * dvStarL) / (vSmvL * vSmvL) / mL; + } + else { // Acoustic + mL = zL; + dmL = 0.; + } + + sL = uL - mL / rhoL; + + u = uL + mL * vSmvL; + du = dmL * vSmvL + mL * dvStarL; + + f = m0 - rhoStarL * u; + df = - drhoStarL * u - rhoStarL * du; + } while (std::fabs(f) > 1.e-3 && it <= 50); - // Jump accross left wave is described by RH or acoustic relations (if specific volume jump is small) - if (std::abs(vSmvL) > 1e-10) { mL = sqrt((pL - pStar) / vSmvL); } - else { mL = zL; } - sL = uL - mL / rhoL; // For low-Mach (for general purpose machRefMin set to 1) if (std::fabs(sL) > 1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - sM = uL + mL * vSmvL; - - // Pathologic case I: sL>0 - if (sL >= 0.) { //Supersonic outflow => Left state solution + // Solution state + if (sL >= 0.) { // Pathologic case: supersonic outflow uStar = uL; - pStar = pL; rhoStar = rhoL; + pStar = pL; } - // Pathologic case II: inflow conditions, we temporarly keep the specific mass - else if (sM < 0) { - uStar = sM; + else if (u < 0.) { // Pathologic case: Back flow (we keep the mass temporarly) + uStar = u; rhoStar = rhoL; + pStar = p; } - // Imposed pressure outflow - else { - uStar = sM; + else { // Subsonic outflow + pStar = p; + rhoStar = rhoStarL; + eStar = eos->computeEnergy(rhoStar, pStar); + uStar = u; } // Flux completion - eStar = TB->eos[0]->computeEnergy(rhoStar, pStar); - static_cast (fluxBuff)->m_mass = rhoStar*uStar; - static_cast (fluxBuff)->m_momentum.setX(rhoStar*uStar*uStar + pStar); - static_cast (fluxBuff)->m_momentum.setY(rhoStar*uStar*vL); - static_cast (fluxBuff)->m_momentum.setZ(rhoStar*uStar*wL); - static_cast (fluxBuff)->m_energ = (rhoStar*(eStar + 0.5*(uStar*uStar + vL*vL + wL*wL)) + pStar)*uStar; + static_cast (fluxBuff)->m_mass = rhoStar * uStar; + static_cast (fluxBuff)->m_momentum.setX(rhoStar * uStar * uStar + pStar); + static_cast (fluxBuff)->m_momentum.setY(rhoStar * uStar * vL); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar * uStar * wL); + static_cast (fluxBuff)->m_energ = (rhoStar * (eStar + 0.5 * (uStar * uStar + vL * vL + wL * wL)) + pStar) * uStar; - //Contact discontinuity velocity + // Contact discontinuity velocity static_cast (fluxBuff)->m_sM = uStar; // Boundary data for output @@ -685,6 +945,100 @@ void ModEuler::solveRiemannNullFlux() const static_cast (fluxBuff)->m_energ = 0.; } +//**************************************************************************** +//********************** Transport Riemann solvers *************************** +//**************************************************************************** + +void ModEuler::solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight) +{ + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemann(cellLeft.getTransport(k).getValue(), cellRight.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM); + } +} + +//**************************************************************************** + +void ModEuler::solveRiemannTransportWall() +{ + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannWall(); + } +} + +//**************************************************************************** + +void ModEuler::solveRiemannTransportPiston(Cell& cellLeft, double uPiston) +{ + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannPiston(cellLeft.getTransport(k).getValue(), uPiston); + } +} + + +//**************************************************************************** + +void ModEuler::solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports) +{ + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannInletTank(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); + } +} + +//**************************************************************************** + +void ModEuler::solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports) +{ + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannInletInjStagState(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); + } +} + +//**************************************************************************** + +void ModEuler::solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransports) +{ + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannOutletPressure(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); + } +} + +//**************************************************************************** +//******************************* Accessors ********************************** +//**************************************************************************** + +double ModEuler::selectScalar(Phase** phases, Mixture* /*mixture*/, Transport* transports, Variable nameVariable, int num) const +{ + switch (nameVariable) { + case Variable::pressure: + return phases[0]->getPressure(); + break; + case Variable::density: + return phases[0]->getDensity(); + break; + case Variable::velocityU: + return phases[0]->getU(); + break; + case Variable::velocityV: + return phases[0]->getV(); + break; + case Variable::velocityW: + return phases[0]->getW(); + break; + case Variable::velocityMag: + return phases[0]->getVelocity().norm(); + break; + case Variable::transport: + return transports[num].getValue(); + break; + case Variable::temperature: + return phases[0]->getTemperature(); + break; + default: + Errors::errorMessage("nameVariable unknown in selectScalar"); return 0; + break; + } +} + //**************************************************************************** const double& ModEuler::getSM() @@ -692,15 +1046,13 @@ const double& ModEuler::getSM() return static_cast (fluxBuff)->m_sM; } +//**************************************************************************** +//***************************** Others methods ******************************* //**************************************************************************** void ModEuler::reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const { - Coord fluxProjete; - fluxProjete.setX(normal.getX()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjete.setY(normal.getY()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjete.setZ(normal.getZ()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuff)->m_momentum.getZ()); - static_cast (fluxBuff)->m_momentum.setXYZ(fluxProjete.getX(), fluxProjete.getY(), fluxProjete.getZ()); + static_cast (fluxBuff)->m_momentum.reverseProjection(normal, tangent, binormal); } //**************************************************************************** @@ -713,25 +1065,24 @@ void ModEuler::lowMachSoundSpeed(double& machRef, const double& uL, double& cL, // Journal of Computational Physics, 255, 53-82. // --- Mref --- - // double machRef = 0.1; - // cL = (1. - machRef*machRef)*uL + sqrt((machRef*machRef - 1.)*(machRef*machRef - 1.) * uL*uL + 4.* machRef*machRef*cL*cL); + // double machRefMin = 0.1; + // cL = (1. - machRefMin*machRefMin)*uL + sqrt((machRefMin*machRefMin - 1.)*(machRefMin*machRefMin - 1.) * uL*uL + 4.* machRefMin*machRefMin*cL*cL); // cL *= 0.5; - // cR = (machRef*machRef - 1.)*uR + sqrt((machRef*machRef - 1.)*(machRef*machRef - 1.) * uR*uR + 4.* machRef*machRef*cR*cR); + // cR = (machRefMin*machRefMin - 1.)*uR + sqrt((machRefMin*machRefMin - 1.)*(machRefMin*machRefMin - 1.) * uR*uR + 4.* machRefMin*machRefMin*cR*cR); // cR *= 0.5; - // machRefMin = machRef; // For CFL criteria + // machRef = machRefMin; // For CFL criteria // --- Mlocal --- double machLimitComp(0.3); - double machRefMin = 1.e-2; double machRefL(0.); if (std::fabs(uL)/cL >= machLimitComp) machRefL = 1.; - else if (std::fabs(uL)/cL > machRefMin) machRefL = std::fabs(uL)/cL; - else machRefL = machRefMin; + else if (std::fabs(uL)/cL > m_machRefMin) machRefL = std::fabs(uL)/cL; + else machRefL = m_machRefMin; // Right double machRefR(0.); if (std::fabs(uR)/cR >= machLimitComp) machRefR = 1.; - else if (std::fabs(uR)/cR > machRefMin) machRefR = std::fabs(uR)/cR; - else machRefR = machRefMin; + else if (std::fabs(uR)/cR > m_machRefMin) machRefR = std::fabs(uR)/cR; + else machRefR = m_machRefMin; machRef = std::max(machRefL, machRefR); //Caution: Keep right before left for boundary condition Riemann solver cR = (machRef*machRef - 1.)*uR + sqrt((machRef*machRef - 1.)*(machRef*machRef - 1.) * uR*uR + 4.* machRef*machRef*cR*cR); @@ -740,4 +1091,22 @@ void ModEuler::lowMachSoundSpeed(double& machRef, const double& uL, double& cL, cL *= 0.5; } +//**************************************************************************** + +void ModEuler::addNonConsMrfFlux(Phase** phases) +{ + static_cast (fluxBuffMRF)->addNonConsMrfFlux(phases); +} + +//**************************************************************************** + +void ModEuler::reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const +{ + Coord projectedFlux; + projectedFlux.setX(normal.getX()*static_cast (fluxBuffMRF)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuffMRF)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuffMRF)->m_momentum.getZ()); + projectedFlux.setY(normal.getY()*static_cast (fluxBuffMRF)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuffMRF)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuffMRF)->m_momentum.getZ()); + projectedFlux.setZ(normal.getZ()*static_cast (fluxBuffMRF)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuffMRF)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuffMRF)->m_momentum.getZ()); + static_cast (fluxBuffMRF)->m_momentum.setXYZ(projectedFlux.getX(), projectedFlux.getY(), projectedFlux.getZ()); +} + //**************************************************************************** \ No newline at end of file diff --git a/src/Models/Euler/ModEuler.h b/src/Models/Euler/ModEuler.h index 92187b7d..10d9bbe0 100644 --- a/src/Models/Euler/ModEuler.h +++ b/src/Models/Euler/ModEuler.h @@ -35,6 +35,9 @@ #include "../../Order1/Cell.h" #include "FluxEuler.h" #include "MixEuler.h" +#include "PhaseEuler.h" +#include "GradPhaseEuler.h" +#include "GradMixEuler.h" //! \class ModEuler //! \brief Model class for Euler mathematical system of equations (single phase) @@ -49,6 +52,8 @@ class ModEuler : public Model virtual void allocateCons(Flux** cons); virtual void allocatePhase(Phase** phase); virtual void allocateMixture(Mixture** mixture); + virtual void allocatePhaseGradient(GradPhase** phase); + virtual void allocateMixtureGradient(GradMixture** mixture); //! \details Complete single fluid state from pressure, density and velocity virtual void fulfillState(Phase** phases, Mixture* /*mixture*/); @@ -62,22 +67,46 @@ class ModEuler : public Model //Hydrodynamic Riemann solvers //---------------------------- virtual void solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, std::vector &boundData = DEFAULT_VEC_INTERFACE_DATA) const; + virtual void solveRiemannInternMRF(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, const Coord& omega, const Coord& normal, const Coord& tangent, const Coord& binormal, const Coord& position) const; virtual void solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dtMax, std::vector &boundData) const; - virtual void solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* /*ak0*/, const double* rhok0, const double* pk0, std::vector &boundData) const; - virtual void solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* /*ak0*/, std::vector &boundData) const; - virtual void solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* /*ak0*/, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const; - virtual void solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const; + virtual void solveRiemannInletTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* /*ak0*/, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const; + virtual void solveRiemannInletInjStagState(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* /*ak0*/, const double* rhok0, const double* pk0, std::vector &boundData) const; + virtual void solveRiemannInletInjTemp(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* /*ak0*/, std::vector &boundData) const; + virtual void solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const; + virtual void solveRiemannOutletMassflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, std::vector& boundData) const; virtual void solveRiemannNullFlux() const; + //Transports Riemann solvers + //-------------------------- + virtual void solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight); + virtual void solveRiemannTransportWall(); + virtual void solveRiemannTransportPiston(Cell& cellLeft, double uPiston); + virtual void solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports); + virtual void solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports); + virtual void solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransport); + virtual void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const; //low-Mach preconditioning //------------------------ virtual void lowMachSoundSpeed(double& machRef, const double& uL, double& cL, const double& uR = Errors::defaultDouble, double& cR = Tools::uselessDouble) const; virtual void setLowMach(const bool& lowMach) { m_lowMach = lowMach; }; + virtual void setMachRefMin(const double& machRefMin) { m_machRefMin = machRefMin; }; + + //Moving Reference Frame + //---------------------- + virtual void addNonConsMrfFlux(Phase** phases); + virtual void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const; //Accessors //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** phases, Mixture* /*mixture*/, Transport* transports, Variable nameVariable, int num = 0) const; virtual const double& getSM(); virtual const Coord& getVelocity(const Cell* cell) const { return cell->getPhase(0)->getVelocity(); }; virtual Coord& getVelocity(Cell* cell) { return cell->getPhase(0)->getVelocity(); }; diff --git a/src/Models/Euler/PhaseEuler.cpp b/src/Models/Euler/PhaseEuler.cpp index 5acd5823..5bbf2982 100644 --- a/src/Models/Euler/PhaseEuler.cpp +++ b/src/Models/Euler/PhaseEuler.cpp @@ -29,13 +29,12 @@ // If not, see . #include "PhaseEuler.h" -#include "../../Eos/Eos.h" using namespace tinyxml2; //*************************************************************************** -PhaseEuler::PhaseEuler() :m_density(0.), m_pressure(0.), m_eos(0), m_energy(0.), m_totalEnergy(0.), m_soundSpeed(0.) +PhaseEuler::PhaseEuler() : m_density(0.), m_pressure(0.), m_eos(0), m_energy(0.), m_totalEnergy(0.), m_soundSpeed(0.) { m_velocity.setXYZ(0., 0., 0.); } @@ -300,6 +299,14 @@ void PhaseEuler::setToZero() //*************************************************************************** +void PhaseEuler::setToMax() +{ + m_density = 1.e15; m_pressure = 1.e15; + m_velocity.setX(1.e15); m_velocity.setY(1.e15); m_velocity.setZ(1.e15); +} + +//*************************************************************************** + void PhaseEuler::extrapolate(const Phase &slope, const double& distance) { m_density += slope.getDensity() * distance; @@ -320,6 +327,42 @@ void PhaseEuler::limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, m_velocity.setZ(globalLimiter.limiteSlope(slopeGauche.getVelocity().getZ(), slopeDroite.getVelocity().getZ())); } +//**************************************************************************** + +void PhaseEuler::setMin(const Phase& phase1, const Phase& phase2) +{ + m_density = std::min(phase1.getDensity(), phase2.getDensity()); + m_pressure = std::min(phase1.getPressure(), phase2.getPressure()); + + m_velocity.setX(std::min(phase1.getVelocity().getX(), phase2.getVelocity().getX())); + m_velocity.setY(std::min(phase1.getVelocity().getY(), phase2.getVelocity().getY())); + m_velocity.setZ(std::min(phase1.getVelocity().getZ(), phase2.getVelocity().getZ())); +} + +//**************************************************************************** + +void PhaseEuler::setMax(const Phase& phase1, const Phase& phase2) +{ + m_density = std::max(phase1.getDensity(), phase2.getDensity()); + m_pressure = std::max(phase1.getPressure(), phase2.getPressure()); + + m_velocity.setX(std::max(phase1.getVelocity().getX(), phase2.getVelocity().getX())); + m_velocity.setY(std::max(phase1.getVelocity().getY(), phase2.getVelocity().getY())); + m_velocity.setZ(std::max(phase1.getVelocity().getZ(), phase2.getVelocity().getZ())); +} + +//**************************************************************************** + +void PhaseEuler::computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope) +{ + m_density = std::min(m_density, globalLimiter.computeGradientLimiter(phase.getDensity(), phaseMin.getDensity(), phaseMax.getDensity(), slope.getDensity())); + m_pressure = std::min(m_pressure, globalLimiter.computeGradientLimiter(phase.getPressure(), phaseMin.getPressure(), phaseMax.getPressure(), slope.getPressure())); + + m_velocity.setX(std::min(m_velocity.getX(), globalLimiter.computeGradientLimiter(phase.getVelocity().getX(), phaseMin.getVelocity().getX(), phaseMax.getVelocity().getX(), slope.getVelocity().getX()))); + m_velocity.setY(std::min(m_velocity.getY(), globalLimiter.computeGradientLimiter(phase.getVelocity().getY(), phaseMin.getVelocity().getY(), phaseMax.getVelocity().getY(), slope.getVelocity().getY()))); + m_velocity.setZ(std::min(m_velocity.getZ(), globalLimiter.computeGradientLimiter(phase.getVelocity().getZ(), phaseMin.getVelocity().getZ(), phaseMax.getVelocity().getZ(), slope.getVelocity().getZ()))); +} + //**************************************************************************** //************************** ORDER 2 PARALLEL ******************************** //**************************************************************************** diff --git a/src/Models/Euler/PhaseEuler.h b/src/Models/Euler/PhaseEuler.h index 241d12a1..d7254f88 100644 --- a/src/Models/Euler/PhaseEuler.h +++ b/src/Models/Euler/PhaseEuler.h @@ -85,8 +85,12 @@ class PhaseEuler : public Phase //--------------------------------- virtual void computeSlopesPhase(const Phase& sLeft, const Phase& sRight, const double& distance); virtual void setToZero(); + virtual void setToMax(); virtual void extrapolate(const Phase& slope, const double& distance); virtual void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& globalLimiter, Limiter& /*volumeFractionLimiter*/); + virtual void setMin(const Phase& phase1, const Phase& phase2); + virtual void setMax(const Phase& phase1, const Phase& phase2); + virtual void computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope); //Specific methods for parallele computing at second order //-------------------------------------------------------- diff --git a/src/Models/EulerHomogeneous/FluxEulerHomogeneous.h b/src/Models/EulerHomogeneous/FluxEulerHomogeneous.h index acb575e1..37882b50 100644 --- a/src/Models/EulerHomogeneous/FluxEulerHomogeneous.h +++ b/src/Models/EulerHomogeneous/FluxEulerHomogeneous.h @@ -54,8 +54,8 @@ class FluxEulerHomogeneous : public Flux virtual void buildCons(Phase** phase, Mixture* mixture); virtual void buildPrim(Phase** phase, Mixture* mixture); virtual void setToZero(); - virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/) {}; - virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/) {}; + virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; + virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; virtual void addFluxSmooth1D(double coefA, const Coord& normal, Cell* cell); virtual void substractFluxSmooth1D(double coefA, const Coord& normal, Cell* cell); diff --git a/src/Models/EulerHomogeneous/GradMixEulerHomogeneous.cpp b/src/Models/EulerHomogeneous/GradMixEulerHomogeneous.cpp new file mode 100644 index 00000000..87c507a8 --- /dev/null +++ b/src/Models/EulerHomogeneous/GradMixEulerHomogeneous.cpp @@ -0,0 +1,71 @@ +#include "GradMixEulerHomogeneous.h" + +//*************************************************************************** + +GradMixEulerHomogeneous::GradMixEulerHomogeneous() +{ + m_grads.resize(4); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } +} + +//*************************************************************************** + +GradMixEulerHomogeneous::~GradMixEulerHomogeneous() +{ +} + +//*************************************************************************** + +void GradMixEulerHomogeneous::initializeGradientVectors() +{ + this->initializeGradsVariablesNamesNumerators(); + + variableNamesMixture[VarLocal::pressure] = Variable::pressure; + variableNamesMixture[VarLocal::velocityU] = Variable::velocityU; + variableNamesMixture[VarLocal::velocityV] = Variable::velocityV; + variableNamesMixture[VarLocal::velocityW] = Variable::velocityW; +} + +//*************************************************************************** + +void GradMixEulerHomogeneous::computeDistanceGradientScalarProduct(Coord const& distance, Mixture* mixture) const +{ + static_cast (mixture)->setPressure(distance.scalar(m_grads[VarLocal::pressure])); + static_cast (mixture)->setVelocity(distance.scalar(m_grads[VarLocal::velocityU]), + distance.scalar(m_grads[VarLocal::velocityV]), + distance.scalar(m_grads[VarLocal::velocityW])); +} + +//*************************************************************************** + +void GradMixEulerHomogeneous::limitGradients(const Mixture& gradientLimiter) +{ + m_grads[VarLocal::pressure].setX(m_grads[VarLocal::pressure].getX() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setY(m_grads[VarLocal::pressure].getY() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setZ(m_grads[VarLocal::pressure].getZ() * gradientLimiter.getPressure()); + + m_grads[VarLocal::velocityU].setX(m_grads[VarLocal::velocityU].getX() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setY(m_grads[VarLocal::velocityU].getY() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setZ(m_grads[VarLocal::velocityU].getZ() * gradientLimiter.getVelocity().getX()); + + m_grads[VarLocal::velocityV].setX(m_grads[VarLocal::velocityV].getX() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setY(m_grads[VarLocal::velocityV].getY() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setZ(m_grads[VarLocal::velocityV].getZ() * gradientLimiter.getVelocity().getY()); + + m_grads[VarLocal::velocityW].setX(m_grads[VarLocal::velocityW].getX() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setY(m_grads[VarLocal::velocityW].getY() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setZ(m_grads[VarLocal::velocityW].getZ() * gradientLimiter.getVelocity().getZ()); +} + +//**************************************************************************** +//************************** ORDER 2 PARALLEL ******************************** +//**************************************************************************** + +int GradMixEulerHomogeneous::numberOfTransmittedGradients() const +{ + return 12; +} + +//**************************************************************************** \ No newline at end of file diff --git a/src/Models/EulerHomogeneous/GradMixEulerHomogeneous.h b/src/Models/EulerHomogeneous/GradMixEulerHomogeneous.h new file mode 100644 index 00000000..3ed8f31b --- /dev/null +++ b/src/Models/EulerHomogeneous/GradMixEulerHomogeneous.h @@ -0,0 +1,61 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADMIXEULERHOMOGENEOUS_H +#define GRADMIXEULERHOMOGENEOUS_H + +#include "../GradMixture.h" +#include "MixEulerHomogeneous.h" + +class Mixture; + +//! \class GradMixEulerHomogeneous +//! \brief Mixture variable gradients for EulerHomogeneous model. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradMixEulerHomogeneous : public GradMixture +{ +public: + GradMixEulerHomogeneous(); + virtual ~GradMixEulerHomogeneous(); + + virtual void initializeGradientVectors(); + + virtual void computeDistanceGradientScalarProduct(Coord const& distance, Mixture* mixture) const; + virtual void limitGradients(const Mixture& gradientLimiter); + + // O2 parallel + virtual int numberOfTransmittedGradients() const; + +protected: + //! \brief Enumeration for the mixture flow variables, specific to EulerHomogeneous + enum VarLocal { pressure, velocityU, velocityV, velocityW }; +}; + +#endif \ No newline at end of file diff --git a/src/Models/EulerHomogeneous/GradPhaseEulerHomogeneous.cpp b/src/Models/EulerHomogeneous/GradPhaseEulerHomogeneous.cpp new file mode 100644 index 00000000..8a23b6f6 --- /dev/null +++ b/src/Models/EulerHomogeneous/GradPhaseEulerHomogeneous.cpp @@ -0,0 +1,53 @@ +#include "GradPhaseEulerHomogeneous.h" + +//*************************************************************************** + +GradPhaseEulerHomogeneous::GradPhaseEulerHomogeneous() +{ + m_grads.resize(1); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } +} + +//*************************************************************************** + +GradPhaseEulerHomogeneous::~GradPhaseEulerHomogeneous() +{ +} + +//*************************************************************************** + +void GradPhaseEulerHomogeneous::initializeGradientVectors() +{ + this->initializeGradsVariablesNamesNumerators(); + + variableNamesPhases[VarLocal::alpha] = Variable::alpha; +} + +//*************************************************************************** + +void GradPhaseEulerHomogeneous::computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const +{ + static_cast (phase)->setAlpha(distance.scalar(m_grads[VarLocal::alpha])); +} + +//*************************************************************************** + +void GradPhaseEulerHomogeneous::limitGradients(const Phase& gradientLimiter) +{ + m_grads[VarLocal::alpha].setX(m_grads[VarLocal::alpha].getX() * gradientLimiter.getAlpha()); + m_grads[VarLocal::alpha].setY(m_grads[VarLocal::alpha].getY() * gradientLimiter.getAlpha()); + m_grads[VarLocal::alpha].setZ(m_grads[VarLocal::alpha].getZ() * gradientLimiter.getAlpha()); +} + +//**************************************************************************** +//************************** ORDER 2 PARALLEL ******************************** +//**************************************************************************** + +int GradPhaseEulerHomogeneous::numberOfTransmittedGradients() const +{ + return 3; +} + +//**************************************************************************** \ No newline at end of file diff --git a/src/Models/EulerHomogeneous/GradPhaseEulerHomogeneous.h b/src/Models/EulerHomogeneous/GradPhaseEulerHomogeneous.h new file mode 100644 index 00000000..ed2605f9 --- /dev/null +++ b/src/Models/EulerHomogeneous/GradPhaseEulerHomogeneous.h @@ -0,0 +1,61 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADPHASEEULERHOMOGENEOUS_H +#define GRADPHASEEULERHOMOGENEOUS_H + +#include "../GradPhase.h" +#include "PhaseEulerHomogeneous.h" + +class Phase; + +//! \class GradPhaseEulerHomogeneous +//! \brief Phase variable gradients for EulerHomogeneous model. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradPhaseEulerHomogeneous : public GradPhase +{ +public: + GradPhaseEulerHomogeneous(); + virtual ~GradPhaseEulerHomogeneous(); + + virtual void initializeGradientVectors(); + + virtual void computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const; + virtual void limitGradients(const Phase& gradientLimiter); + + // O2 parallel + virtual int numberOfTransmittedGradients() const; + +protected: + //! \brief Enumeration for the phase flow variables, specific to EulerHomogeneous + enum VarLocal { alpha }; +}; + +#endif \ No newline at end of file diff --git a/src/Models/EulerHomogeneous/MixEulerHomogeneous.cpp b/src/Models/EulerHomogeneous/MixEulerHomogeneous.cpp index 97e09b29..58fb7bf5 100644 --- a/src/Models/EulerHomogeneous/MixEulerHomogeneous.cpp +++ b/src/Models/EulerHomogeneous/MixEulerHomogeneous.cpp @@ -203,7 +203,7 @@ void MixEulerHomogeneous::computeMixtureVariables(Phase** vecPhase) //*************************************************************************** -void MixEulerHomogeneous::internalEnergyToTotalEnergy(std::vector& vecGPA) +void MixEulerHomogeneous::computeTotalEnergy(std::vector& vecGPA) { m_totalEnergy = m_energy + 0.5*m_velocity.squaredNorm(); for (unsigned int pa = 0; pa < vecGPA.size(); pa++) { @@ -352,6 +352,17 @@ void MixEulerHomogeneous::fillBuffer(double* buffer, int& counter) const //*************************************************************************** +void MixEulerHomogeneous::fillBuffer(std::vector& dataToSend) const +{ + dataToSend.push_back(m_velocity.getX()); + dataToSend.push_back(m_velocity.getY()); + dataToSend.push_back(m_velocity.getZ()); + dataToSend.push_back(m_pressure); + dataToSend.push_back(m_totalEnergy); +} + +//*************************************************************************** + void MixEulerHomogeneous::getBuffer(double* buffer, int& counter) { m_velocity.setX(buffer[++counter]); @@ -361,6 +372,17 @@ void MixEulerHomogeneous::getBuffer(double* buffer, int& counter) m_totalEnergy = buffer[++counter]; } +//*************************************************************************** + +void MixEulerHomogeneous::getBuffer(std::vector& dataToReceive, int& counter) +{ + m_velocity.setX(dataToReceive[counter++]); + m_velocity.setY(dataToReceive[counter++]); + m_velocity.setZ(dataToReceive[counter++]); + m_pressure = dataToReceive[counter++]; + m_totalEnergy = dataToReceive[counter++]; +} + //**************************************************************************** //******************************* ORDER 2 ************************************ //**************************************************************************** @@ -383,6 +405,14 @@ void MixEulerHomogeneous::setToZero() //*************************************************************************** +void MixEulerHomogeneous::setToMax() +{ + m_pressure = 1.e15; + m_velocity.setX(1.e15); m_velocity.setY(1.e15); m_velocity.setZ(1.e15); +} + +//*************************************************************************** + void MixEulerHomogeneous::extrapolate(const Mixture &slope, const double& distance) { m_pressure += slope.getPressure()*distance; @@ -401,6 +431,36 @@ void MixEulerHomogeneous::limitSlopes(const Mixture &slopeGauche, const Mixture m_velocity.setZ(globalLimiter.limiteSlope(slopeGauche.getVelocity().getZ(), slopeDroite.getVelocity().getZ())); } +//**************************************************************************** + +void MixEulerHomogeneous::setMin(const Mixture& mixture1, const Mixture& mixture2) +{ + m_pressure = std::min(mixture1.getPressure(), mixture2.getPressure()); + m_velocity.setX(std::min(mixture1.getVelocity().getX(), mixture2.getVelocity().getX())); + m_velocity.setY(std::min(mixture1.getVelocity().getY(), mixture2.getVelocity().getY())); + m_velocity.setZ(std::min(mixture1.getVelocity().getZ(), mixture2.getVelocity().getZ())); +} + +//**************************************************************************** + +void MixEulerHomogeneous::setMax(const Mixture& mixture1, const Mixture& mixture2) +{ + m_pressure = std::max(mixture1.getPressure(), mixture2.getPressure()); + m_velocity.setX(std::max(mixture1.getVelocity().getX(), mixture2.getVelocity().getX())); + m_velocity.setY(std::max(mixture1.getVelocity().getY(), mixture2.getVelocity().getY())); + m_velocity.setZ(std::max(mixture1.getVelocity().getZ(), mixture2.getVelocity().getZ())); +} + +//**************************************************************************** + +void MixEulerHomogeneous::computeGradientLimiter(const Limiter& globalLimiter, const Mixture &mixture, const Mixture &mixtureMin, const Mixture &mixtureMax, const Mixture& slope) +{ + m_pressure = std::min(m_pressure, globalLimiter.computeGradientLimiter(mixture.getPressure(), mixtureMin.getPressure(), mixtureMax.getPressure(), slope.getPressure())); + m_velocity.setX(std::min(m_velocity.getX(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getX(), mixtureMin.getVelocity().getX(), mixtureMax.getVelocity().getX(), slope.getVelocity().getX()))); + m_velocity.setY(std::min(m_velocity.getY(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getY(), mixtureMin.getVelocity().getY(), mixtureMax.getVelocity().getY(), slope.getVelocity().getY()))); + m_velocity.setZ(std::min(m_velocity.getZ(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getZ(), mixtureMin.getVelocity().getZ(), mixtureMax.getVelocity().getZ(), slope.getVelocity().getZ()))); +} + //**************************************************************************** //************************** ORDER 2 PARALLEL ******************************** //**************************************************************************** diff --git a/src/Models/EulerHomogeneous/MixEulerHomogeneous.h b/src/Models/EulerHomogeneous/MixEulerHomogeneous.h index 993deb74..cbdf5fcc 100644 --- a/src/Models/EulerHomogeneous/MixEulerHomogeneous.h +++ b/src/Models/EulerHomogeneous/MixEulerHomogeneous.h @@ -60,7 +60,7 @@ class MixEulerHomogeneous : public Mixture virtual double computePressure(double mass, const double& internalEnergy, Phase** phases, Mixture* mixture, const int& liq, const int& vap); virtual void computeMixtureVariables(Phase** vecPhase); - virtual void internalEnergyToTotalEnergy(std::vector& vecGPA); + virtual void computeTotalEnergy(std::vector& vecGPA); virtual void totalEnergyToInternalEnergy(std::vector& vecGPA); virtual void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); @@ -83,14 +83,20 @@ class MixEulerHomogeneous : public Mixture //--------------------------------------- virtual int numberOfTransmittedVariables() const; virtual void fillBuffer(double* buffer, int& counter) const; + virtual void fillBuffer(std::vector& dataToSend) const; virtual void getBuffer(double* buffer, int& counter); + virtual void getBuffer(std::vector& dataToReceive, int& counter); //Specific methods for second order //--------------------------------- virtual void computeSlopesMixture(const Mixture &sLeft, const Mixture &sRight, const double& distance); virtual void setToZero(); + virtual void setToMax(); virtual void extrapolate(const Mixture &slope, const double& distance); virtual void limitSlopes(const Mixture &slopeGauche, const Mixture &slopeDroite, Limiter& globalLimiter); + virtual void setMin(const Mixture& mixture1, const Mixture& mixture2); + virtual void setMax(const Mixture& mixture1, const Mixture& mixture2); + virtual void computeGradientLimiter(const Limiter& globalLimiter, const Mixture& mixture, const Mixture& mixtureMin, const Mixture& mixtureMax, const Mixture& slope); //Specific methods for parallele computing at second order //-------------------------------------------------------- diff --git a/src/Models/EulerHomogeneous/ModEulerHomogeneous.cpp b/src/Models/EulerHomogeneous/ModEulerHomogeneous.cpp index c9973424..95828051 100644 --- a/src/Models/EulerHomogeneous/ModEulerHomogeneous.cpp +++ b/src/Models/EulerHomogeneous/ModEulerHomogeneous.cpp @@ -30,6 +30,8 @@ #include "ModEulerHomogeneous.h" #include "PhaseEulerHomogeneous.h" +#include "GradPhaseEulerHomogeneous.h" +#include "GradMixEulerHomogeneous.h" const std::string ModEulerHomogeneous::NAME = "EULERHOMOGENEOUS"; @@ -71,6 +73,20 @@ void ModEulerHomogeneous::allocateMixture(Mixture** mixture) //*********************************************************************** +void ModEulerHomogeneous::allocatePhaseGradient(GradPhase** phase) +{ + *phase = new GradPhaseEulerHomogeneous; +} + +//*********************************************************************** + +void ModEulerHomogeneous::allocateMixtureGradient(GradMixture** mixture) +{ + *mixture = new GradMixEulerHomogeneous; +} + +//*********************************************************************** + void ModEulerHomogeneous::fulfillState(Phase** phases, Mixture* mixture) { //Temperature calculus @@ -206,11 +222,7 @@ const double& ModEulerHomogeneous::getSM() void ModEulerHomogeneous::reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const { - Coord fluxProjete; - fluxProjete.setX(normal.getX()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjete.setY(normal.getY()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjete.setZ(normal.getZ()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuff)->m_momentum.getZ()); - static_cast (fluxBuff)->m_momentum.setXYZ(fluxProjete.getX(), fluxProjete.getY(), fluxProjete.getZ()); + static_cast (fluxBuff)->m_momentum.reverseProjection(normal, tangent, binormal); } //**************************************************************************** @@ -227,4 +239,44 @@ int ModEulerHomogeneous::getVap() return m_vap; } -//**************************************************************************** \ No newline at end of file +//**************************************************************************** +//******************************* Accessors ********************************** +//**************************************************************************** + +double ModEulerHomogeneous::selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num) const +{ + switch (nameVariable) { + case Variable::pressure: + return mixture->getPressure(); + break; + case Variable::alpha: + return phases[num]->getAlpha(); + break; + case Variable::velocityU: + return mixture->getVelocity().getX(); + break; + case Variable::velocityV: + return mixture->getVelocity().getY(); + break; + case Variable::velocityW: + return mixture->getVelocity().getZ(); + break; + case Variable::velocityMag: + return mixture->getVelocity().norm(); + break; + case Variable::density: + return mixture->getDensity(); + break; + case Variable::transport: + return transports[num].getValue(); + break; + case Variable::temperature: + return mixture->getTemperature(); + break; + default: + Errors::errorMessage("nameVariable unknown in selectScalar"); return 0; + break; + } +} + +//*********************************************************************** \ No newline at end of file diff --git a/src/Models/EulerHomogeneous/ModEulerHomogeneous.h b/src/Models/EulerHomogeneous/ModEulerHomogeneous.h index cb689360..9a082ed4 100644 --- a/src/Models/EulerHomogeneous/ModEulerHomogeneous.h +++ b/src/Models/EulerHomogeneous/ModEulerHomogeneous.h @@ -54,6 +54,8 @@ class ModEulerHomogeneous : public Model virtual void allocateCons(Flux** cons); virtual void allocatePhase(Phase** phase); virtual void allocateMixture(Mixture** mixture); + void allocatePhaseGradient(GradPhase** phase); + void allocateMixtureGradient(GradMixture** mixture); virtual void fulfillState(Phase** phases, Mixture* mixture); @@ -70,6 +72,13 @@ class ModEulerHomogeneous : public Model //Accessors //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const; virtual const double& getSM(); virtual const Coord& getVelocity(const Cell* cell) const { return cell->getMixture()->getVelocity(); }; virtual Coord& getVelocity(Cell* cell) { return cell->getMixture()->getVelocity(); }; diff --git a/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.cpp b/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.cpp index 30d578c3..b0925345 100644 --- a/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.cpp +++ b/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.cpp @@ -168,6 +168,16 @@ void PhaseEulerHomogeneous::fillBuffer(double* buffer, int& counter) const //*************************************************************************** +void PhaseEulerHomogeneous::fillBuffer(std::vector& dataToSend) const +{ + dataToSend.push_back(m_alpha); + dataToSend.push_back(m_density); + dataToSend.push_back(m_pressure); + dataToSend.push_back(static_cast(m_eos->getNumber())); +} + +//*************************************************************************** + void PhaseEulerHomogeneous::getBuffer(double* buffer, int& counter, Eos** eos) { m_alpha = buffer[++counter]; @@ -176,6 +186,16 @@ void PhaseEulerHomogeneous::getBuffer(double* buffer, int& counter, Eos** eos) m_eos = eos[static_cast(buffer[++counter])]; } +//*************************************************************************** + +void PhaseEulerHomogeneous::getBuffer(std::vector& dataToReceive, int& counter, Eos** eos) +{ + m_alpha = dataToReceive[counter++]; + m_density = dataToReceive[counter++]; + m_pressure = dataToReceive[counter++]; + m_eos = eos[static_cast(std::round(dataToReceive[counter++]))]; +} + //**************************************************************************** //******************************* ORDER 2 ************************************ //**************************************************************************** @@ -194,6 +214,13 @@ void PhaseEulerHomogeneous::setToZero() //*************************************************************************** +void PhaseEulerHomogeneous::setToMax() +{ + m_alpha = 1.e15; +} + +//*************************************************************************** + void PhaseEulerHomogeneous::extrapolate(const Phase &slope, const double& distance) { m_alpha += slope.getAlpha() * distance; @@ -206,6 +233,27 @@ void PhaseEulerHomogeneous::limitSlopes(const Phase& slopeGauche, const Phase& s m_alpha = volumeFractionLimiter.limiteSlope(slopeGauche.getAlpha(), slopeDroite.getAlpha()); } +//**************************************************************************** + +void PhaseEulerHomogeneous::setMin(const Phase& phase1, const Phase& phase2) +{ + m_alpha = std::min(phase1.getAlpha(), phase2.getAlpha()); +} + +//**************************************************************************** + +void PhaseEulerHomogeneous::setMax(const Phase& phase1, const Phase& phase2) +{ + m_alpha = std::max(phase1.getAlpha(), phase2.getAlpha()); +} + +//**************************************************************************** + +void PhaseEulerHomogeneous::computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope) +{ + m_alpha = std::min(m_alpha, globalLimiter.computeGradientLimiter(phase.getAlpha(), phaseMin.getAlpha(), phaseMax.getAlpha(), slope.getAlpha())); +} + //**************************************************************************** //************************** ORDER 2 PARALLEL ******************************** //**************************************************************************** diff --git a/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.h b/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.h index 13d88238..ee4f08c2 100644 --- a/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.h +++ b/src/Models/EulerHomogeneous/PhaseEulerHomogeneous.h @@ -74,14 +74,20 @@ class PhaseEulerHomogeneous : public Phase //--------------------------------------- virtual int numberOfTransmittedVariables() const; virtual void fillBuffer(double* buffer, int& counter) const; + virtual void fillBuffer(std::vector& dataToSend) const; virtual void getBuffer(double* buffer, int& counter, Eos** eos); + virtual void getBuffer(std::vector& dataToReceive, int& counter, Eos** eos); //Specific methods for second order //--------------------------------- virtual void computeSlopesPhase(const Phase& sLeft, const Phase& sRight, const double& distance); virtual void setToZero(); + virtual void setToMax(); virtual void extrapolate(const Phase& slope, const double& distance); virtual void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& /*globalLimiter*/, Limiter& volumeFractionLimiter); + virtual void setMin(const Phase& phase1, const Phase& phase2); + virtual void setMax(const Phase& phase1, const Phase& phase2); + virtual void computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope); //Specific methods for parallele computing at second order //-------------------------------------------------------- diff --git a/src/Models/EulerKorteweg/FluxEulerKorteweg.h b/src/Models/EulerKorteweg/FluxEulerKorteweg.h index ca5dc2bd..9512e6bb 100644 --- a/src/Models/EulerKorteweg/FluxEulerKorteweg.h +++ b/src/Models/EulerKorteweg/FluxEulerKorteweg.h @@ -50,8 +50,8 @@ class FluxEulerKorteweg : public Flux virtual void buildCons(Phase** phase, Mixture* /*mixture*/); virtual void buildPrim(Phase** phase, Mixture* /*mixture*/); virtual void setToZero(); - virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/) {}; - virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/) {}; + virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; + virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; virtual void addSymmetricTerms(Phase** /*phases*/, Mixture* /*mixture*/,const double& /*r*/, const double& /*v*/) {}; virtual void prepSourceTermsGravity(const Coord& /*g*/) {}; diff --git a/src/Models/EulerKorteweg/MixEulerKorteweg.h b/src/Models/EulerKorteweg/MixEulerKorteweg.h index 3b3d6296..a5d36cec 100644 --- a/src/Models/EulerKorteweg/MixEulerKorteweg.h +++ b/src/Models/EulerKorteweg/MixEulerKorteweg.h @@ -49,7 +49,7 @@ class MixEulerKorteweg : public Mixture virtual double computeFrozenSoundSpeed(const double* /*Yk*/, const double* /*ck*/) { return 0.; }; virtual void computeMixtureVariables(Phase** /*vecPhase*/) {}; - virtual void internalEnergyToTotalEnergy(std::vector& /*vecGPA*/) {}; + virtual void computeTotalEnergy(std::vector& /*vecGPA*/) {}; virtual void totalEnergyToInternalEnergy(std::vector& /*vecGPA*/) {}; virtual void localProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; diff --git a/src/Models/EulerKorteweg/ModEulerKorteweg.cpp b/src/Models/EulerKorteweg/ModEulerKorteweg.cpp index 66f1bb22..25ed1217 100644 --- a/src/Models/EulerKorteweg/ModEulerKorteweg.cpp +++ b/src/Models/EulerKorteweg/ModEulerKorteweg.cpp @@ -111,12 +111,12 @@ void ModEulerKorteweg::initializeAugmentedVariables(Cell* cell) //Eta phase->setEta(phase->getDensity()); //Omega - Coord gradRho(cell->computeGradient(density, 0)); + cell->computeGradients(gradRho, variableDensity, numeratorDefault); double omega(0.); //This variable may need to be manually initialized - omega = phase->getVelocity().norm() * gradRho.norm(); + omega = phase->getVelocity().norm() * gradRho[0].norm(); phase->setOmega(omega); //VectorP - phase->setVectorP(gradRho); + phase->setVectorP(gradRho[0]); //Pressure (not for NLS) if (phase->getEos() != nullptr) phase->setPressure(phase->getEos()->computePressure(phase->getDensity(), temperatureEK)); } @@ -184,16 +184,8 @@ void ModEulerKorteweg::solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const void ModEulerKorteweg::reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const { - Coord fluxProjete; - fluxProjete.setX(normal.getX()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjete.setY(normal.getY()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjete.setZ(normal.getZ()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuff)->m_momentum.getZ()); - static_cast (fluxBuff)->m_momentum.setXYZ(fluxProjete.getX(), fluxProjete.getY(), fluxProjete.getZ()); - - fluxProjete.setX(normal.getX()*static_cast (fluxBuff)->m_eqVectorP.getX() + tangent.getX()*static_cast (fluxBuff)->m_eqVectorP.getY() + binormal.getX()*static_cast (fluxBuff)->m_eqVectorP.getZ()); - fluxProjete.setY(normal.getY()*static_cast (fluxBuff)->m_eqVectorP.getX() + tangent.getY()*static_cast (fluxBuff)->m_eqVectorP.getY() + binormal.getY()*static_cast (fluxBuff)->m_eqVectorP.getZ()); - fluxProjete.setZ(normal.getZ()*static_cast (fluxBuff)->m_eqVectorP.getX() + tangent.getZ()*static_cast (fluxBuff)->m_eqVectorP.getY() + binormal.getZ()*static_cast (fluxBuff)->m_eqVectorP.getZ()); - static_cast (fluxBuff)->m_eqVectorP.setXYZ(fluxProjete.getX(), fluxProjete.getY(), fluxProjete.getZ()); + static_cast (fluxBuff)->m_momentum.reverseProjection(normal, tangent, binormal); + static_cast (fluxBuff)->m_eqVectorP.reverseProjection(normal, tangent, binormal); } //**************************************************************************** @@ -256,4 +248,38 @@ double ModEulerKorteweg::computeMaxWaveSpeed(Cell& cellLeft, Cell& cellRight, co return S; } +//**************************************************************************** +//******************************* Accessors ********************************** +//**************************************************************************** + +double ModEulerKorteweg::selectScalar(Phase** phases, Mixture* /*mixture*/, Transport* transports, Variable nameVariable, int num) const +{ + switch (nameVariable) { + case Variable::pressure: + return phases[0]->getPressure(); + break; + case Variable::density: + return phases[0]->getDensity(); + break; + case Variable::velocityU: + return phases[0]->getU(); + break; + case Variable::velocityV: + return phases[0]->getV(); + break; + case Variable::velocityW: + return phases[0]->getW(); + break; + case Variable::velocityMag: + return phases[0]->getVelocity().norm(); + break; + case Variable::transport: + return transports[num].getValue(); + break; + default: + Errors::errorMessage("nameVariable unknown in selectScalar"); return 0; + break; + } +} + //**************************************************************************** \ No newline at end of file diff --git a/src/Models/EulerKorteweg/ModEulerKorteweg.h b/src/Models/EulerKorteweg/ModEulerKorteweg.h index 255171e5..81041c26 100644 --- a/src/Models/EulerKorteweg/ModEulerKorteweg.h +++ b/src/Models/EulerKorteweg/ModEulerKorteweg.h @@ -83,6 +83,13 @@ class ModEulerKorteweg : public Model //Accessors //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** phases, Mixture* /*mixture*/, Transport* transports, Variable nameVariable, int num = 0) const; virtual const double& getSM() { Errors::errorMessage("getSM not available for required model"); return Errors::defaultDouble; }; virtual const Coord& getVelocity(const Cell* cell) const { return cell->getPhase(0)->getVelocity(); }; virtual Coord& getVelocity(Cell* cell) { return cell->getPhase(0)->getVelocity(); }; diff --git a/src/Models/EulerKorteweg/PhaseEulerKorteweg.cpp b/src/Models/EulerKorteweg/PhaseEulerKorteweg.cpp index b38b4982..aeb6701f 100644 --- a/src/Models/EulerKorteweg/PhaseEulerKorteweg.cpp +++ b/src/Models/EulerKorteweg/PhaseEulerKorteweg.cpp @@ -419,6 +419,13 @@ void PhaseEulerKorteweg::verifyAndCorrectPhase() if (m_density < 1.e-10) m_density = 1.e-10; } +//*************************************************************************** + +void PhaseEulerKorteweg::verifyAndCorrectDensityMax() +{ + m_eos->verifyAndCorrectDensityMax(m_density); +} + //**************************************************************************** //**************************** DATA ACCESSORS ******************************** //**************************************************************************** diff --git a/src/Models/EulerKorteweg/PhaseEulerKorteweg.h b/src/Models/EulerKorteweg/PhaseEulerKorteweg.h index 8519831a..2e6d90e3 100644 --- a/src/Models/EulerKorteweg/PhaseEulerKorteweg.h +++ b/src/Models/EulerKorteweg/PhaseEulerKorteweg.h @@ -98,6 +98,7 @@ class PhaseEulerKorteweg : public Phase //------------- virtual void verifyPhase(const std::string& message = "") const; virtual void verifyAndCorrectPhase(); + virtual void verifyAndCorrectDensityMax(); //Accessors //--------- diff --git a/src/Models/Flux.cpp b/src/Models/Flux.cpp index 292b08f8..3f8ff81c 100644 --- a/src/Models/Flux.cpp +++ b/src/Models/Flux.cpp @@ -32,6 +32,7 @@ std::vector sourceCons; Flux* fluxBuff; +Flux* fluxBuffMRF; //**************************************************************************** diff --git a/src/Models/Flux.h b/src/Models/Flux.h index cef7b849..869cf965 100644 --- a/src/Models/Flux.h +++ b/src/Models/Flux.h @@ -56,6 +56,12 @@ class Flux //! \brief Subtract flux to the corresponding model buffer flux //! \param coefA possibility to multiply the flux before subtraction (set 1.d0 if not needed) virtual void subtractFlux(double /*coefA*/){ Errors::errorMessage("subtractFlux not available for required model"); }; + //! \brief Add flux to the rotating region in MRF context + //! \param coefA possibility to multiply the flux before adding (set 1.d0 if not needed) + virtual void addFluxRotatingRegion(double /*coefA*/){ Errors::errorMessage("addFluxRotatingRegion not available for required model"); }; + //! \brief Subtract flux to the rotating region in MRF context + //! \param coefA possibility to multiply the flux before subtraction (set 1.d0 if not needed) + virtual void subtractFluxRotatingRegion(double /*coefA*/){ Errors::errorMessage("subtractFluxRotatingRegion not available for required model"); }; //! \brief multiply the flux of the corresponding model by a constant //! \param scalar constant virtual void multiply(double /*scalar*/){ Errors::errorMessage("multiply not available for required model"); }; @@ -73,17 +79,21 @@ class Flux virtual void buildPrim(Phase** /*phases*/, Mixture* /*mixture*/) { Errors::errorMessage("buildPrim not available for required model"); }; //! \brief set each attribute of the flux to zero virtual void setToZero(){ Errors::errorMessage("setToZero not available for required model"); }; - //! \brief set each attribute of the corresponding buffer flux to zero - virtual void setToZeroBufferFlux() { Errors::errorMessage("setToZero not available for required model"); }; //! \brief Add non conservative term to the flux //! \param coefA possibility to multiply the non conservative term before adding (set 1.d0 if not needed) //! \param cell reference cell used to approximate the non conservative term - virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/){ Errors::errorMessage("addNonCons not available for required model"); }; + //! \param normal normal vector of the treated face + //! \param tangent tangent vector of the treated face + //! \param binormal binormal vector of the treated face + virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/){ Errors::errorMessage("addNonCons not available for required model"); }; //! \brief Subtract non conservative term to the flux //! \param coefA possibility to multiply the non conservative term before subtraction (set 1.d0 if not needed) //! \param cell reference cell used to approximate the non conservative term - virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/){ Errors::errorMessage("subtractNonCons not available for required model"); }; + //! \param normal normal vector of the treated face + //! \param tangent tangent vector of the treated face + //! \param binormal binormal vector of the treated face + virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/){ Errors::errorMessage("subtractNonCons not available for required model"); }; //! \brief Method to correct energy in non conservative models using total energy conservation //! \param cell cell to correct //! \param type enumeration allowing to correct either state in the cell or second order half time step state @@ -107,6 +117,9 @@ class Flux virtual void addFluxSmooth1D(double /*coefA*/, const Coord& /*normal*/, Cell* /*cell*/) { Errors::errorMessage("addFluxSmooth1D not available for required model"); }; //! \brief Compute additionnal flux for 1D geometry with smooth varying cross section virtual void substractFluxSmooth1D(double /*coefA*/, const Coord& /*normal*/, Cell* /*cell*/) { Errors::errorMessage("substractFluxSmooth1D not available for required model"); }; + + //Moving Reference Frame + virtual void addNonConsMrfFlux(Phase** /*phases*/) { Errors::errorMessage("addNonConsMrfFlux not available for required model"); }; // Accessors //---------- @@ -118,18 +131,21 @@ class Flux virtual const double& getEqEta() const { Errors::errorMessage("getEqEta not available for required model"); return Errors::defaultDouble; }; virtual const double& getEnergy(const int& /*numPhase*/) const { Errors::errorMessage("getEnergy not available for required model"); return Errors::defaultDouble; }; virtual const double& getTotEnergy(const int& /*numPhase*/) const { Errors::errorMessage("getTotEnergy not available for required model"); return Errors::defaultDouble; }; + virtual const double& getLambda(const int& /*numPhase*/) const { Errors::errorMessage("getLambda not available for required model"); return Errors::defaultDouble; }; + virtual const Tensor& getCobase(const int& /*numPhase*/) const { Errors::errorMessage("getCobase not available for required model"); return Tensor::defaultTensor; }; virtual const Coord& getMomentum() const { Errors::errorMessage("getMomentum not available for required model"); return Coord::defaultCoord; }; virtual const Coord& getEqVectorP() const { Errors::errorMessage("getEqVectorP not available for required model"); return Coord::defaultCoord; }; virtual void setCons(const Flux* /*cons*/) { Errors::errorMessage("setCons not available for required model"); }; protected: - double m_sM; //!< Fluid velocity for intercell interfaces + double m_sM; //!< Fluid velocity for intercell interfaces double m_uStar; //!< Velocity solution of the Riemann problem !VERY IMPORTANT! DO NOT ERASE! private: }; extern std::vector sourceCons; extern Flux* fluxBuff; +extern Flux* fluxBuffMRF; #endif // FLUX_H diff --git a/src/Models/GradMixture.cpp b/src/Models/GradMixture.cpp new file mode 100644 index 00000000..a7cf4048 --- /dev/null +++ b/src/Models/GradMixture.cpp @@ -0,0 +1,62 @@ +#include "GradMixture.h" +#include "../Order2/CellO2NS.h" + +std::vector variableNamesMixture; +std::vector numeratorMixture; + +//*************************************************************************** + +GradMixture::GradMixture() {} + +//*************************************************************************** + +GradMixture::~GradMixture() {} + +//*************************************************************************** + +void GradMixture::initializeGradsVariablesNamesNumerators() +{ + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } + + numeratorMixture.resize(m_grads.size()); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + numeratorMixture[i] = -1; + } + + variableNamesMixture.resize(m_grads.size()); +} + +//*************************************************************************** + +void GradMixture::computeGradients(Cell* cell) +{ + cell->computeGradients(m_grads, variableNamesMixture, numeratorMixture); +} + +//*************************************************************************** +//************************** ORDER 2 PARALLEL ******************************* +//*************************************************************************** + +void GradMixture::getBufferGradients(double * buffer, int& counter) +{ + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i].setX(buffer[++counter]); + m_grads[i].setY(buffer[++counter]); + m_grads[i].setZ(buffer[++counter]); + } +} + +//*************************************************************************** + +void GradMixture::fillBufferGradients(double * buffer, int& counter) +{ + for (unsigned int i = 0; i < m_grads.size(); ++i) { + buffer[++counter] = m_grads[i].getX(); + buffer[++counter] = m_grads[i].getY(); + buffer[++counter] = m_grads[i].getZ(); + } +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Models/GradMixture.h b/src/Models/GradMixture.h new file mode 100644 index 00000000..66d55462 --- /dev/null +++ b/src/Models/GradMixture.h @@ -0,0 +1,70 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADMIXTURE_H +#define GRADMIXTURE_H + +#include "../Tools.h" + +class Cell; +class Mixture; + +#include "../Maths/Coord.h" + +//! \class GradMixture +//! \brief Mixture variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradMixture +{ +public: + GradMixture(); + virtual ~GradMixture(); + + virtual void initializeGradientVectors() { Errors::errorMessage("initializeGradientVectors not available for required GradMixture"); }; + + virtual void computeGradients(Cell* cell); + virtual void computeDistanceGradientScalarProduct(Coord const& /*distance*/, Mixture* /*mixture*/) const { Errors::errorMessage("computeDistanceGradientScalarProduct not available for required GradMixture"); }; + virtual void limitGradients(const Mixture& /*gradientLimiter*/) { Errors::errorMessage("limitGradients not available for required GradMixture"); }; + + // -- O2 parallel -- + virtual int numberOfTransmittedGradients() const { Errors::errorMessage("numberOfTransmittedGradients not available for required GradMixture"); return Errors::defaultInt; }; + virtual void getBufferGradients(double * buffer, int& counter); + virtual void fillBufferGradients(double * buffer, int& counter); + +protected: + void initializeGradsVariablesNamesNumerators(); + + std::vector m_grads; //!< Vector of gradients of the mixture flow variables +}; + +extern std::vector variableNamesMixture; //!< Variable names of the corresponding gradients (for mixture) +extern std::vector numeratorMixture; //!< Default number (not used for mixture variables) + +#endif \ No newline at end of file diff --git a/src/Models/GradPhase.cpp b/src/Models/GradPhase.cpp new file mode 100644 index 00000000..83e562dc --- /dev/null +++ b/src/Models/GradPhase.cpp @@ -0,0 +1,61 @@ +#include "GradPhase.h" +#include "../Order2/CellO2NS.h" + +std::vector variableNamesPhases; +std::vector> numeratorPhases; + +//*************************************************************************** + +GradPhase::GradPhase() {} + +//*************************************************************************** + +GradPhase::~GradPhase() {} + +//*************************************************************************** + +void GradPhase::initializeGradsVariablesNamesNumerators() +{ + numeratorPhases.resize(numberPhases); + for (int i = 0; i < numberPhases; ++i) { + numeratorPhases[i].resize(m_grads.size()); + for (unsigned int j = 0; j < m_grads.size(); ++j) { + numeratorPhases[i][j] = i; + } + } + + variableNamesPhases.resize(m_grads.size()); +} + +//*************************************************************************** + +void GradPhase::computeGradients(Cell* cell, int const& phase) +{ + cell->computeGradients(m_grads, variableNamesPhases, numeratorPhases[phase]); +} + +//*************************************************************************** +//************************** ORDER 2 PARALLEL ******************************* +//*************************************************************************** + +void GradPhase::getBufferGradients(double * buffer, int& counter) +{ + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i].setX(buffer[++counter]); + m_grads[i].setY(buffer[++counter]); + m_grads[i].setZ(buffer[++counter]); + } +} + +//*************************************************************************** + +void GradPhase::fillBufferGradients(double * buffer, int& counter) +{ + for (unsigned int i = 0; i < m_grads.size(); ++i) { + buffer[++counter] = m_grads[i].getX(); + buffer[++counter] = m_grads[i].getY(); + buffer[++counter] = m_grads[i].getZ(); + } +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Models/GradPhase.h b/src/Models/GradPhase.h new file mode 100644 index 00000000..0779cd5e --- /dev/null +++ b/src/Models/GradPhase.h @@ -0,0 +1,69 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADPHASE_H +#define GRADPHASE_H + +#include "../Maths/Coord.h" +#include "../Tools.h" + +class Cell; +class Phase; + +//! \class GradPhase +//! \brief Phase variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradPhase +{ +public: + GradPhase(); + virtual ~GradPhase(); + + virtual void initializeGradientVectors() { Errors::errorMessage("initializeGradientVectors not available for required GradPhase"); }; + + virtual void computeGradients(Cell* cell, int const& phase); + virtual void computeDistanceGradientScalarProduct(Coord const& /*distance*/, Phase* /*phase*/) const { Errors::errorMessage("computeDistanceGradientScalarProduct not available for required GradPhase"); }; + virtual void limitGradients(const Phase& /*gradientLimiter*/) { Errors::errorMessage("limitGradients not available for required GradPhase"); }; + + // -- O2 parallel -- + virtual int numberOfTransmittedGradients() const { Errors::errorMessage("numberOfTransmittedGradients not available for required GradPhase"); return Errors::defaultInt; }; + virtual void getBufferGradients(double* buffer, int& counter); + virtual void fillBufferGradients(double* buffer, int& counter); + +protected: + void initializeGradsVariablesNamesNumerators(); + + std::vector m_grads; //!< Vector of gradients of the phase flow variables +}; + +extern std::vector variableNamesPhases; //!< Variable names of the corresponding gradients (for phases) +extern std::vector> numeratorPhases; //!< Numerator of the computed phase for gradients (for phases) + +#endif \ No newline at end of file diff --git a/src/Models/Mixture.cpp b/src/Models/Mixture.cpp index 41833f86..ebdc3cd9 100644 --- a/src/Models/Mixture.cpp +++ b/src/Models/Mixture.cpp @@ -99,4 +99,67 @@ double Mixture::computeTsat(const Eos* eosLiq, const Eos* eosVap, const double& return Tsat; } +//*************************************************************************** + +double Mixture::computePsat(const Eos* eosLiq, const Eos* eosVap, const double& temp) +{ + if (eosLiq->getType() != TypeEOS::IG && eosLiq->getType() != TypeEOS::SG) { Errors::errorMessage("Only IG and SG permitted saturation pressure computation"); } + if (eosVap->getType() != TypeEOS::IG && eosVap->getType() != TypeEOS::SG) { Errors::errorMessage("Only IG and SG permitted saturation pressure computation"); } + + double gammaL = eosLiq->getGamma(); + double pInfL = eosLiq->getPInf(); + double cvL = eosLiq->getCv(); + double e0L = eosLiq->getERef(); + double s0L = eosLiq->getSRef(); + + double gammaV = eosVap->getGamma(); + double pInfV = eosVap->getPInf(); + double cvV = eosVap->getCv(); + double e0V = eosVap->getERef(); + double s0V = eosVap->getSRef(); + + double A, B, C, D; + A = (gammaL*cvL - gammaV*cvV + s0V - s0L) / (gammaV*cvV - cvV); + B = (e0L - e0V) / (gammaV*cvV - cvV); + C = (gammaV*cvV - gammaL*cvL) / (gammaV*cvV - cvV); + D = (gammaL*cvL - cvL) / (gammaV*cvV - cvV); + + //iterative process to catch saturation pressure + int iteration(0); + double psat(2.e5); + double f(0.), df(1.); + do { + psat -= f / df; iteration++; + if (iteration > 50) { + errors.push_back(Errors("Newton-Raphson has not converged in Mixture::computePsat", __FILE__, __LINE__)); + break; + } + f = psat + pInfV - exp( A + B / temp + C * log(temp) ) * std::pow(psat + pInfL, D); + df = 1. - exp( A + B / temp + C * log(temp)) * D * std::pow(psat + pInfL, D - 1.); + } while (std::fabs(f) > 1.e-8); + + return psat; +} + +//*************************************************************************** + +double Mixture::computeCriticalPressure(const Eos* eosLiq, const Eos* eosVap) +{ + double pCrit(0.); + + double gammaL = eosLiq->getGamma(); + double pInfL = eosLiq->getPInf(); + double cvL = eosLiq->getCv(); + + double gammaV = eosVap->getGamma(); + double pInfV = eosVap->getPInf(); + double cvV = eosVap->getCv(); + + // vVsat = vLsat at critical point + pCrit = pInfL * (gammaV - 1.) * cvV - pInfV * (gammaL - 1.) * cvL; + pCrit /= (gammaL - 1.) * cvL - (gammaV - 1.) * cvV; + + return pCrit; +} + //*************************************************************************** \ No newline at end of file diff --git a/src/Models/Mixture.h b/src/Models/Mixture.h index 12d88658..8fbc548d 100644 --- a/src/Models/Mixture.h +++ b/src/Models/Mixture.h @@ -54,38 +54,49 @@ class Mixture //! \param pressure pressure //! \param dTsat temperature derivative as function of pressure //! \return saturation temperature - //virtual double computeTsat(const Eos* eosLiq, const Eos* eosVap, const double& pressure, double* dTsat=0) { Errors::errorMessage("computeTsat not available for required mixture"); return 0.; }; + //virtual double computeTsat(const Eos* eosLiq, const Eos* eosVap, const double& pressure, double* dTsat=0) { Errors::errorMessage("computeTsat not available for requested mixture"); return 0.; }; double computeTsat(const Eos* eosLiq, const Eos* eosVap, const double& pressure, double* dTsat = 0); + //! \brief Compute saturation pressure for a liq/vapor couple of fluid at given pressure + //! \param eosLiq pointer to equation of state of liquid phase + //! \param eosVap pointer to equation of state of vapor phase + //! \param temp temperature + //! \return saturation pressure + double computePsat(const Eos* eosLiq, const Eos* eosVap, const double& temp); + + //! \brief Compute the theoritical critical pressure + //! \param eosLiq pointer to equation of state of liquid phase + //! \param eosVap pointer to equation of state of vapor phase + double computeCriticalPressure(const Eos* eosLiq, const Eos* eosVap); //! \brief Copy mixture attributes in mixture //! \param mixture destination mixture variable - virtual void allocateAndCopyMixture(Mixture** /*mixture*/) { Errors::errorMessage("allocateAndCopyMixture not available for required mixture"); }; + virtual void allocateAndCopyMixture(Mixture** /*mixture*/) { Errors::errorMessage("allocateAndCopyMixture not available for requested mixture"); }; //! \brief Copy mixture in mixture attributes //! \param mixture source mixture to copy - virtual void copyMixture(Mixture& /*mixture*/) { Errors::errorMessage("copyMixture not available for required mixture"); }; + virtual void copyMixture(Mixture& /*mixture*/) { Errors::errorMessage("copyMixture not available for requested mixture"); }; //! \brief Compute mixture density //! \param alphak phase volume fraction array //! \param rhok phase density array //! \return mixture density - virtual double computeDensity(const double* /*alphak*/, const double* /*rhok*/) { Errors::errorMessage("computeDensity not available for required mixture"); return 0.; }; + virtual double computeDensity(const double* /*alphak*/, const double* /*rhok*/) { Errors::errorMessage("computeDensity not available for requested mixture"); return 0.; }; //! \brief Compute mixture pressure //! \param alphak phase volume fraction array //! \param pk phase pressure array //! \return mixture pressure - virtual double computePressure(const double* /*alphak*/, const double* /*pk*/) { Errors::errorMessage("computePressure not available for required mixture"); return 0.; }; - virtual double computePressure(double* /*masses*/, const double& /*mixInternalEnerg*/, Phase** /*phases*/) { Errors::errorMessage("computePressure not available for required mixture"); return 0.; }; - virtual double computePressure(double /*mass*/, const double& /*internalEnergy*/, Phase** /*phases*/, Mixture* /*mixture*/, const int& /*liq*/, const int& /*vap*/) { Errors::errorMessage("computePressure not available for required mixture"); return 0.; }; - virtual double computeTemperature(double* /*masses*/, const double& /*pressure*/, Phase** /*phases*/) { Errors::errorMessage("computeTemperature not available for required mixture"); return 0.; }; + virtual double computePressure(const double* /*alphak*/, const double* /*pk*/) { Errors::errorMessage("computePressure not available for requested mixture"); return 0.; }; + virtual double computePressure(double* /*masses*/, const double& /*mixInternalEnerg*/, Phase** /*phases*/) { Errors::errorMessage("computePressure not available for requested mixture"); return 0.; }; + virtual double computePressure(double /*mass*/, const double& /*internalEnergy*/, Phase** /*phases*/, Mixture* /*mixture*/, const int& /*liq*/, const int& /*vap*/) { Errors::errorMessage("computePressure not available for requested mixture"); return 0.; }; + virtual double computeTemperature(double* /*masses*/, const double& /*pressure*/, Phase** /*phases*/) { Errors::errorMessage("computeTemperature not available for requested mixture"); return 0.; }; //! \brief Compute mixture specific internal energy //! \param Yk phase mass fraction array //! \param ek phase specific internal energy array //! \return mixture specific internal energy - virtual double computeInternalEnergy(const double* /*Yk*/, const double* /*ek*/) { Errors::errorMessage("computeInternalEnergy not available for required mixture"); return 0.; }; + virtual double computeInternalEnergy(const double* /*Yk*/, const double* /*ek*/) { Errors::errorMessage("computeInternalEnergy not available for requested mixture"); return 0.; }; //! \brief Compute mixture frozen speed of sound //! \param Yk phase mass fraction array //! \param ck phase speed of sound array //! \return mixture frozen speed of sound - virtual double computeFrozenSoundSpeed(const double* /*Yk*/, const double* /*ck*/) { Errors::errorMessage("computeFrozenSoundSpeed not available for required mixture"); return 0.; }; + virtual double computeFrozenSoundSpeed(const double* /*Yk*/, const double* /*ck*/) { Errors::errorMessage("computeFrozenSoundSpeed not available for requested mixture"); return 0.; }; //! \brief Compute temperature for a mixture evolving at thermal equilibrium along mixture isentropic path //! \param Yk array of mass fractions @@ -94,7 +105,7 @@ class Mixture //! \param p final pressure //! \param dTdp derivative according to pressure //! \return temperature after isentropic path - virtual double computeTemperatureIsentrope(const double* /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dTdp*/ = 0) { Errors::errorMessage("computeTemperatureIsentrope not available for required mixture"); return 0.; }; + virtual double computeTemperatureIsentrope(const double* /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dTdp*/ = 0) { Errors::errorMessage("computeTemperatureIsentrope not available for requested mixture"); return 0.; }; //! \brief Compute mixture enthalpy for a mixture evolving at thermal equilibrium along mixture isentropic path //! \param Yk array of mass fractions //! \param p0 initial pressure @@ -102,7 +113,7 @@ class Mixture //! \param p final pressure //! \param dhdp derivative according to pressure //! \return enthalpy after isentropic path - virtual double computeEnthalpyIsentrope(const double* /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dhdp*/ = 0) { Errors::errorMessage("computeEnthalpyIsentrope not available for required mixture"); return 0.; }; + virtual double computeEnthalpyIsentrope(const double* /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dhdp*/ = 0) { Errors::errorMessage("computeEnthalpyIsentrope not available for requested mixture"); return 0.; }; //! \brief Compute mixture specific volume for a mixture evolving at thermal equilibrium along mixture isentropic path //! \param Yk array of mass fractions //! \param p0 initial pressure @@ -110,37 +121,37 @@ class Mixture //! \param p final pressure //! \param dvdp derivative according to pressure //! \return specific volume after isentropic path - virtual double computeVolumeIsentrope(const double* /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dvdp*/ = 0) { Errors::errorMessage("computeVolumeIsentrope not available for required mixture"); return 0.; }; + virtual double computeVolumeIsentrope(const double* /*Yk*/, const double& /*p0*/, const double& /*T0*/, const double& /*p*/, double* /*dvdp*/ = 0) { Errors::errorMessage("computeVolumeIsentrope not available for requested mixture"); return 0.; }; //! \brief Fills some mixture attributes from a phase array //! \param vecPhase phase array - virtual void computeMixtureVariables(Phase** /*vecPhase*/) { Errors::errorMessage("computeMixtureVariables not available for required mixture"); }; + virtual void computeMixtureVariables(Phase** /*vecPhase*/) { Errors::errorMessage("computeMixtureVariables not available for requested mixture"); }; //! \brief Compute mixture total specific energy from internal one taking account for energies associated to extra physics //! \param vecGPA vector of additional physics variables - virtual void internalEnergyToTotalEnergy(std::vector& /*vecGPA*/) { Errors::errorMessage("internalEnergyToTotalEnergy not available for required mixture"); }; + virtual void computeTotalEnergy(std::vector& /*vecGPA*/) { Errors::errorMessage("internalEnergyToTotalEnergy not available for requested mixture"); }; //! \brief Compute mixture internal specific energy from total one taking account for energies associated to extra physics //! \param vecGPA vector of additional physics variables - virtual void totalEnergyToInternalEnergy(std::vector& /*vecGPA*/) { Errors::errorMessage("totalEnergyToInternalEnergy not available for required mixture"); }; + virtual void totalEnergyToInternalEnergy(std::vector& /*vecGPA*/) { Errors::errorMessage("totalEnergyToInternalEnergy not available for requested mixture"); }; //! \brief velocity vector projection in a local Cartesian coordinate system //! \param normal normal vector associated to the cell interface //! \param tangent tangent vector associated to the cell interface //! \param binormal binormal vector associated to the cell interface - virtual void localProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Errors::errorMessage("localProjection not available for required mixture"); }; + virtual void localProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Errors::errorMessage("localProjection not available for requested mixture"); }; //! \brief velocity vector reverse projection in the absolute Cartesian coordinate system //! \param normal normal vector associated to the cell interface //! \param tangent tangent vector associated to the cell interface //! \param binormal binormal vector associated to the cell interface - virtual void reverseProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Errors::errorMessage("reverseProjection not available for required mixture"); }; + virtual void reverseProjection(const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Errors::errorMessage("reverseProjection not available for requested mixture"); }; //Specific methods for data printing //---------------------------------- - virtual int getNumberScalars() const { Errors::errorMessage("getNumberScalars non implemente pour mixture utilise"); return 0; }; - virtual int getNumberVectors() const { Errors::errorMessage("getNumberVectors non implemente pour mixture utilise"); return 0; }; - virtual double returnScalar(const int& /*numVar*/) const { Errors::errorMessage("returnScalar non implemente pour mixture utilise"); return 0.; }; - virtual Coord returnVector(const int& /*numVar*/) const { Errors::errorMessage("returnVector non implemente pour mixture utilise"); return 0; }; - virtual std::string returnNameScalar(const int& /*numVar*/) const { Errors::errorMessage("returnNameScalar non implemente pour mixture utilise"); return 0; }; - virtual std::string returnNameVector(const int& /*numVar*/) const { Errors::errorMessage("returnNameVector non implemente pour mixture utilise"); return 0; }; + virtual int getNumberScalars() const { Errors::errorMessage("getNumberScalars not available for requested mixture"); return 0; }; + virtual int getNumberVectors() const { Errors::errorMessage("getNumberVectors not available for requested mixture"); return 0; }; + virtual double returnScalar(const int& /*numVar*/) const { Errors::errorMessage("returnScalar not available for requested mixture"); return 0.; }; + virtual Coord returnVector(const int& /*numVar*/) const { Errors::errorMessage("returnVector not available for requested mixture"); return 0; }; + virtual std::string returnNameScalar(const int& /*numVar*/) const { Errors::errorMessage("returnNameScalar not available for requested mixture"); return 0; }; + virtual std::string returnNameVector(const int& /*numVar*/) const { Errors::errorMessage("returnNameVector not available for requested mixture"); return 0; }; //Specific method for reading from file //------------------------------------- @@ -149,55 +160,66 @@ class Mixture //Specific methods for parallel computing //--------------------------------------- - virtual int numberOfTransmittedVariables() const { Errors::errorMessage("numberOfTransmittedVariables non implemente pour mixture utilise"); return 0; }; - virtual void fillBuffer(double* /*buffer*/, int& /*counter*/) const { Errors::errorMessage("fillBuffer non implemente pour mixture utilise"); }; - virtual void fillBuffer(std::vector& /*dataToSend*/) const { Errors::errorMessage("fillBuffer non implemente pour mixture utilise"); }; - virtual void getBuffer(double* /*buffer*/, int& /*counter*/) { Errors::errorMessage("getBuffer non implemente pour mixture utilise"); }; - virtual void getBuffer(std::vector& /*dataToReceive*/, int& /*counter*/) { Errors::errorMessage("getBuffer non implemente pour mixture utilise"); }; + virtual int numberOfTransmittedVariables() const { Errors::errorMessage("numberOfTransmittedVariables not available for requested mixture type"); return 0; }; + virtual void fillBuffer(double* /*buffer*/, int& /*counter*/) const { Errors::errorMessage("fillBuffer not available for requested mixture type"); }; + virtual void fillBuffer(std::vector& /*dataToSend*/) const { Errors::errorMessage("fillBuffer not available for requested mixture type"); }; + virtual void getBuffer(double* /*buffer*/, int& /*counter*/) { Errors::errorMessage("getBuffer not available for requested mixture type"); }; + virtual void getBuffer(std::vector& /*dataToReceive*/, int& /*counter*/) { Errors::errorMessage("getBuffer not available for requested mixture type"); }; //Specific methods for second order //--------------------------------- virtual void computeSlopesMixture(const Mixture& /*sLeft*/, const Mixture& /*sRight*/, const double& /*distance*/) { Errors::errorMessage("computeSlopesMixture non implemente pour mixture utilise"); }; - virtual void setToZero() { Errors::errorMessage("setToZero non implemente pour mixture utilise"); }; + virtual void setToZero() { Errors::errorMessage("setToZero not available for requested mixture type"); }; + virtual void setToMax() { Errors::errorMessage("setToMax not available for requested mixture type"); }; virtual void extrapolate(const Mixture& /*slope*/, const double& /*distance*/) { Errors::errorMessage("extrapolate non implemente pour mixture utilise"); }; virtual void limitSlopes(const Mixture& /*slopeGauche*/, const Mixture& /*slopeDroite*/, Limiter& /*globalLimiter*/) { Errors::errorMessage("limitSlopes non implemente pour mixture utilise"); }; + virtual void setMin(const Mixture& /*mixture1*/, const Mixture& /*mixture2*/) { Errors::errorMessage("setMin not available for requested mixture type"); }; + virtual void setMax(const Mixture& /*mixture1*/, const Mixture& /*mixture2*/) { Errors::errorMessage("setMax not available for requested mixture type"); }; + virtual void computeGradientLimiter(const Limiter& /*globalLimiter*/, const Mixture& /*mixture*/, const Mixture& /*mixtureMin*/, const Mixture& /*mixtureMax*/, const Mixture& /*slope*/) { Errors::errorMessage("computeGradientLimiter not available for requested mixture type"); }; //Specific methods for parallele computing at second order //-------------------------------------------------------- - virtual int numberOfTransmittedSlopes() const { Errors::errorMessage("numberOfTransmittedSlopes non implemente pour mixture utilise"); return 0; }; - virtual void fillBufferSlopes(double* /*buffer*/, int& /*counter*/) const { Errors::errorMessage("fillBufferSlopes non implemente pour mixture utilise"); }; - virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/) { Errors::errorMessage("getBufferSlopes non implemente pour mixture utilise"); }; + virtual int numberOfTransmittedSlopes() const { Errors::errorMessage("numberOfTransmittedSlopes not available for requested mixture"); return 0; }; + virtual void fillBufferSlopes(double* /*buffer*/, int& /*counter*/) const { Errors::errorMessage("fillBufferSlopes not available for requested mixture"); }; + virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/) { Errors::errorMessage("getBufferSlopes not available for requested mixture"); }; //Accessors //--------- - virtual const double& getDensity() const { Errors::errorMessage("getDensity not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getPressure() const { Errors::errorMessage("getPressure not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getTemperature() const { Errors::errorMessage("getTemperature not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getU() const { Errors::errorMessage("getU not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getV() const { Errors::errorMessage("getV not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getW() const { Errors::errorMessage("getW not available for required mixture"); return Errors::defaultDouble; }; - virtual const Coord& getVelocity() const { Errors::errorMessage("getVelocity not available for required mixture"); return Coord::defaultCoord; }; - virtual Coord& getVelocity() { Errors::errorMessage("getVelocity not available for required mixture"); return Coord::defaultCoordNonConst; }; - virtual const double& getEnergy() const { Errors::errorMessage("getEnergy not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getTotalEnergy() const { Errors::errorMessage("getTotalEnergy not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getFrozenSoundSpeed() const { Errors::errorMessage("getFrozenSoundSpeed not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getWoodSoundSpeed() const { Errors::errorMessage("getWoodSoundSpeed not available for required mixture"); return Errors::defaultDouble; }; - virtual const double& getMixSoundSpeed() const { Errors::errorMessage("getMixSoundSpeed not available for required mixture"); return Errors::defaultDouble; }; - - virtual void setPressure(const double& /*p*/) { Errors::errorMessage("setPressure non implemente pour mixture utilise"); }; - virtual void setTemperature(const double& /*T*/) { Errors::errorMessage("setTemperature non implemente pour mixture utilise"); } - virtual void setVelocity(const double& /*u*/, const double& /*v*/, const double& /*w*/) { Errors::errorMessage("setVelocity non implemente pour mixture utilise"); }; - virtual void setVelocity(const Coord& /*vit*/) { Errors::errorMessage("setVelocity non implemente pour mixture utilise"); }; - virtual void setU(const double& /*u*/) { Errors::errorMessage("setU non implemente pour mixture utilise"); }; - virtual void setV(const double& /*v*/) { Errors::errorMessage("setV non implemente pour mixture utilise"); }; - virtual void setW(const double& /*w*/) { Errors::errorMessage("setW non implemente pour mixture utilise"); }; - virtual void setTotalEnergy(double& /*totalEnergy*/) { Errors::errorMessage("setTotalEnergy not available for required mixture"); }; + virtual const double& getDensity() const { Errors::errorMessage("getDensity not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getPressure() const { Errors::errorMessage("getPressure not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getTemperature() const { Errors::errorMessage("getTemperature not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getU() const { Errors::errorMessage("getU not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getV() const { Errors::errorMessage("getV not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getW() const { Errors::errorMessage("getW not available for requested mixture"); return Errors::defaultDouble; }; + virtual const Coord& getVelocity() const { Errors::errorMessage("getVelocity not available for requested mixture"); return Coord::defaultCoord; }; + virtual Coord& getVelocity() { Errors::errorMessage("getVelocity not available for requested mixture"); return Coord::defaultCoordNonConst; }; + virtual const double& getEnergy() const { Errors::errorMessage("getEnergy not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getTotalEnergy() const { Errors::errorMessage("getTotalEnergy not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getFrozenSoundSpeed() const { Errors::errorMessage("getFrozenSoundSpeed not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getWoodSoundSpeed() const { Errors::errorMessage("getWoodSoundSpeed not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getMixSoundSpeed() const { Errors::errorMessage("getMixSoundSpeed not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getEnergyCompaction() const { Errors::errorMessage("getEnergyCompaction not available for requested mixture"); return Errors::defaultDouble; }; + virtual const double& getEnergyElastic() const { Errors::errorMessage("getEnergyElastic not available for requested mixture"); return Errors::defaultDouble; }; + virtual const Tensor& getStressTensor() const { Errors::errorMessage("getStressTensor not available for requested mixture"); return Tensor::defaultTensor; }; + virtual Tensor& getStressTensor() { Errors::errorMessage("getStressTensor not available for requested mixture"); return Tensor::defaultTensorNonConst; }; + + virtual void setPressure(const double& /*p*/) { Errors::errorMessage("setPressure not available for requested mixture"); }; + virtual void setTemperature(const double& /*T*/) { Errors::errorMessage("setTemperature not available for requested mixture"); } + virtual void setVelocity(const double& /*u*/, const double& /*v*/, const double& /*w*/) { Errors::errorMessage("setVelocity not available for requested mixture"); }; + virtual void setVelocity(const Coord& /*vit*/) { Errors::errorMessage("setVelocity not available for requested mixture"); }; + virtual void setU(const double& /*u*/) { Errors::errorMessage("setU not available for requested mixture"); }; + virtual void setV(const double& /*v*/) { Errors::errorMessage("setV not available for requested mixture"); }; + virtual void setW(const double& /*w*/) { Errors::errorMessage("setW not available for requested mixture"); }; + virtual void setTotalEnergy(double& /*totalEnergy*/) { Errors::errorMessage("setTotalEnergy not available for requested mixture"); }; + virtual void setEnergyCompaction(const double& /*energyCompaction*/) { Errors::errorMessage("setEnergyCompaction not available for requested mixture"); }; + virtual void setEnergyElastic(const double& /*energyElastic*/) { Errors::errorMessage("setEnergyElastic not available for requested mixture"); }; + virtual void setStressTensor(const Tensor& /*stressTensor*/) { Errors::errorMessage("setStressTensor not available for requested mixture"); }; //Operators //--------- - virtual void changeSign() { Errors::errorMessage("changeSign non implemente pour mixture utilise"); }; - virtual void multiplyAndAdd(const Mixture& /*slopesMixtureTemp*/, const double& /*coeff*/) { Errors::errorMessage("multiplyAndAdd non implemente pour mixture utilise"); }; - virtual void divide(const double& /*coeff*/) { Errors::errorMessage("divide non implemente pour mixture utilise"); }; + virtual void changeSign() { Errors::errorMessage("changeSign not available for requested mixture"); }; + virtual void multiplyAndAdd(const Mixture& /*slopesMixtureTemp*/, const double& /*coeff*/) { Errors::errorMessage("multiplyAndAdd not available for requested mixture"); }; + virtual void divide(const double& /*coeff*/) { Errors::errorMessage("divide not available for requested mixture"); }; protected: private: diff --git a/src/Models/Model.cpp b/src/Models/Model.cpp index 5387ed78..17335459 100644 --- a/src/Models/Model.cpp +++ b/src/Models/Model.cpp @@ -33,7 +33,7 @@ //*********************************************************************** Model::Model(const std::string& name, const int& numbTransports) : - m_name(name), m_lowMach(false), m_smoothCrossSection1d(false) + m_name(name), m_lowMach(false), m_machRefMin(1.e-2), m_smoothCrossSection1d(false) { fluxBufferTransport = 0; if (numbTransports > 0) { fluxBufferTransport = new Transport[numbTransports]; } @@ -58,6 +58,15 @@ void Model::allocateEos(Cell& cell) const //*********************************************************************** +void Model::initializeRelaxation(Cell* cell) const +{ + for (unsigned int r = 0; r < m_relaxations.size(); r++) { + m_relaxations[r]->initializeCriticalPressure(cell); + } +} + +//*********************************************************************** + void Model::relaxations(Cell* cell, const double& dt, Prim type) const { for (unsigned int r = 0; r < m_relaxations.size(); r++) { @@ -72,4 +81,4 @@ void Model::printInfo() const std::cout << "Model : " << m_name << std::endl; } -//*********************************************************************** \ No newline at end of file +//*********************************************************************** diff --git a/src/Models/Model.h b/src/Models/Model.h index 824519f8..dc38d198 100644 --- a/src/Models/Model.h +++ b/src/Models/Model.h @@ -37,6 +37,8 @@ class Model; //Predeclaration of class to include following .h #include "../Maths/Coord.h" #include "../Errors.h" #include "../Relaxations/Relaxation.h" +#include "GradPhase.h" +#include "GradMixture.h" //Only boundary Riemann solvers require to extract interface data for output //This vector allows to use default value for intern Riemann solvers @@ -56,15 +58,30 @@ class Model //! \brief Allocate conservative variable arrays //! \param cons conservative variable array to allocate virtual void allocateCons(Flux** /*cons*/) { Errors::errorMessage("allocateCons not available for required model"); }; - //! \brief Instanciate phase variable + //! \brief Instanciate fluid phase variable //! \param phase phase to instanciate virtual void allocatePhase(Phase** /*phase*/) { Errors::errorMessage("allocatePhase not available for required model"); }; + //! \brief Instanciate solid phase variable + //! \param phase phase to instanciate + virtual void allocatePhaseSolid(Phase** /*phase*/) {}; + //! \brief Instanciate gradient phase variable + //! \param phase phase to instanciate + virtual void allocatePhaseGradient(GradPhase** /*phase*/) { Errors::errorMessage("allocatePhaseGradient not available for required model"); }; + //! \brief Instanciate gradient solid-phase variable + //! \param phase phase to instanciate + virtual void allocatePhaseSolidGradient(GradPhase** /*phase*/) { Errors::errorMessage("allocatePhaseSolidGradient not available for required model"); }; //! \brief Instanciate mixture variable //! \param mixture mixture to instanciate virtual void allocateMixture(Mixture** /*mixture*/) { Errors::errorMessage("allocateMixture not available for required model"); }; + //! \brief Instanciate gradient mixture variable + //! \param mixture mixture to instanciate + virtual void allocateMixtureGradient(GradMixture** /*mixture*/) { Errors::errorMessage("allocateMixtureGradient not available for required model"); }; //! \brief Associate equations of state //! \param cell original cell for equation of state linking void allocateEos(Cell& cell) const; + //! \brief Initialize the theoritical critical pressure of the fluid (only required for PTMu relax) + //! \param cell cell to get the eos + void initializeRelaxation(Cell* cell) const; //! \brief Complete a thermodynamics state frome minimum variables depending on the model //! \param phases phases array variables @@ -90,23 +107,51 @@ class Model //! \param dtMax maximum explicit time step //! \param boundData boundary dataset used for output virtual void solveRiemannIntern(Cell& /*cellLeft*/, Cell& /*cellRight*/, const double& /*dxLeft*/, const double& /*dxRight*/, double& /*dtMax*/, std::vector& /*boundData*/ = DEFAULT_VEC_INTERFACE_DATA) const { Errors::errorMessage("solveRiemannIntern not available for required model"); }; + //! \brief Cell to cell Riemann solver + compute fluxBuffMRF for MRF interface + //! \param cellLeft left cell + //! \param cellRight right cell + //! \param dxLeft left characteristic lenght + //! \param dxRight right characteristic lenght + //! \param dtMax maximum explicit time step + //! \param omega rotating velocity + //! \param normal face normal + //! \param tangent face tangent + //! \param binormal face binormal + //! \param position face position + virtual void solveRiemannInternMRF(Cell& /*cellLeft*/, Cell& /*cellRight*/, const double& /*dxLeft*/, const double& /*dxRight*/, double& /*dtMax*/, const Coord& /*omega*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/, const Coord& /*position*/) const { Errors::errorMessage("solveRiemannInternMRF not available for required model"); }; //! \brief Wall half Riemann solver //! \param cellLeft left cell //! \param dxLeft left characteristic lenght //! \param dtMax maximum explicit time step //! \param boundData boundary dataset used for output virtual void solveRiemannWall(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannWall not available for required model"); }; - //! \brief Inflow (injection) half Riemann solver + //! \brief Piston half Riemann solver //! \param cellLeft left cell //! \param dxLeft left characteristic lenght //! \param dtMax maximum explicit time step - //! \param m0 specific mass flow rate (kg/s/m�) + //! \param boundData boundary dataset used for output + //! \param uPiston piston velocity + virtual void solveRiemannPiston(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, std::vector& /*boundData*/, const double& /*uPiston*/) const { Errors::errorMessage("solveRiemannPiston not available for required model"); }; + //! \brief Inlet tank half Riemann solver + //! \param cellLeft left cell + //! \param dxLeft left characteristic lenght + //! \param dtMax maximum explicit time step + //! \param ak0 volume fraction array of fluids in tank + //! \param rhok0 density array of fluids in tank + //! \param pk0 pressure array of fluids in tank + //! \param boundData boundary dataset used for output + virtual void solveRiemannInletTank(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double* /*ak0*/, const double* /*rhok0*/, const double& /*p0*/, const double& /*T0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannInletTank not available for required model"); }; + //! \brief Inlet injection using stagnation state half Riemann solver + //! \param cellLeft left cell + //! \param dxLeft left characteristic lenght + //! \param dtMax maximum explicit time step + //! \param m0 specific mass flow rate (kg.s-1.m-2) //! \param ak0 volume fraction array of injected fluids //! \param rhok0 density array of injected fluids //! \param pk0 pressure array of injected fluids //! \param boundData boundary dataset used for output - virtual void solveRiemannInflow(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double /*m0*/, const double* /*ak0*/, const double* /*rhok0*/, const double* /*pk0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannInflow not available for required model"); }; - //! \brief Subsonic injection half Riemann solver (Euler specific) + virtual void solveRiemannInletInjStagState(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double /*m0*/, const double* /*ak0*/, const double* /*rhok0*/, const double* /*pk0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannInletInjStagState not available for required model"); }; + //! \brief Inlet injection using temperature half Riemann solver //! \param cellLeft left cell //! \param dxLeft left characteristic lenght //! \param dtMax maximum explicit time step @@ -114,23 +159,21 @@ class Model //! \param Tk0 temperature of injected fluid (same for both phases) //! \param ak0 volume fraction of each injected phase //! \param boundData boundary dataset used for output - virtual void solveRiemannSubInj(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double /*m0*/, const double* /*Tk0*/, const double* /*ak0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannSubInj not available for required model"); }; - //! \brief Tank half Riemann solver + virtual void solveRiemannInletInjTemp(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double /*m0*/, const double* /*Tk0*/, const double* /*ak0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannInletInjTemp not available for required model"); }; + //! \brief Outlet at imposed pressure half Riemann solver //! \param cellLeft left cell //! \param dxLeft left characteristic lenght //! \param dtMax maximum explicit time step - //! \param ak0 volume fraction array of fluids in tank - //! \param rhok0 density array of fluids in tank - //! \param pk0 pressure array of fluids in tank + //! \param p0 external pressure //! \param boundData boundary dataset used for output - virtual void solveRiemannTank(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double* /*ak0*/, const double* /*rhok0*/, const double& /*p0*/, const double& /*T0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannTank not available for required model"); }; - //! \brief Outflow half Riemann solver + virtual void solveRiemannOutletPressure(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double /*p0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannOutletPressure not available for required model"); }; + //! \brief Outlet at imposed massflow half Riemann solver //! \param cellLeft left cell //! \param dxLeft left characteristic lenght //! \param dtMax maximum explicit time step - //! \param p0 external pressure + //! \param m0 specific mass flow rate (kg.s-1.m-2) //! \param boundData boundary dataset used for output - virtual void solveRiemannOutflow(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double /*p0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannOutflow not available for required model"); }; + virtual void solveRiemannOutletMassflow(Cell& /*cellLeft*/, const double& /*dxLeft*/, double& /*dtMax*/, const double /*m0*/, std::vector& /*boundData*/) const { Errors::errorMessage("solveRiemannOutletMassflow not available for required model"); }; //! \brief No flux half Riemann solver (return null flux to use with 1D geometry with smooth varying cross section) virtual void solveRiemannNullFlux() const { Errors::errorMessage("solveRiemannNullFlux not available for required model"); }; @@ -142,18 +185,22 @@ class Model virtual void solveRiemannTransportIntern(Cell& /*cellLeft*/, Cell& /*cellRight*/) { Errors::errorMessage("solveRiemannTransportIntern not available for required model"); }; //! \brief Wall half Riemann solver for transport equations virtual void solveRiemannTransportWall() { Errors::errorMessage("solveRiemannTransportWall not available for required model"); }; - //! \brief Flow injection half Riemann solver for transport equations + //! \brief Piston half Riemann solver for transport equations + //! \param cellLeft left cell + //! \param uPiston piston velocity + virtual void solveRiemannTransportPiston(Cell& /*cellLeft*/, double /*uPiston*/) { Errors::errorMessage("solveRiemannTransportPiston not available for required model"); }; + //! \brief Inlet injection using stagnation state half Riemann solver for transport equations //! \param cellLeft left cell //! \param valueTransports array of transport quantities injected - virtual void solveRiemannTransportInflow(Cell& /*cellLeft*/, double* /*valueTransports*/) { Errors::errorMessage("solveRiemannTransportInflow not available for required model"); }; - //! \brief Tank half Riemann solver for transport equations + virtual void solveRiemannTransportInletInjStagState(Cell& /*cellLeft*/, double* /*valueTransports*/) { Errors::errorMessage("solveRiemannTransportInletInjStagState not available for required model"); }; + //! \brief Inlet tank half Riemann solver for transport equations //! \param cellLeft left cell //! \param valueTransports array of transport quantities in tank - virtual void solveRiemannTransportTank(Cell& /*cellLeft*/, double* /*valueTransports*/) { Errors::errorMessage("solveRiemannTransportTank not available for required model"); }; - //! \brief Outflow half Riemann solver for transport equations + virtual void solveRiemannTransportInletTank(Cell& /*cellLeft*/, double* /*valueTransports*/) { Errors::errorMessage("solveRiemannTransportInletTank not available for required model"); }; + //! \brief Outlet at imposed pressure half Riemann solver for transport equations //! \param cellLeft left cell //! \param valueTransports array of external transport quantities - virtual void solveRiemannTransportOutflow(Cell& /*cellLeft*/, double* /*valueTransports*/) { Errors::errorMessage("solveRiemannTransportOutflow not available for required model"); }; + virtual void solveRiemannTransportOutletPressure(Cell& /*cellLeft*/, double* /*valueTransports*/) { Errors::errorMessage("solveRiemannTransportOutletPressure not available for required model"); }; //! \brief Flux reverse projection in the absolute Cartesian coordinate system //! \param normal normal vector associated to the cell interface @@ -169,8 +216,109 @@ class Model //------------------------ virtual void lowMachSoundSpeed(double& /*machRef*/, const double& /*uL*/, double& /*cL*/, const double& /*uR*/ = Errors::defaultDouble, double& /*cR*/ = Tools::uselessDouble) const { Errors::errorMessage("lowMachSoundSpeed not available for required model"); }; + //Moving Reference Frame + //---------------------- + virtual void addNonConsMrfFlux(Phase** /*phases*/) { Errors::errorMessage("addNonConsMrfFlux not available for required model"); }; + virtual void reverseProjectionMrfFlux(const Coord /*normal*/, const Coord /*tangent*/, const Coord /*binormal*/) const { Errors::errorMessage("reverseProjectionMrfFlux not available for required model"); }; + + //Compaction + //---------- + //! \brief Read compaction parameters + //! \param elementCompaction XML element + //! \param fileName string name of readed XML file + //! \param k phase number + virtual void readCompactionParameters(tinyxml2::XMLElement* /*elementCompaction*/, std::string /*fileName*/, const int& /*k*/) { Errors::errorMessage("readCompactionParameters not available for required model"); }; + + //! \brief Return if compaction is activated or not + //! \param k phase number + virtual bool compaction(const int& /*k*/) const { Errors::errorMessage("compaction not available for required model"); return false; }; + + //! \brief Return the compaction reference density of phase k + //! \param k phase number + virtual const double& getDensityReference(const int& /*k*/) const { Errors::errorMessage("getDensityReference not available for required model"); return Errors::defaultDouble; }; + + //! \brief Return the compaction energy of the fluid/solid + //! \param k phase number + //! \param alpha volume fraction (\f$ \alpha \f$) + //! \param density density (\f$ \rho \f$) + //! \param lambda compaction variable (\f$ \lambda \f$) + //!return \f$ \kappa \f$ (compaction energy) + virtual double computeEnergyCompaction(const int& /*k*/, const double& /*alpha*/, const double& /*density*/, const double& /*lambda*/) const { Errors::errorMessage("computeEnergyCompaction not available for required model"); return Errors::defaultDouble; }; + + //! \brief Compute the compaction pressure of the fluid/solid for relaxation + //! \param k phase number + //! \param alpha volume fraction (\f$ \alpha \f$) + //! \param density density (\f$ \rho \f$) + //! \param lambda compaction variable (\f$ \lambda \f$) + //!return \f$ p_c \f$ (compaction pressure) + virtual double computeCompactionPressure(const int& /*k*/, const double& /*alpha*/, const double& /*density*/, const double& /*lambda*/) const { Errors::errorMessage("computeCompactionPressure not available for required model"); return Errors::defaultDouble; }; + + //! \brief Compute the derivative of the compaction function f with respect to xi + //! \param k phase number + //! \param density density (\f$ \rho \f$) + //! \param lambda compaction variable (\f$ \lambda \f$) + //!return \f$ \partial f / \partial \xi \f$ + virtual double computeDerivativeCompactionFunctionF(const int& /*k*/, const double& /*density*/, const double& /*lambda*/) const { Errors::errorMessage("computeDerivativeCompactionFunctionF not available for required model"); return Errors::defaultDouble; }; + + //! \brief Compute the compaction plasticity term of the fluid/solid for relaxation + //! \param k phase number + //! \param alpha volume fraction (\f$ \alpha \f$) + //! \param density density (\f$ \rho \f$) + //! \param lambda compaction variable (\f$ \lambda \f$) + //! \param pc compaction pressure (\f$ p_c \f$) + //!return \f$ \dlambda \f$ (compaction plasticity) + virtual double computeCompactionPlasticity(const int& /*k*/, const double& /*alpha*/, const double& /*density*/, const double& /*lambda*/, const double& /*pc*/) const { Errors::errorMessage("computeCompactionPlasticity not available for required model"); return Errors::defaultDouble; }; + + //Solid elasticity and plasticity + //------------------------------- + //! \brief Read solid parameters + //! \param elementSolid XML element + //! \param fileName string name of readed XML file + //! \param k phase number + virtual void readSolidParameters(tinyxml2::XMLElement* /*elementSolid*/, std::string /*fileName*/, const int& /*k*/) { Errors::errorMessage("readSolidParameters not available for required model"); }; + + //! \brief Return the reference density for each phase + virtual const double* getDensityReference() const { Errors::errorMessage("getDensityReference not available for required model"); return 0; }; + + //! \brief Return the elastic parameter a of the one-parameter model for each phase + virtual const double* getElasticParameterA() const { Errors::errorMessage("getElasticParameterA not available for required model"); return 0; }; + + //! \brief Return the shear modulus for each phase + virtual const double* getShearModulus() const { Errors::errorMessage("getShearModulus not available for required model"); return 0; }; + + //! \brief Return the limit of elasticity for each phase + virtual const double* getElasticityLimit() const { Errors::errorMessage("getElasticityLimit not available for required model"); return 0; }; + + //! \brief Compute the elastic energy of the solid + //! \param k phase number + //! \param cobase cobase tensor (\f$ e^\beta \f$) + virtual double computeElasticEnergy(const int& /*k*/, const Tensor& /*cobase*/) const { Errors::errorMessage("computeElasticEnergy not available for required model"); return Errors::defaultDouble; }; + + //! \brief Compute the elastic energy and stress tensor of the solid + //! \param k phase number + //! \param cobase cobase tensor (\f$ e^\beta \f$) + //! \param pressure pressure (\f$ p \f$) + //! \param density density (\f$ \rho \f$) + //! \param elasticEnergy elastic energy (\f$ e^e \f$) + //! \param stressTensor stress tensor (\f$ \sigma \f$) + virtual void computeElasticEnergyAndStressTensor(const int& /*k*/, const Tensor& /*cobase*/, const double& /*pressure*/, const double& /*density*/, + double& /*elasticEnergy*/, Tensor& /*stressTensor*/) const { Errors::errorMessage("computeElasticEnergyAndStressTensor not available for required model"); }; + + //! \brief Compute the square longitudinal wave speed of the solid + //! \param k phase number + //! \param phase phase object + //! \return square longitudinal wave speed + virtual double computeSquareLongitudinalWaveSpeed(const int& /*k*/, const Phase& /*phase*/) { Errors::errorMessage("computeSquareLongitudinalWaveSpeed not available for required model"); return Errors::defaultDouble; }; + //Accessors //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** /*phases*/, Mixture* /*mixture*/, Transport* /*transports*/, Variable /*nameVariable*/, int /*num*/ = 0) const { Errors::errorMessage("selectScalar not available for required model"); return Errors::defaultDouble; }; //! \brief Return the local fluid velocity //! \return the velocity solution of the local Riemann problem virtual const double& getSM() { Errors::errorMessage("getSM not available for required model"); return Errors::defaultDouble; }; @@ -182,7 +330,7 @@ class Model virtual const Coord& getVectorP(const Cell* /*cell*/) const { Errors::errorMessage("getVectorP not available for required model"); return Coord::defaultCoord; }; virtual Coord& getVectorP(Cell* /*cell*/) { Errors::errorMessage("getVectorP not available for required model"); return Coord::defaultCoordNonConst; }; - + std::vector* getRelaxations() { return &m_relaxations; }; void printInfo() const; @@ -192,12 +340,14 @@ class Model virtual const bool& isSmoothCrossSection1d() const { return m_smoothCrossSection1d; }; virtual void setLowMach(const bool& /*lowMach*/) { Errors::errorMessage("setLowMach not available for required model"); }; + virtual void setMachRefMin(const double& /*machRefMin*/) { Errors::errorMessage("setMachRefMin not available for required model"); }; protected: std::string m_name; //!< Name of the required model std::vector m_relaxations; //!< Vector of relaxation procedure bool m_lowMach; //!< Low-Mach preconditioning (default: false) + double m_machRefMin; //!< Minimum Mach number limit for L-M preconditionning used when local Mach number is below this value (default: 0.01) bool m_smoothCrossSection1d; //!< 1D geometry with smooth cross section variation (default: false) private: }; diff --git a/src/Models/NonLinearSchrodinger/PhaseNonLinearSchrodinger.h b/src/Models/NonLinearSchrodinger/PhaseNonLinearSchrodinger.h index 0995646a..a8303bd0 100644 --- a/src/Models/NonLinearSchrodinger/PhaseNonLinearSchrodinger.h +++ b/src/Models/NonLinearSchrodinger/PhaseNonLinearSchrodinger.h @@ -65,6 +65,10 @@ class PhaseNonLinearSchrodinger : public PhaseEulerKorteweg virtual void fillBuffer(std::vector& dataToSend) const; virtual void getBuffer(double* buffer, int& counter, Eos** /*eos*/); virtual void getBuffer(std::vector& dataToReceive, int& counter, Eos** /*eos*/); + + //Verifications + //------------- + virtual void verifyAndCorrectDensityMax() {}; }; #endif // PHASENONLINEARSCHRODINGER_H diff --git a/src/Models/PTUEq/FluxPTUEq.cpp b/src/Models/PTUEq/FluxPTUEq.cpp index 28f6a34a..bf9e03d2 100644 --- a/src/Models/PTUEq/FluxPTUEq.cpp +++ b/src/Models/PTUEq/FluxPTUEq.cpp @@ -169,17 +169,6 @@ void FluxPTUEq::setToZero() //*********************************************************************** -void FluxPTUEq::setToZeroBufferFlux() -{ - for (int k = 0; k (fluxBuff)->m_mass[k] = 0.; - } - static_cast (fluxBuff)->m_momentum = 0.; - static_cast (fluxBuff)->m_energMixture = 0.; -} - -//*********************************************************************** - void FluxPTUEq::prepSourceTermsHeating(const double& q) { m_energMixture = q; diff --git a/src/Models/PTUEq/FluxPTUEq.h b/src/Models/PTUEq/FluxPTUEq.h index 872a6bc2..ab29e6b7 100644 --- a/src/Models/PTUEq/FluxPTUEq.h +++ b/src/Models/PTUEq/FluxPTUEq.h @@ -50,9 +50,8 @@ class FluxPTUEq : public Flux virtual void buildCons(Phase** phases, Mixture* mixture); virtual void buildPrim(Phase** phases, Mixture* mixture); virtual void setToZero(); - virtual void setToZeroBufferFlux(); - virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/) {}; - virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/) {}; + virtual void addNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; + virtual void subtractNonCons(double /*coefA*/, const Cell* /*cell*/, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) {}; virtual void prepSourceTermsHeating(const double& q); diff --git a/src/Models/PTUEq/GradMixPTUEq.cpp b/src/Models/PTUEq/GradMixPTUEq.cpp new file mode 100644 index 00000000..b1bf025e --- /dev/null +++ b/src/Models/PTUEq/GradMixPTUEq.cpp @@ -0,0 +1,77 @@ +#include "GradMixPTUEq.h" + +//*************************************************************************** + +GradMixPTUEq::GradMixPTUEq() +{ + m_grads.resize(5); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } +} + +//*************************************************************************** + +GradMixPTUEq::~GradMixPTUEq() +{ +} + +//*************************************************************************** + +void GradMixPTUEq::initializeGradientVectors() +{ + this->initializeGradsVariablesNamesNumerators(); + + variableNamesMixture[VarLocal::pressure] = Variable::pressure; + variableNamesMixture[VarLocal::temperature] = Variable::temperature; + variableNamesMixture[VarLocal::velocityU] = Variable::velocityU; + variableNamesMixture[VarLocal::velocityV] = Variable::velocityV; + variableNamesMixture[VarLocal::velocityW] = Variable::velocityW; +} + +//*************************************************************************** + +void GradMixPTUEq::computeDistanceGradientScalarProduct(Coord const& distance, Mixture* mixture) const +{ + static_cast (mixture)->setPressure(distance.scalar(m_grads[VarLocal::pressure])); + static_cast (mixture)->setTemperature(distance.scalar(m_grads[VarLocal::temperature])); + static_cast (mixture)->setVelocity(distance.scalar(m_grads[VarLocal::velocityU]), + distance.scalar(m_grads[VarLocal::velocityV]), + distance.scalar(m_grads[VarLocal::velocityW])); +} + +//*************************************************************************** + +void GradMixPTUEq::limitGradients(const Mixture& gradientLimiter) +{ + m_grads[VarLocal::pressure].setX(m_grads[VarLocal::pressure].getX() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setY(m_grads[VarLocal::pressure].getY() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setZ(m_grads[VarLocal::pressure].getZ() * gradientLimiter.getPressure()); + + m_grads[VarLocal::temperature].setX(m_grads[VarLocal::temperature].getX() * gradientLimiter.getTemperature()); + m_grads[VarLocal::temperature].setY(m_grads[VarLocal::temperature].getY() * gradientLimiter.getTemperature()); + m_grads[VarLocal::temperature].setZ(m_grads[VarLocal::temperature].getZ() * gradientLimiter.getTemperature()); + + m_grads[VarLocal::velocityU].setX(m_grads[VarLocal::velocityU].getX() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setY(m_grads[VarLocal::velocityU].getY() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setZ(m_grads[VarLocal::velocityU].getZ() * gradientLimiter.getVelocity().getX()); + + m_grads[VarLocal::velocityV].setX(m_grads[VarLocal::velocityV].getX() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setY(m_grads[VarLocal::velocityV].getY() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setZ(m_grads[VarLocal::velocityV].getZ() * gradientLimiter.getVelocity().getY()); + + m_grads[VarLocal::velocityW].setX(m_grads[VarLocal::velocityW].getX() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setY(m_grads[VarLocal::velocityW].getY() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setZ(m_grads[VarLocal::velocityW].getZ() * gradientLimiter.getVelocity().getZ()); +} + +//*************************************************************************** +//************************** ORDER 2 PARALLEL ******************************* +//*************************************************************************** + +int GradMixPTUEq::numberOfTransmittedGradients() const +{ + return 15; +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Models/PTUEq/GradMixPTUEq.h b/src/Models/PTUEq/GradMixPTUEq.h new file mode 100644 index 00000000..687b5c27 --- /dev/null +++ b/src/Models/PTUEq/GradMixPTUEq.h @@ -0,0 +1,61 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADMIXPTPTUEq_H +#define GRADMIXPTPTUEq_H + +#include "../GradMixture.h" +#include "MixPTUEq.h" + +class Mixture; + +//! \class GradMixPTUEq +//! \brief Mixture variable gradients for PTUEq model. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradMixPTUEq : public GradMixture +{ +public: + GradMixPTUEq(); + virtual ~GradMixPTUEq(); + + virtual void initializeGradientVectors(); + + virtual void computeDistanceGradientScalarProduct(Coord const& distance, Mixture* mixture) const; + virtual void limitGradients(const Mixture& gradientLimiter); + + // O2 parallel + virtual int numberOfTransmittedGradients() const; + +protected: + //! \brief Enumeration for the mixture flow variables, specific to PTUEq + enum VarLocal { pressure, temperature, velocityU, velocityV, velocityW }; +}; + +#endif \ No newline at end of file diff --git a/src/Models/PTUEq/GradPhasePTUEq.cpp b/src/Models/PTUEq/GradPhasePTUEq.cpp new file mode 100644 index 00000000..1081ecd2 --- /dev/null +++ b/src/Models/PTUEq/GradPhasePTUEq.cpp @@ -0,0 +1,53 @@ +#include "GradPhasePTUEq.h" + +//*************************************************************************** + +GradPhasePTUEq::GradPhasePTUEq() +{ + m_grads.resize(1); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } +} + +//*************************************************************************** + +GradPhasePTUEq::~GradPhasePTUEq() +{ +} + +//*************************************************************************** + +void GradPhasePTUEq::initializeGradientVectors() +{ + this->initializeGradsVariablesNamesNumerators(); + + variableNamesPhases[VarLocal::alpha] = Variable::alpha; +} + +//*************************************************************************** + +void GradPhasePTUEq::computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const +{ + static_cast (phase)->setAlpha(distance.scalar(m_grads[VarLocal::alpha])); +} + +//*************************************************************************** + +void GradPhasePTUEq::limitGradients(const Phase& gradientLimiter) +{ + m_grads[VarLocal::alpha].setX(m_grads[VarLocal::alpha].getX() * gradientLimiter.getAlpha()); + m_grads[VarLocal::alpha].setY(m_grads[VarLocal::alpha].getY() * gradientLimiter.getAlpha()); + m_grads[VarLocal::alpha].setZ(m_grads[VarLocal::alpha].getZ() * gradientLimiter.getAlpha()); +} + +//*************************************************************************** +//************************** ORDER 2 PARALLEL ******************************* +//*************************************************************************** + +int GradPhasePTUEq::numberOfTransmittedGradients() const +{ + return 3; +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Models/PTUEq/GradPhasePTUEq.h b/src/Models/PTUEq/GradPhasePTUEq.h new file mode 100644 index 00000000..c91fa544 --- /dev/null +++ b/src/Models/PTUEq/GradPhasePTUEq.h @@ -0,0 +1,61 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADPHASEPTPTUEq_H +#define GRADPHASEPTPTUEq_H + +#include "../GradPhase.h" +#include "PhasePTUEq.h" + +class Phase; + +//! \class GradPhasePTUEq +//! \brief Phase variable gradients for PTUEq model. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradPhasePTUEq : public GradPhase +{ +public: + GradPhasePTUEq(); + virtual ~GradPhasePTUEq(); + + virtual void initializeGradientVectors(); + + virtual void computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const; + virtual void limitGradients(const Phase& gradientLimiter); + + // O2 parallel + virtual int numberOfTransmittedGradients() const; + +protected: + //! \brief Enumeration for the phase flow variables, specific to PTUEq + enum VarLocal { alpha }; +}; + +#endif \ No newline at end of file diff --git a/src/Models/PTUEq/MixPTUEq.cpp b/src/Models/PTUEq/MixPTUEq.cpp index a86e506f..d7eb9aa8 100644 --- a/src/Models/PTUEq/MixPTUEq.cpp +++ b/src/Models/PTUEq/MixPTUEq.cpp @@ -308,7 +308,7 @@ void MixPTUEq::computeMixtureVariables(Phase** vecPhase) //*************************************************************************** -void MixPTUEq::internalEnergyToTotalEnergy(std::vector& vecGPA) +void MixPTUEq::computeTotalEnergy(std::vector& vecGPA) { m_totalEnergy = m_energy + 0.5*m_velocity.squaredNorm(); for (unsigned int pa = 0; pa < vecGPA.size(); pa++) { @@ -458,6 +458,18 @@ void MixPTUEq::fillBuffer(double* buffer, int& counter) const //*************************************************************************** +void MixPTUEq::fillBuffer(std::vector& dataToSend) const +{ + dataToSend.push_back(m_pressure); + dataToSend.push_back(m_temperature); + dataToSend.push_back(m_velocity.getX()); + dataToSend.push_back(m_velocity.getY()); + dataToSend.push_back(m_velocity.getZ()); + dataToSend.push_back(m_totalEnergy); +} + +//*************************************************************************** + void MixPTUEq::getBuffer(double* buffer, int& counter) { m_pressure = buffer[++counter]; @@ -468,6 +480,18 @@ void MixPTUEq::getBuffer(double* buffer, int& counter) m_totalEnergy = buffer[++counter]; } +//*************************************************************************** + +void MixPTUEq::getBuffer(std::vector& dataToReceive, int& counter) +{ + m_pressure = dataToReceive[counter++]; + m_temperature = dataToReceive[counter++]; + m_velocity.setX(dataToReceive[counter++]); + m_velocity.setY(dataToReceive[counter++]); + m_velocity.setZ(dataToReceive[counter++]); + m_totalEnergy = dataToReceive[counter++]; +} + //**************************************************************************** //******************************* ORDER 2 ************************************ //**************************************************************************** @@ -491,6 +515,14 @@ void MixPTUEq::setToZero() //*************************************************************************** +void MixPTUEq::setToMax() +{ + m_pressure = 1.e15; m_temperature = 1.e15; + m_velocity.setX(1.e15); m_velocity.setY(1.e15); m_velocity.setZ(1.e15); +} + +//*************************************************************************** + void MixPTUEq::extrapolate(const Mixture &slope, const double& distance) { m_pressure += slope.getPressure()*distance; @@ -511,6 +543,39 @@ void MixPTUEq::limitSlopes(const Mixture &slopeGauche, const Mixture &slopeDroit m_velocity.setZ(globalLimiter.limiteSlope(slopeGauche.getVelocity().getZ(), slopeDroite.getVelocity().getZ())); } +//**************************************************************************** + +void MixPTUEq::setMin(const Mixture& mixture1, const Mixture& mixture2) +{ + m_pressure = std::min(mixture1.getPressure(), mixture2.getPressure()); + m_temperature = std::min(mixture1.getTemperature(), mixture2.getTemperature()); + m_velocity.setX(std::min(mixture1.getVelocity().getX(), mixture2.getVelocity().getX())); + m_velocity.setY(std::min(mixture1.getVelocity().getY(), mixture2.getVelocity().getY())); + m_velocity.setZ(std::min(mixture1.getVelocity().getZ(), mixture2.getVelocity().getZ())); +} + +//**************************************************************************** + +void MixPTUEq::setMax(const Mixture& mixture1, const Mixture& mixture2) +{ + m_pressure = std::max(mixture1.getPressure(), mixture2.getPressure()); + m_temperature = std::max(mixture1.getTemperature(), mixture2.getTemperature()); + m_velocity.setX(std::max(mixture1.getVelocity().getX(), mixture2.getVelocity().getX())); + m_velocity.setY(std::max(mixture1.getVelocity().getY(), mixture2.getVelocity().getY())); + m_velocity.setZ(std::max(mixture1.getVelocity().getZ(), mixture2.getVelocity().getZ())); +} + +//**************************************************************************** + +void MixPTUEq::computeGradientLimiter(const Limiter& globalLimiter, const Mixture &mixture, const Mixture &mixtureMin, const Mixture &mixtureMax, const Mixture& slope) +{ + m_pressure = std::min(m_pressure, globalLimiter.computeGradientLimiter(mixture.getPressure(), mixtureMin.getPressure(), mixtureMax.getPressure(), slope.getPressure())); + m_temperature = std::min(m_temperature, globalLimiter.computeGradientLimiter(mixture.getTemperature(), mixtureMin.getTemperature(), mixtureMax.getTemperature(), slope.getTemperature())); + m_velocity.setX(std::min(m_velocity.getX(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getX(), mixtureMin.getVelocity().getX(), mixtureMax.getVelocity().getX(), slope.getVelocity().getX()))); + m_velocity.setY(std::min(m_velocity.getY(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getY(), mixtureMin.getVelocity().getY(), mixtureMax.getVelocity().getY(), slope.getVelocity().getY()))); + m_velocity.setZ(std::min(m_velocity.getZ(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getZ(), mixtureMin.getVelocity().getZ(), mixtureMax.getVelocity().getZ(), slope.getVelocity().getZ()))); +} + //**************************************************************************** //************************** ORDER 2 PARALLEL ******************************** //**************************************************************************** @@ -575,6 +640,13 @@ void MixPTUEq::setTotalEnergy(double& totalEnergy) m_totalEnergy = totalEnergy; } +//*************************************************************************** + +void MixPTUEq::setTemperature(const double& T) +{ + m_temperature = T; +} + //**************************************************************************** //***************************** OPERATORS ************************************ //**************************************************************************** diff --git a/src/Models/PTUEq/MixPTUEq.h b/src/Models/PTUEq/MixPTUEq.h index f8524806..c0cbca39 100644 --- a/src/Models/PTUEq/MixPTUEq.h +++ b/src/Models/PTUEq/MixPTUEq.h @@ -65,7 +65,7 @@ class MixPTUEq : public Mixture virtual double computeVolumeIsentrope(const double* Yk, const double& p0, const double& T0, const double& p, double* dvdp = 0); virtual void computeMixtureVariables(Phase** vecPhase); - virtual void internalEnergyToTotalEnergy(std::vector& vecGPA); + virtual void computeTotalEnergy(std::vector& vecGPA); virtual void totalEnergyToInternalEnergy(std::vector& vecGPA); virtual void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); @@ -86,13 +86,19 @@ class MixPTUEq : public Mixture //Parallel virtual int numberOfTransmittedVariables() const; virtual void fillBuffer(double* buffer, int& counter) const; + virtual void fillBuffer(std::vector& dataToSend) const; virtual void getBuffer(double* buffer, int& counter); + virtual void getBuffer(std::vector& dataToReceive, int& counter); //Second order virtual void computeSlopesMixture(const Mixture &sLeft, const Mixture &sRight, const double& distance); virtual void setToZero(); + virtual void setToMax(); virtual void extrapolate(const Mixture &slope, const double& distance); virtual void limitSlopes(const Mixture &slopeGauche, const Mixture &slopeDroite, Limiter& globalLimiter); + virtual void setMin(const Mixture& mixture1, const Mixture& mixture2); + virtual void setMax(const Mixture& mixture1, const Mixture& mixture2); + virtual void computeGradientLimiter(const Limiter& globalLimiter, const Mixture& mixture, const Mixture& mixtureMin, const Mixture& mixtureMax, const Mixture& slope); //Parallel second order virtual int numberOfTransmittedSlopes() const; @@ -119,6 +125,7 @@ class MixPTUEq : public Mixture virtual void setV(const double& v); virtual void setW(const double& w); virtual void setTotalEnergy(double& totalEnergy); + virtual void setTemperature(const double& T); //Operators virtual void changeSign(); diff --git a/src/Models/PTUEq/ModPTUEq.cpp b/src/Models/PTUEq/ModPTUEq.cpp index 0064b3c9..ac869114 100644 --- a/src/Models/PTUEq/ModPTUEq.cpp +++ b/src/Models/PTUEq/ModPTUEq.cpp @@ -30,6 +30,8 @@ #include "ModPTUEq.h" #include "PhasePTUEq.h" +#include "GradPhasePTUEq.h" +#include "GradMixPTUEq.h" const std::string ModPTUEq::NAME = "TEMPERATUREPRESSUREVELOCITYEQ"; @@ -78,6 +80,20 @@ void ModPTUEq::allocateMixture(Mixture** mixture) //*********************************************************************** +void ModPTUEq::allocatePhaseGradient(GradPhase** phase) +{ + *phase = new GradPhasePTUEq; +} + +//*********************************************************************** + +void ModPTUEq::allocateMixtureGradient(GradMixture** mixture) +{ + *mixture = new GradMixPTUEq; +} + +//*********************************************************************** + void ModPTUEq::fulfillState(Phase** phases, Mixture* mixture) { //Complete phases and mixture states from : alphak, pressure and temperature @@ -252,7 +268,7 @@ void ModPTUEq::solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dt //**************************************************************************** -void ModPTUEq::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& T0, std::vector &boundData) const +void ModPTUEq::solveRiemannInletTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& T0, std::vector &boundData) const { double sL, zL, sM, vmv0, mL; double pStar(0.), uStar(0.), rhoStar(0.), uyStar(0.), uzStar(0.), EStar(0.), vStar(0.); @@ -323,7 +339,7 @@ void ModPTUEq::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dt double vStarL(0.), dvStarL(0.); do { p -= f / df; iteration++; - if (iteration > 50) Errors::errorMessage("solveRiemannTank not converged in ModPTUEq"); + if (iteration > 50) Errors::errorMessage("solveRiemannInletTank not converged in ModPTUEq"); //Physical pressure ? for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(p); } if (p > p0) { p = p0 - 1e-6; } @@ -388,7 +404,7 @@ void ModPTUEq::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dt //**************************************************************************** -void ModPTUEq::solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const +void ModPTUEq::solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const { double sL, zL; double pStar(p0); @@ -445,6 +461,46 @@ void ModPTUEq::solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& boundData[VarBoundary::velW] = wL; } +//**************************************************************************** +//******************************* Accessors ********************************** +//**************************************************************************** + +double ModPTUEq::selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num) const +{ + switch (nameVariable) { + case Variable::pressure: + return mixture->getPressure(); + break; + case Variable::temperature: + return mixture->getTemperature(); + break; + case Variable::alpha: + return phases[num]->getAlpha(); + break; + case Variable::velocityU: + return mixture->getVelocity().getX(); + break; + case Variable::velocityV: + return mixture->getVelocity().getY(); + break; + case Variable::velocityW: + return mixture->getVelocity().getZ(); + break; + case Variable::velocityMag: + return mixture->getVelocity().norm(); + break; + case Variable::transport: + return transports[num].getValue(); + break; + case Variable::density: + return mixture->getDensity(); + break; + default: + Errors::errorMessage("nameVariable unknown in selectScalar"); return 0; + break; + } +} + //**************************************************************************** const double& ModPTUEq::getSM() @@ -458,11 +514,7 @@ const double& ModPTUEq::getSM() void ModPTUEq::reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const { - Coord fluxProjected; - fluxProjected.setX(normal.getX()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjected.setY(normal.getY()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjected.setZ(normal.getZ()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuff)->m_momentum.getZ()); - static_cast (fluxBuff)->m_momentum.setXYZ(fluxProjected.getX(), fluxProjected.getY(), fluxProjected.getZ()); + static_cast (fluxBuff)->m_momentum.reverseProjection(normal, tangent, binormal); } //**************************************************************************** \ No newline at end of file diff --git a/src/Models/PTUEq/ModPTUEq.h b/src/Models/PTUEq/ModPTUEq.h index 8d432c93..3af7e72f 100644 --- a/src/Models/PTUEq/ModPTUEq.h +++ b/src/Models/PTUEq/ModPTUEq.h @@ -50,6 +50,8 @@ class ModPTUEq : public Model virtual void allocateCons(Flux** cons); virtual void allocatePhase(Phase** phase); virtual void allocateMixture(Mixture** mixture); + virtual void allocatePhaseGradient(GradPhase** phase); + virtual void allocateMixtureGradient(GradMixture** mixture); virtual void fulfillState(Phase** phases, Mixture* mixture); @@ -63,13 +65,20 @@ class ModPTUEq : public Model //---------------------------- virtual void solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, std::vector &boundData = DEFAULT_VEC_INTERFACE_DATA) const; // Riemann between two computed cells virtual void solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dtMax, std::vector& boundData) const; // Riemann between left cell and wall - virtual void solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& T0, std::vector &boundData) const; // Riemann for tank - virtual void solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const; // Riemann for outflow with imposed pressure + virtual void solveRiemannInletTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& T0, std::vector &boundData) const; // Riemann for tank + virtual void solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const; // Riemann for outflow with imposed pressure virtual void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const; //Accessors //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const; virtual const double& getSM(); virtual const Coord& getVelocity(const Cell* cell) const { return cell->getMixture()->getVelocity(); }; virtual Coord& getVelocity(Cell* cell) { return cell->getMixture()->getVelocity(); }; diff --git a/src/Models/PTUEq/PhasePTUEq.cpp b/src/Models/PTUEq/PhasePTUEq.cpp index 36d5712c..1257bb30 100644 --- a/src/Models/PTUEq/PhasePTUEq.cpp +++ b/src/Models/PTUEq/PhasePTUEq.cpp @@ -153,12 +153,28 @@ void PhasePTUEq::fillBuffer(double* buffer, int& counter) const //*************************************************************************** +void PhasePTUEq::fillBuffer(std::vector& dataToSend) const +{ + dataToSend.push_back(m_alpha); + dataToSend.push_back(static_cast(m_eos->getNumber())); +} + +//*************************************************************************** + void PhasePTUEq::getBuffer(double* buffer, int& counter, Eos** eos) { m_alpha = buffer[++counter]; m_eos = eos[static_cast(buffer[++counter])]; } +//*************************************************************************** + +void PhasePTUEq::getBuffer(std::vector& dataToReceive, int& counter, Eos** eos) +{ + m_alpha = dataToReceive[counter++]; + m_eos = eos[static_cast(std::round(dataToReceive[counter++]))]; +} + //**************************************************************************** //******************************* ORDER 2 ************************************ //**************************************************************************** @@ -177,6 +193,13 @@ void PhasePTUEq::setToZero() //*************************************************************************** +void PhasePTUEq::setToMax() +{ + m_alpha = 1.e15; +} + +//*************************************************************************** + void PhasePTUEq::extrapolate(const Phase &slope, const double& distance) { m_alpha += slope.getAlpha() * distance; @@ -189,6 +212,27 @@ void PhasePTUEq::limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, m_alpha = volumeFractionLimiter.limiteSlope(slopeGauche.getAlpha(), slopeDroite.getAlpha()); } +//*************************************************************************** + +void PhasePTUEq::setMin(const Phase& phase1, const Phase& phase2) +{ + m_alpha = std::min(phase1.getAlpha(), phase2.getAlpha()); +} + +//**************************************************************************** + +void PhasePTUEq::setMax(const Phase& phase1, const Phase& phase2) +{ + m_alpha = std::max(phase1.getAlpha(), phase2.getAlpha()); +} + +//**************************************************************************** + +void PhasePTUEq::computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope) +{ + m_alpha = std::min(m_alpha, globalLimiter.computeGradientLimiter(phase.getAlpha(), phaseMin.getAlpha(), phaseMax.getAlpha(), slope.getAlpha())); +} + //**************************************************************************** //************************** ORDER 2 PARALLEL ******************************** //**************************************************************************** diff --git a/src/Models/PTUEq/PhasePTUEq.h b/src/Models/PTUEq/PhasePTUEq.h index a6e335c4..45394e86 100644 --- a/src/Models/PTUEq/PhasePTUEq.h +++ b/src/Models/PTUEq/PhasePTUEq.h @@ -73,14 +73,20 @@ class PhasePTUEq : public Phase //--------------------------------------- virtual int numberOfTransmittedVariables() const; virtual void fillBuffer(double* buffer, int& counter) const; + virtual void fillBuffer(std::vector& dataToSend) const; virtual void getBuffer(double* buffer, int& counter, Eos** eos); + virtual void getBuffer(std::vector& dataToReceive, int& counter, Eos** eos); //Specific methods for second order //--------------------------------- virtual void computeSlopesPhase(const Phase& sLeft, const Phase& sRight, const double& distance); virtual void setToZero(); + virtual void setToMax(); virtual void extrapolate(const Phase& slope, const double& distance); virtual void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& /*globalLimiter*/, Limiter& volumeFractionLimiter); + virtual void setMin(const Phase& phase1, const Phase& phase2); + virtual void setMax(const Phase& phase1, const Phase& phase2); + virtual void computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope); //Specific methods for parallele computing at second order //-------------------------------------------------------- diff --git a/src/Models/PUEq/FluxPUEq.cpp b/src/Models/PUEq/FluxPUEq.cpp index a79eb171..f6e37a43 100644 --- a/src/Models/PUEq/FluxPUEq.cpp +++ b/src/Models/PUEq/FluxPUEq.cpp @@ -41,7 +41,7 @@ FluxPUEq::~FluxPUEq(){} //*********************************************************************** -void FluxPUEq::addNonCons(double coefA, const Cell* cell) +void FluxPUEq::addNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Phase* phase; for(int k=0;ksetPressure(mixture->getPressure()); } + for (int k = 0; k < numberPhases; k++) { + phases[k]->setPressure(mixture->getPressure()); + phases[k]->verifyAndCorrectPhase(); + } +} + +//**************************************************************************** +//******************************* Accessors ********************************** +//**************************************************************************** + +double ModPUEq::selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num) const +{ + switch (nameVariable) { + case Variable::pressure: + return mixture->getPressure(); + break; + case Variable::density: + if (num < 0) { + return mixture->getDensity(); + } + else { + return phases[num]->getDensity(); + } + break; + case Variable::alpha: + return phases[num]->getAlpha(); + break; + case Variable::velocityU: + return mixture->getVelocity().getX(); + break; + case Variable::velocityV: + return mixture->getVelocity().getY(); + break; + case Variable::velocityW: + return mixture->getVelocity().getZ(); + break; + case Variable::velocityMag: + return mixture->getVelocity().norm(); + break; + case Variable::transport: + return transports[num].getValue(); + //double psi(0.), coeff(0.75); + //psi = std::pow(transports[num].getValue(), coeff) / (std::pow(transports[num].getValue(), coeff) + std::pow((1 - transports[num].getValue()), coeff)); + //return psi; + break; + case Variable::temperature: + return phases[num]->getTemperature(); + break; + default: + Errors::errorMessage("nameVariable unknown in selectScalar"); return 0; + break; + } } //*********************************************************************** \ No newline at end of file diff --git a/src/Models/PUEq/ModPUEq.h b/src/Models/PUEq/ModPUEq.h index 8b763a53..b791721e 100644 --- a/src/Models/PUEq/ModPUEq.h +++ b/src/Models/PUEq/ModPUEq.h @@ -57,6 +57,16 @@ class ModPUEq : public ModUEq //! \details Complete pressures when restarting a simulation virtual void fulfillStateRestart(Phase** phases, Mixture* mixture); + //Accessors + //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const; + private: static const std::string NAME; diff --git a/src/Models/PUEq/PhasePUEq.cpp b/src/Models/PUEq/PhasePUEq.cpp index c92ec13f..d8980d75 100644 --- a/src/Models/PUEq/PhasePUEq.cpp +++ b/src/Models/PUEq/PhasePUEq.cpp @@ -80,4 +80,73 @@ void PhasePUEq::allocateAndCopyPhase(Phase** vecPhase) *vecPhase = new PhasePUEq(*this); } +//**************************************************************************** +//****************************** DATA PRINTING ******************************* +//**************************************************************************** + +double PhasePUEq::returnScalar(const int& numVar) const +{ + switch (numVar) + { + case 1: + if (m_alpha < 1.e-20) { return 0.; } + else { return m_alpha; } + break; + case 2: + if (m_density < 1.e-20) { return 1.e-20; } + else { return m_density; } + break; + case 3: + if (m_temperature < 1.e-20) { return 1.e-20; } + else { return m_temperature; } + break; + case 4: + if (m_Y < 1.e-20) { return 0.; } + else { return m_Y; } + break; + default: + return 0.; break; + } +} + +//*************************************************************************** + +std::string PhasePUEq::returnNameScalar(const int& numVar) const +{ + switch (numVar) + { + case 1: + return "Alpha"; break; + case 2: + return "Density"; break; + case 3: + return "Temperature"; break; + case 4: + return "Mass fraction"; break; + default: + return "NoName"; break; + } +} + +//**************************************************************************** +//************************* READING FROM FILE ******************************** +//**************************************************************************** + +void PhasePUEq::setScalar(const int& numVar, const double& value) +{ + switch (numVar) + { + case 1: + m_alpha = value; break; + case 2: + m_density = value; break; + case 3: + m_temperature = value; break; + case 4: + m_Y = value; break; + default: + Errors::errorMessage("numVar not found in PhaseUEq::setScalar"); break; + } +} + //*************************************************************************** \ No newline at end of file diff --git a/src/Models/PUEq/PhasePUEq.h b/src/Models/PUEq/PhasePUEq.h index 16fb7abf..0846e06b 100644 --- a/src/Models/PUEq/PhasePUEq.h +++ b/src/Models/PUEq/PhasePUEq.h @@ -55,7 +55,12 @@ class PhasePUEq : public PhaseUEq //Specific methods for data printing //---------------------------------- - virtual int getNumberScalars() const { return numberScalarsPhase; }; + virtual double returnScalar(const int& numVar) const; + virtual std::string returnNameScalar(const int& numVar) const; + + //Specific method for reading from file + //------------------------------------- + virtual void setScalar(const int& numVar, const double& value); }; #endif // PHASEPUEQ_H diff --git a/src/Models/Phase.h b/src/Models/Phase.h index 07d2d929..29ee36b4 100644 --- a/src/Models/Phase.h +++ b/src/Models/Phase.h @@ -35,6 +35,7 @@ #include "../Errors.h" #include "../Eos/Eos.h" #include "../Maths/Coord.h" +#include "../Maths/Tensor.h" #include "../libTierces/tinyxml2.h" #include "../Order2/HeaderLimiter.h" #include "../Tools.h" @@ -92,8 +93,12 @@ class Phase //--------------------------------- virtual void computeSlopesPhase(const Phase& /*sLeft*/, const Phase& /*sRight*/, const double& /*distance*/) { Errors::errorMessage("computeSlopesPhase not available for requested phase type"); }; virtual void setToZero() { Errors::errorMessage("setToZero not available for requested phase type"); }; + virtual void setToMax() { Errors::errorMessage("setToMax not available for requested phase type"); }; virtual void extrapolate(const Phase& /*slope*/, const double& /*distance*/) { Errors::errorMessage("extrapolate not available for requested phase type"); }; virtual void limitSlopes(const Phase& /*slopeGauche*/, const Phase& /*slopeDroite*/, Limiter& /*globalLimiter*/, Limiter& /*volumeFractionLimiter*/) { Errors::errorMessage("limitSlopes not available for requested phase type"); }; + virtual void setMin(const Phase& /*phase1*/, const Phase& /*phase2*/) { Errors::errorMessage("setMin not available for requested phase type"); }; + virtual void setMax(const Phase& /*phase1*/, const Phase& /*phase2*/) { Errors::errorMessage("setMax not available for requested phase type"); }; + virtual void computeGradientLimiter(const Limiter& /*globalLimiter*/, const Phase& /*phase*/, const Phase& /*phaseMin*/, const Phase& /*phaseMax*/, const Phase& /*slope*/) { Errors::errorMessage("computeGradientLimiter not available for requested phase type"); }; //Specific methods for parallele computing at second order //-------------------------------------------------------- @@ -101,6 +106,10 @@ class Phase virtual void fillBufferSlopes(double* /*buffer*/, int& /*counter*/) const { Errors::errorMessage("fillBufferSlopes not available for requested phase type"); }; virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/) { Errors::errorMessage("getBufferSlopes not available for requested phase type"); }; + //Specific methods for solids + //--------------------------- + virtual double getSquareLongitudinalWaveSpeed() const { Errors::errorMessage("getSquareLongitudinalWaveSpeed not available for requested phase type"); return Errors::defaultDouble; }; + //Verifications //------------- virtual void verifyPhase(const std::string& /*message*/ = "") const { Errors::errorMessage("verifyPhase not available for requested phase type"); }; @@ -132,6 +141,13 @@ class Phase virtual const double& getSoundSpeed() const { Errors::errorMessage("getSoundSpeed impossible avec type de phase demande"); return Errors::defaultDouble; }; virtual const double& getTotalEnergy() const { Errors::errorMessage("getTotalEnergy impossible avec type de phase demande"); return Errors::defaultDouble; }; virtual double getTemperature() const { Errors::errorMessage("getT impossible avec type de phase demande"); return 0.; }; + virtual const double& getLambda() const { Errors::errorMessage("getLambda not available for requested phase type"); return Errors::defaultDouble; }; + virtual const double& getEnergyCompaction() const { Errors::errorMessage("getEnergyCompaction not available for requested phase type"); return Errors::defaultDouble; }; + virtual const Tensor& getCobase() const { Errors::errorMessage("getCobase not available for requested phase type"); return Tensor::defaultTensor; }; + virtual Tensor& getCobase() { Errors::errorMessage("getCobase not available for requested phase type"); return Tensor::defaultTensorNonConst; }; + virtual const double& getEnergyElastic() const { Errors::errorMessage("getEnergyElastic not available for requested phase type"); return Errors::defaultDouble; }; + virtual const Tensor& getStressTensor() const { Errors::errorMessage("getStressTensor not available for requested phase type"); return Tensor::defaultTensor; }; + virtual Tensor& getStressTensor() { Errors::errorMessage("getStressTensor not available for requested phase type"); return Tensor::defaultTensorNonConst; }; virtual void setAlpha(double /*alpha*/) { Errors::errorMessage("setAlpha not available for requested phase type"); }; virtual void setDensity(double /*density*/) { Errors::errorMessage("setDensity not available for requested phase type"); }; @@ -154,6 +170,11 @@ class Phase virtual void setTotalEnergy(double /*totalEnergy*/) { Errors::errorMessage("setTotalEnergy not available for requested phase type"); }; virtual void setTotalEnergy(const double & /*energy*/, const Coord& /*vel*/) { Errors::errorMessage("setTotalEnergy not available for requested phase type"); }; virtual void setTemperature(double /*temperature*/) { Errors::errorMessage("setTemperature not available for requested phase type"); }; + virtual void setLambda(double /*lambda*/) { Errors::errorMessage("setLambda not available for requested phase type"); }; + virtual void setEnergyCompaction(double /*energyCompaction*/) { Errors::errorMessage("setEnergyCompaction not available for requested phase type"); }; + virtual void setCobase(const Tensor& /*cobase*/) { Errors::errorMessage("setCobase not available for requested phase type"); }; + virtual void setEnergyElastic(double /*energyElastic*/) { Errors::errorMessage("setEnergyElastic not available for requested phase type"); }; + virtual void setStressTensor(const Tensor& /*stressTensor*/) { Errors::errorMessage("setStressTensor not available for requested phase type"); }; //Operators //--------- diff --git a/src/Models/UEq/FluxUEq.cpp b/src/Models/UEq/FluxUEq.cpp index 51785d8a..e7b3797b 100644 --- a/src/Models/UEq/FluxUEq.cpp +++ b/src/Models/UEq/FluxUEq.cpp @@ -97,6 +97,32 @@ void FluxUEq::subtractFlux(double coefA) //*********************************************************************** +void FluxUEq::addFluxRotatingRegion(double coefA) +{ + for (int k = 0; k < numberPhases; k++) { + m_alpha[k] += coefA*static_cast (fluxBuffMRF)->m_alpha[k]; + m_mass[k] += coefA*static_cast (fluxBuffMRF)->m_mass[k]; + m_energ[k] += coefA*static_cast (fluxBuffMRF)->m_energ[k]; + } + m_momentum += coefA*static_cast (fluxBuffMRF)->m_momentum; + m_energMixture += coefA*static_cast (fluxBuffMRF)->m_energMixture; +} + +//*********************************************************************** + +void FluxUEq::subtractFluxRotatingRegion(double coefA) +{ + for (int k = 0; k < numberPhases; k++) { + m_alpha[k] -= coefA*static_cast (fluxBuffMRF)->m_alpha[k]; + m_mass[k] -= coefA*static_cast (fluxBuffMRF)->m_mass[k]; + m_energ[k] -= coefA*static_cast (fluxBuffMRF)->m_energ[k]; + } + m_momentum -= coefA*static_cast (fluxBuffMRF)->m_momentum; + m_energMixture -= coefA*static_cast (fluxBuffMRF)->m_energMixture; +} + +//*********************************************************************** + void FluxUEq::multiply(double scalar) { for(int k=0;k (fluxBuff)->m_alpha[k] = 0.; - static_cast (fluxBuff)->m_mass[k] = 0.; - static_cast (fluxBuff)->m_energ[k] = 0.; - } - static_cast (fluxBuff)->m_momentum = 0.; - static_cast (fluxBuff)->m_energMixture = 0.; - static_cast (fluxBuff)->m_sM = 0.; -} - -//*********************************************************************** - -void FluxUEq::addNonCons(double coefA, const Cell* cell) +void FluxUEq::addNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Phase* phase; for(int k=0;kgetDensity(); for (int k = 0; k < numberPhases; k++) { - rhoNp1 += m_mass[k] + static_cast (fluxBuff)->getMass(k); + rhoNp1 += m_mass[k] + static_cast (fluxBuff)->getMass(k); //Sum of (alpha_k * rho_k)^(n+1) sumDeltaAlphaRhoInternalEnergy_k += m_energ[k]; } - double DeltaRhoU2(0.), DeltaRhoInternalEnergy(0.); - Coord momentumNp1; momentumNp1 = m_momentum + static_cast (fluxBuff)->getMomentum(); DeltaRhoU2 = momentumNp1.squaredNorm() / rhoNp1 - static_cast (fluxBuff)->getMomentum().squaredNorm() / rhoN; DeltaRhoInternalEnergy = m_energMixture - 0.5*DeltaRhoU2; //Note that here the delta from the surface-tension energy is considered as negligible (0.) - double errorOnEnergy(0.); errorOnEnergy = DeltaRhoInternalEnergy - sumDeltaAlphaRhoInternalEnergy_k; for (int k = 0; k < numberPhases; k++) { m_energ[k] += cell.getPhase(k)->getAlpha() * errorOnEnergy; @@ -341,7 +354,7 @@ void FluxUEq::prepSourceTermsHeating(const double& q) m_mass[k] = 0.; } - //JC//Dev To generalize + //FP//Dev To generalize ////Version 2 directly on PUEq (Kapila) model //double p0 = cell->getMixture()->getPressure(); //double v = 1./cell->getMixture()->getDensity(); @@ -435,4 +448,14 @@ void FluxUEq::setCons(const Flux* cons) m_energMixture = cons->getEnergyMix(); } +//*********************************************************************** + +void FluxUEq::addNonConsMrfFlux(Phase** phase) +{ + for(int k=0; kgetAlpha() * m_uStar; + m_energ[k] += phase[k]->getAlpha() * phase[k]->getPressure() * m_uStar; + } +} + //*********************************************************************** \ No newline at end of file diff --git a/src/Models/UEq/FluxUEq.h b/src/Models/UEq/FluxUEq.h index 54282555..89d611f4 100644 --- a/src/Models/UEq/FluxUEq.h +++ b/src/Models/UEq/FluxUEq.h @@ -49,14 +49,15 @@ class FluxUEq : public Flux virtual void addFlux(double coefA); virtual void addFlux(Flux* flux); virtual void subtractFlux(double coefA); + virtual void addFluxRotatingRegion(double coefA); + virtual void subtractFluxRotatingRegion(double coefA); virtual void multiply(double scalar); virtual void setBufferFlux(Cell& cell); virtual void buildCons(Phase** phases, Mixture* mixture); virtual void buildPrim(Phase** phases, Mixture* mixture); virtual void setToZero(); - virtual void setToZeroBufferFlux(); - virtual void addNonCons(double coefA, const Cell* cell); - virtual void subtractNonCons(double coefA, const Cell* cell); + virtual void addNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/); + virtual void subtractNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/); virtual void schemeCorrection(Cell& cell) const; virtual void addFluxSmooth1D(double coefA, const Coord& normal, Cell* cell); @@ -67,6 +68,9 @@ class FluxUEq : public Flux virtual void prepSourceTermsHeating(const double& q); virtual void prepSourceTermsMRF(Cell* cell, const Coord& omega); + //Moving Reference Frame + virtual void addNonConsMrfFlux(Phase** phases); + // Accessors //---------- virtual const double& getAlpha(const int& numPhase) const { return m_alpha[numPhase]; }; @@ -79,7 +83,7 @@ class FluxUEq : public Flux protected: double* m_alpha; //!< volume fraction array double* m_mass; //!< mass array - double* m_energ; //!< specific internal energy array + double* m_energ; //!< specific internal energy array (may contain compaction energy for UEqSolid model) Coord m_momentum; //!< momentum array double m_energMixture; //!< mixture energy diff --git a/src/Models/UEq/GradMixUEq.cpp b/src/Models/UEq/GradMixUEq.cpp new file mode 100644 index 00000000..0183087d --- /dev/null +++ b/src/Models/UEq/GradMixUEq.cpp @@ -0,0 +1,65 @@ +#include "GradMixUEq.h" + +//*************************************************************************** + +GradMixUEq::GradMixUEq() +{ + m_grads.resize(3); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } +} + +//*************************************************************************** + +GradMixUEq::~GradMixUEq() +{ +} + +//*************************************************************************** + +void GradMixUEq::initializeGradientVectors() +{ + this->initializeGradsVariablesNamesNumerators(); + + variableNamesMixture[VarLocal::velocityU] = Variable::velocityU; + variableNamesMixture[VarLocal::velocityV] = Variable::velocityV; + variableNamesMixture[VarLocal::velocityW] = Variable::velocityW; +} + +//*************************************************************************** + +void GradMixUEq::computeDistanceGradientScalarProduct(Coord const& distance, Mixture* mixture) const +{ + static_cast (mixture)->setVelocity(distance.scalar(m_grads[VarLocal::velocityU]), + distance.scalar(m_grads[VarLocal::velocityV]), + distance.scalar(m_grads[VarLocal::velocityW])); +} + +//*************************************************************************** + +void GradMixUEq::limitGradients(const Mixture& gradientLimiter) +{ + m_grads[VarLocal::velocityU].setX(m_grads[VarLocal::velocityU].getX() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setY(m_grads[VarLocal::velocityU].getY() * gradientLimiter.getVelocity().getX()); + m_grads[VarLocal::velocityU].setZ(m_grads[VarLocal::velocityU].getZ() * gradientLimiter.getVelocity().getX()); + + m_grads[VarLocal::velocityV].setX(m_grads[VarLocal::velocityV].getX() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setY(m_grads[VarLocal::velocityV].getY() * gradientLimiter.getVelocity().getY()); + m_grads[VarLocal::velocityV].setZ(m_grads[VarLocal::velocityV].getZ() * gradientLimiter.getVelocity().getY()); + + m_grads[VarLocal::velocityW].setX(m_grads[VarLocal::velocityW].getX() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setY(m_grads[VarLocal::velocityW].getY() * gradientLimiter.getVelocity().getZ()); + m_grads[VarLocal::velocityW].setZ(m_grads[VarLocal::velocityW].getZ() * gradientLimiter.getVelocity().getZ()); +} + +//*************************************************************************** +//************************** ORDER 2 PARALLEL ******************************* +//*************************************************************************** + +int GradMixUEq::numberOfTransmittedGradients() const +{ + return 9; +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Models/UEq/GradMixUEq.h b/src/Models/UEq/GradMixUEq.h new file mode 100644 index 00000000..dae321ad --- /dev/null +++ b/src/Models/UEq/GradMixUEq.h @@ -0,0 +1,61 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADMIXUEQ_H +#define GRADMIXUEQ_H + +#include "../GradMixture.h" +#include "MixUEq.h" + +class Mixture; + +//! \class GradMixUEq +//! \brief Mixture variable gradients for UEq model. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradMixUEq : public GradMixture +{ +public: + GradMixUEq(); + virtual ~GradMixUEq(); + + virtual void initializeGradientVectors(); + + virtual void computeDistanceGradientScalarProduct(Coord const& distance, Mixture* mixture) const; + virtual void limitGradients(const Mixture& gradientLimiter); + + // O2 parallel + virtual int numberOfTransmittedGradients() const; + +protected: + //! \brief Enumeration for the mixture flow variables, specific to UEq + enum VarLocal { velocityU, velocityV, velocityW }; +}; + +#endif \ No newline at end of file diff --git a/src/Models/UEq/GradPhaseUEq.cpp b/src/Models/UEq/GradPhaseUEq.cpp new file mode 100644 index 00000000..6df6dba3 --- /dev/null +++ b/src/Models/UEq/GradPhaseUEq.cpp @@ -0,0 +1,65 @@ +#include "GradPhaseUEq.h" + +//*************************************************************************** + +GradPhaseUEq::GradPhaseUEq() +{ + m_grads.resize(3); + for (unsigned int i = 0; i < m_grads.size(); ++i) { + m_grads[i] = 0.; + } +} + +//*************************************************************************** + +GradPhaseUEq::~GradPhaseUEq() +{ +} + +//*************************************************************************** + +void GradPhaseUEq::initializeGradientVectors() +{ + this->initializeGradsVariablesNamesNumerators(); + + variableNamesPhases[VarLocal::alpha] = Variable::alpha; + variableNamesPhases[VarLocal::density] = Variable::density; + variableNamesPhases[VarLocal::pressure] = Variable::pressure; +} + +//*************************************************************************** + +void GradPhaseUEq::computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const +{ + static_cast (phase)->setAlpha(distance.scalar(m_grads[VarLocal::alpha])); + static_cast (phase)->setDensity(distance.scalar(m_grads[VarLocal::density])); + static_cast (phase)->setPressure(distance.scalar(m_grads[VarLocal::pressure])); +} + +//*************************************************************************** + +void GradPhaseUEq::limitGradients(const Phase& gradientLimiter) +{ + m_grads[VarLocal::alpha].setX(m_grads[VarLocal::alpha].getX() * gradientLimiter.getAlpha()); + m_grads[VarLocal::alpha].setY(m_grads[VarLocal::alpha].getY() * gradientLimiter.getAlpha()); + m_grads[VarLocal::alpha].setZ(m_grads[VarLocal::alpha].getZ() * gradientLimiter.getAlpha()); + + m_grads[VarLocal::density].setX(m_grads[VarLocal::density].getX() * gradientLimiter.getDensity()); + m_grads[VarLocal::density].setY(m_grads[VarLocal::density].getY() * gradientLimiter.getDensity()); + m_grads[VarLocal::density].setZ(m_grads[VarLocal::density].getZ() * gradientLimiter.getDensity()); + + m_grads[VarLocal::pressure].setX(m_grads[VarLocal::pressure].getX() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setY(m_grads[VarLocal::pressure].getY() * gradientLimiter.getPressure()); + m_grads[VarLocal::pressure].setZ(m_grads[VarLocal::pressure].getZ() * gradientLimiter.getPressure()); +} + +//*************************************************************************** +//************************** ORDER 2 PARALLEL ******************************* +//*************************************************************************** + +int GradPhaseUEq::numberOfTransmittedGradients() const +{ + return 9; +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Models/UEq/GradPhaseUEq.h b/src/Models/UEq/GradPhaseUEq.h new file mode 100644 index 00000000..ec76f8ac --- /dev/null +++ b/src/Models/UEq/GradPhaseUEq.h @@ -0,0 +1,61 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADPHASEUEQ_H +#define GRADPHASEUEQ_H + +#include "../GradPhase.h" +#include "PhaseUEq.h" + +class Phase; + +//! \class GradPhaseUEq +//! \brief Phase variable gradients for UEq model. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class GradPhaseUEq : public GradPhase +{ +public: + GradPhaseUEq(); + virtual ~GradPhaseUEq(); + + virtual void initializeGradientVectors(); + + virtual void computeDistanceGradientScalarProduct(Coord const& distance, Phase* phase) const; + virtual void limitGradients(const Phase& gradientLimiter); + + // O2 parallel + virtual int numberOfTransmittedGradients() const; + +protected: + //! \brief Enumeration for the phase flow variables, specific to UEq + enum VarLocal { alpha, density, pressure }; +}; + +#endif \ No newline at end of file diff --git a/src/Models/UEq/MixUEq.cpp b/src/Models/UEq/MixUEq.cpp index 4b2de797..180c5bee 100644 --- a/src/Models/UEq/MixUEq.cpp +++ b/src/Models/UEq/MixUEq.cpp @@ -162,7 +162,7 @@ void MixUEq::computeMixtureVariables(Phase** vecPhase) //*************************************************************************** -void MixUEq::internalEnergyToTotalEnergy(std::vector& vecGPA) +void MixUEq::computeTotalEnergy(std::vector& vecGPA) { m_totalEnergy = m_energy + 0.5*m_velocity.squaredNorm(); for (unsigned int pa = 0; pa < vecGPA.size(); pa++) { @@ -358,6 +358,13 @@ void MixUEq::setToZero() //*************************************************************************** +void MixUEq::setToMax() +{ + m_velocity.setX(1.e15); m_velocity.setY(1.e15); m_velocity.setZ(1.e15); +} + +//*************************************************************************** + void MixUEq::extrapolate(const Mixture &slope, const double& distance) { m_velocity.setX(m_velocity.getX() + slope.getVelocity().getX() * distance); @@ -374,6 +381,33 @@ void MixUEq::limitSlopes(const Mixture &slopeGauche, const Mixture &slopeDroite, m_velocity.setZ(globalLimiter.limiteSlope(slopeGauche.getVelocity().getZ(), slopeDroite.getVelocity().getZ())); } +//**************************************************************************** + +void MixUEq::setMin(const Mixture& mixture1, const Mixture& mixture2) +{ + m_velocity.setX(std::min(mixture1.getVelocity().getX(), mixture2.getVelocity().getX())); + m_velocity.setY(std::min(mixture1.getVelocity().getY(), mixture2.getVelocity().getY())); + m_velocity.setZ(std::min(mixture1.getVelocity().getZ(), mixture2.getVelocity().getZ())); +} + +//**************************************************************************** + +void MixUEq::setMax(const Mixture& mixture1, const Mixture& mixture2) +{ + m_velocity.setX(std::max(mixture1.getVelocity().getX(), mixture2.getVelocity().getX())); + m_velocity.setY(std::max(mixture1.getVelocity().getY(), mixture2.getVelocity().getY())); + m_velocity.setZ(std::max(mixture1.getVelocity().getZ(), mixture2.getVelocity().getZ())); +} + +//**************************************************************************** + +void MixUEq::computeGradientLimiter(const Limiter& globalLimiter, const Mixture &mixture, const Mixture &mixtureMin, const Mixture &mixtureMax, const Mixture& slope) +{ + m_velocity.setX(std::min(m_velocity.getX(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getX(), mixtureMin.getVelocity().getX(), mixtureMax.getVelocity().getX(), slope.getVelocity().getX()))); + m_velocity.setY(std::min(m_velocity.getY(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getY(), mixtureMin.getVelocity().getY(), mixtureMax.getVelocity().getY(), slope.getVelocity().getY()))); + m_velocity.setZ(std::min(m_velocity.getZ(), globalLimiter.computeGradientLimiter(mixture.getVelocity().getZ(), mixtureMin.getVelocity().getZ(), mixtureMax.getVelocity().getZ(), slope.getVelocity().getZ()))); +} + //**************************************************************************** //************************** ORDER 2 PARALLEL ******************************** //**************************************************************************** diff --git a/src/Models/UEq/MixUEq.h b/src/Models/UEq/MixUEq.h index 81951db4..a8c22306 100644 --- a/src/Models/UEq/MixUEq.h +++ b/src/Models/UEq/MixUEq.h @@ -57,7 +57,7 @@ class MixUEq : public Mixture virtual double computeFrozenSoundSpeed(const double* Yk, const double* ck); virtual void computeMixtureVariables(Phase** vecPhase); - virtual void internalEnergyToTotalEnergy(std::vector& vecGPA); + virtual void computeTotalEnergy(std::vector& vecGPA); virtual void totalEnergyToInternalEnergy(std::vector& vecGPA); virtual void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); @@ -85,8 +85,12 @@ class MixUEq : public Mixture //Second order virtual void computeSlopesMixture(const Mixture &sLeft, const Mixture &sRight, const double& distance); virtual void setToZero(); + virtual void setToMax(); virtual void extrapolate(const Mixture &slope, const double& distance); virtual void limitSlopes(const Mixture &slopeGauche, const Mixture &slopeDroite, Limiter& globalLimiter); + virtual void setMin(const Mixture& mixture1, const Mixture& mixture2); + virtual void setMax(const Mixture& mixture1, const Mixture& mixture2); + virtual void computeGradientLimiter(const Limiter& globalLimiter, const Mixture& mixture, const Mixture& mixtureMin, const Mixture& mixtureMax, const Mixture& slope); //Parallel second order virtual int numberOfTransmittedSlopes() const; diff --git a/src/Models/UEq/ModUEq.cpp b/src/Models/UEq/ModUEq.cpp index a28ea4bb..9ee97024 100644 --- a/src/Models/UEq/ModUEq.cpp +++ b/src/Models/UEq/ModUEq.cpp @@ -29,7 +29,6 @@ // If not, see . #include "ModUEq.h" -#include "PhaseUEq.h" const std::string ModUEq::NAME = "VELOCITYEQ"; @@ -38,6 +37,7 @@ const std::string ModUEq::NAME = "VELOCITYEQ"; ModUEq::ModUEq(const int& numbTransports, const int& numbPhases) : Model(NAME, numbTransports) { fluxBuff = new FluxUEq(numbPhases); + fluxBuffMRF = new FluxUEq(numbPhases); for (int i = 0; i < 4; i++) { sourceCons.push_back(new FluxUEq(numbPhases)); } @@ -52,6 +52,7 @@ ModUEq::ModUEq(const std::string& name, const int& numbTransports) : Model(name, ModUEq::~ModUEq() { delete fluxBuff; + delete fluxBuffMRF; for (int i = 0; i < 4; i++) { delete sourceCons[i]; } @@ -81,6 +82,20 @@ void ModUEq::allocateMixture(Mixture** mixture) //*********************************************************************** +void ModUEq::allocatePhaseGradient(GradPhase** phase) +{ + *phase = new GradPhaseUEq; +} + +//*********************************************************************** + +void ModUEq::allocateMixtureGradient(GradMixture** mixture) +{ + *mixture = new GradMixUEq; +} + +//*********************************************************************** + void ModUEq::fulfillState(Phase** phases, Mixture* mixture) { //Complete phases state @@ -91,8 +106,6 @@ void ModUEq::fulfillState(Phase** phases, Mixture* mixture) mixture->computeMixtureVariables(phases); } -//*********************************************************************** - //**************************************************************************** //********************* Cell to cell Riemann solvers ************************* //**************************************************************************** @@ -253,6 +266,185 @@ void ModUEq::solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& d static_cast (fluxBuff)->m_sM = sM; } +//**************************************************************************** +//*** Half Riemann solver for MRF interface between static/rotating region *** +//**************************************************************************** + +void ModUEq::solveRiemannInternMRF(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, const Coord& omega, const Coord& normal, const Coord& tangent, const Coord& binormal, const Coord& position) const +{ + Phase* vecPhase; + double sL, sR; + double pStar(0.), rhoStar(0.), EStar(0.); + Coord velocityStar; + + double uL = cellLeft.getMixture()->getVelocity().getX(), cL = cellLeft.getMixture()->getFrozenSoundSpeed(), pL = cellLeft.getMixture()->getPressure(), rhoL = cellLeft.getMixture()->getDensity(); + double uR = cellRight.getMixture()->getVelocity().getX(), cR = cellRight.getMixture()->getFrozenSoundSpeed(), pR = cellRight.getMixture()->getPressure(), rhoR = cellRight.getMixture()->getDensity(); + + // Low-Mach preconditioning + double machRefMin(1.); // Default value without low-Mach preco. + if(m_lowMach){ + lowMachSoundSpeed(machRefMin, uL, cL, uR, cR); + } + + //Davies + sL = std::min(uL - cL, uR - cR); + sR = std::max(uR + cR, uL + cL); + + // For low-Mach (for general purpose machRefMin set to 1) + if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); + if (std::fabs(sR)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxRight / std::fabs(sR)); + + //compute left and right mass flow rates and sM + double mL(rhoL*(sL - uL)), mR(rhoR*(sR - uR)), mkL, mkR; + double sM((pR - pL + mL*uL - mR*uR) / (mL - mR)); + if (std::fabs(sM)<1.e-8) sM = 0.; + + //Solution sampling + if (sL >= 0.){ + double vitY = cellLeft.getMixture()->getVelocity().getY(); double vitZ = cellLeft.getMixture()->getVelocity().getZ(); + velocityStar.setXYZ(uL, vitY, vitZ); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + for (int k = 0; k < numberPhases; k++) { + vecPhase = cellLeft.getPhase(k); + double alpha = vecPhase->getAlpha(); + double density = vecPhase->getDensity(); + double energy = vecPhase->getEnergy(); + static_cast (fluxBuff)->m_alpha[k] = alpha*sM; + static_cast (fluxBuff)->m_mass[k] = alpha*density*uL; + static_cast (fluxBuff)->m_energ[k] = alpha*density*energy*uL; + static_cast (fluxBuffMRF)->m_alpha[k] = alpha*velocityStar.getX(); //FP//Should be related to sM (choice on the other components?) + static_cast (fluxBuffMRF)->m_mass[k] = alpha*density*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_energ[k] = alpha*density*energy*velocityStar.getX(); + } + double totalEnergy = cellLeft.getMixture()->getEnergy() + 0.5*cellLeft.getMixture()->getVelocity().squaredNorm(); + static_cast (fluxBuff)->m_momentum.setX(rhoL*uL*uL + pL); + static_cast (fluxBuff)->m_momentum.setY(rhoL*vitY*uL); + static_cast (fluxBuff)->m_momentum.setZ(rhoL*vitZ*uL); + static_cast (fluxBuff)->m_energMixture = (rhoL*totalEnergy + pL)*uL; + static_cast (fluxBuff)->m_uStar = uL; + totalEnergy = cellLeft.getMixture()->getEnergy() + 0.5*velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoL*velocityStar.getX()*velocityStar.getX() + pL); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoL*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoL*velocityStar.getZ()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_energMixture = (rhoL*totalEnergy + pL)*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_uStar = velocityStar.getX(); + } + else if (sR <= 0.){ + double vitY = cellRight.getMixture()->getVelocity().getY(); double vitZ = cellRight.getMixture()->getVelocity().getZ(); + velocityStar.setXYZ(uR, vitY, vitZ); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + for (int k = 0; k < numberPhases; k++) { + vecPhase = cellRight.getPhase(k); + double alpha = vecPhase->getAlpha(); + double density = vecPhase->getDensity(); + double energy = vecPhase->getEnergy(); + static_cast (fluxBuff)->m_alpha[k] = alpha*sM; + static_cast (fluxBuff)->m_mass[k] = alpha*density*uR; + static_cast (fluxBuff)->m_energ[k] = alpha*density*energy*uR; + static_cast (fluxBuffMRF)->m_alpha[k] = alpha*velocityStar.getX(); //FP//Should be related to sM (choice on the other components?) + static_cast (fluxBuffMRF)->m_mass[k] = alpha*density*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_energ[k] = alpha*density*energy*velocityStar.getX(); + } + double totalEnergy = cellRight.getMixture()->getEnergy() + 0.5*cellRight.getMixture()->getVelocity().squaredNorm(); + static_cast (fluxBuff)->m_momentum.setX(rhoR*uR*uR + pR); + static_cast (fluxBuff)->m_momentum.setY(rhoR*vitY*uR); + static_cast (fluxBuff)->m_momentum.setZ(rhoR*vitZ*uR); + static_cast (fluxBuff)->m_energMixture = (rhoR*totalEnergy + pR)*uR; + static_cast (fluxBuff)->m_uStar = uR; + totalEnergy = cellRight.getMixture()->getEnergy() + 0.5*velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoR*velocityStar.getX()*velocityStar.getX() + pR); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoR*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoR*velocityStar.getZ()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_energMixture = (rhoR*totalEnergy + pR)*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_uStar = velocityStar.getX(); + } + else if (sM >= 0.){ + //Compute left solution state + double vitY = cellLeft.getMixture()->getVelocity().getY(); double vitZ = cellLeft.getMixture()->getVelocity().getZ(); + velocityStar.setXYZ(sM, vitY, vitZ); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + double totalEnergy = cellLeft.getMixture()->getEnergy() + 0.5*cellLeft.getMixture()->getVelocity().squaredNorm(); + rhoStar = mL / (sL - sM); + EStar = totalEnergy + (sM - uL)*(sM + pL / mL); + pStar = mL*(sM - uL) + pL; + for (int k = 0; k < numberPhases; k++) { + vecPhase = cellLeft.getPhase(k); + double alpha = vecPhase->getAlpha(); + double density = vecPhase->getDensity(); + double pressure = vecPhase->getPressure(); + mkL = density*(sL - uL); + TB->rhokStar[k] = mkL / (sL - sM); + TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); + TB->pkStar[k] = TB->eos[k]->computePressureIsentropic(pressure, density, TB->rhokStar[k]); + // TB->pkStar[k] = TB->eos[k]->computePressureHugoniot(pressure, density, TB->rhokStar[k]); + if(!m_lowMach) TB->ekStar[k] = TB->eos[k]->computeEnergy(TB->rhokStar[k], TB->pkStar[k]); + else { TB->ekStar[k] = vecPhase->getEnergy(); } + static_cast (fluxBuff)->m_alpha[k] = alpha*sM; + static_cast (fluxBuff)->m_mass[k] = alpha* TB->rhokStar[k] * sM; + static_cast (fluxBuff)->m_energ[k] = alpha* TB->rhokStar[k] * TB->ekStar[k] * sM; + static_cast (fluxBuffMRF)->m_alpha[k] = alpha*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_mass[k] = alpha*TB->rhokStar[k]*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_energ[k] = alpha*TB->rhokStar[k]*TB->ekStar[k]*velocityStar.getX(); + } + static_cast (fluxBuff)->m_momentum.setX(rhoStar*sM*sM + pStar); + static_cast (fluxBuff)->m_momentum.setY(rhoStar*vitY*sM); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar*vitZ*sM); + static_cast (fluxBuff)->m_energMixture = (rhoStar*EStar + pStar)*sM; + static_cast (fluxBuff)->m_uStar = sM; + totalEnergy = EStar - 0.5*(sM*sM+vitY*vitY+vitZ*vitZ); + totalEnergy += 0.5*velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoStar*velocityStar.getX()*velocityStar.getX() + pStar); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoStar*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoStar*velocityStar.getZ()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_energMixture = (rhoStar*totalEnergy + pStar)*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_uStar = velocityStar.getX(); + } + else{ + //Compute right solution state + double vitY = cellRight.getMixture()->getVelocity().getY(); double vitZ = cellRight.getMixture()->getVelocity().getZ(); + velocityStar.setXYZ(sM, vitY, vitZ); + velocityStar.buildRelativeVelForRiemannMRF(omega, normal, tangent, binormal, position); + double totalEnergy = cellRight.getMixture()->getEnergy() + 0.5*cellRight.getMixture()->getVelocity().squaredNorm(); + rhoStar = mR / (sR - sM); + EStar = totalEnergy + (sM - uR)*(sM + pR / mR); + pStar = mR*(sM - uR) + pR; + for (int k = 0; k < numberPhases; k++) { + vecPhase = cellRight.getPhase(k); + double alpha = vecPhase->getAlpha(); + double density = vecPhase->getDensity(); + double pressure = vecPhase->getPressure(); + mkR = density*(sR - uR); + TB->rhokStar[k] = mkR / (sR - sM); + TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); + TB->pkStar[k] = TB->eos[k]->computePressureIsentropic(pressure, density, TB->rhokStar[k]); + // TB->pkStar[k] = TB->eos[k]->computePressureHugoniot(pressure, density, TB->rhokStar[k]); + if(!m_lowMach) TB->ekStar[k] = TB->eos[k]->computeEnergy(TB->rhokStar[k], TB->pkStar[k]); + else { TB->ekStar[k] = vecPhase->getEnergy(); } + static_cast (fluxBuff)->m_alpha[k] = alpha*sM; + static_cast (fluxBuff)->m_mass[k] = alpha* TB->rhokStar[k] * sM; + static_cast (fluxBuff)->m_energ[k] = alpha* TB->rhokStar[k] * TB->ekStar[k] * sM; + static_cast (fluxBuffMRF)->m_alpha[k] = alpha*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_mass[k] = alpha*TB->rhokStar[k]*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_energ[k] = alpha*TB->rhokStar[k]*TB->ekStar[k]*velocityStar.getX(); + } + static_cast (fluxBuff)->m_momentum.setX(rhoStar*sM*sM + pStar); + static_cast (fluxBuff)->m_momentum.setY(rhoStar*vitY*sM); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar*vitZ*sM); + static_cast (fluxBuff)->m_energMixture = (rhoStar*EStar + pStar)*sM; + static_cast (fluxBuff)->m_uStar = sM; + totalEnergy = EStar - 0.5*(sM*sM+vitY*vitY+vitZ*vitZ); + totalEnergy += 0.5*velocityStar.squaredNorm(); + static_cast (fluxBuffMRF)->m_momentum.setX(rhoStar*velocityStar.getX()*velocityStar.getX() + pStar); + static_cast (fluxBuffMRF)->m_momentum.setY(rhoStar*velocityStar.getY()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_momentum.setZ(rhoStar*velocityStar.getZ()*velocityStar.getX()); + static_cast (fluxBuffMRF)->m_energMixture = (rhoStar*totalEnergy + pStar)*velocityStar.getX(); + static_cast (fluxBuffMRF)->m_uStar = velocityStar.getX(); + } + + //Contact discontinuity velocity + static_cast (fluxBuff)->m_sM = sM; +} + //**************************************************************************** //************** Half Riemann solvers for boundary conditions **************** //**************************************************************************** @@ -301,13 +493,15 @@ void ModUEq::solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dtMa //**************************************************************************** -void ModUEq::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* ak0, const double* rhok0, const double* pk0, std::vector &boundData) const +void ModUEq::solveRiemannInletTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const { - double sL, zL; - double pStar(0.), uStar(0.), rhoStar(0.); + double tabp[50], tabf[50]; + double sL, zL, sM, vmv0, mL; + double pStar(0.), uStar(0.), rhoStar(0.), vStar(0.), uyStar(0.), uzStar(0.); + Phase* vecPhase; double uL = cellLeft.getMixture()->getVelocity().getX(), cL = cellLeft.getMixture()->getWoodSoundSpeed(), pL = cellLeft.getMixture()->getPressure(), rhoL = cellLeft.getMixture()->getDensity(); - // double vL = cellLeft.getMixture()->getVelocity().getY(), wL = cellLeft.getMixture()->getVelocity().getZ(); + double uyL = cellLeft.getMixture()->getVelocity().getY(), uzL = cellLeft.getMixture()->getVelocity().getZ(); // Low-Mach preconditioning double machRefMin(1.); // Default value without low-Mach preco. @@ -315,63 +509,241 @@ void ModUEq::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dt lowMachSoundSpeed(machRefMin, uL, cL); } - //Compute total enthalpy of injected fluid and speed of sound - double rho0 = cellLeft.getMixture()->computeDensity(ak0, rhok0); - double u0 = m0 / rho0; - double c0(0.), p0(0.); - for (int k = 0;k < numberPhases; k++) { - p0 += ak0[k] * pk0[k]; - TB->Hk0[k] = TB->eos[k]->computeTotalEnthalpy(rhok0[k], pk0[k], u0); - TB->Yk0[k] = ak0[k] * rhok0[k] / rho0; - double ck = cellLeft.getPhase(k)->getEos()->computeSoundSpeed(rhok0[k], pk0[k]); - c0 += ak0[k]/ std::max((rhok0[k] * ck * ck), epsilonAlphaNull); - } - c0 = 1./ sqrt(rho0 * c0); + zL = rhoL*cL; - //Estimates for acoustic wave sL - sL = uL - cL; + //1) Left wave velocity estimation using pStar = p0 + //------------------------------------------------- + pStar = p0; vStar = 0.; + for (int k = 0; k < numberPhases; k++) { + vecPhase = cellLeft.getPhase(k); + //TB->rhokStar[k] = TB->eos[k]->computeDensityIsentropic(vecPhase->getPressure(), vecPhase->getDensity(), pStar); //other possiblity + TB->rhokStar[k] = TB->eos[k]->computeDensityHugoniot(vecPhase->getPressure(), vecPhase->getDensity(), pStar); + TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); + vStar += vecPhase->getAlpha()*vecPhase->getDensity() / rhoL / std::max(TB->rhokStar[k], epsilonAlphaNull); + } + vmv0 = vStar - 1. / rhoL; + if (std::fabs(vmv0) > 1e-10) { mL = sqrt((pL - pStar) / vmv0); } + else { mL = zL; } + sL = uL - mL / rhoL; // For low-Mach (for general purpose machRefMin set to 1) if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - zL = rhoL*cL; + sM = uL + mL*vmv0; - //Null Mass flow - //-------------- - if (fabs(u0) < 1.e-6) { - uStar = 0.; + //2) Check for pathologic cases + //----------------------------- + if (sL >= 0.) { //supersonic outflow => left state solution + uStar = uL; pStar = pL; - rhoStar = rhoL; for (int k = 0; k < numberPhases; k++) { - TB->vkStar[k] = 1. / cellLeft.getPhase(k)->getDensity(); + vecPhase = cellLeft.getPhase(k); + TB->rhokStar[k] = vecPhase->getDensity(); + TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); + TB->YkStar[k] = vecPhase->getAlpha()*vecPhase->getDensity() / rhoL; } + rhoStar = rhoL; + uyStar = uyL; + uzStar = uzL; } - //Supersonic inflow - //----------------- - else if (u0 < -c0) { - uStar = u0; - pStar = p0; - rhoStar = rho0; + else if (sM >= -1e-3) { //subsonic outflow => star left state solution + uStar = sM; + pStar = p0; //approximation for (int k = 0; k < numberPhases; k++) { - TB->vkStar[k] = 1. / rhok0[k]; + // TB->rhokStar[k] unchanged : see 1) + TB->YkStar[k] = cellLeft.getPhase(k)->getAlpha()*cellLeft.getPhase(k)->getDensity() / rhoL; } + rhoStar = 1. / vStar; + uyStar = uyL; + uzStar = uzL; } - else { - //Subsonic inflow - //--------------- + + //3) Tank + //------- + else { //tank inflow => star right state solution + //Total enthalpy in tank state + double H0(0.); + Coord u0(0.); + double rho0 = cellLeft.getMixture()->computeDensity(ak0, rhok0); + for (int k = 0;k < numberPhases;k++) { + TB->Yk0[k] = ak0[k] * rhok0[k] / rho0; + H0 += TB->Yk0[k] * TB->eos[k]->computeTotalEnthalpy(rhok0[k], p0, u0.norm()); //default zero velocity in tank + } + //ITERATIVE PROCESS FOR PRESSURE DETERMINATION + //-------------------------------------------- int iteration(0); - pStar = pL; + double p(0.5*p0); double f(0.), df(1.); - double u, du, hk; - double vStar(0.), dvStar(0.), dvk(0.); - + double hk, dhk, rhok, drhok, dmL, YkL; + double uStarR(0.), duStarR(0.), uStarL(0.), duStarL(0.); + double vStarL(0.), dvStarL(0.); do { - pStar -= f / df; iteration++; - if (iteration > 50) { exit(0); Errors::errorMessage("solveRiemannInflow not converged in ModUEq"); } + p -= f / df; iteration++; //Physical pressure ? + for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(p); } + if (p > p0) { p = p0 - 1e-6; } + tabp[iteration - 1] = p; tabf[iteration - 1] = f; + if (iteration > 50) { + for (int i = 0; i < 50; i++) { std::cout << tabp[i] << " " << tabf[i] << std::endl; } + Errors::errorMessage("solveRiemannInletTank not converged in ModUEq"); + } + //R) Tank rekations in the right (H=cte et sk=cste) + uStarR = H0; duStarR = 0.; for (int k = 0; k < numberPhases; k++) { - TB->eos[k]->verifyAndModifyPressure(pStar); + TB->rhokStar[k] = TB->eos[k]->computeDensityIsentropic(p0, rhok0[k], p); + TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); + hk = TB->eos[k]->computeEnthalpyIsentropic(p0, rhok0[k], p, &dhk); + uStarR -= TB->Yk0[k] * hk; + duStarR -= TB->Yk0[k] * dhk; } - if (pStar - pL - zL*uL < 0.) pStar = (1. + 1.e-6)*(pL + zL * uL); - //Left acoustic relations + uStarR = -sqrt(2.*uStarR); + duStarR = duStarR / uStarR; + //L) Left relations sk=cste (could be R-H if needed) + vStarL = 0.; dvStarL = 0.; + for (int k = 0; k < numberPhases; k++) { + vecPhase = cellLeft.getPhase(k); + rhok = TB->eos[k]->computeDensityIsentropic(vecPhase->getPressure(), vecPhase->getDensity(), p, &drhok); //other possiblity + //rhok = TB->eos[k]->computeDensityHugoniot(vecPhase->getPressure(), vecPhase->getDensity(), p, &drhok); + TB->eos[k]->verifyAndCorrectDensityMax(rhok); + YkL = vecPhase->getAlpha()*vecPhase->getDensity() / rhoL; + vStarL += YkL / std::max(rhok, epsilonAlphaNull); + dvStarL -= YkL / std::max((rhok * rhok), epsilonAlphaNull) * drhok; + } + vmv0 = vStarL - 1. / rhoL; + if (std::fabs(vmv0) > 1e-10) { + mL = sqrt((pL - p) / vmv0); + dmL = 0.5*(-vmv0 + (p - pL)*dvStarL) / (vmv0*vmv0) / mL; + } + else { + mL = zL; + dmL = 0.; + } + sL = uL - mL / rhoL; + // For low-Mach (for general purpose machRefMin set to 1) + if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); + uStarL = uL + mL*vmv0; + duStarL = dmL*vmv0 + mL*dvStarL; + //solved function + f = uStarR - uStarL; + df = duStarR - duStarL; + } while (std::fabs(f)>1e-2); //End iterative loop + pStar = p; + uStar = 0.5*(uStarL + uStarR); + rhoStar = 0.; + for (int k = 0; k < numberPhases; k++) { + TB->YkStar[k] = TB->Yk0[k]; + rhoStar += TB->YkStar[k] / std::max(TB->rhokStar[k], epsilonAlphaNull); + } + rhoStar = 1. / rhoStar; + uyStar = 0.; + uzStar = 0.; + sM = uStar; + + } //End tank case + + //4) Flux completion + //------------------ + double akStar; + double EStar(0.5*(uStar*uStar + uyStar*uyStar + uzStar*uzStar)), ek; + for (int k = 0; k < numberPhases; k++) { + if(!m_lowMach) ek = TB->eos[k]->computeEnergy(TB->rhokStar[k], pStar); + else { ek = cellLeft.getPhase(k)->getEnergy(); } + EStar += TB->YkStar[k] * ek; + akStar = TB->YkStar[k] * rhoStar / std::max(TB->rhokStar[k], epsilonAlphaNull); + static_cast (fluxBuff)->m_alpha[k] = akStar * sM; + static_cast (fluxBuff)->m_mass[k] = akStar * uStar * TB->rhokStar[k]; + static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_mass[k] * ek; + } + static_cast (fluxBuff)->m_momentum.setX(rhoStar*uStar*uStar + pStar); + static_cast (fluxBuff)->m_momentum.setY(rhoStar*uStar*uyStar); + static_cast (fluxBuff)->m_momentum.setZ(rhoStar*uStar*uzStar); + static_cast (fluxBuff)->m_energMixture = (rhoStar*EStar + pStar)*uStar; + + //Contact discontinuity velocity + static_cast (fluxBuff)->m_sM = sM; + static_cast (fluxBuff)->m_uStar = uStar; + + // Boundary data for output + boundData[VarBoundary::p] = pStar; + boundData[VarBoundary::rho] = rhoStar; + boundData[VarBoundary::velU] = uStar; + boundData[VarBoundary::velV] = uyStar; + boundData[VarBoundary::velW] = uzStar; +} + +//**************************************************************************** + +void ModUEq::solveRiemannInletInjStagState(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* ak0, const double* rhok0, const double* pk0, std::vector &boundData) const +{ + double sL, zL, sM; + double pStar(0.), uStar(0.), rhoStar(0.); + + double uL = cellLeft.getMixture()->getVelocity().getX(), cL = cellLeft.getMixture()->getWoodSoundSpeed(), pL = cellLeft.getMixture()->getPressure(), rhoL = cellLeft.getMixture()->getDensity(); + // double vL = cellLeft.getMixture()->getVelocity().getY(), wL = cellLeft.getMixture()->getVelocity().getZ(); + + // Low-Mach preconditioning + double machRefMin(1.); // Default value without low-Mach preco. + if(m_lowMach){ + lowMachSoundSpeed(machRefMin, uL, cL); + } + + //Compute total enthalpy of injected fluid and speed of sound + double rho0 = cellLeft.getMixture()->computeDensity(ak0, rhok0); + double u0 = m0 / rho0; + double c0(0.), p0(0.); + for (int k = 0;k < numberPhases; k++) { + p0 += ak0[k] * pk0[k]; + TB->Hk0[k] = TB->eos[k]->computeTotalEnthalpy(rhok0[k], pk0[k], u0); + TB->Yk0[k] = ak0[k] * rhok0[k] / rho0; + double ck = cellLeft.getPhase(k)->getEos()->computeSoundSpeed(rhok0[k], pk0[k]); + c0 += ak0[k]/ std::max((rhok0[k] * ck * ck), epsilonAlphaNull); + } + c0 = 1./ sqrt(rho0 * c0); + + //Estimates for acoustic wave sL + sL = uL - cL; + // For low-Mach (for general purpose machRefMin set to 1) + if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); + zL = rhoL*cL; + + //Null Mass flow + //-------------- + if (fabs(u0) < 1.e-6) { + uStar = 0.; + sM = 0.; + pStar = pL; + rhoStar = rhoL; + for (int k = 0; k < numberPhases; k++) { + TB->vkStar[k] = 1. / cellLeft.getPhase(k)->getDensity(); + } + } + //Supersonic inflow + //----------------- + else if (u0 < -c0) { + uStar = u0; + sM = u0; + pStar = p0; + rhoStar = rho0; + for (int k = 0; k < numberPhases; k++) { + TB->vkStar[k] = 1. / rhok0[k]; + } + } + else { + //Subsonic inflow + //--------------- + int iteration(0); + pStar = pL; + double f(0.), df(1.); + double u, du, hk; + double vStar(0.), dvStar(0.), dvk(0.); + + do { + pStar -= f / df; iteration++; + if (iteration > 50) { exit(0); Errors::errorMessage("solveRiemannInletInjStagState not converged in ModUEq"); } + //Physical pressure ? + for (int k = 0; k < numberPhases; k++) { + TB->eos[k]->verifyAndModifyPressure(pStar); + } + if (pStar - pL - zL*uL < 0.) pStar = (1. + 1.e-6)*(pL + zL * uL); + //Left acoustic relations u = uL + (pL - pStar) / zL; du = -1. / zL; @@ -392,19 +764,22 @@ void ModUEq::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dt df -= m0 * dvStar; } while (std::fabs(f) > 1e-8 && iteration <= 50); uStar = u; + sM = u; rhoStar = m0 / uStar; } //Flux completion + double akStar; double Estar(0.5*(uStar * uStar)), ek, rhok; for (int k = 0; kvkStar[k]; if(!m_lowMach) ek = TB->eos[k]->computeEnergy(rhok, pStar); else { ek = cellLeft.getPhase(k)->getEnergy(); } Estar += TB->Yk0[k] * ek; - static_cast (fluxBuff)->m_alpha[k] = TB->Yk0[k] * TB->vkStar[k] * rhoStar * uStar; - static_cast (fluxBuff)->m_mass[k] = static_cast (fluxBuff)->m_alpha[k] * rhok; - static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_alpha[k] * rhok*ek; + akStar = TB->Yk0[k] * TB->vkStar[k] * rhoStar; + static_cast (fluxBuff)->m_alpha[k] = akStar * sM; + static_cast (fluxBuff)->m_mass[k] = akStar * uStar * rhok; + static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_mass[k] * ek; } static_cast (fluxBuff)->m_momentum.setX(uStar * uStar * rhoStar + pStar); static_cast (fluxBuff)->m_momentum.setY(0.); @@ -412,7 +787,7 @@ void ModUEq::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dt static_cast (fluxBuff)->m_energMixture = (Estar * rhoStar + pStar)* uStar; //Contact discontinuity velocity - static_cast (fluxBuff)->m_sM = uStar; + static_cast (fluxBuff)->m_sM = sM; static_cast (fluxBuff)->m_uStar = uStar; // Boundary data for output @@ -425,12 +800,14 @@ void ModUEq::solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dt //**************************************************************************** -void ModUEq::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* ak0, std::vector &boundData) const +void ModUEq::solveRiemannInletInjTemp(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* ak0, std::vector &boundData) const { - double sL, zL; + double sL, zL, sM; - double uL = cellLeft.getMixture()->getVelocity().getX(), cL = cellLeft.getMixture()->getWoodSoundSpeed(), pL = cellLeft.getMixture()->getPressure(), rhoL = cellLeft.getMixture()->getDensity(); - // double vL = cellLeft.getMixture()->getVelocity().getY(), wL = cellLeft.getMixture()->getVelocity().getZ(); + double uL = cellLeft.getMixture()->getVelocity().getX(); + double pL = cellLeft.getMixture()->getPressure(); + double rhoL = cellLeft.getMixture()->getDensity(); + double cL = cellLeft.getMixture()->getWoodSoundSpeed(); // Low-Mach preconditioning double machRefMin(1.); // Default value without low-Mach preco. @@ -443,15 +820,15 @@ void ModUEq::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dt int it(0); double pStar(pL), uStar(0.), rhoStar(0.), f(0.), df(1.); double u(0.), du(0.); - double rhok(0.), drhok(0.), vStarL(0.), dvStarL(0.), vmv0(0.), mL(zL), dmL(0.), YkL(0.); + double rhok(0.), drhok(0.), vStarL(0.), dvStarL(0.), vSmvL(0.), mL(zL), dmL(0.), YkL(0.); Phase* vecPhase; do { pStar -= f / df; it++; - if (it > 50) { Errors::errorMessage("solveRiemannSubInj not converged in ModUEq"); } - // Physical pressure ? + if (it > 50) { Errors::errorMessage("solveRiemannInletInjTemp not converged in ModUEq"); } + // Check physical pressure for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(pStar); } @@ -466,10 +843,10 @@ void ModUEq::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dt dvStarL -= YkL / std::max((rhok *rhok), epsilonAlphaNull) * drhok; } - vmv0 = vStarL - 1. / rhoL; - if (std::fabs(vmv0) > 1e-10) { - mL = sqrt((pL - pStar) / vmv0); - dmL = 0.5*(-vmv0 + (p - pL)*dvStarL) / (vmv0*vmv0) / mL; + vSmvL = vStarL - 1. / rhoL; + if (std::fabs(vSmvL) > 1.e-10) { + mL = sqrt((pL - pStar) / vSmvL); + dmL = 0.5*(-vSmvL + (p - pL)*dvStarL) / (vSmvL*vSmvL) / mL; } else { mL = zL; @@ -480,14 +857,15 @@ void ModUEq::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dt sL = uL - mL / rhoL; - u = uL + mL * vmv0; - du = dmL * vmv0 + mL * dvStarL; + u = uL + mL * vSmvL; + du = dmL * vSmvL + mL * dvStarL; f = m0 * vStarL - u; df = m0 * dvStarL - du; } while (std::fabs(f) > 1e-8 && it <= 50); uStar = u; + sM = u; rhoStar = m0 / uStar; // For low-Mach (for general purpose machRefMin set to 1) @@ -501,9 +879,9 @@ void ModUEq::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dt else { ekStar = cellLeft.getPhase(k)->getEnergy(); } TB->YkStar[k] = ak0[k] * TB->rhokStar[k] / rhoStar; Estar += TB->YkStar[k] * ekStar; - static_cast (fluxBuff)->m_alpha[k] = ak0[k] * uStar; - static_cast (fluxBuff)->m_mass[k] = static_cast (fluxBuff)->m_alpha[k] * TB->rhokStar[k]; - static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_alpha[k] * TB->rhokStar[k] * ekStar; + static_cast (fluxBuff)->m_alpha[k] = ak0[k] * sM; + static_cast (fluxBuff)->m_mass[k] = ak0[k] * uStar * TB->rhokStar[k]; + static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_mass[k] * ekStar; } static_cast (fluxBuff)->m_momentum.setX(uStar * uStar * rhoStar + pStar); static_cast (fluxBuff)->m_momentum.setY(0.); @@ -511,7 +889,7 @@ void ModUEq::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dt static_cast (fluxBuff)->m_energMixture = (Estar * rhoStar + pStar)* uStar; //Contact discontinuity velocity - static_cast (fluxBuff)->m_sM = uStar; + static_cast (fluxBuff)->m_sM = sM; static_cast (fluxBuff)->m_uStar = uStar; // Boundary data for output @@ -524,12 +902,10 @@ void ModUEq::solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dt //**************************************************************************** -void ModUEq::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const +void ModUEq::solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const { - double tabp[50], tabf[50]; - double sL, zL, sM, vmv0, mL; - double pStar(0.), uStar(0.), rhoStar(0.), vStar(0.), uyStar(0.), uzStar(0.); - Phase* vecPhase; + double sL, sM, zL; + double pStar(p0), EStar(0.), vStar(0.), uStar(0.); double uL = cellLeft.getMixture()->getVelocity().getX(), cL = cellLeft.getMixture()->getWoodSoundSpeed(), pL = cellLeft.getMixture()->getPressure(), rhoL = cellLeft.getMixture()->getDensity(); double uyL = cellLeft.getMixture()->getVelocity().getY(), uzL = cellLeft.getMixture()->getVelocity().getZ(); @@ -542,149 +918,58 @@ void ModUEq::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMa zL = rhoL*cL; - //1) Left wave velocity estimation using pStar = p0 - //------------------------------------------------- - pStar = p0; vStar = 0.; + //Left wave : isentropic wave assumption + //-------------------------------------- + double vSmvL, mL(zL); for (int k = 0; k < numberPhases; k++) { - vecPhase = cellLeft.getPhase(k); - //TB->rhokStar[k] = TB->eos[k]->computeDensityIsentropic(vecPhase->getPressure(), vecPhase->getDensity(), pStar); //other possiblity - TB->rhokStar[k] = TB->eos[k]->computeDensityHugoniot(vecPhase->getPressure(), vecPhase->getDensity(), pStar); + //TB->rhokStar[k] = TB->eos[k]->computeDensityIsentropic(pL, vecPhase->getDensity(), pStar); //other possiblity + TB->rhokStar[k] = TB->eos[k]->computeDensityHugoniot(pL, cellLeft.getPhase(k)->getDensity(), pStar); TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); - vStar += vecPhase->getAlpha()*vecPhase->getDensity() / rhoL / std::max(TB->rhokStar[k], epsilonAlphaNull); + vStar += cellLeft.getPhase(k)->getAlpha()*cellLeft.getPhase(k)->getDensity() /rhoL / std::max(TB->rhokStar[k], epsilonAlphaNull); } - vmv0 = vStar - 1. / rhoL; - if (std::fabs(vmv0) > 1e-10) { mL = sqrt((pL - pStar) / vmv0); } - else { mL = zL; } + vSmvL = vStar - 1. / rhoL; + if (std::fabs(vSmvL) > 1e-10) { mL = sqrt((pL - pStar) / vSmvL); } sL = uL - mL / rhoL; // For low-Mach (for general purpose machRefMin set to 1) if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - sM = uL + mL*vmv0; + sM = uL + mL*vSmvL; - //2) Check for pathologic cases - //----------------------------- - if (sL >= 0.) { //supersonic outflow => left state solution + //Pathologic case sL>0 + if (sL >= 0.) { //Supersonic outflow => Left state solution uStar = uL; pStar = pL; - for (int k = 0; k < numberPhases; k++) { - vecPhase = cellLeft.getPhase(k); - TB->rhokStar[k] = vecPhase->getDensity(); - TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); - TB->YkStar[k] = vecPhase->getAlpha()*vecPhase->getDensity() / rhoL; - } - rhoStar = rhoL; - uyStar = uyL; - uzStar = uzL; + for (int k = 0; k < numberPhases; k++) { TB->rhokStar[k] = cellLeft.getPhase(k)->getDensity(); } + vStar = 1. / rhoL; } - else if (sM >= -1e-3) { //subsonic outflow => star left state solution + else if (sM < 0) { //Inflow conditions : the outflow assumption is not adapted + uStar = sM; + for (int k = 0; k < numberPhases; k++) { TB->rhokStar[k] = cellLeft.getPhase(k)->getDensity(); } + vStar = 1. / rhoL; + } + else { //imposed pressure outflow OK uStar = sM; - pStar = p0; //approximation - for (int k = 0; k < numberPhases; k++) { - // TB->rhokStar[k] unchanged : see 1) - TB->YkStar[k] = cellLeft.getPhase(k)->getAlpha()*cellLeft.getPhase(k)->getDensity() / rhoL; - } - rhoStar = 1. / vStar; - uyStar = uyL; - uzStar = uzL; } - //3) Tank - //------- - else { //tank inflow => star right state solution - //Total enthalpy in tank state - double H0(0.); - Coord u0(0.); - double rho0 = cellLeft.getMixture()->computeDensity(ak0, rhok0); - for (int k = 0;k < numberPhases;k++) { - TB->Yk0[k] = ak0[k] * rhok0[k] / rho0; - H0 += TB->Yk0[k] * TB->eos[k]->computeTotalEnthalpy(rhok0[k], p0, u0.norm()); //default zero velocity in tank - } - //ITERATIVE PROCESS FOR PRESSURE DETERMINATION - //-------------------------------------------- - int iteration(0); - double p(0.5*p0); - double f(0.), df(1.); - double hk, dhk, rhok, drhok, dmL, YkL; - double uStarR(0.), duStarR(0.), uStarL(0.), duStarL(0.); - double vStarL(0.), dvStarL(0.); - do { - p -= f / df; iteration++; - //Physical pressure ? - for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(p); } - if (p > p0) { p = p0 - 1e-6; } - tabp[iteration - 1] = p; tabf[iteration - 1] = f; - if (iteration > 50) { - for (int i = 0; i < 50; i++) { std::cout << tabp[i] << " " << tabf[i] << std::endl; } - Errors::errorMessage("solveRiemannTank not converged in ModUEq"); - } - //R) Tank rekations in the right (H=cte et sk=cste) - uStarR = H0; duStarR = 0.; - for (int k = 0; k < numberPhases; k++) { - TB->rhokStar[k] = TB->eos[k]->computeDensityIsentropic(p0, rhok0[k], p); - TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); - hk = TB->eos[k]->computeEnthalpyIsentropic(p0, rhok0[k], p, &dhk); - uStarR -= TB->Yk0[k] * hk; - duStarR -= TB->Yk0[k] * dhk; - } - uStarR = -sqrt(2.*uStarR); - duStarR = duStarR / uStarR; - //L) Left relations sk=cste (could be R-H if needed) - vStarL = 0.; dvStarL = 0.; - for (int k = 0; k < numberPhases; k++) { - vecPhase = cellLeft.getPhase(k); - rhok = TB->eos[k]->computeDensityIsentropic(vecPhase->getPressure(), vecPhase->getDensity(), p, &drhok); //other possiblity - //rhok = TB->eos[k]->computeDensityHugoniot(vecPhase->getPressure(), vecPhase->getDensity(), p, &drhok); - TB->eos[k]->verifyAndCorrectDensityMax(rhok); - YkL = vecPhase->getAlpha()*vecPhase->getDensity() / rhoL; - vStarL += YkL / std::max(rhok, epsilonAlphaNull); - dvStarL -= YkL / std::max((rhok * rhok), epsilonAlphaNull) * drhok; - } - vmv0 = vStarL - 1. / rhoL; - if (std::fabs(vmv0) > 1e-10) { - mL = sqrt((pL - p) / vmv0); - dmL = 0.5*(-vmv0 + (p - pL)*dvStarL) / (vmv0*vmv0) / mL; - } - else { - mL = zL; - dmL = 0.; - } - sL = uL - mL / rhoL; - // For low-Mach (for general purpose machRefMin set to 1) - if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - uStarL = uL + mL*vmv0; - duStarL = dmL*vmv0 + mL*dvStarL; - //solved function - f = uStarR - uStarL; - df = duStarR - duStarL; - } while (std::fabs(f)>1e-2); //End iterative loop - pStar = p; - uStar = 0.5*(uStarL + uStarR); - rhoStar = 0.; - for (int k = 0; k < numberPhases; k++) { - TB->YkStar[k] = TB->Yk0[k]; - rhoStar += TB->YkStar[k] / std::max(TB->rhokStar[k], epsilonAlphaNull); - } - rhoStar = 1. / rhoStar; - uyStar = 0.; - uzStar = 0.; - sM = uStar; + //Flux completion + double ekStar, YkL, akStar; + EStar = 0.5*(uStar*uStar + uyL * uyL + uzL * uzL); + for (int k = 0; k < numberPhases; k++) { + YkL = cellLeft.getPhase(k)->getAlpha()*cellLeft.getPhase(k)->getDensity() / rhoL; + akStar = YkL / std::max(TB->rhokStar[k], epsilonAlphaNull) / vStar; - } //End tank case + if(!m_lowMach) ekStar = TB->eos[k]->computeEnergy(TB->rhokStar[k], pStar); + else { ekStar = cellLeft.getPhase(k)->getEnergy(); } - //4) Flux completion - //------------------ - double EStar(0.5*(uStar*uStar + uyStar*uyStar + uzStar*uzStar)), ek; - for (int k = 0; k < numberPhases; k++) { - if(!m_lowMach) ek = TB->eos[k]->computeEnergy(TB->rhokStar[k], pStar); - else { ek = cellLeft.getPhase(k)->getEnergy(); } - EStar += TB->YkStar[k] * ek; - static_cast (fluxBuff)->m_alpha[k] = TB->YkStar[k] * rhoStar / std::max(TB->rhokStar[k], epsilonAlphaNull) * uStar; - static_cast (fluxBuff)->m_mass[k] = static_cast (fluxBuff)->m_alpha[k] * TB->rhokStar[k]; - static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_mass[k] * ek; + static_cast (fluxBuff)->m_alpha[k] = akStar * sM; + static_cast (fluxBuff)->m_mass[k] = akStar * uStar * TB->rhokStar[k]; + static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_mass[k] * ekStar; + + EStar += YkL * ekStar; } - static_cast (fluxBuff)->m_momentum.setX(rhoStar*uStar*uStar + pStar); - static_cast (fluxBuff)->m_momentum.setY(rhoStar*uStar*uyStar); - static_cast (fluxBuff)->m_momentum.setZ(rhoStar*uStar*uzStar); - static_cast (fluxBuff)->m_energMixture = (rhoStar*EStar + pStar)*uStar; + static_cast (fluxBuff)->m_momentum.setX(uStar*uStar / vStar + pStar); + static_cast (fluxBuff)->m_momentum.setY(uStar*uyL / vStar); + static_cast (fluxBuff)->m_momentum.setZ(uStar*uzL / vStar); + static_cast (fluxBuff)->m_energMixture = (EStar / vStar + pStar)*uStar; //Contact discontinuity velocity static_cast (fluxBuff)->m_sM = sM; @@ -692,21 +977,24 @@ void ModUEq::solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMa // Boundary data for output boundData[VarBoundary::p] = pStar; - boundData[VarBoundary::rho] = rhoStar; + boundData[VarBoundary::rho] = 1./vStar; boundData[VarBoundary::velU] = uStar; - boundData[VarBoundary::velV] = uyStar; - boundData[VarBoundary::velW] = uzStar; + boundData[VarBoundary::velV] = uyL; + boundData[VarBoundary::velW] = uzL; } //**************************************************************************** -void ModUEq::solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const +void ModUEq::solveRiemannOutletMassflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, std::vector& boundData) const { - double sL, sM, zL; - double pStar(p0), EStar(0.), vStar(0.), uStar(0.); - - double uL = cellLeft.getMixture()->getVelocity().getX(), cL = cellLeft.getMixture()->getWoodSoundSpeed(), pL = cellLeft.getMixture()->getPressure(), rhoL = cellLeft.getMixture()->getDensity(); - double uyL = cellLeft.getMixture()->getVelocity().getY(), uzL = cellLeft.getMixture()->getVelocity().getZ(); + Phase* vecPhase; + double sL, zL; + double uL = cellLeft.getMixture()->getVelocity().getX(); + double uyL = cellLeft.getMixture()->getVelocity().getY(); + double uzL = cellLeft.getMixture()->getVelocity().getZ(); + double cL = cellLeft.getMixture()->getWoodSoundSpeed(); + double pL = cellLeft.getMixture()->getPressure(); + double rhoL = cellLeft.getMixture()->getDensity(); // Low-Mach preconditioning double machRefMin(1.); // Default value without low-Mach preco. @@ -716,48 +1004,86 @@ void ModUEq::solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& d zL = rhoL*cL; - //Left wave : isentropic wave assumption - //-------------------------------------- - double vSmvL, mL(zL); - for (int k = 0; k < numberPhases; k++) { - //TB->rhokStar[k] = TB->eos[k]->computeDensityIsentropic(pL, vecPhase->getDensity(), pStar); //other possiblity - TB->rhokStar[k] = TB->eos[k]->computeDensityHugoniot(pL, cellLeft.getPhase(k)->getDensity(), pStar); - TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); - vStar += cellLeft.getPhase(k)->getAlpha()*cellLeft.getPhase(k)->getDensity() /rhoL / std::max(TB->rhokStar[k], epsilonAlphaNull); - } - vSmvL = vStar - 1. / rhoL; - if (std::fabs(vSmvL) > 1e-10) { mL = sqrt((pL - pStar) / vSmvL); } - sL = uL - mL / rhoL; + // ITERATIVE PROCESS FOR PRESSURE DETERMINATION + // -------------------------------------------- + int it(0); + double p(pL), u(0.), du(0.), f(0.), df(1.); + double vStar(0.), dvStar(0.), vSmvL(0.), mL(zL), dmL(0.); + double drhokStar(0.), YkL(0.); + + do { + p -= f / df; + it++; + if (it > 50) { + warnings.push_back(Errors("solveRiemannOutletMassflow not converged in ModUEq", __FILE__, __LINE__)); + } + // Check physical pressure + for (int k = 0; k < numberPhases; k++) { + TB->eos[k]->verifyAndModifyPressure(p); + } + vStar = 0.; dvStar = 0.; + for (int k = 0; k < numberPhases; k++) { + vecPhase = cellLeft.getPhase(k); + //TB->rhokStar[k] = TB->eos[k]->computeDensityIsentropic(vecPhase->getPressure(), vecPhase->getDensity(), pStar, &drhokStar); //other possiblity + TB->rhokStar[k] = TB->eos[k]->computeDensityHugoniot(vecPhase->getPressure(), vecPhase->getDensity(), p, &drhokStar); + TB->eos[k]->verifyAndCorrectDensityMax(TB->rhokStar[k]); + YkL = vecPhase->getAlpha()*vecPhase->getDensity() / rhoL; + vStar += YkL / std::max(TB->rhokStar[k], epsilonAlphaNull); + dvStar -= YkL / std::max(TB->rhokStar[k] * TB->rhokStar[k], epsilonAlphaNull) * drhokStar; + } + vSmvL = vStar - 1. / rhoL; + if (std::fabs(vSmvL) > 1.e-10) { // Rankine-Hugoniot + mL = sqrt((pL - p) / vSmvL); + dmL = 0.5 * (- vSmvL + (p - pL) * dvStar) / (vSmvL * vSmvL) / mL; + } + else { // Acoustic + mL = zL; + dmL = 0.; + } + + sL = uL - mL / rhoL; + + u = uL + mL * vSmvL; + du = dmL * vSmvL + mL * dvStar; + + f = m0 - u / vStar; + df = - (du * vStar - u * dvStar) / std::max(vStar * vStar, epsilonAlphaNull); + } while (std::fabs(f) > 1.e-3 && it <= 50); + // For low-Mach (for general purpose machRefMin set to 1) if (std::fabs(sL)>1.e-3) dtMax = std::min(dtMax, machRefMin * dxLeft / std::fabs(sL)); - sM = uL + mL*vSmvL; - //Pathologic case sL>0 - if (sL >= 0.) { //Supersonic outflow => Left state solution + // Solution state + double uStar, pStar; + if (sL >= 0.) { // Pathologic case: supersonic outflow uStar = uL; - pStar = pL; - for (int k = 0; k < numberPhases; k++) { TB->rhokStar[k] = cellLeft.getPhase(k)->getDensity(); } vStar = 1. / rhoL; + pStar = pL; } - else if (sM < 0) { //Inflow conditions : the outflow assumption is not adapted - uStar = sM; - for (int k = 0; k < numberPhases; k++) { TB->rhokStar[k] = cellLeft.getPhase(k)->getDensity(); } + else if (u < 0.) { // Pathologic case: Back flow (we keep the mass temporarly) + uStar = u; vStar = 1. / rhoL; + pStar = p; } - else { //imposed pressure outflow OK - uStar = sM; + else { // Subsonic outflow + pStar = p; + uStar = u; } - //Flux completion - double ekStar; + // Flux completion + double ekStar, EStar, akStar; EStar = 0.5*(uStar*uStar + uyL * uyL + uzL * uzL); for (int k = 0; k < numberPhases; k++) { - double YkL = cellLeft.getPhase(k)->getAlpha()*cellLeft.getPhase(k)->getDensity() / rhoL; + YkL = cellLeft.getPhase(k)->getAlpha()*cellLeft.getPhase(k)->getDensity() / rhoL; + akStar = YkL / std::max(TB->rhokStar[k], epsilonAlphaNull) / vStar; + if(!m_lowMach) ekStar = TB->eos[k]->computeEnergy(TB->rhokStar[k], pStar); else { ekStar = cellLeft.getPhase(k)->getEnergy(); } - static_cast (fluxBuff)->m_alpha[k] = YkL / std::max(TB->rhokStar[k], epsilonAlphaNull) / vStar * uStar; - static_cast (fluxBuff)->m_mass[k] = static_cast (fluxBuff)->m_alpha[k] * TB->rhokStar[k]; + + static_cast (fluxBuff)->m_alpha[k] = akStar * u; + static_cast (fluxBuff)->m_mass[k] = akStar * uStar * TB->rhokStar[k]; static_cast (fluxBuff)->m_energ[k] = static_cast (fluxBuff)->m_mass[k] * ekStar; + EStar += YkL * ekStar; } static_cast (fluxBuff)->m_momentum.setX(uStar*uStar / vStar + pStar); @@ -766,7 +1092,7 @@ void ModUEq::solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& d static_cast (fluxBuff)->m_energMixture = (EStar / vStar + pStar)*uStar; //Contact discontinuity velocity - static_cast (fluxBuff)->m_sM = sM; + static_cast (fluxBuff)->m_sM = u; static_cast (fluxBuff)->m_uStar = uStar; // Boundary data for output @@ -800,65 +1126,121 @@ void ModUEq::solveRiemannNullFlux() const void ModUEq::solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight) { - for (int k = 0; k < numberTransports; k++) { - fluxBufferTransport[k].solveRiemann(cellLeft.getTransport(k).getValue(), cellRight.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM); - } + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemann(cellLeft.getTransport(k).getValue(), cellRight.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM); + } } //**************************************************************************** void ModUEq::solveRiemannTransportWall() { - for (int k = 0; k < numberTransports; k++) { + for (int k = 0; k < numberTransports; k++) { fluxBufferTransport[k].solveRiemannWall(); - } + } } //**************************************************************************** -void ModUEq::solveRiemannTransportInflow(Cell& cellLeft, double* valueTransports) +void ModUEq::solveRiemannTransportPiston(Cell& cellLeft, double uPiston) { - for (int k = 0; k < numberTransports; k++) { - fluxBufferTransport[k].solveRiemannInflow(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); - } + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannPiston(cellLeft.getTransport(k).getValue(), uPiston); + } } + //**************************************************************************** -void ModUEq::solveRiemannTransportTank(Cell& cellLeft, double* valueTransports) +void ModUEq::solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports) { - for (int k = 0; k < numberTransports; k++) { - fluxBufferTransport[k].solveRiemannTank(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); - } + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannInletTank(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); + } } //**************************************************************************** -void ModUEq::solveRiemannTransportOutflow(Cell& cellLeft, double* valueTransports) +void ModUEq::solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports) { - for (int k = 0; k < numberTransports; k++) { - fluxBufferTransport[k].solveRiemannOutflow(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); - } + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannInletInjStagState(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); + } } //**************************************************************************** +void ModUEq::solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransports) +{ + for (int k = 0; k < numberTransports; k++) { + fluxBufferTransport[k].solveRiemannOutletPressure(cellLeft.getTransport(k).getValue(), static_cast (fluxBuff)->m_sM, valueTransports[k]); + } +} + +//**************************************************************************** +//******************************* Accessors ********************************** +//**************************************************************************** + +double ModUEq::selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num) const +{ + switch (nameVariable) { + case Variable::pressure: + if (num < 0) { + return mixture->getPressure(); + } + else { + return phases[num]->getPressure(); + } + break; + case Variable::density: + if (num < 0) { + return mixture->getDensity(); + } + else { + return phases[num]->getDensity(); + } + break; + case Variable::alpha: + return phases[num]->getAlpha(); + break; + case Variable::velocityU: + return mixture->getVelocity().getX(); + break; + case Variable::velocityV: + return mixture->getVelocity().getY(); + break; + case Variable::velocityW: + return mixture->getVelocity().getZ(); + break; + case Variable::velocityMag: + return mixture->getVelocity().norm(); + break; + case Variable::transport: + return transports[num].getValue(); + break; + case Variable::temperature: + return phases[num]->getTemperature(); + break; + default: + Errors::errorMessage("nameVariable unknown in selectScalar"); return 0; + break; + } +} + +//*********************************************************************** + const double& ModUEq::getSM() { return static_cast (fluxBuff)->m_sM; } //**************************************************************************** -//***************************** others methods ******************************* +//***************************** Others methods ******************************* //**************************************************************************** void ModUEq::reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const { - Coord fluxProjected; - fluxProjected.setX(normal.getX()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjected.setY(normal.getY()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjected.setZ(normal.getZ()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuff)->m_momentum.getZ()); - static_cast (fluxBuff)->m_momentum.setXYZ(fluxProjected.getX(), fluxProjected.getY(), fluxProjected.getZ()); + static_cast (fluxBuff)->m_momentum.reverseProjection(normal, tangent, binormal); } //**************************************************************************** @@ -880,16 +1262,15 @@ void ModUEq::lowMachSoundSpeed(double& machRef, const double& uL, double& cL, co // --- Mlocal --- double machLimitComp(0.3); - double machRefMin = 1.e-2; double machRefL(0.); if (std::fabs(uL)/cL >= machLimitComp) machRefL = 1.; - else if (std::fabs(uL)/cL > machRefMin) machRefL = std::fabs(uL)/cL; - else machRefL = machRefMin; + else if (std::fabs(uL)/cL > m_machRefMin) machRefL = std::fabs(uL)/cL; + else machRefL = m_machRefMin; // Right double machRefR(0.); if (std::fabs(uR)/cR >= machLimitComp) machRefR = 1.; - else if (std::fabs(uR)/cR > machRefMin) machRefR = std::fabs(uR)/cR; - else machRefR = machRefMin; + else if (std::fabs(uR)/cR > m_machRefMin) machRefR = std::fabs(uR)/cR; + else machRefR = m_machRefMin; machRef = std::max(machRefL, machRefR); //Caution: Keep right before left for boundary condition Riemann solver cR = (machRef*machRef - 1.)*uR + sqrt((machRef*machRef - 1.)*(machRef*machRef - 1.) * uR*uR + 4.* machRef*machRef*cR*cR); @@ -898,4 +1279,22 @@ void ModUEq::lowMachSoundSpeed(double& machRef, const double& uL, double& cL, co cL *= 0.5; } +//**************************************************************************** + +void ModUEq::addNonConsMrfFlux(Phase** phases) +{ + static_cast (fluxBuffMRF)->addNonConsMrfFlux(phases); +} + +//**************************************************************************** + +void ModUEq::reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const +{ + Coord projectedFlux; + projectedFlux.setX(normal.getX()*static_cast (fluxBuffMRF)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuffMRF)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuffMRF)->m_momentum.getZ()); + projectedFlux.setY(normal.getY()*static_cast (fluxBuffMRF)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuffMRF)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuffMRF)->m_momentum.getZ()); + projectedFlux.setZ(normal.getZ()*static_cast (fluxBuffMRF)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuffMRF)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuffMRF)->m_momentum.getZ()); + static_cast (fluxBuffMRF)->m_momentum.setXYZ(projectedFlux.getX(), projectedFlux.getY(), projectedFlux.getZ()); +} + //**************************************************************************** \ No newline at end of file diff --git a/src/Models/UEq/ModUEq.h b/src/Models/UEq/ModUEq.h index a0e1b48e..4d05252c 100644 --- a/src/Models/UEq/ModUEq.h +++ b/src/Models/UEq/ModUEq.h @@ -34,6 +34,9 @@ #include "../Model.h" #include "../../Order1/Cell.h" #include "MixUEq.h" +#include "PhaseUEq.h" +#include "GradPhaseUEq.h" +#include "GradMixUEq.h" class ModUEq; @@ -57,6 +60,8 @@ class ModUEq : public Model virtual void allocateCons(Flux** cons); virtual void allocatePhase(Phase** phase); virtual void allocateMixture(Mixture** mixture); + virtual void allocatePhaseGradient(GradPhase** phase); + virtual void allocateMixtureGradient(GradMixture** mixture); //! \details Complete multiphase state from volume fractions, pressures, densities and velocity virtual void fulfillState(Phase** phases, Mixture* mixture); @@ -70,20 +75,23 @@ class ModUEq : public Model //Hydrodynamic Riemann solvers //---------------------------- virtual void solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, std::vector &boundData = DEFAULT_VEC_INTERFACE_DATA) const; // Riemann between two computed cells + virtual void solveRiemannInternMRF(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, const Coord& omega, const Coord& normal, const Coord& tangent, const Coord& binormal, const Coord& position) const; virtual void solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dtMax, std::vector &boundData) const; // Riemann between left cell and wall - virtual void solveRiemannInflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* ak0, const double* rhok0, const double* pk0, std::vector &boundData) const; // Riemann for inflow (injection) - virtual void solveRiemannSubInj(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* ak0, std::vector &boundData) const; - virtual void solveRiemannTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const; // Riemann for tank - virtual void solveRiemannOutflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const; // Riemann for outflow with imposed pressure + virtual void solveRiemannInletTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& /*T0*/, std::vector &boundData) const; + virtual void solveRiemannInletInjStagState(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* ak0, const double* rhok0, const double* pk0, std::vector &boundData) const; + virtual void solveRiemannInletInjTemp(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* ak0, std::vector &boundData) const; + virtual void solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector &boundData) const; + virtual void solveRiemannOutletMassflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, std::vector& boundData) const; virtual void solveRiemannNullFlux() const; //Transports Riemann solvers //-------------------------- virtual void solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight); virtual void solveRiemannTransportWall(); - virtual void solveRiemannTransportInflow(Cell& cellLeft, double* valueTransports); - virtual void solveRiemannTransportTank(Cell& cellLeft, double* valueTransports); - virtual void solveRiemannTransportOutflow(Cell& cellLeft, double* valueTransport); + virtual void solveRiemannTransportPiston(Cell& cellLeft, double uPiston); + virtual void solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports); + virtual void solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports); + virtual void solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransport); virtual void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const; @@ -91,9 +99,22 @@ class ModUEq : public Model //------------------------ virtual void lowMachSoundSpeed(double& machRef, const double& uL, double& cL, const double& uR = Errors::defaultDouble, double& cR = Tools::uselessDouble) const; virtual void setLowMach(const bool& lowMach) { m_lowMach = lowMach; }; + virtual void setMachRefMin(const double& machRefMin) { m_machRefMin = machRefMin; }; + + //Moving Reference Frame + //---------------------- + virtual void addNonConsMrfFlux(Phase** phases); + virtual void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const; //Accessors //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const; virtual const double& getSM(); virtual const Coord& getVelocity(const Cell* cell) const { return cell->getMixture()->getVelocity(); }; virtual Coord& getVelocity(Cell* cell) { return cell->getMixture()->getVelocity(); }; diff --git a/src/Models/UEq/PhaseUEq.cpp b/src/Models/UEq/PhaseUEq.cpp index f7e2a59d..00fcd52a 100644 --- a/src/Models/UEq/PhaseUEq.cpp +++ b/src/Models/UEq/PhaseUEq.cpp @@ -29,7 +29,6 @@ // If not, see . #include "PhaseUEq.h" -#include "../../Eos/Eos.h" using namespace tinyxml2; @@ -86,6 +85,8 @@ void PhaseUEq::copyPhase(Phase &phase) m_alpha = phase.getAlpha(); m_density = phase.getDensity(); m_pressure = phase.getPressure(); + m_Y = phase.getMassFraction(); + m_temperature = phase.getTemperature(); m_eos = phase.getEos(); m_energy = phase.getEnergy(); m_soundSpeed = phase.getSoundSpeed(); @@ -124,16 +125,16 @@ double PhaseUEq::returnScalar(const int& numVar) const else { return m_density; } break; case 3: + return m_pressure; + break; + case 4: if (m_temperature < 1.e-20) { return 1.e-20; } else { return m_temperature; } break; - case 4: + case 5: if (m_Y < 1.e-20) { return 0.; } else { return m_Y; } break; - case 5: - return m_pressure; - break; default: return 0.; break; } @@ -150,11 +151,11 @@ std::string PhaseUEq::returnNameScalar(const int& numVar) const case 2: return "Density"; break; case 3: - return "Temperature"; break; + return "Pressure"; break; case 4: - return "Mass fraction"; break; + return "Temperature"; break; case 5: - return "Pressure"; break; + return "Mass fraction"; break; default: return "NoName"; break; } @@ -173,11 +174,11 @@ void PhaseUEq::setScalar(const int& numVar, const double& value) case 2: m_density = value; break; case 3: - m_temperature = value; break; + m_pressure = value; break; case 4: - m_Y = value; break; + m_temperature = value; break; case 5: - m_pressure = value; break; + m_Y = value; break; default: Errors::errorMessage("numVar not found in PhaseUEq::setScalar"); break; } @@ -253,6 +254,13 @@ void PhaseUEq::setToZero() //*************************************************************************** +void PhaseUEq::setToMax() +{ + m_alpha = 1.e15; m_density = 1.e15; m_pressure = 1.e15; +} + +//*************************************************************************** + void PhaseUEq::extrapolate(const Phase &slope, const double& distance) { m_alpha += slope.getAlpha() * distance; @@ -269,6 +277,33 @@ void PhaseUEq::limitSlopes(const Phase &slopeGauche, const Phase &slopeDroite, L m_pressure = globalLimiter.limiteSlope(slopeGauche.getPressure(), slopeDroite.getPressure()); } +//**************************************************************************** + +void PhaseUEq::setMin(const Phase& phase1, const Phase& phase2) +{ + m_alpha = std::min(phase1.getAlpha(), phase2.getAlpha()); + m_density = std::min(phase1.getDensity(), phase2.getDensity()); + m_pressure = std::min(phase1.getPressure(), phase2.getPressure()); +} + +//**************************************************************************** + +void PhaseUEq::setMax(const Phase& phase1, const Phase& phase2) +{ + m_alpha = std::max(phase1.getAlpha(), phase2.getAlpha()); + m_density = std::max(phase1.getDensity(), phase2.getDensity()); + m_pressure = std::max(phase1.getPressure(), phase2.getPressure()); +} + +//**************************************************************************** + +void PhaseUEq::computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope) +{ + m_alpha = std::min(m_alpha, globalLimiter.computeGradientLimiter(phase.getAlpha(), phaseMin.getAlpha(), phaseMax.getAlpha(), slope.getAlpha())); + m_density = std::min(m_density, globalLimiter.computeGradientLimiter(phase.getDensity(), phaseMin.getDensity(), phaseMax.getDensity(), slope.getDensity())); + m_pressure = std::min(m_pressure, globalLimiter.computeGradientLimiter(phase.getPressure(), phaseMin.getPressure(), phaseMax.getPressure(), slope.getPressure())); +} + //**************************************************************************** //************************** ORDER 2 PARALLEL ******************************** //**************************************************************************** @@ -400,3 +435,5 @@ void PhaseUEq::divide(const double& coeff) m_density /= coeff; m_pressure /= coeff; } + +//*************************************************************************** \ No newline at end of file diff --git a/src/Models/UEq/PhaseUEq.h b/src/Models/UEq/PhaseUEq.h index e077f2ef..c1f089d3 100644 --- a/src/Models/UEq/PhaseUEq.h +++ b/src/Models/UEq/PhaseUEq.h @@ -33,7 +33,6 @@ #include "../Phase.h" #include "../../Eos/Eos.h" -#include //! \class PhaseUEq //! \brief Phase variables for the velocity-equilibrium system of equations @@ -60,7 +59,7 @@ class PhaseUEq : public Phase //Specific methods for data printing //---------------------------------- - virtual int getNumberScalars() const { return 5; }; + virtual int getNumberScalars() const { return numberScalarsPhase; }; virtual int getNumberVectors() const { return 0; }; virtual double returnScalar(const int& numVar) const; virtual Coord returnVector(const int& /*numVar*/) const { return 0; }; @@ -83,8 +82,12 @@ class PhaseUEq : public Phase //--------------------------------- virtual void computeSlopesPhase(const Phase& sLeft, const Phase& sRight, const double& distance); virtual void setToZero(); + virtual void setToMax(); virtual void extrapolate(const Phase& slope, const double& distance); virtual void limitSlopes(const Phase& slopeGauche, const Phase& slopeDroite, Limiter& globalLimiter, Limiter& volumeFractionLimiter); + virtual void setMin(const Phase& phase1, const Phase& phase2); + virtual void setMax(const Phase& phase1, const Phase& phase2); + virtual void computeGradientLimiter(const Limiter& globalLimiter, const Phase& phase, const Phase& phaseMin, const Phase& phaseMax, const Phase& slope); //Specific methods for parallele computing at second order //-------------------------------------------------------- @@ -114,7 +117,7 @@ class PhaseUEq : public Phase virtual Eos* getEos() const { return m_eos; }; virtual const double& getEnergy() const { return m_energy; }; virtual const double& getSoundSpeed() const { return m_soundSpeed; }; - virtual double getTemperature() const { return m_eos->computeTemperature(m_density, m_pressure); }; //KS//Modify with m_temperature directly? + virtual double getTemperature() const { return m_temperature; }; virtual void setAlpha(double alpha); virtual void setDensity(double density); diff --git a/src/Models/UEqSolid/FluxUEqSolid.o b/src/Models/UEqSolid/FluxUEqSolid.o index 927221c5..4726843a 100644 Binary files a/src/Models/UEqSolid/FluxUEqSolid.o and b/src/Models/UEqSolid/FluxUEqSolid.o differ diff --git a/src/Models/UEqSolid/MixUEqSolid.o b/src/Models/UEqSolid/MixUEqSolid.o index 3d4fedf0..cb5d7619 100644 Binary files a/src/Models/UEqSolid/MixUEqSolid.o and b/src/Models/UEqSolid/MixUEqSolid.o differ diff --git a/src/Models/UEqSolid/ModUEqSolid.o b/src/Models/UEqSolid/ModUEqSolid.o index ff6fc126..f63ebfc6 100644 Binary files a/src/Models/UEqSolid/ModUEqSolid.o and b/src/Models/UEqSolid/ModUEqSolid.o differ diff --git a/src/Models/UEqSolid/PhaseFluidUEqSolid.o b/src/Models/UEqSolid/PhaseFluidUEqSolid.o index e6b2ed82..da46c34d 100644 Binary files a/src/Models/UEqSolid/PhaseFluidUEqSolid.o and b/src/Models/UEqSolid/PhaseFluidUEqSolid.o differ diff --git a/src/Models/UEqSolid/PhaseSolidUEqSolid.o b/src/Models/UEqSolid/PhaseSolidUEqSolid.o index b8d14f03..01a2f6ad 100644 Binary files a/src/Models/UEqSolid/PhaseSolidUEqSolid.o and b/src/Models/UEqSolid/PhaseSolidUEqSolid.o differ diff --git a/src/Models/UEqSolid/PlasticCompaction/ModPCConfigurationEnergy.o b/src/Models/UEqSolid/PlasticCompaction/ModPCConfigurationEnergy.o deleted file mode 100644 index 89572123..00000000 Binary files a/src/Models/UEqSolid/PlasticCompaction/ModPCConfigurationEnergy.o and /dev/null differ diff --git a/src/Models/UEqSolid/PlasticCompaction/ModPCGurson.o b/src/Models/UEqSolid/PlasticCompaction/ModPCGurson.o deleted file mode 100644 index 5368f5dc..00000000 Binary files a/src/Models/UEqSolid/PlasticCompaction/ModPCGurson.o and /dev/null differ diff --git a/src/Models/UEqSolid/PlasticCompaction/ModPlasticCompaction.o b/src/Models/UEqSolid/PlasticCompaction/ModPlasticCompaction.o deleted file mode 100644 index a02e255f..00000000 Binary files a/src/Models/UEqSolid/PlasticCompaction/ModPlasticCompaction.o and /dev/null differ diff --git a/src/Models/UEqTotEnergy/FluxUEqTotEnergy.cpp b/src/Models/UEqTotEnergy/FluxUEqTotEnergy.cpp index 18472f80..a5cbf3d9 100644 --- a/src/Models/UEqTotEnergy/FluxUEqTotEnergy.cpp +++ b/src/Models/UEqTotEnergy/FluxUEqTotEnergy.cpp @@ -201,19 +201,7 @@ void FluxUEqTotEnergy::setToZero() //*********************************************************************** -void FluxUEqTotEnergy::setToZeroBufferFlux() -{ - for (int k = 0; k (fluxBuff)->m_alpha[k] = 0.; - static_cast (fluxBuff)->m_mass[k] = 0.; - static_cast (fluxBuff)->m_totEnerg[k] = 0.; - } - static_cast (fluxBuff)->m_momentum = 0.; -} - -//*********************************************************************** - -void FluxUEqTotEnergy::addNonCons(double coefA, const Cell* cell) +void FluxUEqTotEnergy::addNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Phase* phase; double uStar(static_cast (fluxBuff)->m_uStar); @@ -236,7 +224,7 @@ void FluxUEqTotEnergy::addNonCons(double coefA, const Cell* cell) //*********************************************************************** -void FluxUEqTotEnergy::subtractNonCons(double coefA, const Cell* cell) +void FluxUEqTotEnergy::subtractNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/) { Phase* phase; double uStar(static_cast (fluxBuff)->m_uStar); diff --git a/src/Models/UEqTotEnergy/FluxUEqTotEnergy.h b/src/Models/UEqTotEnergy/FluxUEqTotEnergy.h index 0c0d0638..cc93e34f 100644 --- a/src/Models/UEqTotEnergy/FluxUEqTotEnergy.h +++ b/src/Models/UEqTotEnergy/FluxUEqTotEnergy.h @@ -55,9 +55,8 @@ class FluxUEqTotEnergy : public Flux virtual void buildCons(Phase** phases, Mixture* mixture); virtual void buildPrim(Phase** phases, Mixture* mixture); virtual void setToZero(); - virtual void setToZeroBufferFlux(); - virtual void addNonCons(double coefA, const Cell* cell); - virtual void subtractNonCons(double coefA, const Cell* cell); + virtual void addNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/); + virtual void subtractNonCons(double coefA, const Cell* cell, const Coord& /*normal*/, const Coord& /*tangent*/, const Coord& /*binormal*/); // Accessors //---------- diff --git a/src/Models/UEqTotEnergy/MixUEqTotEnergy.h b/src/Models/UEqTotEnergy/MixUEqTotEnergy.h index 318aa2d6..1fbadce9 100644 --- a/src/Models/UEqTotEnergy/MixUEqTotEnergy.h +++ b/src/Models/UEqTotEnergy/MixUEqTotEnergy.h @@ -58,7 +58,7 @@ class MixUEqTotEnergy : public Mixture virtual double computeFrozenSoundSpeed(const double* Yk, const double* ck); virtual void computeMixtureVariables(Phase** vecPhase); - virtual void internalEnergyToTotalEnergy(std::vector& /*vecGPA*/) {}; + virtual void computeTotalEnergy(std::vector& /*vecGPA*/) {}; virtual void totalEnergyToInternalEnergy(std::vector& /*vecGPA*/) {}; virtual void localProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); diff --git a/src/Models/UEqTotEnergy/ModUEqTotEnergy.cpp b/src/Models/UEqTotEnergy/ModUEqTotEnergy.cpp index 6b6f062f..857d23a8 100644 --- a/src/Models/UEqTotEnergy/ModUEqTotEnergy.cpp +++ b/src/Models/UEqTotEnergy/ModUEqTotEnergy.cpp @@ -242,6 +242,56 @@ void ModUEqTotEnergy::solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const static_cast (fluxBuff)->m_sM = sM; } +//**************************************************************************** +//******************************* Accessors ********************************** +//**************************************************************************** + +double ModUEqTotEnergy::selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num) const +{ + switch (nameVariable) { + case Variable::pressure: + if (num < 0) { + return mixture->getPressure(); + } + else { + return phases[num]->getPressure(); + } + break; + case Variable::density: + if (num < 0) { + return mixture->getDensity(); + } + else { + return phases[num]->getDensity(); + } + break; + case Variable::alpha: + return phases[num]->getAlpha(); + break; + case Variable::velocityU: + return mixture->getVelocity().getX(); + break; + case Variable::velocityV: + return mixture->getVelocity().getY(); + break; + case Variable::velocityW: + return mixture->getVelocity().getZ(); + break; + case Variable::velocityMag: + return mixture->getVelocity().norm(); + break; + case Variable::transport: + return transports[num].getValue(); + break; + case Variable::temperature: + return phases[num]->getTemperature(); + break; + default: + Errors::errorMessage("nameVariable unknown in selectScalar"); return 0; + break; + } +} + //**************************************************************************** const double& ModUEqTotEnergy::getSM() @@ -255,11 +305,7 @@ const double& ModUEqTotEnergy::getSM() void ModUEqTotEnergy::reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const { - Coord fluxProjected; - fluxProjected.setX(normal.getX()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getX()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getX()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjected.setY(normal.getY()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getY()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getY()*static_cast (fluxBuff)->m_momentum.getZ()); - fluxProjected.setZ(normal.getZ()*static_cast (fluxBuff)->m_momentum.getX() + tangent.getZ()*static_cast (fluxBuff)->m_momentum.getY() + binormal.getZ()*static_cast (fluxBuff)->m_momentum.getZ()); - static_cast (fluxBuff)->m_momentum.setXYZ(fluxProjected.getX(), fluxProjected.getY(), fluxProjected.getZ()); + static_cast (fluxBuff)->m_momentum.reverseProjection(normal, tangent, binormal); } //**************************************************************************** \ No newline at end of file diff --git a/src/Models/UEqTotEnergy/ModUEqTotEnergy.h b/src/Models/UEqTotEnergy/ModUEqTotEnergy.h index a442c2a2..4442de70 100644 --- a/src/Models/UEqTotEnergy/ModUEqTotEnergy.h +++ b/src/Models/UEqTotEnergy/ModUEqTotEnergy.h @@ -75,6 +75,13 @@ class ModUEqTotEnergy : public Model //Accessors //--------- + //! \brief Select a specific scalar variable + //! \param phases phases array variables + //! \param mixture mixture variables + //! \param vecTransports vector of transport variables + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + virtual double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const; virtual const double& getSM(); virtual const Coord& getVelocity(const Cell* cell) const { return cell->getMixture()->getVelocity(); }; virtual Coord& getVelocity(Cell* cell) { return cell->getMixture()->getVelocity(); }; diff --git a/src/Models/UEqTotEnergy/PhaseUEqTotEnergy.h b/src/Models/UEqTotEnergy/PhaseUEqTotEnergy.h index e55c312f..d2849c0b 100644 --- a/src/Models/UEqTotEnergy/PhaseUEqTotEnergy.h +++ b/src/Models/UEqTotEnergy/PhaseUEqTotEnergy.h @@ -113,7 +113,7 @@ class PhaseUEqTotEnergy : public Phase virtual Eos* getEos() const { return m_eos; }; virtual const double& getTotalEnergy() const { return m_totEnergy; }; virtual const double& getSoundSpeed() const { return m_soundSpeed; }; - virtual double getTemperature() const { return m_eos->computeTemperature(m_density, m_pressure); }; //KS//Modify with m_temperature directly? + virtual double getTemperature() const { return m_temperature; }; virtual void setAlpha(double alpha); virtual void setDensity(double density); diff --git a/src/Order1/Cell.cpp b/src/Order1/Cell.cpp index 9b24f49c..497b5e56 100644 --- a/src/Order1/Cell.cpp +++ b/src/Order1/Cell.cpp @@ -31,12 +31,16 @@ #include "Cell.h" int numberPhases; +int numberSolids; int numberTransports; Gradient* gradient; +std::vector gradRho; +std::vector variableDensity; +std::vector numeratorDefault; //*********************************************************************** -Cell::Cell() : m_vecPhases(0), m_mixture(0), m_vecTransports(0), m_cons(0), m_consTransports(0), +Cell::Cell() : m_wall(false), m_vecPhases(0), m_mixture(0), m_vecTransports(0), m_cons(0), m_consTransports(0), m_element(0), m_childrenCells(0) { m_lvl = 0; @@ -46,7 +50,7 @@ Cell::Cell() : m_vecPhases(0), m_mixture(0), m_vecTransports(0), m_cons(0), m_co //*********************************************************************** -Cell::Cell(int lvl) : m_vecPhases(0), m_mixture(0), m_vecTransports(0), m_cons(0), m_consTransports(0), +Cell::Cell(int lvl) : m_wall(false), m_vecPhases(0), m_mixture(0), m_vecTransports(0), m_cons(0), m_consTransports(0), m_element(0), m_childrenCells(0) { m_lvl = lvl; @@ -102,6 +106,11 @@ void Cell::associateExtVar(Model* mod, Gradient* grad) { model = mod; gradient = grad; + gradRho.resize(1); + variableDensity.resize(1); + variableDensity[0] = Variable::density; + numeratorDefault.resize(1); + numeratorDefault[0] = -1; } //*********************************************************************** @@ -109,7 +118,10 @@ void Cell::associateExtVar(Model* mod, Gradient* grad) void Cell::allocate(const std::vector& addPhys) { m_vecPhases = new Phase*[numberPhases]; - for (int k = 0; k < numberPhases; k++) { + for (int k = 0; k < numberSolids; k++) { + model->allocatePhaseSolid(&m_vecPhases[k]); + } + for (int k = numberSolids; k < numberPhases; k++) { model->allocatePhase(&m_vecPhases[k]); } model->allocateMixture(&m_mixture); @@ -144,14 +156,18 @@ void Cell::fill(std::vector& domains, const int& /*lvlMax*/) // double radius; // double x_init(0.), y_init(0.), z_init(0.); // //radius = std::pow(std::pow(coordinates.getX() - x_init, 2.), 0.5); //1D - // x_init = 3175.e-6; - // radius = std::pow(std::pow(coordinates.getX() - x_init, 2.) + std::pow(coordinates.getY() - y_init, 2.), 0.5); //2D + // // x_init = 3175.e-6; + // // radius = std::pow(std::pow(coordinates.getX() - x_init, 2.) + std::pow(coordinates.getY() - y_init, 2.), 0.5); //2D // //radius = std::pow(std::pow(coordinates.getX() - x_init, 2.) + std::pow(coordinates.getY() - y_init, 2.) + std::pow(coordinates.getZ() - z_init, 2.), 0.5); //3D + // x_init = 3.2e-3; + // radius = std::pow(std::pow(coordinates.getX() - x_init, 2.) + std::pow(coordinates.getY() - y_init, 2.), 0.5); //2D // double alphaAir(0.), alphaEau(0.); // //double h(3200.e-6/50./std::pow(2., (double)lvlMax)); //0.04e-3 // //double h(3.e-4/150./std::pow(2., (double)lvlMax)); - // double h(350.e-6/100./std::pow(2., (double)lvlMax)); - // alphaAir = 1. / 2.*(1. - tanh((radius - 100.e-6)/1.5/h)); + // // double h(350.e-6/100./std::pow(2., (double)lvlMax)); + // double h(1.e-5); + // // alphaAir = 1. / 2.*(1. - tanh((radius - 100.e-6)/1.5/h)); + // alphaAir = 1. / 2.*(1. - tanh((radius - 0.6e-3) / 1.5 / h)); // if (alphaAir > 1.) alphaAir = 1.; // if (alphaAir < 0.) alphaAir = 0.; // alphaEau = 1. - alphaAir; @@ -267,13 +283,6 @@ void Cell::setToZeroConsGlobal() //*********************************************************************** -void Cell::setToZeroBufferFlux() -{ - m_cons->setToZeroBufferFlux(); -} - -//*********************************************************************** - void Cell::timeEvolution(const double& dt, Symmetry* symmetry) { m_cons->setBufferFlux(*this); //fluxBuff receive conservative variables at time n: Un @@ -338,7 +347,7 @@ void Cell::completeFulfillState() model->fulfillState(m_vecPhases, m_mixture); //Extended energies depending on additional physics this->prepareAddPhys(); - m_mixture->internalEnergyToTotalEnergy(m_vecQuantitiesAddPhys); + m_mixture->computeTotalEnergy(m_vecQuantitiesAddPhys); //Complete augmented variables (such as the ones of Euler-Korteweg model) model->initializeAugmentedVariables(this); } @@ -401,94 +410,15 @@ void Cell::copyVec(Phase** vecPhases, Mixture* mixture, Transport* vecTransports //*********************************************************************** -//void Cell::printCut1Dde2D(std::ofstream &fileStream, std::string variableConstanteCut, const double& valueCut, const double& dL) -//{ -// if (m_childrenCells.size() == 0) { -// bool imprX(false), imprY(false), imprZ(false); -// double dLsur2, position, epsilon; -// dLsur2 = dL / std::pow(2., (double)m_lvl) / 2.; -// epsilon = 1.e-3*dLsur2; -// if (variableConstanteCut == "x") { -// imprY = true; -// position = m_element->getPosition().getX(); -// } -// else if (variableConstanteCut == "y") { -// imprX = true; -// position = m_element->getPosition().getY(); -// } -// -// //imprX = true; -// //imprY = false; -// //if (std::fabs(m_element->getPosition().getX() - m_element->getPosition().getY()) < 1.e-6) { -// if (std::fabs(position - valueCut - epsilon) < dLsur2) { -// m_element->ecritPos(fileStream, imprX, imprY, imprZ); -// this->printPhasesMixture(fileStream); -// fileStream << m_lvl << " " << m_xi << " "; -// fileStream << endl; -// } -// } -// else { -// for (unsigned int i = 0; i < m_childrenCells.size(); i++) { -// m_childrenCells[i]->printCut1Dde2D(fileStream, variableConstanteCut, valueCut, dL); -// } -// } -//} -// -////*********************************************************************** -// -//void Cell::printCut1Dde3D(std::ofstream &fileStream, std::string variableConstanteCut1, std::string variableConstanteCut2, -// const double& valueCut1, const double& valueCut2, const double& dL1, const double& dL2) -//{ -// if (m_childrenCells.size() == 0) { -// bool imprX(true), imprY(true), imprZ(true); -// double dL1sur2, dL2sur2, position1, position2, epsilon1, epsilon2; -// dL1sur2 = dL1 / std::pow(2., (double)m_lvl) / 2.; -// dL2sur2 = dL2 / std::pow(2., (double)m_lvl) / 2.; -// epsilon1 = 1.e-3*dL1sur2; -// epsilon2 = 1.e-3*dL2sur2; -// -// if (variableConstanteCut1 == "x") { -// imprX = false; -// position1 = m_element->getPosition().getX(); -// } -// else if (variableConstanteCut1 == "y") { -// imprY = false; -// position1 = m_element->getPosition().getY(); -// } -// else { -// imprZ = false; -// position1 = m_element->getPosition().getZ(); -// } -// -// if (variableConstanteCut2 == "x") { -// imprX = false; -// position2 = m_element->getPosition().getX(); -// } -// else if (variableConstanteCut2 == "y") { -// imprY = false; -// position2 = m_element->getPosition().getY(); -// } -// else { -// imprZ = false; -// position2 = m_element->getPosition().getZ(); -// } -// -// if ((std::fabs(position1 - valueCut1 - epsilon1) < dL1sur2) && (std::fabs(position2 - valueCut2 - epsilon2) < dL2sur2)) { -// m_element->ecritPos(fileStream, imprX, imprY, imprZ); -// this->printPhasesMixture(fileStream); -// fileStream << m_lvl << " " << m_xi << " "; -// fileStream << endl; -// } -// } -// else { -// for (unsigned int i = 0; i < m_childrenCells.size(); i++) { -// m_childrenCells[i]->printCut1Dde3D(fileStream, variableConstanteCut1, variableConstanteCut2, valueCut1, valueCut2, dL1, dL2); -// } -// } -//} +void Cell::deleteInterface(const int &b) +{ + m_cellInterfaces.erase(m_cellInterfaces.begin()+b); +} + +//*********************************************************************** //**************************************************************************** -//***************************Additional Physics******************************* +//**************************** Additional Physics **************************** //**************************************************************************** void Cell::prepareAddPhys() @@ -500,101 +430,13 @@ void Cell::prepareAddPhys() //*********************************************************************** -double Cell::selectScalar(Variable nameVariable, int num) const -{ - //Selection scalar - switch (nameVariable) { - case transport: - return m_vecTransports[num].getValue(); - //double psi(0.), coeff(0.75); - //psi = std::pow(m_vecTransports[num].getValue(), coeff) / (std::pow(m_vecTransports[num].getValue(), coeff) + std::pow((1 - m_vecTransports[num].getValue()), coeff)); - //return psi; - break; - case pressure: - if (numberPhases > 1) { - return m_mixture->getPressure(); - } - else { - return m_vecPhases[num]->getPressure(); - } - break; - case density: - if (numberPhases > 1) { - return m_mixture->getDensity(); - } - else { - return m_vecPhases[num]->getDensity(); - } - break; - case alpha: - if (numberPhases > 1) { - return m_vecPhases[num]->getAlpha(); - } - else { return 1.; } - break; - case velocityMag: - if (numberPhases > 1) { - return m_mixture->getVelocity().norm(); - } - else { - return m_vecPhases[num]->getVelocity().norm(); - } - break; - case velocityU: - if (numberPhases > 1) { - return m_mixture->getVelocity().getX(); - } - else { - return m_vecPhases[num]->getU(); - } - break; - case velocityV: - if (numberPhases > 1) { - return m_mixture->getVelocity().getY(); - } - else { - return m_vecPhases[num]->getV(); - } - break; - case velocityW: - if (numberPhases > 1) { - return m_mixture->getVelocity().getZ(); - } - else { - return m_vecPhases[num]->getW(); - } - break; - case temperature: - return m_vecPhases[num]->getTemperature(); - break; - //FP//TODO// faire QPA et Phases - default: - Errors::errorMessage("nameVariable unknown in selectScalar (linked to QuantitiesAddPhys)"); return 0; - break; - } -} - -//*********************************************************************** - -void Cell::setScalar(Variable nameVariable, const double& value, int num) -{ - //Selection scalar - if (nameVariable == transport) { - m_vecTransports[num].setValue(value); - } - //FP//TODO// faire QPA et Phases - else { Errors::errorMessage("nameVariable unknown in setScalar (linked to QuantitiesAddPhys)"); } -} - -//*********************************************************************** - Coord Cell::selectVector(Variable nameVector, int num, int subscript) const { //Selection vector - if (nameVector == QPA) { //additional physics + if (nameVector == Variable::QPA) { //additional physics return m_vecQuantitiesAddPhys[num]->getGrad(subscript); } - //FP//TODO// faire vecteur pour les Phases + //FP//TODO// faire vector pour les Phases else { Errors::errorMessage("nameVector unknown in selectVector (linked to QuantitiesAddPhys)"); return 0; } } @@ -603,29 +445,15 @@ Coord Cell::selectVector(Variable nameVector, int num, int subscript) const void Cell::setVector(Variable nameVector, const Coord& value, int num, int subscript) { //Selection vector - if (nameVector == QPA) { //additional physics + if (nameVector == Variable::QPA) { //additional physics m_vecQuantitiesAddPhys[num]->setGrad(value, subscript); } - //FP//TODO// faire vecteur pour les Phases + //FP//TODO// faire vector pour les Phases else { Errors::errorMessage("nameVector unknown in setVector (linked to QuantitiesAddPhys)"); } } //*********************************************************************** -Coord Cell::computeGradient(Variable nameVariable, int numPhase) -{ - return gradient->computeGradient(this, nameVariable, numPhase); -} - -//*********************************************************************** - -void Cell::computeGradient(std::vector& grads, std::vector& nameVariables, std::vector& numPhase) -{ - gradient->computeGradient(this, grads, nameVariables, numPhase); -} - -//*********************************************************************** - const Coord& Cell::getGradTk(int& numPhase, int& numAddPhys) const { return m_vecQuantitiesAddPhys[numAddPhys]->getGradTk(numPhase); @@ -658,7 +486,16 @@ void Cell::reinitializeColorFunction(const int& numTransport, const int& numPhas } //**************************************************************************** -//*****************************Accessors************************************** +//******************************** Gradients ********************************* +//**************************************************************************** + +void Cell::computeGradients(std::vector& grads, std::vector& nameVariables, std::vector& numPhases) +{ + gradient->computeGradients(this, grads, nameVariables, numPhases); +} + +//**************************************************************************** +//******************************** Accessors ********************************* //**************************************************************************** int Cell::getCellInterfacesSize() const @@ -675,6 +512,13 @@ CellInterface* Cell::getCellInterface(const int& b) //*********************************************************************** +void Cell::setCellInterface(const int& b, CellInterface* cellInterface) +{ + m_cellInterfaces[b] = cellInterface; +} + +//*********************************************************************** + Phase* Cell::getPhase(const int& phaseNumber, Prim /*type*/) const { return m_vecPhases[phaseNumber]; @@ -773,10 +617,17 @@ const Coord& Cell::getVelocity() const //*********************************************************************** +void Cell::setWall(bool wall) +{ + m_wall = wall; +} + +//*********************************************************************** + double Cell::getDensityGradient() { - int var = 0; //only for single phase - return this->computeGradient(density, var).norm(); + gradient->computeGradients(this, gradRho, variableDensity, numeratorDefault); + return gradRho[0].norm(); } //*********************************************************************** @@ -809,13 +660,13 @@ const int& Cell::getNumberTransports() const //*********************************************************************** -void Cell::printInfo() const +double Cell::selectScalar(Variable nameVariable, int num) const { - m_element->printInfo(); + return model->selectScalar(m_vecPhases, m_mixture, m_vecTransports, nameVariable, num); } //**************************************************************************** -//******************************Distances************************************* +//******************************** Distances ********************************* //**************************************************************************** double Cell::distance(Cell* c) @@ -880,7 +731,194 @@ bool Cell::traverseObjet(const GeometricObject &objet) const } //**************************************************************************** -//***************************** AMR ********************************** +//******************************** Printing ********************************** +//**************************************************************************** + +double Cell::getPsat() +{ + // Computation of saturation pressure is only valid for a liquid/vapor couple + // Be careful, in case of a pure phase, the main phase is assumed to be indexed at 0 + // and currently the order is fixed. + return m_mixture->computePsat(TB->eos[PhaseType::LIQ], TB->eos[PhaseType::VAP], m_vecPhases[0]->getTemperature()); +} + +//*********************************************************************** + +void Cell::printInfo() const +{ + m_element->printInfo(); +} + +//*********************************************************************** + +bool Cell::printGnuplotAMR(std::ofstream &fileStream, const int& dim, GeometricObject *objet, bool recordPsat) +{ + bool write(true); + int dimension(dim); + Coord position = m_element->getPosition(); + //for cut printing + if (objet != 0) + { + if (objet->getType() != 0) { //For non probes objects + write = m_element->traverseObjet(*objet); + position = objet->projectionPoint(position); + dimension = objet->getType(); + } + } + if (write) { + if (!m_split) { + //CAUTION: the order has to be kept for conformity reasons with gnuplot scripts + if (dimension >= 1) fileStream << position.getX() << " "; + if (dimension >= 2) fileStream << position.getY() << " "; + if (dimension == 3)fileStream << position.getZ() << " "; + this->printPhasesMixture(fileStream); + fileStream << m_lvl << " " << m_xi << " "; + if (recordPsat) fileStream << this->getPsat() << " "; + fileStream << std::endl; + if (objet != 0) { if (objet->getType() == 0) return true; } //probe specificity, unique. + } + else { + + for (unsigned int i = 0; i < m_childrenCells.size(); i++) { + m_childrenCells[i]->printGnuplotAMR(fileStream, dim, objet, recordPsat); + } + } + } + return false; +} + +//*********************************************************************** + +void Cell::computeVolumePhaseK(double& integration, const int& numPhase) +{ + if (!m_split) { + //Compute the volume without any particular condition + //--------------------------------------------------- + //Cell-center formulation + integration += m_element->getVolume() * m_vecPhases[numPhase]->getAlpha(); + + //Face formulation + // double faceR(0.), faceL(0.); + // for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { + // if (m_cellInterfaces[b]->getLvl() == m_lvl) { + // if (m_cellInterfaces[b]->getCellRight() == this) { + // faceL = m_cellInterfaces[b]->getFace()->getPos().getX(); + // } + // if (m_cellInterfaces[b]->getCellLeft() == this) { + // faceR = m_cellInterfaces[b]->getFace()->getPos().getX(); + // } + // } + // } + // integration += m_vecPhases[numPhase]->getAlpha() * (std::pow(faceR, 3.) - std::pow(faceL, 3.)); + + //Compute the volume with a particular condition + //---------------------------------------------- + //2D + // if (m_vecTransports[0].getValue() < 1.e-8) integration += m_element->getVolume() * m_vecPhases[numPhase]->getAlpha(); + + //2D axi-symmetric + // if (m_vecTransports[0].getValue() < 1.e-8) { + // double faceRmax(0.), faceRmin(0.), volumeCell(0.); + // for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { + // if (m_cellInterfaces[b]->getLvl() == m_lvl) { + // if (std::fabs(m_element->getPosition().getY() - m_cellInterfaces[b]->getFace()->getPos().getY()) > 1.e-10) { + // if (m_cellInterfaces[b]->getCellRight() == this) { + // faceRmin = m_cellInterfaces[b]->getFace()->getPos().getY(); + // } + // if (m_cellInterfaces[b]->getCellLeft() == this) { + // faceRmax = m_cellInterfaces[b]->getFace()->getPos().getY(); + // } + // } + // } + // } + // volumeCell = sqrt(m_element->getVolume()) * M_PI * (faceRmax*faceRmax - faceRmin*faceRmin); + // integration += volumeCell * m_vecPhases[numPhase]->getAlpha(); + // } + } + else { + for (unsigned int i = 0; i < m_childrenCells.size(); i++) { + m_childrenCells[i]->computeVolumePhaseK(integration, numPhase); + } + } +} + +//*********************************************************************** + +void Cell::computeMass(double& mass, double& alphaRef) +{ + if (!m_split) { + if (m_vecPhases[1]->getAlpha() >= alphaRef) { + mass += m_element->getVolume()*m_vecPhases[1]->getAlpha()*m_vecPhases[1]->getDensity(); + } + } + else { + for (unsigned int i = 0; i < m_childrenCells.size(); i++) { + m_childrenCells[i]->computeMass(mass, alphaRef); + } + } +} + +//*********************************************************************** + +void Cell::computeTotalMass(double& mass) +{ + if (!m_split) { + if (numberPhases > 1) { + mass += m_mixture->getDensity() * m_element->getVolume(); + } + else { mass += m_vecPhases[0]->getDensity() * m_element->getVolume(); } + } + else { + for (unsigned int i = 0; i < m_childrenCells.size(); i++) { + m_childrenCells[i]->computeTotalMass(mass); + } + } +} + +//*********************************************************************** + +void Cell::computeTotalEnergy(double& totalEnergy) +{ + if (!m_split) { + if (numberPhases > 1) { + totalEnergy += m_mixture->getDensity() * m_mixture->getTotalEnergy() * m_element->getVolume(); + } + else { totalEnergy += m_vecPhases[0]->getDensity() * m_vecPhases[0]->getTotalEnergy() * m_element->getVolume(); } + } + else { + for (unsigned int i = 0; i < m_childrenCells.size(); i++) { + m_childrenCells[i]->computeTotalEnergy(totalEnergy); + } + } +} + +//*********************************************************************** + +void Cell::lookForPmax(double* pMax, double*pMaxWall) +{ + if (!m_split) { + if (m_mixture->getPressure() > pMax[0]) { + pMax[0] = m_mixture->getPressure(); + pMax[1] = m_element->getPosition().getX(); + pMax[2] = m_element->getPosition().getY(); + pMax[3] = m_element->getPosition().getZ(); + } + if (m_mixture->getPressure() > pMaxWall[0] && m_element->getPosition().getX() < 0.005) { + pMaxWall[0] = m_mixture->getPressure(); + pMaxWall[1] = m_element->getPosition().getX(); + pMaxWall[2] = m_element->getPosition().getY(); + pMaxWall[3] = m_element->getPosition().getZ(); + } + } + else { + for (unsigned int i = 0; i < m_childrenCells.size(); i++) { + m_childrenCells[i]->lookForPmax(pMax, pMaxWall); + } + } +} + +//**************************************************************************** +//*********************************** AMR ************************************ //**************************************************************************** void Cell::setToZeroXi() @@ -992,7 +1030,6 @@ void Cell::refineCellAndCellInterfaces(const int& nbCellsY, const int& nbCellsZ, for (int i = 0; i < numberCellsChildren; i++) { - //Children cells creation //----------------------- this->createChildCell(m_lvl); @@ -1005,6 +1042,7 @@ void Cell::refineCellAndCellInterfaces(const int& nbCellsY, const int& nbCellsZ, posYChild = posYCellParent + dimY*dYParent*(double)(-0.25 + 0.5 * ((i / 2) % 2)); posZChild = posZCellParent + dimZ*dZParent*(double)(-0.25 + 0.5 * ((i / 4) % 2)); m_childrenCells[i]->getElement()->setPos(posXChild, posYChild, posZChild); + m_childrenCells[i]->m_wall = m_wall; //Set the key for the child //----------------------- @@ -1396,8 +1434,8 @@ bool Cell::lvlNeighborTooLow() if (m_cellInterfaces[b]->whoAmI() == 0) //Cell interface of type CellInterface/O2 (inner) { //Getting left and right AMR levels for each cell interface - int lvlg = m_cellInterfaces[b]->getCellGauche()->getLvl(); - int lvld = m_cellInterfaces[b]->getCellDroite()->getLvl(); + int lvlg = m_cellInterfaces[b]->getCellLeft()->getLvl(); + int lvld = m_cellInterfaces[b]->getCellRight()->getLvl(); //Looking for neighbor level to be not too low if (lvlg < m_lvl) { criteria = true; return criteria; } @@ -1406,7 +1444,7 @@ bool Cell::lvlNeighborTooLow() else { //Getting Left AMR levels for cell-interface conditions - int lvlg = m_cellInterfaces[b]->getCellGauche()->getLvl(); + int lvlg = m_cellInterfaces[b]->getCellLeft()->getLvl(); //Looking for neighbor level to be not too low if (lvlg < m_lvl) { criteria = true; return criteria; } @@ -1430,132 +1468,6 @@ void Cell::buildLvlCellsAndLvlInternalCellInterfacesArrays(std::vector* c //*********************************************************************** -bool Cell::printGnuplotAMR(std::ofstream &fileStream, const int& dim, GeometricObject *objet) -{ - bool ecrit(true); - int dimension(dim); - Coord position = m_element->getPosition(); - //for cut printing - if (objet != 0) - { - if (objet->getType() != 0) { //For non probes objects - ecrit = m_element->traverseObjet(*objet); - position = objet->projectionPoint(position); - dimension = objet->getType(); - } - } - if (ecrit) { - if (!m_split) { - //CAUTION: the order has to be kept for conformity reasons with gnuplot scripts - if (dimension >= 1) fileStream << position.getX() << " "; - if (dimension >= 2) fileStream << position.getY() << " "; - if (dimension == 3)fileStream << position.getZ() << " "; - this->printPhasesMixture(fileStream); - fileStream << m_lvl << " " << m_xi << " "; - fileStream << std::endl; - if (objet != 0) { if (objet->getType() == 0) return true; } //probe specificity, unique. - } - else { - - for (unsigned int i = 0; i < m_childrenCells.size(); i++) { - m_childrenCells[i]->printGnuplotAMR(fileStream, dim, objet); - } - } - } - return false; -} - -//*********************************************************************** - -void Cell::computeVolumePhaseK(double& integration, const int& numPhase) -{ - if (!m_split) { - integration += m_element->getVolume()*m_vecPhases[numPhase]->getAlpha(); - } - else { - for (unsigned int i = 0; i < m_childrenCells.size(); i++) { - m_childrenCells[i]->computeVolumePhaseK(integration, numPhase); - } - } -} - -//*********************************************************************** - -void Cell::computeMass(double& mass, double& alphaRef) -{ - if (!m_split) { - if (m_vecPhases[1]->getAlpha() >= alphaRef) { - mass += m_element->getVolume()*m_vecPhases[1]->getAlpha()*m_vecPhases[1]->getDensity(); - } - } - else { - for (unsigned int i = 0; i < m_childrenCells.size(); i++) { - m_childrenCells[i]->computeMass(mass, alphaRef); - } - } -} - -//*********************************************************************** - -void Cell::computeTotalMass(double& mass) -{ - if (!m_split) { - if (numberPhases > 1) { - mass += m_mixture->getDensity() * m_element->getVolume(); - } - else { mass += m_vecPhases[0]->getDensity() * m_element->getVolume(); } - } - else { - for (unsigned int i = 0; i < m_childrenCells.size(); i++) { - m_childrenCells[i]->computeTotalMass(mass); - } - } -} - -//*********************************************************************** - -void Cell::computeTotalEnergy(double& totalEnergy) -{ - if (!m_split) { - if (numberPhases > 1) { - totalEnergy += m_mixture->getDensity() * m_mixture->getTotalEnergy() * m_element->getVolume(); - } - else { totalEnergy += m_vecPhases[0]->getDensity() * m_vecPhases[0]->getTotalEnergy() * m_element->getVolume(); } - } - else { - for (unsigned int i = 0; i < m_childrenCells.size(); i++) { - m_childrenCells[i]->computeTotalEnergy(totalEnergy); - } - } -} - -//*********************************************************************** - -void Cell::lookForPmax(double* pMax, double*pMaxWall) -{ - if (!m_split) { - if (m_mixture->getPressure() > pMax[0]) { - pMax[0] = m_mixture->getPressure(); - pMax[1] = m_element->getPosition().getX(); - pMax[2] = m_element->getPosition().getY(); - pMax[3] = m_element->getPosition().getZ(); - } - if (m_mixture->getPressure() > pMaxWall[0] && m_element->getPosition().getX() < 0.005) { - pMaxWall[0] = m_mixture->getPressure(); - pMaxWall[1] = m_element->getPosition().getX(); - pMaxWall[2] = m_element->getPosition().getY(); - pMaxWall[3] = m_element->getPosition().getZ(); - } - } - else { - for (unsigned int i = 0; i < m_childrenCells.size(); i++) { - m_childrenCells[i]->lookForPmax(pMax, pMaxWall); - } - } -} - -//*********************************************************************** - void Cell::setXi(double value) { m_xi = value; @@ -1711,17 +1623,17 @@ bool Cell::hasNeighboringGhostCellOfCPUneighbour(const int& neighbour) const bool hasGhostNeighbour(false); for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { if (m_cellInterfaces[b]->whoAmI() == 0) { //Cell interface of type CellInterface/O2 (inner) - if (this == m_cellInterfaces[b]->getCellGauche()) { - if (m_cellInterfaces[b]->getCellDroite()->isCellGhost()) { - if (m_cellInterfaces[b]->getCellDroite()->getRankOfNeighborCPU() == neighbour) { + if (this == m_cellInterfaces[b]->getCellLeft()) { + if (m_cellInterfaces[b]->getCellRight()->isCellGhost()) { + if (m_cellInterfaces[b]->getCellRight()->getRankOfNeighborCPU() == neighbour) { hasGhostNeighbour = true; break; } } } else { - if (m_cellInterfaces[b]->getCellGauche()->isCellGhost()) { - if (m_cellInterfaces[b]->getCellGauche()->getRankOfNeighborCPU() == neighbour) { + if (m_cellInterfaces[b]->getCellLeft()->isCellGhost()) { + if (m_cellInterfaces[b]->getCellLeft()->getRankOfNeighborCPU() == neighbour) { hasGhostNeighbour = true; break; } @@ -1740,16 +1652,16 @@ int Cell::numberOfNeighboringGhostCellsOfCPUneighbour(const int& neighbour) cons for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { if (m_cellInterfaces[b]->whoAmI() == 0) { //Cell interface of type CellInterface/O2 (inner) if (m_cellInterfaces[b]->getLvl() == m_lvl) { - if (this == m_cellInterfaces[b]->getCellGauche()) { - if (m_cellInterfaces[b]->getCellDroite()->isCellGhost()) { - if (m_cellInterfaces[b]->getCellDroite()->getRankOfNeighborCPU() == neighbour) { + if (this == m_cellInterfaces[b]->getCellLeft()) { + if (m_cellInterfaces[b]->getCellRight()->isCellGhost()) { + if (m_cellInterfaces[b]->getCellRight()->getRankOfNeighborCPU() == neighbour) { hasGhostNeighbour++; } } } else { - if (m_cellInterfaces[b]->getCellGauche()->isCellGhost()) { - if (m_cellInterfaces[b]->getCellGauche()->getRankOfNeighborCPU() == neighbour) { + if (m_cellInterfaces[b]->getCellLeft()->isCellGhost()) { + if (m_cellInterfaces[b]->getCellLeft()->getRankOfNeighborCPU() == neighbour) { hasGhostNeighbour++; } } @@ -1829,14 +1741,14 @@ void Cell::refineCellAndCellInterfacesGhost(const int& nbCellsY, const int& nbCe auto coordFirstChild = key.child(0).coordinate(); - if (this == m_cellInterfaces[b]->getCellGauche()) + if (this == m_cellInterfaces[b]->getCellLeft()) { - GhostCellNeighbor = m_cellInterfaces[b]->getCellDroite(); + GhostCellNeighbor = m_cellInterfaces[b]->getCellRight(); GhostCellIsLeft = true; } else { - GhostCellNeighbor = m_cellInterfaces[b]->getCellGauche(); + GhostCellNeighbor = m_cellInterfaces[b]->getCellLeft(); GhostCellIsLeft = false; } @@ -1934,7 +1846,7 @@ void Cell::refineCellAndCellInterfacesGhost(const int& nbCellsY, const int& nbCe m_cellInterfaces[b]->getCellInterfaceChildBack()->setFace(f); //Face properties - m_cellInterfaces[b]->getCellInterfaceChildBack()->getFace()->initializeAutres(surfaceChild, face->getNormal(), face->getTangent(), face->getBinormal()); + m_cellInterfaces[b]->getCellInterfaceChildBack()->getFace()->initializeOthers(surfaceChild, face->getNormal(), face->getTangent(), face->getBinormal()); m_cellInterfaces[b]->getCellInterfaceChildBack()->getFace()->setPos(childCellInterfacePosition.getX(),childCellInterfacePosition.getY(),childCellInterfacePosition.getZ()); auto FaceSize = face->getSize(); diff --git a/src/Order1/Cell.h b/src/Order1/Cell.h index 48e4b743..a7bc5209 100644 --- a/src/Order1/Cell.h +++ b/src/Order1/Cell.h @@ -36,8 +36,7 @@ #include "../Maths/Coord.h" #include "../Maths/Tensor.h" #include "../Transport/Transport.h" - -enum Variable { transport, pressure, density, alpha, velocityMag, velocityU, velocityV, velocityW, temperature, QPA }; +#include "../Transport/GradTransport.h" class Cell; //Predeclaration of class to include following .h @@ -51,6 +50,9 @@ class Cell; //Predeclaration of class to include following .h #include "../Geometries/GeometricalDomain.h" #include "../Symmetries/Symmetry.h" +class GradPhase; +class GradMixture; + //! \class Cell //! \brief Base class for a mesh cell class Cell @@ -85,7 +87,6 @@ class Cell void copyMixture(Mixture* mixture); void setToZeroCons(); void setToZeroConsGlobal(); - void setToZeroBufferFlux(); void timeEvolution(const double& dt, Symmetry* symmetry); void timeEvolutionAddPhys(const double& dt); void buildPrim(); @@ -100,24 +101,16 @@ class Cell virtual void reverseProjection(const Coord& normal, const Coord& tangent, const Coord& binormal); virtual void copyInCell(Cell& /*cellSource*/) const { Errors::errorMessage("methode copie non dispo pour cell"); }; void copyVec(Phase** vecPhases, Mixture* mixture, Transport* vecTransports); - //void printCut1Dde2D(std::ofstream& fileStream, std::string variableConstanteCut, const double& valueCut, const double& dL); /*!< Ecriture de la cut 1D de la simulation 2D */ - //void printCut1Dde3D(std::ofstream& fileStream, std::string variableConstanteCut1, std::string variableConstanteCut2, const double& valueCut1, const double& valueCut2, const double& dL1, const double& dL2); /*!< Ecriture de la cut 1D de la simulation 3D */ + //void printCut1Dde2D(std::ofstream& fileStream, std::string variableConstanteCut, const double& valueCut, const double& dL); /*!< Write de la cut 1D de la simulation 2D */ + //void printCut1Dde3D(std::ofstream& fileStream, std::string variableConstanteCut1, std::string variableConstanteCut2, const double& valueCut1, const double& valueCut2, const double& dL1, const double& dL2); /*!< Write de la cut 1D de la simulation 3D */ + void deleteInterface(const int &b); //For additional physics //---------------------- void prepareAddPhys(); - double selectScalar(Variable nameVariable, int num = 0) const; - void setScalar(Variable nameVariable, const double& value, int num = 0); Coord selectVector(Variable nameVector, int num = 0, int subscript = -1) const; void setVector(Variable nameVector, const Coord& value, int num = 0, int subscript = -1); - Coord computeGradient(Variable nameVariable, int numPhase = -1); - //! \brief Compute gradients (temperature, velocity, density) of a cell following the Green-Gauss method - //! \param grads Array of desired gradients, e.g. for temperature each component represents phase temperature and for velocity each component represents the gradient of a velocity component (grad(u), grad(v), grad(w)) - //! \param nameVariables Name of the variable for which the gradient is calculated - //! \param numPhases Phases number's - void computeGradient(std::vector& grads, std::vector& nameVariables, std::vector& numPhases); - const QuantitiesAddPhys* getQPA(int& numQPA) const { return m_vecQuantitiesAddPhys[numQPA]; }; //!< Allow to recover an additional physical quantity const Coord& getGradTk(int& numPhase, int& numAddPhys) const; @@ -125,11 +118,20 @@ class Cell void addNonConsAddPhys(AddPhys& addPhys, Symmetry* symmetry); void reinitializeColorFunction(const int& numTransport, const int& numPhase); //!< Re-initialize the color function (transport) with alpha + + //Gradients + //--------- + //! \brief Compute gradients (temperature, velocity, density) of a cell + //! \param grads Array of desired gradients, e.g. for temperature each component represents phase temperature and for velocity each component represents the gradient of a velocity component (grad(u), grad(v), grad(w)) + //! \param nameVariables Name of the variable for which the gradient is calculated + //! \param numPhases Phases number's + void computeGradients(std::vector& grads, std::vector& nameVariables, std::vector& numPhases); //Accessors //--------- int getCellInterfacesSize() const; CellInterface* getCellInterface(const int& b); + void setCellInterface(const int& b, CellInterface* cellInterface); virtual Phase* getPhase(const int& phaseNumber, Prim /*type*/ = vecPhases) const; virtual Phase** getPhases(Prim /*type*/ = vecPhases) const; virtual Mixture* getMixture(Prim /*type*/ = vecPhases) const; @@ -154,9 +156,24 @@ class Cell Model* getModel(); Coord& getVelocity(); const Coord& getVelocity() const; + void setWall(bool wall); + bool getWall() const { return m_wall; }; + //! \brief Select a specific scalar variable + //! \param nameVariables Name of the variable to select + //! \param numPhases Phases number's + double selectScalar(Variable nameVariable, int num = 0) const; + + //Second order (not used for first-order cells) + //--------------------------------------------- + //! \brief Compute global variable buffers (min, max, etc.) and initialize speficic gradient vectors for 2nd-order scheme on unstructured mesh + virtual void allocateSecondOrderBuffersAndGradientVectors(Phase** /*phases*/, Mixture* /*mixture*/) {}; - //Not used for first order cells - //------------------------------ + //! \brief Compute gradients for 2nd-order scheme on unstructured mesh + virtual void computeGradientsO2() {}; + virtual void limitGradientsO2(Limiter& /*globalLimiter*/) {}; + + //! \brief Compute slopes for 2nd-order scheme on unstructured mesh + virtual void computeLocalSlopes(CellInterface& /*cellInterfaceRef*/) {}; virtual void computeLocalSlopes(CellInterface& /*cellInterface*/, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, double& /*alphaCellAfterOppositeSide*/, double& /*alphaCell*/, double& /*alphaCellOtherInterfaceSide*/, @@ -167,12 +184,10 @@ class Cell virtual Phase* getSlopes() const { return 0; }; /*!< Does nothing for first order cells */ virtual Transport* getSlopesTransport() const { return 0; }; /*!< Does nothing for first order cells */ virtual void saveCons() {}; /*!< Does nothing for first order cells */ - virtual void recuperationCons() {}; /*!< Does nothing for first order cells */ + virtual void getBackCons() {}; /*!< Does nothing for first order cells */ virtual void predictionOrdre2(const double& /*dt*/, Symmetry* /*symmetry*/) {}; /*!< Does nothing for first order cells */ - void printInfo() const; - - //methods for distance to an other object (Cell or CellInterface) + //Methods for distance to an other object (Cell or CellInterface) //--------------------------------------------------------------- double distance(Cell* c); /*!< Distance totale */ double distanceX(Cell* c); /*!< Distance selon x */ @@ -187,7 +202,10 @@ class Cell //Printing //-------- - bool printGnuplotAMR(std::ofstream& fileStream, const int& dim, GeometricObject* objet = 0); + void printInfo() const; + //! \brief Compute saturation pressure for a liquid/vapor fluid mixture (first phase is considered predominant -> not generalized be careful) + double getPsat(); + bool printGnuplotAMR(std::ofstream& fileStream, const int& dim, GeometricObject* objet = 0, bool recordPsat = false); void computeVolumePhaseK(double& integration, const int& numPhase); void computeMass(double& mass, double& alphaRef); void computeTotalMass(double& mass); @@ -216,24 +234,28 @@ class Cell void addFluxXi(double value); /*!< Add xi cell flux */ int getNumberCellsChildren(); /*!< Return the number of children cells */ Cell* getCellChild(const int& num); /*!< Return pointer to the corresponding child cell number */ - std::vector* getChildVector(); /*!< Return pointer to child vector */ + std::vector* getChildVector(); /*!< Return pointer to child vector */ //For parallel computing (no AMR) //------------------------------- virtual void pushBackSlope() {}; /*!< Does nothing for non-ghost O2 cells */ + virtual void popBackSlope() {}; /*!< Does nothing for non-ghost O2 cells */ virtual int getRankOfNeighborCPU() const { return -1; }; - virtual void setRankOfNeighborCPU(int /*rank*/) {}; /*!< Does nothing for non-ghost cells */ + virtual void setRankOfNeighborCPU(int /*rank*/) {}; /*!< Does nothing for non-ghost cells */ void fillBufferPrimitives(double* buffer, int& counter, const int& lvl, const int& neighbour, Prim type = vecPhases) const; void getBufferPrimitives(double* buffer, int& counter, const int& lvl, Eos** eos, Prim type = vecPhases); void fillBufferVector(double* buffer, int& counter, const int& lvl, const int& neighbour, const int& dim, Variable nameVector, int num = 0, int index = -1) const; void getBufferVector(double* buffer, int& counter, const int& lvl, const int& dim, Variable nameVector, int num = 0, int index = -1); void fillBufferTransports(double* buffer, int& counter, const int& lvl, const int& neighbour) const; void getBufferTransports(double* buffer, int& counter, const int& lvl); - virtual void fillBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/, const int& /*neighbour*/) const {}; /*!< Does nothing for first order cells */ - virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/) {}; /*!< Does nothing for first order cells */ + virtual void fillBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/, const int& /*neighbour*/) const { Errors::errorMessage("fillBufferSlopes not available for Cell"); }; /*!< Does nothing for first order cells */ + virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/) { Errors::errorMessage("getBufferSlopes not available for Cell"); }; /*!< Does nothing for first order cells */ virtual bool isCellGhost() const { return false; }; bool hasNeighboringGhostCellOfCPUneighbour(const int& neighbour) const; /*!< Return a bool that is true if the cell has a neighboring ghost cell corresponding to CPU "neighbour" */ int numberOfNeighboringGhostCellsOfCPUneighbour(const int& neighbour) const; /*!< Return the number of neighboring ghost cells corresponding to CPU "neighbour" this cell has */ + virtual GradPhase* getGradPhase(const int& /*phaseNumber*/) const { Errors::errorMessage("getGradPhase not available for Cell"); return nullptr; }; + virtual GradMixture* getGradMixture() const { Errors::errorMessage("getGradMixture not available for Cell"); return nullptr; }; + virtual GradTransport* getGradTransport(const int& /*transportNumber*/) const { Errors::errorMessage("getGradTransport not available for Cell"); return nullptr; }; //For parallel AMR computing //-------------------------- @@ -255,8 +277,9 @@ class Cell void updateNbCellsTotalAMR(int& nbCellsTotalAMR); protected: - Phase** m_vecPhases; - Mixture* m_mixture; + bool m_wall; /*!< Bool indicating if the cell is a solid boundary (for immersed boundaries) */ + Phase** m_vecPhases; /*!< Array of phases */ + Mixture* m_mixture; /*!< Mixture */ Transport* m_vecTransports; /*!< Array of passive variables advected in the flow */ Flux* m_cons; /*!< Conservative variables */ Transport* m_consTransports; /*!< Array of fluxes for advected variables */ @@ -277,5 +300,8 @@ class Cell extern Model* model; /*!< Pointer to model */ extern Gradient* gradient; /*!< Pointer to gradient method */ +extern std::vector gradRho; /*!< Gradient of density */ +extern std::vector variableDensity; /*!< Variable name for density gradients */ +extern std::vector numeratorDefault; /*!< Default numerator (used for density gradients) */ #endif // CELL_H diff --git a/src/Order1/CellInterface.cpp b/src/Order1/CellInterface.cpp index 6c684791..8fa08948 100644 --- a/src/Order1/CellInterface.cpp +++ b/src/Order1/CellInterface.cpp @@ -37,12 +37,14 @@ Cell* bufferCellRight; //*********************************************************************** -CellInterface::CellInterface() : m_cellLeft(0), m_cellRight(0), m_face(0), m_lvl(0), m_cellInterfacesChildren(0) +CellInterface::CellInterface() : m_cellLeft(0), m_cellRight(0), m_face(0), m_lvl(0), m_cellInterfacesChildren(0), + m_mrfInterface(false), m_mrfStaticRegionIsLeft(false), m_omega(0.) {} //*********************************************************************** -CellInterface::CellInterface(const int& lvl) : m_cellLeft(0), m_cellRight(0), m_face(0), m_lvl(lvl), m_cellInterfacesChildren(0) +CellInterface::CellInterface(const int& lvl) : m_cellLeft(0), m_cellRight(0), m_face(0), m_lvl(lvl), m_cellInterfacesChildren(0), + m_mrfInterface(false), m_mrfStaticRegionIsLeft(false), m_omega(0.) {} //*********************************************************************** @@ -87,22 +89,56 @@ void CellInterface::setFace(Face *face) //*********************************************************************** +void CellInterface::checkMrfInterface(Source* sourceMRF) +{ + int rotatingRegion(sourceMRF->getPhysicalEntity()); + if (m_cellLeft->getElement()->getAppartenancePhysique() != rotatingRegion && + m_cellRight->getElement()->getAppartenancePhysique() == rotatingRegion) + { + m_mrfInterface = true; + m_mrfStaticRegionIsLeft = true; + m_omega = sourceMRF->getOmega(); + } + else if (m_cellLeft->getElement()->getAppartenancePhysique() == rotatingRegion && + m_cellRight->getElement()->getAppartenancePhysique() != rotatingRegion) + { + m_mrfInterface = true; + m_mrfStaticRegionIsLeft = false; + m_omega = sourceMRF->getOmega(); + } + else { m_mrfInterface = false; } // SRF +} + +//*********************************************************************** + void CellInterface::computeFlux(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type) { - this->solveRiemann(dtMax, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, type); - - if (m_cellLeft->getLvl() == m_cellRight->getLvl()) { //CoefAMR = 1 pour les deux - this->addFlux(1.); //Ajout du flux sur maille droite - this->subtractFlux(1.); //Retrait du flux sur maille gauche - } - else if (m_cellLeft->getLvl() > m_cellRight->getLvl()) { //CoefAMR = 1 pour la gauche et 0.5 pour la droite - this->addFlux(0.5); //Ajout du flux sur maille droite - this->subtractFlux(1.); //Retrait du flux sur maille gauche + if (!m_mrfInterface) { // No MRF or not MRF interface + this->solveRiemann(dtMax, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, type); + if (m_cellLeft->getLvl() == m_cellRight->getLvl()) { //CoefAMR = 1 pour les deux + this->addFlux(1.); //Add of flux on right cell + this->subtractFlux(1.); //Subtract of flux on left cell + } + else if (m_cellLeft->getLvl() > m_cellRight->getLvl()) { //CoefAMR = 1 pour la gauche et 0.5 pour la droite + this->addFlux(0.5); //Add of flux on right cell + this->subtractFlux(1.); //Subtract of flux on left cell + } + else { //CoefAMR = 0.5 pour la gauche et 1 pour la droite + this->addFlux(1.); //Add of flux on right cell + this->subtractFlux(0.5); //Subtract of flux on left cell + } } - else { //CoefAMR = 0.5 pour la gauche et 1 pour la droite - this->addFlux(1.); //Ajout du flux sur maille droite - this->subtractFlux(0.5); //Retrait du flux sur maille gauche + else { // MRF activated + this->solveRiemannMRF(dtMax); + if (m_mrfStaticRegionIsLeft) { + this->addFluxRotatingRegion(); + this->subtractFlux(1.); + } + else { + this->addFlux(1.); + this->substractFluxRotatingRegion(); + } } } @@ -118,11 +154,11 @@ void CellInterface::computeFluxAddPhys(AddPhys &addPhys) void CellInterface::solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim /*type*/) { - //Projection des velocities sur repere attache a la face + //Vector and tensor projections on geometric reference frame of the face m_cellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); m_cellRight->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); - //Probleme de Riemann + //Riemann problem double dxLeft(m_cellLeft->getElement()->getLCFL()); double dxRight(m_cellRight->getElement()->getLCFL()); dxLeft = dxLeft*std::pow(2., (double)m_lvl); @@ -131,10 +167,99 @@ void CellInterface::solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limi //Handling of transport functions (m_Sm known: need to be called after Riemann solver) if (numberTransports > 0) { model->solveRiemannTransportIntern(*m_cellLeft, *m_cellRight); } - //Projection du flux sur le repere absolu + //Flux projection on absolute reference frame + model->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellLeft->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellRight->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); +} + +//*********************************************************************** + +void CellInterface::solveRiemannMRF(double& dtMax) +{ + // This routine allows to compute two fluxes: + // - an absolute flux for the static region, + // - a relative flux for the rotating region. + // The absolute flux is computed by projection of the velocity of the rotating region into the static one + // and the relative flux is built from the RP primitive vector solution after the relative velocity reconstruction. + // For both fluxes the Riemann problem uses an absolute velocity. + + Coord buffVel; // Same variable is used for two purpose (1: build abs. vel. of rotating region, 2: re-build rel. vel. of rot. region) + Cell *rotatingCell(nullptr); + + // Build absolute velocity in the rotating region + if (m_mrfStaticRegionIsLeft) { rotatingCell = m_cellRight; } + else { rotatingCell = m_cellLeft; } + + if (numberPhases > 1) { + buffVel.setXYZ( + rotatingCell->getMixture()->getVelocity().getX(), + rotatingCell->getMixture()->getVelocity().getY(), + rotatingCell->getMixture()->getVelocity().getZ() + ); + rotatingCell->getMixture()->setVelocity( + buffVel + m_omega.cross(this->getFace()->getPos()) + ); + } + else { + buffVel.setXYZ( + rotatingCell->getPhase(0)->getVelocity().getX(), + rotatingCell->getPhase(0)->getVelocity().getY(), + rotatingCell->getPhase(0)->getVelocity().getZ() + ); + rotatingCell->getPhase(0)->setVelocity( + buffVel + m_omega.cross(this->getFace()->getPos()) + ); + } + rotatingCell->fulfillState(); // Required to compute total energy + + // Vector and tensor projections on geometric reference frame of the face + m_cellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellRight->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + + // Riemann problem to build relative and absolute fluxes + double dxLeft(m_cellLeft->getElement()->getLCFL()); + double dxRight(m_cellRight->getElement()->getLCFL()); + dxLeft = dxLeft*std::pow(2., (double)m_lvl); + dxRight = dxRight*std::pow(2., (double)m_lvl); + std::vector primStar(VarBoundary::SIZE, 0); // Vector of intermediate state primitive variables from RP + model->solveRiemannInternMRF(*m_cellLeft, *m_cellRight, dxLeft, dxRight, dtMax, m_omega, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal(), m_face->getPos()); + + // Finish build of relative flux for rotating region + model->addNonConsMrfFlux(rotatingCell->getPhases()); + model->reverseProjectionMrfFlux(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + + // Handling of transport functions (m_Sm known: need to be called after Riemann solver) + if (numberTransports > 0) { model->solveRiemannTransportIntern(*m_cellLeft, *m_cellRight); } + + // Absolute flux is projected into global frame model->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); m_cellLeft->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); m_cellRight->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + + // Reset velocity of the rotating region to relative one for Godunov scheme + if (numberPhases > 1) { + buffVel.setXYZ( + rotatingCell->getMixture()->getVelocity().getX(), + rotatingCell->getMixture()->getVelocity().getY(), + rotatingCell->getMixture()->getVelocity().getZ() + ); + rotatingCell->getMixture()->setVelocity( + buffVel - m_omega.cross(this->getFace()->getPos()) + ); + } + else { + buffVel.setXYZ( + rotatingCell->getPhase(0)->getVelocity().getX(), + rotatingCell->getPhase(0)->getVelocity().getY(), + rotatingCell->getPhase(0)->getVelocity().getZ() + ); + rotatingCell->getPhase(0)->setVelocity( + buffVel - m_omega.cross(this->getFace()->getPos()) + ); + } + rotatingCell->fulfillState(); // Required to compute total energy + rotatingCell = nullptr; } //*********************************************************************** @@ -144,7 +269,7 @@ void CellInterface::addFlux(const double& coefAMR) //No "time step" double coefA = m_face->getSurface() / m_cellRight->getElement()->getVolume() * coefAMR; m_cellRight->getCons()->addFlux(coefA); - m_cellRight->getCons()->addNonCons(coefA, m_cellRight); + m_cellRight->getCons()->addNonCons(coefA, m_cellRight, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); for (int k = 0; k < numberTransports; k++) { m_cellRight->getConsTransport(k)->addFlux(coefA, k); m_cellRight->getConsTransport(k)->addNonCons(coefA, m_cellRight->getTransport(k).getValue(), model->getSM()); @@ -161,7 +286,7 @@ void CellInterface::subtractFlux(const double& coefAMR) //No "time step" double coefA = m_face->getSurface() / m_cellLeft->getElement()->getVolume() * coefAMR; m_cellLeft->getCons()->subtractFlux(coefA); - m_cellLeft->getCons()->subtractNonCons(coefA, m_cellLeft); + m_cellLeft->getCons()->subtractNonCons(coefA, m_cellLeft, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); for (int k = 0; k < numberTransports; k++) { m_cellLeft->getConsTransport(k)->subtractFlux(coefA, k); m_cellLeft->getConsTransport(k)->subtractNonCons(coefA, m_cellLeft->getTransport(k).getValue(), model->getSM()); @@ -173,6 +298,24 @@ void CellInterface::subtractFlux(const double& coefAMR) //*********************************************************************** +void CellInterface::addFluxRotatingRegion() +{ + //No "time step" + double coefA = m_face->getSurface() / m_cellRight->getElement()->getVolume(); + m_cellRight->getCons()->addFluxRotatingRegion(coefA); +} + +//*********************************************************************** + +void CellInterface::substractFluxRotatingRegion() +{ + //No "time step" + double coefA = m_face->getSurface() / m_cellLeft->getElement()->getVolume(); + m_cellLeft->getCons()->subtractFluxRotatingRegion(coefA); +} + +//*********************************************************************** + double CellInterface::distance(Cell* c) { return m_face->distance(c->getElement()); @@ -194,14 +337,14 @@ Model* CellInterface::getMod() const //*********************************************************************** -Cell* CellInterface::getCellGauche() const +Cell* CellInterface::getCellLeft() const { return m_cellLeft; } //*********************************************************************** -Cell* CellInterface::getCellDroite() const +Cell* CellInterface::getCellRight() const { return m_cellRight; } @@ -212,15 +355,21 @@ Cell* CellInterface::getCellDroite() const void CellInterface::computeXi(const double& criteriaVar, const bool &varRho, const bool &varP, const bool &varU, const bool &varAlpha) { - if (varRho) { this->computeCritereAMR(criteriaVar, density); } + if (varRho) { this->computeCritereAMR(criteriaVar, Variable::density, -1); } if (varP) { - if (m_cellLeft->getXi() < 0.99 || m_cellRight->getXi() < 0.99) { this->computeCritereAMR(criteriaVar, pressure); } + if (m_cellLeft->getXi() < 0.99 || m_cellRight->getXi() < 0.99) { + this->computeCritereAMR(criteriaVar, Variable::pressure, -1); + } } if (varU) { - if (m_cellLeft->getXi() < 0.99 || m_cellRight->getXi() < 0.99) { this->computeCritereAMR(criteriaVar, velocityMag); } + if (m_cellLeft->getXi() < 0.99 || m_cellRight->getXi() < 0.99) { this->computeCritereAMR(criteriaVar, Variable::velocityMag); } } if (varAlpha) { - if (m_cellLeft->getXi() < 0.99 || m_cellRight->getXi() < 0.99) { this->computeCritereAMR(criteriaVar, alpha, 1); } + if (m_cellLeft->getXi() < 0.99 || m_cellRight->getXi() < 0.99) { + for (int k = 0; k < numberPhases; k++) { + this->computeCritereAMR(criteriaVar, Variable::alpha, k); + } + } } } @@ -229,14 +378,14 @@ void CellInterface::computeXi(const double& criteriaVar, const bool &varRho, con void CellInterface::computeCritereAMR(const double& criteriaVar, Variable nameVariable, int num) { double valueMin, variation, cd, cg; - // Recuperation des values de la variable en question a gauche et a droite + // Get des values de la variable en question a gauche et a droite cg = m_cellLeft->selectScalar(nameVariable, num); cd = m_cellRight->selectScalar(nameVariable, num); // Valeur de la variation valueMin = std::min(std::fabs(cd), std::fabs(cg)); if (valueMin < 1.e-2) { //Utile pour alpha (quasi-seulement) ou velocity - if (nameVariable == velocityMag) { valueMin = 0.1; } + if (nameVariable == Variable::velocityMag) { valueMin = 0.1; } else { valueMin = 1.e-2; } } variation = std::fabs(cd - cg) / valueMin; @@ -317,7 +466,7 @@ void CellInterface::raffineCellInterfaceExterne(const int& nbCellsY, const int& this->creerCellInterfaceChild(); m_cellInterfacesChildren[0]->m_face = m_face->creerNouvelleFace(); - m_cellInterfacesChildren[0]->m_face->initializeAutres(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellInterfacesChildren[0]->m_face->initializeOthers(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); m_cellInterfacesChildren[0]->m_face->setPos(m_face->getPos().getX(), m_face->getPos().getY(), m_face->getPos().getZ()); m_cellInterfacesChildren[0]->m_face->setSize(m_face->getSize()); if (m_face->getPos().getX() < cellRef->getElement()->getPosition().getX()) { @@ -366,7 +515,7 @@ void CellInterface::raffineCellInterfaceExterne(const int& nbCellsY, const int& for (int i = 0; i < 2; i++) { this->creerCellInterfaceChild(); m_cellInterfacesChildren[i]->m_face = m_face->creerNouvelleFace(); - m_cellInterfacesChildren[i]->m_face->initializeAutres(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellInterfacesChildren[i]->m_face->initializeOthers(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); } //Face selon X @@ -558,7 +707,7 @@ void CellInterface::raffineCellInterfaceExterne(const int& nbCellsY, const int& for (int i = 0; i < 4; i++) { this->creerCellInterfaceChild(); m_cellInterfacesChildren[i]->m_face = m_face->creerNouvelleFace(); - m_cellInterfacesChildren[i]->m_face->initializeAutres(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + m_cellInterfacesChildren[i]->m_face->initializeOthers(surfaceChild, m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); m_cellInterfacesChildren[i]->m_face->setSize(0.5*m_face->getSize()); } @@ -998,7 +1147,7 @@ void CellInterface::deraffineCellInterfaceExterne(Cell* cellRef) //On parcourt seulement les parent cell interfaces pour regarder si la cell voisine de celle de reference a des enfants, //si oui (enfants), on ne peut pas deraffiner le cell interface, on reaffecte donc les liaisons cells/cell interfaces des children cell interfaces, //si non (pas enfants), on peut deraffiner le cell interface et mettre a jour les neighbouring cells. - //Plus, si je suis un parent cell interface, qui a donc des enfants, mais que la cell de reference ne les connait pas encore, on les ajoute a ses cell interfaces. + //Plus, si je suis un parent cell interface, qui a donc des enfants, mais que la cell de reference ne les connait pas encore, on les adde a ses cell interfaces. //Parcours les parent cell interfaces if (cellRef->getLvl() == m_lvl) { @@ -1012,7 +1161,7 @@ void CellInterface::deraffineCellInterfaceExterne(Cell* cellRef) } //La cell voisine (droite) n'a pas d'enfants, on deraffine le cell interface et met a jour les neighbouring cells else { - //Il faut aussi enlever ses children cell interfaces des cell interfaces de la cell droite et de mes cell interfaces + //Il faut aussi remove ses children cell interfaces des cell interfaces de la cell droite et de mes cell interfaces for (unsigned int cellInterfaceChild = 0; cellInterfaceChild < m_cellInterfacesChildren.size(); cellInterfaceChild++) { m_cellRight->deleteCellInterface(m_cellInterfacesChildren[cellInterfaceChild]); cellRef->deleteCellInterface(m_cellInterfacesChildren[cellInterfaceChild]); @@ -1030,7 +1179,7 @@ void CellInterface::deraffineCellInterfaceExterne(Cell* cellRef) } //La cell voisine (gauche) n'a pas d'enfants, on deraffine le cell interface et met a jour les neighbouring cells else { - //Il faut aussi enlever ses children cell interfaces des cell interfaces de la cell gauche et de mes cell interfaces + //Il faut aussi remove ses children cell interfaces des cell interfaces de la cell gauche et de mes cell interfaces for (unsigned int cellInterfaceChild = 0; cellInterfaceChild < m_cellInterfacesChildren.size(); cellInterfaceChild++) { m_cellLeft->deleteCellInterface(m_cellInterfacesChildren[cellInterfaceChild]); cellRef->deleteCellInterface(m_cellInterfacesChildren[cellInterfaceChild]); @@ -1039,13 +1188,13 @@ void CellInterface::deraffineCellInterfaceExterne(Cell* cellRef) } } - //Si je suis un cell interface parent, qui a donc des enfants, mais que la cell de reference ne les connait pas encore, on les ajoute a ses cell interfaces. + //Si je suis un cell interface parent, qui a donc des enfants, mais que la cell de reference ne les connait pas encore, on les adde a ses cell interfaces. for (unsigned int cellInterfaceChild = 0; cellInterfaceChild < m_cellInterfacesChildren.size(); cellInterfaceChild++) { - bool ajoutChildAuxCellInterfacesCellRef(true); + bool addChildToCellInterfacesCellRef(true); for (int i = 0; i < cellRef->getCellInterfacesSize(); i++) { - if (cellRef->getCellInterface(i) == m_cellInterfacesChildren[cellInterfaceChild]) { ajoutChildAuxCellInterfacesCellRef = false; break; } + if (cellRef->getCellInterface(i) == m_cellInterfacesChildren[cellInterfaceChild]) { addChildToCellInterfacesCellRef = false; break; } } - if (ajoutChildAuxCellInterfacesCellRef) { cellRef->addCellInterface(m_cellInterfacesChildren[cellInterfaceChild]); } + if (addChildToCellInterfacesCellRef) { cellRef->addCellInterface(m_cellInterfacesChildren[cellInterfaceChild]); } } } } @@ -1062,7 +1211,7 @@ void CellInterface::deraffineCellInterfacesChildren() //*********************************************************************** -void CellInterface::constructionTableauCellInterfacesExternesLvl(std::vector* cellInterfacesLvl) +void CellInterface::constructionArrayExternalCellInterfacesLvl(std::vector* cellInterfacesLvl) { for (unsigned int i = 0; i < m_cellInterfacesChildren.size(); i++) { cellInterfacesLvl[m_lvl + 1].push_back(m_cellInterfacesChildren[i]); diff --git a/src/Order1/CellInterface.h b/src/Order1/CellInterface.h index 9b7406d5..bc485646 100644 --- a/src/Order1/CellInterface.h +++ b/src/Order1/CellInterface.h @@ -41,6 +41,9 @@ class CellInterface; //Predeclaration de la classe CellInterface pour pouvoir in #include "../Meshes/FaceCartesian.h" #include "../AdditionalPhysics/AddPhys.h" +class Source; //Predeclaration to include following file +#include "../Sources/Source.h" + enum BO2 { BG1M, BG2M, BG3M, BG1P, BG2P, BG3P, BD1M, BD2M, BD3M, BD1P, BD2P, BD3P }; enum betaO2 { betaG1M, betaG2M, betaG3M, betaG1P, betaG2P, betaG3P, betaD1M, betaD2M, betaD3M, betaD1P, betaD2P, betaD3P }; enum distanceHO2 { distanceHGM, distanceHGP, distanceHDM, distanceHDP }; @@ -58,18 +61,23 @@ class CellInterface virtual void computeFlux(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type = vecPhases); virtual void computeFluxAddPhys(AddPhys& addPhys); - virtual void solveRiemann(double& ondeMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim /*type*/ = vecPhases); + virtual void solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim /*type*/ = vecPhases); virtual void initialize(Cell* cellLeft, Cell* cellRight); void initializeGauche(Cell* cellLeft); virtual void initializeDroite(Cell* cellRight); virtual void addFlux(const double& coefAMR); void subtractFlux(const double& coefAMR); + void addFluxRotatingRegion(); + void substractFluxRotatingRegion(); double distance(Cell* c); virtual int whoAmI() const { return 0; }; virtual int whoAmIHeat() const { return ADIABATIC; }; //!< Returns heat boundary type for wall (see BoundCondWall.h) virtual bool isMRFWall() const { return false; } + virtual void checkMrfInterface(Source* sourceMRF); + void solveRiemannMRF(double& dtMax); + //Inutilise pour cell interfaces ordre 1 virtual void allocateSlopes(int& /*allocateSlopeLocal*/) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */ virtual void computeSlopes(Prim /*type*/ = vecPhases) {}; /*!< Ne fait rien pour des cell interfaces ordre 1 */ @@ -87,8 +95,8 @@ class CellInterface //Accesseurs Face *getFace(); /*!< Attention, getFace() non const */ Model* getMod() const; - Cell* getCellGauche() const; - Cell* getCellDroite() const; + Cell* getCellLeft() const; + Cell* getCellRight() const; virtual const int& getNumPhys() const { return Errors::defaultIntNeg; }; virtual double getBoundData(VarBoundary /*var*/) const { Errors::errorMessage("getBoundData not available for CellInterface"); return 0.; } virtual double getBoundaryHeatQuantity() const { return Errors::defaultDouble; }; //!< Returns imposed heat quantity on the wall, could be temperature or flux density (see BounCondWall.h) @@ -104,7 +112,7 @@ class CellInterface virtual void raffineCellInterfaceExterne(const int& nbCellsY, const int& nbCellsZ, const double& dXParent, const double& dYParent, const double& dZParent, Cell* cellRef, const int& dim); /*!< Raffinement du extern cell interface en creant si besoin des children cell interfaces + liaisons cells/cell interfaces */ virtual void deraffineCellInterfaceExterne(Cell* cellRef); /*!< Deraffinement du extern cell interface en supprimant si besoin ses children cell interfaces + liaisons cells/cell interfaces */ void deraffineCellInterfacesChildren(); /*!< Supprime les children cell interfaces */ - void constructionTableauCellInterfacesExternesLvl(std::vector* cellInterfacesLvl); /*!< Construction du nouveau tableau de cell interfaces du niveau (lvl + 1), cell interfaces externes ajoutes ici */ + void constructionArrayExternalCellInterfacesLvl(std::vector* cellInterfacesLvl); /*!< Construction of new array of cell interfaces of the level (lvl + 1), external cell interfaces added here */ bool getSplit() const; /*!< Renvoie si oui ou non le cell interface est splitte */ const int& getLvl() const { return m_lvl; }; /*!< Renvoie le niveau du cell interface */ int getNumberCellInterfacesChildren() const; /*!< Renvoie le number de children cell interfaces de ce cell interface*/ @@ -119,7 +127,12 @@ class CellInterface //Attributs pour methode AMR int m_lvl; /*!< Niveau dans l arbre AMR du cell interface */ - std::vector m_cellInterfacesChildren; /*!< Tableau de children cell interfaces (taille : 1 en 1D, 2 en 2D et 4 en 3D) */ + std::vector m_cellInterfacesChildren; /*!< Array of children cell interfaces (taille : 1 en 1D, 2 en 2D et 4 en 3D) */ + + //Atributes MRF + bool m_mrfInterface; + bool m_mrfStaticRegionIsLeft; + Coord m_omega; private: }; diff --git a/src/Order2/CellInterfaceO2.cpp b/src/Order2/CellInterfaceO2.cpp index 1c741ea5..51346536 100644 --- a/src/Order2/CellInterfaceO2.cpp +++ b/src/Order2/CellInterfaceO2.cpp @@ -39,60 +39,25 @@ double* slopesTransportLocal2; //*********************************************************************** -CellInterfaceO2::CellInterfaceO2() : CellInterface(), m_vecPhasesSlopes(0), m_mixtureSlopes(0), m_vecTransportsSlopes(0) - //m_BG1M(0), m_BG2M(0), m_BG3M(0), m_BG1P(0), m_BG2P(0), m_BG3P(0), m_BD1M(0), - //m_BD2M(0), m_BD3M(0), m_BD1P(0), m_BD2P(0), m_BD3P(0), - //m_betaG1M(1.), m_betaG2M(0.), m_betaG3M(0.), m_betaG1P(1.), m_betaG2P(0.), m_betaG3P(0.), - //m_betaD1M(1.), m_betaD2M(0.), m_betaD3M(0.), m_betaD1P(1.), m_betaD2P(0.), m_betaD3P(0.), - //m_distanceHGM(0.), m_distanceHGP(0.), m_distanceHDM(0.), m_distanceHDP(0.) - {} +CellInterfaceO2::CellInterfaceO2() : CellInterface() +{} //*********************************************************************** -CellInterfaceO2::CellInterfaceO2(int lvl) : CellInterface(lvl), m_vecPhasesSlopes(0), m_mixtureSlopes(0), m_vecTransportsSlopes(0) -//m_BG1M(0), m_BG2M(0), m_BG3M(0), m_BG1P(0), m_BG2P(0), m_BG3P(0), m_BD1M(0), -//m_BD2M(0), m_BD3M(0), m_BD1P(0), m_BD2P(0), m_BD3P(0), -//m_betaG1M(1.), m_betaG2M(0.), m_betaG3M(0.), m_betaG1P(1.), m_betaG2P(0.), m_betaG3P(0.), -//m_betaD1M(1.), m_betaD2M(0.), m_betaD3M(0.), m_betaD1P(1.), m_betaD2P(0.), m_betaD3P(0.), -//m_distanceHGM(0.), m_distanceHGP(0.), m_distanceHDM(0.), m_distanceHDP(0.) +CellInterfaceO2::CellInterfaceO2(int lvl) : CellInterface(lvl) {} //*********************************************************************** CellInterfaceO2::~CellInterfaceO2() { - for (int k = 0; k < numberPhases; k++) { - delete m_vecPhasesSlopes[k]; - } - delete[] m_vecPhasesSlopes; - delete m_mixtureSlopes; - delete[] m_vecTransportsSlopes; } //*********************************************************************** void CellInterfaceO2::allocateSlopes(int& allocateSlopeLocal) -{ - //Allocation des slopes des phases - m_vecPhasesSlopes = new Phase*[numberPhases]; - - //On attribut les phases a partir de la cell a gauche (car cell a droite inexistante pour les limites) - //Necessaire car il faut connaitre le type de phase (ex: PhasePUEq, etc.)) - //Ensuite on met a zero toutes les slopes - for(int k = 0; k < numberPhases; k++){ - m_cellLeft->getPhase(k)->allocateAndCopyPhase(&m_vecPhasesSlopes[k]); - m_vecPhasesSlopes[k]->setToZero(); - } - m_cellLeft->getMixture()->allocateAndCopyMixture(&m_mixtureSlopes); - m_mixtureSlopes->setToZero(); - - //Allocation des slopes sur transports - m_vecTransportsSlopes = new Transport[numberTransports]; - for (int k = 0; k < numberTransports; k++) { - m_vecTransportsSlopes[k].setValue(0.); - } - - //Allocation des variables externes +{ + // Allocate extern variables if (allocateSlopeLocal < 1) { slopesPhasesLocal1 = new Phase*[numberPhases]; slopesPhasesLocal2 = new Phase*[numberPhases]; @@ -121,63 +86,39 @@ void CellInterfaceO2::allocateSlopes(int& allocateSlopeLocal) //*********************************************************************** -void CellInterfaceO2::computeSlopes(Prim type) -{ - if (m_cellInterfacesChildren.size() == 0) { - //Distance entre les deux mailles en contact - double distance(m_cellLeft->distance(m_cellRight)); - //Attribution gauche/droite - //Si la cell gauche ou droite est de niveau inferieur a "lvl", on ne prend pas "type" mais vecPhases (ca evite de prendre vecPhaseO2 alors qu'on ne l'a pas). - Prim typeGauche = type; - Prim typeDroite = type; - if (m_cellLeft->getLvl() < m_lvl) { typeGauche = vecPhases; } - if (m_cellRight->getLvl() < m_lvl) { typeDroite = vecPhases; } - - for (int k = 0; k < numberPhases; k++) { - m_vecPhasesSlopes[k]->computeSlopesPhase(*m_cellLeft->getPhase(k, typeGauche), *m_cellRight->getPhase(k, typeDroite), distance); - } - m_mixtureSlopes->computeSlopesMixture(*m_cellLeft->getMixture(typeGauche), *m_cellRight->getMixture(typeDroite), distance); - for (int k = 0; k < numberTransports; k++) { - m_vecTransportsSlopes[k].computeSlopeTransport(m_cellLeft->getTransport(k, typeGauche).getValue(), m_cellRight->getTransport(k, typeDroite).getValue(), distance); - } - } -} - -//*********************************************************************** - void CellInterfaceO2::computeFlux(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type) { - // Quand on fait le premier computeFlux (donc avec vecPhases) on n'incremente pas m_cons pour les mailles de niveau different (inferieur) de "lvl". + // Quand on fait le premier computeFlux (donc avec vecPhases) on n'incremente pas m_cons pour les cells de niveau different (inferieur) de "lvl". // Sinon ca veut dire qu on l ajoute pour les 2 computeFlux sans le remettre a zero entre les deux, donc 2 fois plus de flux que ce que l on veut. this->solveRiemann(dtMax, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, type); switch (type) { case vecPhases: if (m_cellLeft->getLvl() == m_cellRight->getLvl()) { //CoefAMR = 1 pour les deux - this->addFlux(1.); //Ajout du flux sur maille droite - this->subtractFlux(1.); //Retrait du flux sur maille gauche + this->addFlux(1.); //Add of flux on right cell + this->subtractFlux(1.); //Subtract of flux on left cell } - else if (m_cellLeft->getLvl() > m_cellRight->getLvl()) { //CoefAMR = 1 pour la gauche et on n'ajoute rien sur la maille droite - this->subtractFlux(1.); //Retrait du flux sur maille gauche + else if (m_cellLeft->getLvl() > m_cellRight->getLvl()) { //CoefAMR = 1 pour la gauche et on n'ajoute rien sur la right cell + this->subtractFlux(1.); //Subtract of flux on left cell } - else { //CoefAMR = 1 pour la droite et on ne retire rien sur la maille gauche - this->addFlux(1.); //Ajout du flux sur maille droite + else { //CoefAMR = 1 pour la droite et on ne retire rien sur la left cell + this->addFlux(1.); //Add of flux on right cell } break; case vecPhasesO2: if (m_cellLeft->getLvl() == m_cellRight->getLvl()) { //CoefAMR = 1 pour les deux - this->addFlux(1.); //Ajout du flux sur maille droite - this->subtractFlux(1.); //Retrait du flux sur maille gauche + this->addFlux(1.); //Add of flux on right cell + this->subtractFlux(1.); //Subtract of flux on left cell } else if (m_cellLeft->getLvl() > m_cellRight->getLvl()) { //CoefAMR = 1 pour la gauche et 0.5 pour la droite - this->addFlux(0.5); //Ajout du flux sur maille droite - this->subtractFlux(1.); //Retrait du flux sur maille gauche + this->addFlux(0.5); //Add of flux on right cell + this->subtractFlux(1.); //Subtract of flux on left cell } else { //CoefAMR = 1 pour la droite et 0.5 pour la gauche - this->addFlux(1.); //Ajout du flux sur maille droite - this->subtractFlux(0.5); //Retrait du flux sur maille gauche + this->addFlux(1.); //Add of flux on right cell + this->subtractFlux(0.5); //Subtract of flux on left cell } break; @@ -185,239 +126,4 @@ void CellInterfaceO2::computeFlux(double& dtMax, Limiter& globalLimiter, Limiter } } -//*********************************************************************** - -void CellInterfaceO2::solveRiemann(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type) -{ - //Si la cell gauche ou droite est de niveau inferieur a "lvl", on ne prend pas "type" mais vecPhases (ca evite de prendre vecPhaseO2 alors qu'on ne l'a pas). - if (m_cellLeft->getLvl() == m_lvl) { bufferCellLeft->copyVec(m_cellLeft->getPhases(type), m_cellLeft->getMixture(type), m_cellLeft->getTransports(type)); } - else { bufferCellLeft->copyVec(m_cellLeft->getPhases(vecPhases), m_cellLeft->getMixture(vecPhases), m_cellLeft->getTransports(vecPhases)); } - - if (m_cellRight->getLvl() == m_lvl) { bufferCellRight->copyVec(m_cellRight->getPhases(type), m_cellRight->getMixture(type), m_cellRight->getTransports(type)); } - else { bufferCellRight->copyVec(m_cellRight->getPhases(vecPhases), m_cellRight->getMixture(vecPhases), m_cellRight->getTransports(vecPhases)); } - - //Calcul des distances cell interface <-> cells pour l extrapolation - double distanceGauche(this->distance(m_cellLeft)); - double distanceDroite(this->distance(m_cellRight)); - - //Initialization of variables to detect the interface for limiters and THINC method - int phase0(0), phase1(1); - double alphaCellLeft(0.), alphaCellLeftLeft(0.), alphaCellRight(0.), alphaCellRightRight(0.); - double beta(1.6), sign(0.), newAlpha(0.), A(0.), B(0.), C(0.), qmin(0.), qmax(0.), epsInterface(1.e-4); - alphaCellLeft = bufferCellLeft->getPhase(phase0)->getAlpha(); - alphaCellRight = bufferCellRight->getPhase(phase0)->getAlpha(); - - //Extrapolation gauche - m_cellLeft->computeLocalSlopes(*this, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, alphaCellLeftLeft, alphaCellLeft, alphaCellRight, epsInterface); - for (int k = 0; k < numberPhases; k++) { - bufferCellLeft->getPhase(k)->extrapolate(*slopesPhasesLocal1[k], distanceGauche); - bufferCellLeft->getPhase(k)->verifyAndCorrectPhase(); - bufferCellLeft->getPhase(k)->verifyAndCorrectDensityMax(); - } - bufferCellLeft->getMixture()->extrapolate(*slopesMixtureLocal1, distanceGauche); - for (int k = 0; k < numberTransports; k++) { - bufferCellLeft->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceGauche); - } - //THINC method (for alpha only) - if (globalVolumeFractionLimiter.AmITHINC() || interfaceVolumeFractionLimiter.AmITHINC()) { - if ((alphaCellLeft >= epsInterface) && (alphaCellLeft <= 1. - epsInterface) && ((alphaCellRight - alphaCellLeft)*(alphaCellLeft - alphaCellLeftLeft) >= 1.e-8)) { - if (alphaCellRight - alphaCellLeftLeft > 0.) { sign = 1.; } - else { sign = -1.; } - qmin = std::min(alphaCellRight, alphaCellLeftLeft); - qmax = std::max(alphaCellRight, alphaCellLeftLeft) - qmin; - C = (alphaCellLeft - qmin + 1.e-20) / (qmax + 1.e-20); - B = exp(sign*beta*(2.*C - 1.)); - A = (B / cosh(beta) - 1.) / tanh(beta); - newAlpha = qmin + 0.5*qmax*(1. + sign * (tanh(beta) + A) / (1. + A * tanh(beta))); - if (newAlpha < epsInterface) { newAlpha = epsInterface; } - if (newAlpha > 1. - epsInterface) { newAlpha = 1. - epsInterface; } - bufferCellLeft->getPhase(phase0)->setAlpha(newAlpha); - bufferCellLeft->getPhase(phase1)->setAlpha(1. - newAlpha); - } - } - - //Extrapolation droite - m_cellRight->computeLocalSlopes(*this, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, alphaCellRightRight, alphaCellRight, alphaCellLeft, epsInterface); - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->changeSign(); //On doit soustraire les slopes a droite - bufferCellRight->getPhase(k)->extrapolate(*slopesPhasesLocal1[k], distanceDroite); - bufferCellRight->getPhase(k)->verifyAndCorrectPhase(); - bufferCellRight->getPhase(k)->verifyAndCorrectDensityMax(); - } - slopesMixtureLocal1->changeSign(); - bufferCellRight->getMixture()->extrapolate(*slopesMixtureLocal1, distanceDroite); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = -slopesTransportLocal1[k]; - bufferCellRight->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceDroite); - } - //THINC method (for alpha only) - if (globalVolumeFractionLimiter.AmITHINC() || interfaceVolumeFractionLimiter.AmITHINC()) { - if ((alphaCellRight >= epsInterface) && (alphaCellRight <= 1. - epsInterface) && ((alphaCellRightRight - alphaCellRight)*(alphaCellRight - alphaCellLeft) >= 1.e-8)) { - if (alphaCellRightRight - alphaCellLeft > 0.) { sign = 1.; } - else { sign = -1.; } - qmin = std::min(alphaCellRightRight, alphaCellLeft); - qmax = std::max(alphaCellRightRight, alphaCellLeft) - qmin; - C = (alphaCellRight - qmin + 1.e-20) / (qmax + 1.e-20); - B = exp(sign*beta*(2.*C - 1.)); - A = (B / cosh(beta) - 1.) / tanh(beta); - newAlpha = qmin + 0.5*qmax*(1. + sign * A); - if (newAlpha < epsInterface) { newAlpha = epsInterface; } - if (newAlpha > 1. - epsInterface) { newAlpha = 1. - epsInterface; } - bufferCellRight->getPhase(phase0)->setAlpha(newAlpha); - bufferCellRight->getPhase(phase1)->setAlpha(1. - newAlpha); - } - } - - //Projection des velocities sur repere attache a la face - bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); - bufferCellRight->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); - - //Calcul des variables etendus (Phases, Mixture, AddPhys) - bufferCellLeft->fulfillState(); - bufferCellRight->fulfillState(); - - //Probleme de Riemann - double dxLeft(m_cellLeft->getElement()->getLCFL()); - double dxRight(m_cellRight->getElement()->getLCFL()); - dxLeft = dxLeft*std::pow(2., (double)m_lvl); - dxRight = dxRight*std::pow(2., (double)m_lvl); - model->solveRiemannIntern(*bufferCellLeft, *bufferCellRight, dxLeft, dxRight, dtMax); - //Handling of transport functions (m_Sm known: need to be called after Riemann solver) - if (numberTransports > 0) { model->solveRiemannTransportIntern(*bufferCellLeft, *bufferCellRight); } - - //Projection du flux sur le repere absolu - model->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); -} - -//*********************************************************************** - -Phase* CellInterfaceO2::getSlopesPhase(const int& phaseNumber) const -{ - return m_vecPhasesSlopes[phaseNumber]; -} - -//*********************************************************************** - -Mixture* CellInterfaceO2::getSlopesMixture() const -{ - return m_mixtureSlopes; -} - -//*********************************************************************** - -Transport* CellInterfaceO2::getSlopesTransport(const int& numberTransport) const -{ - return &m_vecTransportsSlopes[numberTransport]; -} - -//*********************************************************************** - -//Cell* CellInterfaceO2::getB(BO2 B) const -//{ -// switch (B){ -// case BG1M: return m_BG1M; break; -// case BG2M: return m_BG2M; break; -// case BG1P: return m_BG1P; break; -// case BG2P: return m_BG2P; break; -// case BD1M: return m_BD1M; break; -// case BD2M: return m_BD2M; break; -// case BD1P: return m_BD1P; break; -// case BD2P: return m_BD2P; break; -// default: Errors::errorMessage("probleme enum non connu dans BorDeMailleO2::getB"); return 0; break; -// } -//} - -//*********************************************************************** - -//double CellInterfaceO2::getBeta(betaO2 beta) const -//{ -// switch (beta) { -// case betaG1M: return m_betaG1M; break; -// case betaG2M: return m_betaG2M; break; -// case betaG1P: return m_betaG1P; break; -// case betaG2P: return m_betaG2P; break; -// case betaD1M: return m_betaD1M; break; -// case betaD2M: return m_betaD2M; break; -// case betaD1P: return m_betaD1P; break; -// case betaD2P: return m_betaD2P; break; -// default: Errors::errorMessage("probleme enum non connu dans BorDeMailleO2::getBeta"); return 0; break; -// } -//} - -//*********************************************************************** - -//double CellInterfaceO2::getDistanceH(distanceHO2 dist) const -//{ -// switch (dist) { -// case distanceHGM: return m_distanceHGM; break; -// case distanceHGP: return m_distanceHGP; break; -// case distanceHDM: return m_distanceHDM; break; -// case distanceHDP: return m_distanceHDP; break; -// default: Errors::errorMessage("probleme enum non connu dans BorDeMailleO2::getDistanceH"); return 0; break; -// } -//} - -//*********************************************************************** - -//void CellInterfaceO2::setB(BO2 B, Cell* cell) -//{ -// switch (B) { -// case BG1M: m_BG1M = cell; break; -// case BG2M: m_BG2M = cell; break; -// case BG1P: m_BG1P = cell; break; -// case BG2P: m_BG2P = cell; break; -// case BD1M: m_BD1M = cell; break; -// case BD2M: m_BD2M = cell; break; -// case BD1P: m_BD1P = cell; break; -// case BD2P: m_BD2P = cell; break; -// default: Errors::errorMessage("probleme enum non connu dans BorDeMailleO2::setB"); break; -// } -//} - -//*********************************************************************** - -//void CellInterfaceO2::setBeta(betaO2 beta, double& value) -//{ -// switch (beta) { -// case betaG1M: m_betaG1M = value; break; -// case betaG2M: m_betaG2M = value; break; -// case betaG1P: m_betaG1P = value; break; -// case betaG2P: m_betaG2P = value; break; -// case betaD1M: m_betaD1M = value; break; -// case betaD2M: m_betaD2M = value; break; -// case betaD1P: m_betaD1P = value; break; -// case betaD2P: m_betaD2P = value; break; -// default: Errors::errorMessage("probleme enum non connu dans BorDeMailleO2::setB"); break; -// } -//} - -//*********************************************************************** - -//void CellInterfaceO2::setDistanceH(distanceHO2 dist, double& value) -//{ -// switch (dist) { -// case distanceHGM: m_distanceHGM = value; break; -// case distanceHGP: m_distanceHGP = value; break; -// case distanceHDM: m_distanceHDM = value; break; -// case distanceHDP: m_distanceHDP = value; break; -// default: Errors::errorMessage("probleme enum non connu dans BorDeMailleO2::setDistanceH"); break; -// } -//} - -//**************************************************************************** -//******************************AMR Method*********************************** -//**************************************************************************** - -void CellInterfaceO2::creerCellInterfaceChild() -{ - m_cellInterfacesChildren.push_back(new CellInterfaceO2(m_lvl + 1)); -} - -//*********************************************************************** - -void CellInterfaceO2::creerCellInterfaceChildInterne(const int& lvl, std::vector* childrenInternalCellInterfaces) -{ - (*childrenInternalCellInterfaces).push_back(new CellInterfaceO2(lvl + 1)); -} - //*********************************************************************** \ No newline at end of file diff --git a/src/Order2/CellInterfaceO2.h b/src/Order2/CellInterfaceO2.h index e5b4e9e8..9065177e 100644 --- a/src/Order2/CellInterfaceO2.h +++ b/src/Order2/CellInterfaceO2.h @@ -33,77 +33,29 @@ #include "../Order1/CellInterface.h" -//class CellInterfaceO2; //Predeclaration de la classe CellInterfaceO2 pour pouvoir inclure CellO2.h -// -//#include "CellO2.h" - class CellInterfaceO2 : public CellInterface { public: - /** Default constructor */ CellInterfaceO2(); CellInterfaceO2(int lvl); //Pour AMR - /** Default destructor */ virtual ~CellInterfaceO2(); virtual void allocateSlopes(int& allocateSlopeLocal); - virtual void computeSlopes(Prim type = vecPhases); virtual void computeFlux(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type = vecPhases); - void solveRiemann(double& ondeMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type = vecPhases); /*!< probleme de Riemann special ordre 2 */ - - //Accesseurs - virtual Phase* getSlopesPhase(const int& phaseNumber) const; - virtual Mixture* getSlopesMixture() const; - virtual Transport* getSlopesTransport(const int& numberTransport) const; - //virtual Cell* getB(BO2 B) const; - //virtual double getBeta(betaO2 beta) const; - //virtual double getDistanceH(distanceHO2 dist) const; - //virtual void setB(BO2 B, Cell* cell); - //void setBeta(betaO2 beta, double& value); - //virtual void setDistanceH(distanceHO2 dist, double& value); - - //Pour methode AMR - virtual void creerCellInterfaceChild(); /*!< Creer un child cell interface (non initialize) */ - virtual void creerCellInterfaceChildInterne(const int& lvl, std::vector* childrenInternalCellInterfaces); /*!< Creer un intern child cell interface (non initialize) */ - - protected: - Phase** m_vecPhasesSlopes; /*!< vecteur des slopes des phases */ - Mixture* m_mixtureSlopes; /*!< vecteur des slopes de mixture */ - Transport* m_vecTransportsSlopes; /*!< vecteur des slopes des transports */ - - //Stockage methode multislopes - //Cell* m_BG1M; /*!< pointeurs vers cells Arrieres a gauche pour secondOrder */ - //Cell* m_BG2M; - //Cell* m_BG3M; - //Cell* m_BG1P; /*!< pointeurs vers cells Avants a gauche pour secondOrder */ - //Cell* m_BG2P; - //Cell* m_BG3P; - //Cell* m_BD1M; /*!< pointeurs vers cells Arrieres a droite pour secondOrder */ - //Cell* m_BD2M; - //Cell* m_BD3M; - //Cell* m_BD1P; /*!< pointeurs vers cells Avants a droite pour secondOrder */ - //Cell* m_BD2P; - //Cell* m_BD3P; + /*!< Specific Riemann problem for 2nd order */ + virtual void solveRiemann(double& /*dtMax*/, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim /*type*/ = vecPhases) = 0; - //double m_betaG1M; /*!< ponderations pour secondOrder */ - //double m_betaG2M; - //double m_betaG3M; - //double m_betaG1P; - //double m_betaG2P; - //double m_betaG3P; - //double m_betaD1M; - //double m_betaD2M; - //double m_betaD3M; - //double m_betaD1P; - //double m_betaD2P; - //double m_betaD3P; + // -- Cartesian -- + virtual void computeSlopes(Prim /*type*/ = vecPhases) {}; - //double m_distanceHGM; /*!< distances au vertex geometrique pour le compute des slopes */ - //double m_distanceHGP; - //double m_distanceHDM; - //double m_distanceHDP; + //Accessors + virtual Phase* getSlopesPhase(const int& /*phaseNumber*/) const { return nullptr; }; + virtual Mixture* getSlopesMixture() const { return nullptr; }; + virtual Transport* getSlopesTransport(const int& /*numberTransport*/) const { return nullptr; }; - private: + //For AMR method + virtual void creerCellInterfaceChild() {}; /*!< Creer un child cell interface (non initialize) */ + virtual void creerCellInterfaceChildInterne(const int& /*lvl*/, std::vector* /*childrenInternalCellInterfaces*/) {}; /*!< Creer un intern child cell interface (non initialize) */ }; extern Phase** slopesPhasesLocal1; diff --git a/src/Order2/CellInterfaceO2Cartesian.cpp b/src/Order2/CellInterfaceO2Cartesian.cpp new file mode 100644 index 00000000..41a7a4e5 --- /dev/null +++ b/src/Order2/CellInterfaceO2Cartesian.cpp @@ -0,0 +1,240 @@ +#include "CellInterfaceO2Cartesian.h" + +//*********************************************************************** + +CellInterfaceO2Cartesian::CellInterfaceO2Cartesian() : CellInterfaceO2(), m_vecPhasesSlopes(0), m_mixtureSlopes(0), m_vecTransportsSlopes(0) +{} + +//*********************************************************************** + +CellInterfaceO2Cartesian::CellInterfaceO2Cartesian(int lvl) : CellInterfaceO2(lvl), m_vecPhasesSlopes(0), m_mixtureSlopes(0), m_vecTransportsSlopes(0) +{} + +//*********************************************************************** + +CellInterfaceO2Cartesian::~CellInterfaceO2Cartesian() +{ + for (int k = 0; k < numberPhases; k++) { + delete m_vecPhasesSlopes[k]; + } + delete[] m_vecPhasesSlopes; + delete m_mixtureSlopes; + delete[] m_vecTransportsSlopes; +} + +//*********************************************************************** + +void CellInterfaceO2Cartesian::allocateSlopes(int& allocateSlopeLocal) +{ + //Allocation des slopes des phases + m_vecPhasesSlopes = new Phase*[numberPhases]; + + //On attribut les phases a partir de la cell a gauche (car cell a droite inexistante pour les limites) + //Necessaire car il faut connaitre le type de phase (ex: PhasePUEq, etc.)) + //Ensuite on met a zero toutes les slopes + for(int k = 0; k < numberPhases; k++){ + m_cellLeft->getPhase(k)->allocateAndCopyPhase(&m_vecPhasesSlopes[k]); + m_vecPhasesSlopes[k]->setToZero(); + } + m_cellLeft->getMixture()->allocateAndCopyMixture(&m_mixtureSlopes); + m_mixtureSlopes->setToZero(); + + //Allocation des slopes sur transports + m_vecTransportsSlopes = new Transport[numberTransports]; + for (int k = 0; k < numberTransports; k++) { + m_vecTransportsSlopes[k].setValue(0.); + } + + //Allocation des variables externes + if (allocateSlopeLocal < 1) { + slopesPhasesLocal1 = new Phase*[numberPhases]; + slopesPhasesLocal2 = new Phase*[numberPhases]; + for (int k = 0; k < numberPhases; k++) { + m_cellLeft->getPhase(k)->allocateAndCopyPhase(&slopesPhasesLocal1[k]); + m_cellLeft->getPhase(k)->allocateAndCopyPhase(&slopesPhasesLocal2[k]); + slopesPhasesLocal1[k]->setToZero(); + slopesPhasesLocal2[k]->setToZero(); + } + + m_cellLeft->getMixture()->allocateAndCopyMixture(&slopesMixtureLocal1); + m_cellLeft->getMixture()->allocateAndCopyMixture(&slopesMixtureLocal2); + slopesMixtureLocal1->setToZero(); + slopesMixtureLocal2->setToZero(); + + slopesTransportLocal1 = new double[numberTransports]; + slopesTransportLocal2 = new double[numberTransports]; + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = 0.; + slopesTransportLocal2[k] = 0.; + } + + allocateSlopeLocal = 1; + } +} + +//*********************************************************************** + +void CellInterfaceO2Cartesian::computeSlopes(Prim type) +{ + if (m_cellInterfacesChildren.size() == 0) { + //Distance between the two cells in contact + double distance(m_cellLeft->distance(m_cellRight)); + //Attribution gauche/droite + //Si la cell gauche ou droite est de niveau inferieur a "lvl", on ne prend pas "type" mais vecPhases (ca evite de prendre vecPhaseO2 alors qu'on ne l'a pas). + Prim typeGauche = type; + Prim typeDroite = type; + if (m_cellLeft->getLvl() < m_lvl) { typeGauche = vecPhases; } + if (m_cellRight->getLvl() < m_lvl) { typeDroite = vecPhases; } + + for (int k = 0; k < numberPhases; k++) { + m_vecPhasesSlopes[k]->computeSlopesPhase(*m_cellLeft->getPhase(k, typeGauche), *m_cellRight->getPhase(k, typeDroite), distance); + } + m_mixtureSlopes->computeSlopesMixture(*m_cellLeft->getMixture(typeGauche), *m_cellRight->getMixture(typeDroite), distance); + for (int k = 0; k < numberTransports; k++) { + m_vecTransportsSlopes[k].computeSlopeTransport(m_cellLeft->getTransport(k, typeGauche).getValue(), m_cellRight->getTransport(k, typeDroite).getValue(), distance); + } + } +} + +//*********************************************************************** + +void CellInterfaceO2Cartesian::solveRiemann(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type) +{ + //Si la cell gauche ou droite est de niveau inferieur a "lvl", on ne prend pas "type" mais vecPhases (ca evite de prendre vecPhaseO2 alors qu'on ne l'a pas). + if (m_cellLeft->getLvl() == m_lvl) { bufferCellLeft->copyVec(m_cellLeft->getPhases(type), m_cellLeft->getMixture(type), m_cellLeft->getTransports(type)); } + else { bufferCellLeft->copyVec(m_cellLeft->getPhases(vecPhases), m_cellLeft->getMixture(vecPhases), m_cellLeft->getTransports(vecPhases)); } + + if (m_cellRight->getLvl() == m_lvl) { bufferCellRight->copyVec(m_cellRight->getPhases(type), m_cellRight->getMixture(type), m_cellRight->getTransports(type)); } + else { bufferCellRight->copyVec(m_cellRight->getPhases(vecPhases), m_cellRight->getMixture(vecPhases), m_cellRight->getTransports(vecPhases)); } + + //Calcul des distances cell interface <-> cells pour l extrapolation + double distanceGauche(this->distance(m_cellLeft)); + double distanceDroite(this->distance(m_cellRight)); + + //Initialization of variables to detect the interface for limiters and THINC method + int phase0(0), phase1(1); + double alphaCellLeft(0.), alphaCellLeftLeft(0.), alphaCellRight(0.), alphaCellRightRight(0.); + double beta(1.6), sign(0.), newAlpha(0.), A(0.), B(0.), C(0.), qmin(0.), qmax(0.), epsInterface(1.e-4); + alphaCellLeft = bufferCellLeft->getPhase(phase0)->getAlpha(); + alphaCellRight = bufferCellRight->getPhase(phase0)->getAlpha(); + + //Extrapolation gauche + m_cellLeft->computeLocalSlopes(*this, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, alphaCellLeftLeft, alphaCellLeft, alphaCellRight, epsInterface); + for (int k = 0; k < numberPhases; k++) { + bufferCellLeft->getPhase(k)->extrapolate(*slopesPhasesLocal1[k], distanceGauche); + bufferCellLeft->getPhase(k)->verifyAndCorrectPhase(); + bufferCellLeft->getPhase(k)->verifyAndCorrectDensityMax(); + } + bufferCellLeft->getMixture()->extrapolate(*slopesMixtureLocal1, distanceGauche); + for (int k = 0; k < numberTransports; k++) { + bufferCellLeft->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceGauche); + } + //THINC method (for alpha only) + if (globalVolumeFractionLimiter.AmITHINC() || interfaceVolumeFractionLimiter.AmITHINC()) { + if ((alphaCellLeft >= epsInterface) && (alphaCellLeft <= 1. - epsInterface) && ((alphaCellRight - alphaCellLeft)*(alphaCellLeft - alphaCellLeftLeft) >= 1.e-8)) { + if (alphaCellRight - alphaCellLeftLeft > 0.) { sign = 1.; } + else { sign = -1.; } + qmin = std::min(alphaCellRight, alphaCellLeftLeft); + qmax = std::max(alphaCellRight, alphaCellLeftLeft) - qmin; + C = (alphaCellLeft - qmin + 1.e-20) / (qmax + 1.e-20); + B = exp(sign*beta*(2.*C - 1.)); + A = (B / cosh(beta) - 1.) / tanh(beta); + newAlpha = qmin + 0.5*qmax*(1. + sign * (tanh(beta) + A) / (1. + A * tanh(beta))); + if (newAlpha < epsInterface) { newAlpha = epsInterface; } + if (newAlpha > 1. - epsInterface) { newAlpha = 1. - epsInterface; } + bufferCellLeft->getPhase(phase0)->setAlpha(newAlpha); + bufferCellLeft->getPhase(phase1)->setAlpha(1. - newAlpha); + } + } + + //Extrapolation droite + m_cellRight->computeLocalSlopes(*this, globalLimiter, interfaceLimiter, globalVolumeFractionLimiter, interfaceVolumeFractionLimiter, alphaCellRightRight, alphaCellRight, alphaCellLeft, epsInterface); + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->changeSign(); //On doit soustraire les slopes a droite + bufferCellRight->getPhase(k)->extrapolate(*slopesPhasesLocal1[k], distanceDroite); + bufferCellRight->getPhase(k)->verifyAndCorrectPhase(); + bufferCellRight->getPhase(k)->verifyAndCorrectDensityMax(); + } + slopesMixtureLocal1->changeSign(); + bufferCellRight->getMixture()->extrapolate(*slopesMixtureLocal1, distanceDroite); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = -slopesTransportLocal1[k]; + bufferCellRight->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceDroite); + } + //THINC method (for alpha only) + if (globalVolumeFractionLimiter.AmITHINC() || interfaceVolumeFractionLimiter.AmITHINC()) { + if ((alphaCellRight >= epsInterface) && (alphaCellRight <= 1. - epsInterface) && ((alphaCellRightRight - alphaCellRight)*(alphaCellRight - alphaCellLeft) >= 1.e-8)) { + if (alphaCellRightRight - alphaCellLeft > 0.) { sign = 1.; } + else { sign = -1.; } + qmin = std::min(alphaCellRightRight, alphaCellLeft); + qmax = std::max(alphaCellRightRight, alphaCellLeft) - qmin; + C = (alphaCellRight - qmin + 1.e-20) / (qmax + 1.e-20); + B = exp(sign*beta*(2.*C - 1.)); + A = (B / cosh(beta) - 1.) / tanh(beta); + newAlpha = qmin + 0.5*qmax*(1. + sign * A); + if (newAlpha < epsInterface) { newAlpha = epsInterface; } + if (newAlpha > 1. - epsInterface) { newAlpha = 1. - epsInterface; } + bufferCellRight->getPhase(phase0)->setAlpha(newAlpha); + bufferCellRight->getPhase(phase1)->setAlpha(1. - newAlpha); + } + } + + //Computation of extended variables (Phases, Mixture, AddPhys) + bufferCellLeft->fulfillState(); + bufferCellRight->fulfillState(); + + //Vector and tensor projections on geometric reference frame of the face + bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + bufferCellRight->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + + //Probleme de Riemann + double dxLeft(m_cellLeft->getElement()->getLCFL()); + double dxRight(m_cellRight->getElement()->getLCFL()); + dxLeft = dxLeft*std::pow(2., (double)m_lvl); + dxRight = dxRight*std::pow(2., (double)m_lvl); + model->solveRiemannIntern(*bufferCellLeft, *bufferCellRight, dxLeft, dxRight, dtMax); + //Handling of transport functions (m_Sm known: need to be called after Riemann solver) + if (numberTransports > 0) { model->solveRiemannTransportIntern(*bufferCellLeft, *bufferCellRight); } + + //Projection du flux sur le repere absolu + model->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); +} + +//*********************************************************************** + +Phase* CellInterfaceO2Cartesian::getSlopesPhase(const int& phaseNumber) const +{ + return m_vecPhasesSlopes[phaseNumber]; +} + +//*********************************************************************** + +Mixture* CellInterfaceO2Cartesian::getSlopesMixture() const +{ + return m_mixtureSlopes; +} + +//*********************************************************************** + +Transport* CellInterfaceO2Cartesian::getSlopesTransport(const int& numberTransport) const +{ + return &m_vecTransportsSlopes[numberTransport]; +} + +//**************************************************************************** +//******************************AMR Method*********************************** +//**************************************************************************** + +void CellInterfaceO2Cartesian::creerCellInterfaceChild() +{ + m_cellInterfacesChildren.push_back(new CellInterfaceO2Cartesian(m_lvl + 1)); +} + +//*********************************************************************** + +void CellInterfaceO2Cartesian::creerCellInterfaceChildInterne(const int& lvl, std::vector* childrenInternalCellInterfaces) +{ + (*childrenInternalCellInterfaces).push_back(new CellInterfaceO2Cartesian(lvl + 1)); +} + +//*********************************************************************** \ No newline at end of file diff --git a/src/Order2/CellInterfaceO2Cartesian.h b/src/Order2/CellInterfaceO2Cartesian.h new file mode 100644 index 00000000..a4116074 --- /dev/null +++ b/src/Order2/CellInterfaceO2Cartesian.h @@ -0,0 +1,63 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef CELLINTERFACEO2CARTESIAN_H +#define CELLINTERFACEO2CARTESIAN_H + +#include "CellInterfaceO2.h" + +class CellInterfaceO2Cartesian : public CellInterfaceO2 +{ +public: + CellInterfaceO2Cartesian(); + CellInterfaceO2Cartesian(int lvl); + virtual ~CellInterfaceO2Cartesian(); + + virtual void allocateSlopes(int& allocateSlopeLocal); + virtual void computeSlopes(Prim type = vecPhases); + /*!< Specific Riemann problem for 2nd order */ + virtual void solveRiemann(double& dtMax, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, Prim type = vecPhases); + + //Accessors + virtual Phase* getSlopesPhase(const int& phaseNumber) const; + virtual Mixture* getSlopesMixture() const; + virtual Transport* getSlopesTransport(const int& numberTransport) const; + + //For AMR method + virtual void creerCellInterfaceChild(); /*!< Creer un child cell interface (non initialize) */ + virtual void creerCellInterfaceChildInterne(const int& lvl, std::vector* childrenInternalCellInterfaces); /*!< Creer un intern child cell interface (non initialize) */ + +protected: + Phase** m_vecPhasesSlopes; /*!< Model based array of phase slopes */ + Mixture* m_mixtureSlopes; /*!< Model based mixture slopes */ + Transport* m_vecTransportsSlopes; /*!< Model based transport slopes */ +}; + +#endif \ No newline at end of file diff --git a/src/Order2/CellInterfaceO2NS.cpp b/src/Order2/CellInterfaceO2NS.cpp new file mode 100644 index 00000000..fba5f860 --- /dev/null +++ b/src/Order2/CellInterfaceO2NS.cpp @@ -0,0 +1,73 @@ +#include "CellInterfaceO2NS.h" + +//*********************************************************************** + +CellInterfaceO2NS::CellInterfaceO2NS() +{ +} + +//*********************************************************************** + +CellInterfaceO2NS::~CellInterfaceO2NS() +{ +} + +//*********************************************************************** + +void CellInterfaceO2NS::solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim type) +{ + // Initialize buffer cells used in Riemann problem + bufferCellLeft->copyVec(m_cellLeft->getPhases(type), m_cellLeft->getMixture(type), m_cellLeft->getTransports(type)); + bufferCellRight->copyVec(m_cellRight->getPhases(type), m_cellRight->getMixture(type), m_cellRight->getTransports(type)); + + // For NS extrapolation a scalar product between the distance + // Coord rij and the gradient is already done during CellO2NS::computeLocalSlopes + // and stored in slopesPhase/MixtureLocal1 + // Therefore, to stay compliant with cartesian 2nd order, distance is equal to 1 here + double distanceLeft = 1.0; + double distanceRight = 1.0; + + // Left side of interface extrapolation + m_cellLeft->computeLocalSlopes(*this); // Build slopesPhasesLocal1 = theta_i * rij . grad(Wi) + for (int k = 0; k < numberPhases; k++) { + bufferCellLeft->getPhase(k)->extrapolate(*slopesPhasesLocal1[k], distanceLeft); // Build Wij_lim = Wi + theta_i * rij . grad(Wi) + bufferCellLeft->getPhase(k)->verifyAndCorrectPhase(); + bufferCellLeft->getPhase(k)->verifyAndCorrectDensityMax(); + } + bufferCellLeft->getMixture()->extrapolate(*slopesMixtureLocal1, distanceLeft); + for (int k = 0; k < numberTransports; k++) { + bufferCellLeft->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceLeft); + } + + // Right side of interface extrapolation + m_cellRight->computeLocalSlopes(*this); + for (int k = 0; k < numberPhases; k++) { + bufferCellRight->getPhase(k)->extrapolate(*slopesPhasesLocal1[k], distanceRight); + bufferCellRight->getPhase(k)->verifyAndCorrectPhase(); + bufferCellRight->getPhase(k)->verifyAndCorrectDensityMax(); + } + bufferCellRight->getMixture()->extrapolate(*slopesMixtureLocal1, distanceRight); + for (int k = 0; k < numberTransports; k++) { + bufferCellRight->getTransport(k).extrapolate(slopesTransportLocal1[k], distanceRight); + } + + // Compute extended variables since projection change some of them (Phases, Mixture, AddPhys) + bufferCellLeft->fulfillState(); + bufferCellRight->fulfillState(); + + // Vector and tensor projections into reference frame attached to the face + bufferCellLeft->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + bufferCellRight->localProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); + + // Riemann problem + double dxLeft(m_cellLeft->getElement()->getLCFL()); + double dxRight(m_cellRight->getElement()->getLCFL()); + model->solveRiemannIntern(*bufferCellLeft, *bufferCellRight, dxLeft, dxRight, dtMax); + // Handling of transport functions (m_Sm known: need to be called after Riemann solver) + if (numberTransports > 0) { model->solveRiemannTransportIntern(*bufferCellLeft, *bufferCellRight); } + + // Flux projection into the global reference frame + model->reverseProjection(m_face->getNormal(), m_face->getTangent(), m_face->getBinormal()); +} + +//*********************************************************************** \ No newline at end of file diff --git a/src/Order2/CellInterfaceO2NS.h b/src/Order2/CellInterfaceO2NS.h new file mode 100644 index 00000000..718c116b --- /dev/null +++ b/src/Order2/CellInterfaceO2NS.h @@ -0,0 +1,45 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef CELLINTERFACEO2NS_H +#define CELLINTERFACEO2NS_H + +#include "CellInterfaceO2.h" + +class CellInterfaceO2NS : public CellInterfaceO2 +{ +public: + CellInterfaceO2NS(); + virtual ~CellInterfaceO2NS(); + + virtual void solveRiemann(double& dtMax, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, Prim type = vecPhases); /*!< probleme de Riemann special ordre 2 */ +}; + +#endif \ No newline at end of file diff --git a/src/Order2/CellO2.cpp b/src/Order2/CellO2.cpp index 0fbf1dc4..39200fec 100644 --- a/src/Order2/CellO2.cpp +++ b/src/Order2/CellO2.cpp @@ -59,7 +59,11 @@ void CellO2::allocate(const std::vector& addPhys) { m_vecPhases = new Phase*[numberPhases]; m_vecPhasesO2 = new Phase*[numberPhases]; - for (int k = 0; k < numberPhases; k++){ + for (int k = 0; k < numberSolids; k++) { + model->allocatePhaseSolid(&m_vecPhases[k]); + model->allocatePhaseSolid(&m_vecPhasesO2[k]); + } + for (int k = numberSolids; k < numberPhases; k++) { model->allocatePhase(&m_vecPhases[k]); model->allocatePhase(&m_vecPhasesO2[k]); } @@ -88,265 +92,6 @@ void CellO2::copyPhase(const int& phaseNumber, Phase* phase) //*********************************************************************** -void CellO2::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, - Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, - double& alphaCellAfterOppositeSide, double& alphaCell, double& alphaCellOtherInterfaceSide, double& epsInterface) -{ - //Mise a zero des slopes locales - //------------------------------ - double coeff(0.), posCellInterfaceRef(0.); - double sommeCoeff(0.), sommeCoeff2(0.); - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->setToZero(); - slopesPhasesLocal2[k]->setToZero(); - } - slopesMixtureLocal1->setToZero(); - slopesMixtureLocal2->setToZero(); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = 0.; - slopesTransportLocal2[k] = 0.; - } - - //Boucle sur les cell interfaces pour la determination des slopes de chaque cote de la cell - //----------------------------------------------------------------------------------------- - int phase0(0); - for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { - //Calcul de la slope a gauche et a droite de la cell (AMR) en se basant sur celle de reference (cell interface a gauche ou a droite, inconnu) - if (m_cellInterfaces[b]->getSlopesPhase(0) != 0) { //Cell interface de type CellInterfaceO2 ou BoundCondWallO2 - if (m_cellInterfaces[b] == &cellInterfaceRef) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), 1.); } - slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), 1.); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += m_cellInterfaces[b]->getSlopesTransport(k)->getValue(); } - sommeCoeff += 1.; - } - else { - if (!m_cellInterfaces[b]->getSplit()) { - //Produit scalar des normals avec celle de reference - coeff = std::fabs(m_cellInterfaces[b]->getFace()->getNormal().scalar(cellInterfaceRef.getFace()->getNormal())); - if (coeff > 1.e-6) { - //Face majoritement selon X - if (std::fabs(cellInterfaceRef.getFace()->getNormal().getX()) > 0.5) { - posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getX(); - //Cote cellInterfaceRef - if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getX()) <= std::fabs(posCellInterfaceRef - m_element->getPosition().getX())) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff += coeff; - } - //Autre cote - else { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff2 += coeff; - if (m_cellInterfaces[b]->getCellGauche() == this) { - if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellDroite()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - } - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - } - } - //Face majoritement selon Y - else if (std::fabs(cellInterfaceRef.getFace()->getNormal().getY()) > 0.5) { - posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getY(); - //Cote cellInterfaceRef - if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getY()) <= std::fabs(posCellInterfaceRef - m_element->getPosition().getY())) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff += coeff; - } - //Autre cote - else { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff2 += coeff; - if (m_cellInterfaces[b]->getCellGauche() == this) { - if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellDroite()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - } - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - } - } - //Face majoritement selon Z - else { - posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getZ(); - //Cote cellInterfaceRef - if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getZ()) <= std::fabs(posCellInterfaceRef - m_element->getPosition().getZ())) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff += coeff; - } - //Autre cote - else { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff2 += coeff; - if (m_cellInterfaces[b]->getCellGauche() == this) { - if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellDroite()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - } - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - } - } - } - } - } - } - } //fin boucle sur les cell interfaces - - //Normalisation des slopes - //------------------------ - if (sommeCoeff > 1.e-8) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->divide(sommeCoeff); } - slopesMixtureLocal1->divide(sommeCoeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] /= sommeCoeff; } - } - if (sommeCoeff2 > 1.e-8) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->divide(sommeCoeff2); } - slopesMixtureLocal2->divide(sommeCoeff2); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] /= sommeCoeff2; } - alphaCellAfterOppositeSide /= sommeCoeff2; - } - - //Limitations des slopes - //---------------------- - //Detection of the interface location - if ((alphaCell >= epsInterface) && (alphaCell <= 1. - epsInterface) && ((alphaCellOtherInterfaceSide - alphaCell)*(alphaCell - alphaCellAfterOppositeSide) >= 1.e-8)) { - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], interfaceLimiter, interfaceVolumeFractionLimiter); - } - slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, interfaceLimiter); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = interfaceVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); - } - } - else { - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], globalLimiter, globalVolumeFractionLimiter); - } - slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, globalLimiter); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = globalVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); - } - } -} - -//*********************************************************************** - -void CellO2::computeLocalSlopesLimite(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, - Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, double& epsInterface) -{ - //Solution pour multiD Cartesian (peut etre une ebauche pour le NS, a voir...) - - //Mise a zero des slopes locales - //------------------------------ - double coeff(0.), posCellInterfaceRef(0.); - double sommeCoeff2(0.); - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->setToZero(); - slopesPhasesLocal2[k]->setToZero(); - } - slopesMixtureLocal1->setToZero(); - slopesMixtureLocal2->setToZero(); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = 0.; - slopesTransportLocal2[k] = 0.; - } - - //Recupere la slope cote CL - //------------------------- - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*cellInterfaceRef.getSlopesPhase(k), 1.); } - slopesMixtureLocal1->multiplyAndAdd(*cellInterfaceRef.getSlopesMixture(), 1.); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += cellInterfaceRef.getSlopesTransport(k)->getValue(); } - - //Boucle sur les cell interfaces pour la determination de la slope cote oppose a la CL - //------------------------------------------------------------------------------------ - for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { - //Calcul de la slope a gauche et a droite de la cell (AMR) en se basant sur celle de reference (cell interface a gauche ou a droite, inconnu) - if (m_cellInterfaces[b]->getSlopesPhase(0) != 0) { //Cell interface de type CellInterface/O2 - if (m_cellInterfaces[b] != &cellInterfaceRef) { - if (!m_cellInterfaces[b]->getSplit()) { - //Produit scalar des normals avec celle de reference - coeff = std::fabs(m_cellInterfaces[b]->getFace()->getNormal().scalar(cellInterfaceRef.getFace()->getNormal())); - if (coeff > 1.e-6) { - //Face majoritement selon X - if (std::fabs(cellInterfaceRef.getFace()->getNormal().getX()) > 0.5) { - posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getX(); - //Autre cote - if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getX()) >= std::fabs(posCellInterfaceRef - m_element->getPosition().getX())) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff2 += coeff; - } - } - //Face majoritement selon Y - else if (std::fabs(cellInterfaceRef.getFace()->getNormal().getY()) > 0.5) { - posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getY(); - //Autre cote - if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getY()) >= std::fabs(posCellInterfaceRef - m_element->getPosition().getY())) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff2 += coeff; - } - } - //Face majoritement selon Z - else { - posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getZ(); - //Autre cote - if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getZ()) >= std::fabs(posCellInterfaceRef - m_element->getPosition().getZ())) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } - slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff2 += coeff; - } - } - } - } - } - } - } //fin boucle sur les cell interfaces - - //Normalisation de la slope - //------------------------- - if (sommeCoeff2 > 1.e-8) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->divide(sommeCoeff2); } - slopesMixtureLocal2->divide(sommeCoeff2); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] /= sommeCoeff2; } - } - - //Limitations des slopes - //---------------------- - //Detection of the interface location - int phase0(0); - if ((m_vecPhases[phase0]->getAlpha() >= epsInterface) && (m_vecPhases[phase0]->getAlpha() <= 1. - epsInterface)) { - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], interfaceLimiter, interfaceVolumeFractionLimiter); - } - slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, interfaceLimiter); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = interfaceVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); - } - } - else { - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], globalLimiter, globalVolumeFractionLimiter); - } - slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, globalLimiter); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = globalVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); - } - } -} - -//*********************************************************************** - void CellO2::saveCons() { m_consSauvegarde->setCons(m_cons); @@ -355,7 +100,7 @@ void CellO2::saveCons() //*********************************************************************** -void CellO2::recuperationCons() +void CellO2::getBackCons() { m_cons->setCons(m_consSauvegarde); for (int k = 0; k < numberTransports; k++) { m_consTransports[k].setValue(m_consTransportsSauvegarde[k].getValue()); } @@ -381,7 +126,7 @@ void CellO2::predictionOrdre2(const double& dt, Symmetry* symmetry) //Relaxations and correction of energies //FP//Derniere news, ceci doit etre exclu de cette routine car pas generique selon modele: A mettre dans Run::solveHyperbolicO2 si besoin - model->relaxations(this, dt, vecPhasesO2); + model->relaxations(this, 0.5*dt, vecPhasesO2); m_mixtureO2->totalEnergyToInternalEnergy(m_vecQuantitiesAddPhys); //We build the internal energy from the total energy m_cons->correctionEnergy(this, vecPhasesO2); model->fulfillState(m_vecPhasesO2, m_mixtureO2); @@ -476,125 +221,4 @@ void CellO2::setTransport(double value, int& numTransport, Prim type) } } -//**************************************************************************** -//***************************** Methode AMR ********************************** -//**************************************************************************** - -void CellO2::createChildCell(const int& lvl) -{ - m_childrenCells.push_back(new CellO2(lvl + 1)); -} - -//**************************************************************************** -//********************** Methode Ordre 2 Parallele *************************** -//**************************************************************************** - -void CellO2::fillBufferSlopes(double* buffer, int& counter, const int& lvl, const int& neighbour) const -{ - if (m_lvl == lvl) { - std::vector cellInterfacesWithNeighboringGhostCell; - for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { - if (m_cellInterfaces[b]->whoAmI() == 0) { //Cell interface of type CellInterface/O2 (inner) - if (m_cellInterfaces[b]->getLvl() == m_lvl) { - if (this == m_cellInterfaces[b]->getCellGauche()) { - if (m_cellInterfaces[b]->getCellDroite()->isCellGhost()) { - if (m_cellInterfaces[b]->getCellDroite()->getRankOfNeighborCPU() == neighbour) { - cellInterfacesWithNeighboringGhostCell.push_back(m_cellInterfaces[b]); - } - } - } - else { - if (m_cellInterfaces[b]->getCellGauche()->isCellGhost()) { - if (m_cellInterfaces[b]->getCellGauche()->getRankOfNeighborCPU() == neighbour) { - cellInterfacesWithNeighboringGhostCell.push_back(m_cellInterfaces[b]); - } - } - } - } - } - } - - double epsilon(1.e-08), sommeCoeff(0.), scalarDiff(0.), alphaCellAfterOppositeSide(0.); - Coord coordBuffer(0.); - int phase0(0); - for (unsigned int b2 = 0; b2 < cellInterfacesWithNeighboringGhostCell.size(); b2++) { - //Reset local slope to send - //------------------------- - sommeCoeff = 0.; - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->setToZero(); - } - slopesMixtureLocal1->setToZero(); - for (int k = 0; k < numberTransports; k++) { - slopesTransportLocal1[k] = 0.; - } - - //Loop over cell interfaces to determine the slope to send - //-------------------------------------------------------- - alphaCellAfterOppositeSide = 0.; - int slopeIndex=-1; - for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { - if (m_cellInterfaces[b] != cellInterfacesWithNeighboringGhostCell[b2]) { - if (m_cellInterfaces[b]->getSlopesPhase(0) != 0) { //Cell interface de type CellInterfaceO2 ou BoundCondWallO2 - if (!m_cellInterfaces[b]->getSplit()) { - coordBuffer = m_cellInterfaces[b]->getFace()->getNormal().abs() - cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getNormal(); - if (coordBuffer.norm() < epsilon) { //Face in the same direction than the reference face - scalarDiff = m_cellInterfaces[b]->getFace()->getPos().scalar(m_cellInterfaces[b]->getFace()->getNormal()) - - cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getPos().scalar(cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getNormal()); - if (std::fabs(scalarDiff) > epsilon) { //Face on the opposite side of the cell in regards to the reference face - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), 1.); } - slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), 1.); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += (m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } - sommeCoeff += 1.; - if (m_cellInterfaces[b]->getCellGauche() == this) { - if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellDroite()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - } - else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellGauche()->getPhase(phase0)->getAlpha(); } - coordBuffer=scalarDiff*cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getNormal(); - if (coordBuffer.getX() < -epsilon) slopeIndex=0; - else if (coordBuffer.getX() > epsilon) slopeIndex=1; - else if (coordBuffer.getY() < -epsilon) slopeIndex=2; - else if (coordBuffer.getY() > epsilon) slopeIndex=3; - else if (coordBuffer.getZ() < -epsilon) slopeIndex=4; - else if (coordBuffer.getZ() > epsilon) slopeIndex=5; - } - } - } - } - } - } - - //Normalization of the slope - //-------------------------- - if (sommeCoeff > 1.e-8) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->divide(sommeCoeff); } - slopesMixtureLocal1->divide(sommeCoeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] /= sommeCoeff; } - alphaCellAfterOppositeSide /= sommeCoeff; - } - - //Fill buffer to send - //------------------- - for (int k = 0; k < numberPhases; k++) { - slopesPhasesLocal1[k]->fillBufferSlopes(buffer, counter); - } - slopesMixtureLocal1->fillBufferSlopes(buffer, counter); - for (int k = 0; k < numberTransports; k++) { - buffer[++counter] = slopesTransportLocal1[k]; - } - buffer[++counter] = alphaCellAfterOppositeSide; - buffer[++counter] = static_cast(slopeIndex); - } - } - - else { - for (unsigned int i = 0; i < m_childrenCells.size(); i++) { - if (m_childrenCells[i]->hasNeighboringGhostCellOfCPUneighbour(neighbour)) { - m_childrenCells[i]->fillBufferSlopes(buffer, counter, lvl, neighbour); - } - } - } -} - -//*********************************************************************** +//*********************************************************************** \ No newline at end of file diff --git a/src/Order2/CellO2.h b/src/Order2/CellO2.h index 16604c25..bc9a1e06 100644 --- a/src/Order2/CellO2.h +++ b/src/Order2/CellO2.h @@ -42,18 +42,12 @@ class CellO2 : public Cell virtual ~CellO2(); virtual void allocate(const std::vector& addPhys); virtual void copyPhase(const int& phaseNumber, Phase* phase); - virtual void computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, - Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, - double& alphaCellAfterOppositeSide, double& alphaCell, double& alphaCellOtherInterfaceSide, double& epsInterface); - virtual void computeLocalSlopesLimite(CellInterface& cellInterfaceRef, Limiter& globalLimiter, - Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, - double& epsInterface); virtual void saveCons(); - virtual void recuperationCons(); + virtual void getBackCons(); virtual void predictionOrdre2(const double& dt, Symmetry* symmetry); virtual void fulfillState(Prim type = vecPhases); - //Accesseurs + //Set/Get virtual Phase* getPhase(const int& phaseNumber, Prim type = vecPhases) const; virtual Phase** getPhases(Prim type = vecPhases) const; virtual Mixture* getMixture(Prim type = vecPhases) const; @@ -61,18 +55,38 @@ class CellO2 : public Cell virtual Transport* getTransports(Prim type = vecPhases) const; virtual void setTransport(double value, int& numTransport, Prim type = vecPhases); + // For 2nd order with parallel + virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/) { Errors::errorMessage("getBufferSlopes not available for CellO2"); }; + virtual void fillBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/, const int& /*neighbour*/) const { Errors::errorMessage("fillBufferSlopes not available for CellO2"); }; + + // -- Cartesian -- + virtual void computeLocalSlopes(CellInterface& /*cellInterfaceRef*/, Limiter& /*globalLimiter*/, Limiter& /*interfaceLimiter*/, + Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, + double& /*alphaCellAfterOppositeSide*/, double& /*alphaCell*/, double& /*alphaCellOtherInterfaceSide*/, double& /*epsInterface*/) {}; + + virtual void computeLocalSlopesLimite(CellInterface& /*cellInterfaceRef*/, Limiter& /*globalLimiter*/, + Limiter& /*interfaceLimiter*/, Limiter& /*globalVolumeFractionLimiter*/, Limiter& /*interfaceVolumeFractionLimiter*/, + double& /*epsInterface*/) {}; + //Pour methode AMR - virtual void createChildCell(const int& lvl); /*!< Creer une cell enfant (non initializee) */ + virtual void createChildCell(const int& /*lvl*/) {}; /*!< Create a child cell (non initialized) */ + + // -- NS -- + virtual GradPhase* getGradPhase(const int& /*phaseNumber*/) const { Errors::errorMessage("getGradPhase not available for Cell"); return nullptr; }; + virtual GradMixture* getGradMixture() const { Errors::errorMessage("getGradMixture not available for Cell"); return nullptr; }; + virtual GradTransport* getGradTransport(const int& /*transportNumber*/) const { Errors::errorMessage("getGradTransport not available for Cell"); return nullptr; }; + virtual void allocateSecondOrderBuffersAndGradientVectors(Phase** /*phases*/, Mixture* /*mixture*/) {}; + virtual void computeGradientsO2() {}; + virtual void limitGradientsO2(Limiter& /*globalLimiter*/) {}; - //Pour methodes ordre 2 parallele - virtual void fillBufferSlopes(double* buffer, int& counter, const int& lvl, const int& neighbour) const; + virtual void computeLocalSlopes(CellInterface& /*cellInterfaceRef*/) {}; protected: Phase** m_vecPhasesO2; /*!< pour stocker les values predites a l ordre 2 */ Mixture* m_mixtureO2; /*!< pour stocker les values predites a l ordre 2 */ - Transport* m_vecTransportsO2; /*!< pour stocker les values predites a l ordre 2 */ - Flux* m_consSauvegarde; /*!< Vector de save des variables conservatives. De type flux car recueille la somme des flux sur l objet cell */ - Transport* m_consTransportsSauvegarde; /*!< Vector de saugevarde des grandeurs passives permettant de recueillir la somme des flux des grandeurs transportees */ + Transport* m_vecTransportsO2; /*!< pour stocker les values predites a l ordre 2 */ + Flux* m_consSauvegarde; /*!< Vector de save des variables conservatives. De type flux car recueille la sum des flux sur l objet cell */ + Transport* m_consTransportsSauvegarde; /*!< Vector de saugevarde des grandeurs passives permettant de recueillir la sum des flux des grandeurs transportees */ private: }; diff --git a/src/Order2/CellO2Cartesian.cpp b/src/Order2/CellO2Cartesian.cpp new file mode 100644 index 00000000..b1424a2d --- /dev/null +++ b/src/Order2/CellO2Cartesian.cpp @@ -0,0 +1,402 @@ +#include "CellO2Cartesian.h" +#include "CellInterfaceO2Cartesian.h" + +//*********************************************************************** + +CellO2Cartesian::CellO2Cartesian() : CellO2() +{ +} + +//*********************************************************************** + +CellO2Cartesian::CellO2Cartesian(int lvl): CellO2(lvl) +{} + +//*********************************************************************** + +CellO2Cartesian::~CellO2Cartesian() +{ +} + +//*********************************************************************** + +void CellO2Cartesian::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, + Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, + double& alphaCellAfterOppositeSide, double& alphaCell, double& alphaCellOtherInterfaceSide, double& epsInterface) +{ + //Mise a zero des slopes locales + //------------------------------ + double coeff(0.), posCellInterfaceRef(0.); + double sumCoeff(0.), sumCoeff2(0.); + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->setToZero(); + slopesPhasesLocal2[k]->setToZero(); + } + slopesMixtureLocal1->setToZero(); + slopesMixtureLocal2->setToZero(); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = 0.; + slopesTransportLocal2[k] = 0.; + } + + //Loop on the cell interfaces for the determination of the slopes on each side of the cell + //---------------------------------------------------------------------------------------- + int phase0(0); + for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { + //Calcul de la slope a gauche et a droite de la cell (AMR) en se basant sur celle de reference (cell interface a gauche ou a droite, unknown) + if (m_cellInterfaces[b]->getSlopesPhase(0) != 0) { //Cell interface de type CellInterfaceO2 ou BoundCondWallO2 + if (m_cellInterfaces[b] == &cellInterfaceRef) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), 1.); } + slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), 1.); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += m_cellInterfaces[b]->getSlopesTransport(k)->getValue(); } + sumCoeff += 1.; + } + else { + if (!m_cellInterfaces[b]->getSplit()) { + //Produit scalar des normals avec celle de reference + coeff = std::fabs(m_cellInterfaces[b]->getFace()->getNormal().scalar(cellInterfaceRef.getFace()->getNormal())); + if (coeff > 1.e-6) { + //Face majoritement selon X + if (std::fabs(cellInterfaceRef.getFace()->getNormal().getX()) > 0.5) { + posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getX(); + //Cote cellInterfaceRef + if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getX()) <= std::fabs(posCellInterfaceRef - m_element->getPosition().getX())) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff += coeff; + } + //Autre cote + else { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff2 += coeff; + if (m_cellInterfaces[b]->getCellLeft() == this) { + if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellRight()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + } + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + } + } + //Face majoritement selon Y + else if (std::fabs(cellInterfaceRef.getFace()->getNormal().getY()) > 0.5) { + posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getY(); + //Cote cellInterfaceRef + if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getY()) <= std::fabs(posCellInterfaceRef - m_element->getPosition().getY())) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff += coeff; + } + //Autre cote + else { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff2 += coeff; + if (m_cellInterfaces[b]->getCellLeft() == this) { + if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellRight()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + } + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + } + } + //Face majoritement selon Z + else { + posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getZ(); + //Cote cellInterfaceRef + if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getZ()) <= std::fabs(posCellInterfaceRef - m_element->getPosition().getZ())) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff += coeff; + } + //Autre cote + else { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff2 += coeff; + if (m_cellInterfaces[b]->getCellLeft() == this) { + if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellRight()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + } + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + } + } + } + } + } + } + } //End loop on cell interfaces + + //Normalisation des slopes + //------------------------ + if (sumCoeff > 1.e-8) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->divide(sumCoeff); } + slopesMixtureLocal1->divide(sumCoeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] /= sumCoeff; } + } + if (sumCoeff2 > 1.e-8) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->divide(sumCoeff2); } + slopesMixtureLocal2->divide(sumCoeff2); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] /= sumCoeff2; } + alphaCellAfterOppositeSide /= sumCoeff2; + } + + //Limitations des slopes + //---------------------- + //Detection of the interface location + if ((alphaCell >= epsInterface) && (alphaCell <= 1. - epsInterface) && ((alphaCellOtherInterfaceSide - alphaCell)*(alphaCell - alphaCellAfterOppositeSide) >= 1.e-8)) { + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], interfaceLimiter, interfaceVolumeFractionLimiter); + } + slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, interfaceLimiter); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = interfaceVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); + } + } + else { + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], globalLimiter, globalVolumeFractionLimiter); + } + slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, globalLimiter); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = globalVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); + } + } +} + +//*********************************************************************** + +void CellO2Cartesian::computeLocalSlopesLimite(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, + Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, double& epsInterface) +{ + //Solution pour multiD Cartesian (peut etre une ebauche pour le NS, a voir...) + + //Set to zero the local slopes + //---------------------------- + double coeff(0.), posCellInterfaceRef(0.); + double sumCoeff2(0.); + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->setToZero(); + slopesPhasesLocal2[k]->setToZero(); + } + slopesMixtureLocal1->setToZero(); + slopesMixtureLocal2->setToZero(); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = 0.; + slopesTransportLocal2[k] = 0.; + } + + //Get the slope on the CL side + //---------------------------- + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*cellInterfaceRef.getSlopesPhase(k), 1.); } + slopesMixtureLocal1->multiplyAndAdd(*cellInterfaceRef.getSlopesMixture(), 1.); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += cellInterfaceRef.getSlopesTransport(k)->getValue(); } + + //Loop on the cell interfaces for the determination of the slopes on the opposite side of the BC + //---------------------------------------------------------------------------------------------- + for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { + //Calcul de la slope a gauche et a droite de la cell (AMR) en se basant sur celle de reference (cell interface a gauche ou a droite, unknown) + if (m_cellInterfaces[b]->getSlopesPhase(0) != 0) { //Cell interface de type CellInterface/O2 + if (m_cellInterfaces[b] != &cellInterfaceRef) { + if (!m_cellInterfaces[b]->getSplit()) { + //Produit scalar des normals avec celle de reference + coeff = std::fabs(m_cellInterfaces[b]->getFace()->getNormal().scalar(cellInterfaceRef.getFace()->getNormal())); + if (coeff > 1.e-6) { + //Face majoritement selon X + if (std::fabs(cellInterfaceRef.getFace()->getNormal().getX()) > 0.5) { + posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getX(); + //Autre cote + if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getX()) >= std::fabs(posCellInterfaceRef - m_element->getPosition().getX())) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff2 += coeff; + } + } + //Face majoritement selon Y + else if (std::fabs(cellInterfaceRef.getFace()->getNormal().getY()) > 0.5) { + posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getY(); + //Autre cote + if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getY()) >= std::fabs(posCellInterfaceRef - m_element->getPosition().getY())) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff2 += coeff; + } + } + //Face majoritement selon Z + else { + posCellInterfaceRef = cellInterfaceRef.getFace()->getPos().getZ(); + //Autre cote + if (std::fabs(posCellInterfaceRef - m_cellInterfaces[b]->getFace()->getPos().getZ()) >= std::fabs(posCellInterfaceRef - m_element->getPosition().getZ())) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), coeff); } + slopesMixtureLocal2->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), coeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] += coeff*(m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff2 += coeff; + } + } + } + } + } + } + } //End loop on cell interfaces + + //Normalisation de la slope + //------------------------- + if (sumCoeff2 > 1.e-8) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal2[k]->divide(sumCoeff2); } + slopesMixtureLocal2->divide(sumCoeff2); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal2[k] /= sumCoeff2; } + } + + //Limitations des slopes + //---------------------- + //Detection of the interface location + int phase0(0); + if ((m_vecPhases[phase0]->getAlpha() >= epsInterface) && (m_vecPhases[phase0]->getAlpha() <= 1. - epsInterface)) { + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], interfaceLimiter, interfaceVolumeFractionLimiter); + } + slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, interfaceLimiter); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = interfaceVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); + } + } + else { + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->limitSlopes(*slopesPhasesLocal1[k], *slopesPhasesLocal2[k], globalLimiter, globalVolumeFractionLimiter); + } + slopesMixtureLocal1->limitSlopes(*slopesMixtureLocal1, *slopesMixtureLocal2, globalLimiter); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = globalVolumeFractionLimiter.limiteSlope(slopesTransportLocal1[k], slopesTransportLocal2[k]); + } + } +} + +//**************************************************************************** +//***************************** Methode AMR ********************************** +//**************************************************************************** + +void CellO2Cartesian::createChildCell(const int& lvl) +{ + m_childrenCells.push_back(new CellO2Cartesian(lvl + 1)); +} + +//**************************************************************************** +//********************** Methode Ordre 2 Parallele *************************** +//**************************************************************************** + +void CellO2Cartesian::fillBufferSlopes(double* buffer, int& counter, const int& lvl, const int& neighbour) const +{ + if (m_lvl == lvl) { + std::vector cellInterfacesWithNeighboringGhostCell; + + for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { + if (m_cellInterfaces[b]->whoAmI() == 0) { //Cell interface of type CellInterface/O2 (inner) + if (m_cellInterfaces[b]->getLvl() == m_lvl) { + if (this == m_cellInterfaces[b]->getCellLeft()) { + if (m_cellInterfaces[b]->getCellRight()->isCellGhost()) { + if (m_cellInterfaces[b]->getCellRight()->getRankOfNeighborCPU() == neighbour) { + cellInterfacesWithNeighboringGhostCell.push_back(m_cellInterfaces[b]); + } + } + } + else { + if (m_cellInterfaces[b]->getCellLeft()->isCellGhost()) { + if (m_cellInterfaces[b]->getCellLeft()->getRankOfNeighborCPU() == neighbour) { + cellInterfacesWithNeighboringGhostCell.push_back(m_cellInterfaces[b]); + } + } + } + } + } + } + + double epsilon(1.e-08), sumCoeff(0.), scalarDiff(0.), alphaCellAfterOppositeSide(0.); + Coord coordBuffer(0.); + int phase0(0); + for (unsigned int b2 = 0; b2 < cellInterfacesWithNeighboringGhostCell.size(); b2++) { + //Reset local slope to send + //------------------------- + sumCoeff = 0.; + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->setToZero(); + } + slopesMixtureLocal1->setToZero(); + for (int k = 0; k < numberTransports; k++) { + slopesTransportLocal1[k] = 0.; + } + + //Loop over cell interfaces to determine the slope to send + //-------------------------------------------------------- + alphaCellAfterOppositeSide = 0.; + int slopeIndex=-1; + for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { + if (m_cellInterfaces[b] != cellInterfacesWithNeighboringGhostCell[b2]) { + if (m_cellInterfaces[b]->getSlopesPhase(0) != 0) { //Cell interface de type CellInterfaceO2 ou BoundCondWallO2 + if (!m_cellInterfaces[b]->getSplit()) { + coordBuffer = m_cellInterfaces[b]->getFace()->getNormal().abs() - cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getNormal(); + if (coordBuffer.norm() < epsilon) { //Face in the same direction than the reference face + scalarDiff = m_cellInterfaces[b]->getFace()->getPos().scalar(m_cellInterfaces[b]->getFace()->getNormal()) - + cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getPos().scalar(cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getNormal()); + if (std::fabs(scalarDiff) > epsilon) { //Face on the opposite side of the cell in regards to the reference face + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), 1.); } + slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), 1.); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += (m_cellInterfaces[b]->getSlopesTransport(k)->getValue()); } + sumCoeff += 1.; + if (m_cellInterfaces[b]->getCellLeft() == this) { + if (m_cellInterfaces[b]->whoAmI() == 0) { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellRight()->getPhase(phase0)->getAlpha(); } //Cell interface of type CellInterface/O2 (inner) + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + } + else { alphaCellAfterOppositeSide += m_cellInterfaces[b]->getCellLeft()->getPhase(phase0)->getAlpha(); } + coordBuffer=scalarDiff*cellInterfacesWithNeighboringGhostCell[b2]->getFace()->getNormal(); + if (coordBuffer.getX() < -epsilon) slopeIndex=0; + else if (coordBuffer.getX() > epsilon) slopeIndex=1; + else if (coordBuffer.getY() < -epsilon) slopeIndex=2; + else if (coordBuffer.getY() > epsilon) slopeIndex=3; + else if (coordBuffer.getZ() < -epsilon) slopeIndex=4; + else if (coordBuffer.getZ() > epsilon) slopeIndex=5; + } + } + } + } + } + } + + //Normalization of the slope + //-------------------------- + if (sumCoeff > 1.e-8) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->divide(sumCoeff); } + slopesMixtureLocal1->divide(sumCoeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] /= sumCoeff; } + alphaCellAfterOppositeSide /= sumCoeff; + } + + //Fill buffer to send + //------------------- + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->fillBufferSlopes(buffer, counter); + } + slopesMixtureLocal1->fillBufferSlopes(buffer, counter); + for (int k = 0; k < numberTransports; k++) { + buffer[++counter] = slopesTransportLocal1[k]; + } + buffer[++counter] = alphaCellAfterOppositeSide; + buffer[++counter] = static_cast(slopeIndex); + } + } + + else { + for (unsigned int i = 0; i < m_childrenCells.size(); i++) { + if (m_childrenCells[i]->hasNeighboringGhostCellOfCPUneighbour(neighbour)) { + m_childrenCells[i]->fillBufferSlopes(buffer, counter, lvl, neighbour); + } + } + } +} + +//*********************************************************************** \ No newline at end of file diff --git a/src/Order2/CellO2Cartesian.h b/src/Order2/CellO2Cartesian.h new file mode 100644 index 00000000..c49fd412 --- /dev/null +++ b/src/Order2/CellO2Cartesian.h @@ -0,0 +1,61 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef CELLO2CARTESIAN_H +#define CELLO2CARTESIAN_H + +#include "CellO2.h" + +class CellInterface; + +class CellO2Cartesian : public CellO2 +{ +public: + CellO2Cartesian(); + CellO2Cartesian(int lvl); + virtual ~CellO2Cartesian(); + + virtual void computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, + Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, + double& alphaCellAfterOppositeSide, double& alphaCell, double& alphaCellOtherInterfaceSide, double& epsInterface); + + virtual void computeLocalSlopesLimite(CellInterface& cellInterfaceRef, Limiter& globalLimiter, + Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, + double& epsInterface); + + //Pour methode AMR + virtual void createChildCell(const int& lvl); /*!< Creer une cell enfant (non initializee) */ + + //Pour methodes ordre 2 parallele + virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/) { Errors::errorMessage("getBufferSlopes not available for CellO2Cartesian"); }; + virtual void fillBufferSlopes(double* buffer, int& counter, const int& lvl, const int& neighbour) const; +}; + +#endif \ No newline at end of file diff --git a/src/Order2/CellO2Ghost.h b/src/Order2/CellO2Ghost.h deleted file mode 100644 index dc0bf529..00000000 --- a/src/Order2/CellO2Ghost.h +++ /dev/null @@ -1,65 +0,0 @@ -// -// ,---. ,--, .---. ,--, ,---. .-. .-. -// | .-' .' .') / .-. ) .' .' | .-' | \| | -// | `-. | |(_) | | |(_) | | __ | `-. | | | -// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | -// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| -// /( __.' \____\ )---' )\____/ /( __.' /( (_) -// (__) (_) (__) (__) (__) -// Official webSite: https://code-mphi.github.io/ECOGEN/ -// -// This file is part of ECOGEN. -// -// ECOGEN is the legal property of its developers, whose names -// are listed in the copyright file included with this source -// distribution. -// -// ECOGEN is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published -// by the Free Software Foundation, either version 3 of the License, -// or (at your option) any later version. -// -// ECOGEN is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with ECOGEN (file LICENSE). -// If not, see . - -#ifndef CELLO2GHOST_H -#define CELLO2GHOST_H - -#include "CellO2.h" - -class CellO2Ghost : public CellO2 -{ -public: - CellO2Ghost(); - CellO2Ghost(int lvl); //Pour AMR - virtual ~CellO2Ghost(); - - virtual void pushBackSlope(); - virtual void allocate(const std::vector& addPhys); - virtual int getRankOfNeighborCPU() const; - virtual void setRankOfNeighborCPU(int rank); - virtual void computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, - Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, double& alphaCellAfterOppositeSide, - double& alphaCell, double& alphaCellOtherInterfaceSide, double& epsInterface); - virtual void createChildCell(const int& lvl); - virtual void getBufferSlopes(double* buffer, int& counter, const int& lvl); - virtual bool isCellGhost() const { return true; }; - -protected: - int m_rankOfNeighborCPU; /*!< Rank of the neighbor CPU corresponding to this ghost cell */ - std::vector m_indexCellInterface; /*!< Index of the corresponding cell interface for following vectors */ - std::vector m_vecPhasesSlopesGhost; /*!< To store slopes of phases */ - std::vector m_mixtureSlopesGhost; /*!< To store slopes of mixtures */ - std::vector m_vecTransportsSlopesGhost; /*!< To store slopes of transports */ - std::vector m_alphaCellAfterOppositeSide; /*!< To store volume fractions after ghost cell */ - -private: -}; - -#endif // CELLO2GHOST_H diff --git a/src/Order2/CellO2Ghost.cpp b/src/Order2/CellO2GhostCartesian.cpp similarity index 79% rename from src/Order2/CellO2Ghost.cpp rename to src/Order2/CellO2GhostCartesian.cpp index cf2a6c9f..637fceb1 100644 --- a/src/Order2/CellO2Ghost.cpp +++ b/src/Order2/CellO2GhostCartesian.cpp @@ -28,19 +28,20 @@ // along with ECOGEN (file LICENSE). // If not, see . -#include "CellO2Ghost.h" +#include "CellO2GhostCartesian.h" +#include "CellInterfaceO2Cartesian.h" //*********************************************************************** -CellO2Ghost::CellO2Ghost() : CellO2(), m_rankOfNeighborCPU(0), m_vecPhasesSlopesGhost(0), m_mixtureSlopesGhost(0), m_vecTransportsSlopesGhost(0) {} +CellO2GhostCartesian::CellO2GhostCartesian() : CellO2Cartesian(), m_rankOfNeighborCPU(0), m_vecPhasesSlopesGhost(0), m_mixtureSlopesGhost(0), m_vecTransportsSlopesGhost(0) {} //*********************************************************************** -CellO2Ghost::CellO2Ghost(int lvl) : CellO2(lvl), m_rankOfNeighborCPU(0), m_vecPhasesSlopesGhost(0), m_mixtureSlopesGhost(0), m_vecTransportsSlopesGhost(0) {} +CellO2GhostCartesian::CellO2GhostCartesian(int lvl) : CellO2Cartesian(lvl), m_rankOfNeighborCPU(0), m_vecPhasesSlopesGhost(0), m_mixtureSlopesGhost(0), m_vecTransportsSlopesGhost(0) {} //*********************************************************************** -CellO2Ghost::~CellO2Ghost() +CellO2GhostCartesian::~CellO2GhostCartesian() { for (unsigned int s = 0; s < m_vecPhasesSlopesGhost.size(); s++) { for (int k = 0; k < numberPhases; k++) { @@ -54,7 +55,7 @@ CellO2Ghost::~CellO2Ghost() //*********************************************************************** -void CellO2Ghost::pushBackSlope() +void CellO2GhostCartesian::pushBackSlope() { m_indexCellInterface.push_back(0); m_vecPhasesSlopesGhost.push_back(nullptr); @@ -65,30 +66,29 @@ void CellO2Ghost::pushBackSlope() //*********************************************************************** -void CellO2Ghost::allocate(const std::vector& addPhys) +void CellO2GhostCartesian::popBackSlope() { - m_vecPhases = new Phase*[numberPhases]; - m_vecPhasesO2 = new Phase*[numberPhases]; - for (int k = 0; k < numberPhases; k++) { - model->allocatePhase(&m_vecPhases[k]); - model->allocatePhase(&m_vecPhasesO2[k]); - } - model->allocateMixture(&m_mixture); - model->allocateMixture(&m_mixtureO2); - model->allocateCons(&m_cons); - model->allocateCons(&m_consSauvegarde); - if (numberTransports > 0) { - m_vecTransports = new Transport[numberTransports]; - m_consTransports = new Transport[numberTransports]; - m_consTransportsSauvegarde = new Transport[numberTransports]; - m_vecTransportsO2 = new Transport[numberTransports]; - } - for (unsigned int k = 0; k < addPhys.size(); k++) { addPhys[k]->addQuantityAddPhys(this); } + m_indexCellInterface.pop_back(); + m_vecPhasesSlopesGhost.pop_back(); + m_mixtureSlopesGhost.pop_back(); + m_vecTransportsSlopesGhost.pop_back(); + m_alphaCellAfterOppositeSide.pop_back(); +} + +//*********************************************************************** - //Allocation des slopes fantomes, specifique aux limites paralleles +void CellO2GhostCartesian::allocate(const std::vector& addPhys) +{ + CellO2::allocate(addPhys); + + // Allocation des slopes fantomes, specifique aux limites paralleles for (unsigned int s = 0; s < m_vecPhasesSlopesGhost.size(); s++) { m_vecPhasesSlopesGhost[s] = new Phase*[numberPhases]; - for (int k = 0; k < numberPhases; k++) { + for (int k = 0; k < numberSolids; k++) { + model->allocatePhaseSolid(&m_vecPhasesSlopesGhost[s][k]); + m_vecPhasesSlopesGhost[s][k]->setToZero(); + } + for (int k = numberSolids; k < numberPhases; k++) { model->allocatePhase(&m_vecPhasesSlopesGhost[s][k]); m_vecPhasesSlopesGhost[s][k]->setToZero(); } @@ -101,24 +101,25 @@ void CellO2Ghost::allocate(const std::vector& addPhys) //*************************************************************************** -int CellO2Ghost::getRankOfNeighborCPU() const +int CellO2GhostCartesian::getRankOfNeighborCPU() const { return m_rankOfNeighborCPU; } //*************************************************************************** -void CellO2Ghost::setRankOfNeighborCPU(int rank) +void CellO2GhostCartesian::setRankOfNeighborCPU(int rank) { m_rankOfNeighborCPU = rank; } //*********************************************************************** -void CellO2Ghost::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, +void CellO2GhostCartesian::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, double& alphaCellAfterOppositeSide, double& alphaCell, double& alphaCellOtherInterfaceSide, double& epsInterface) { + //KS//TODO//Verifier le fonctionnement lorsque la limite CPU est parallele au mur //Find the corresponding slopes store inside this ghost cell //---------------------------------------------------------- int s(-1); @@ -154,7 +155,7 @@ void CellO2Ghost::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& g //Mise a zero des slopes locales //------------------------------ - double sommeCoeff(0.); + double sumCoeff(0.); for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->setToZero(); } @@ -163,8 +164,8 @@ void CellO2Ghost::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& g slopesTransportLocal1[k] = 0.; } - //Boucle sur les cell interfaces pour la determination de la slope du cote de cellInterfaceRef - //-------------------------------------------------------------------------------------------- + //Loop on the cell interfaces for the determination of the slopes on the side of cellInterfaceRef + //----------------------------------------------------------------------------------------------- coordBuffer = 0.; for (unsigned int b = 0; b < m_cellInterfaces.size(); b++) { if (!m_cellInterfaces[b]->getSplit()) { @@ -173,17 +174,17 @@ void CellO2Ghost::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& g for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesPhase(k), 1.); } slopesMixtureLocal1->multiplyAndAdd(*m_cellInterfaces[b]->getSlopesMixture(), 1.); for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] += m_cellInterfaces[b]->getSlopesTransport(k)->getValue(); } - sommeCoeff += 1.; + sumCoeff += 1.; } } } //Normalisation des slopes //------------------------ - if (sommeCoeff > 1.e-8) { - for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->divide(sommeCoeff); } - slopesMixtureLocal1->divide(sommeCoeff); - for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] /= sommeCoeff; } + if (sumCoeff > 1.e-8) { + for (int k = 0; k < numberPhases; k++) { slopesPhasesLocal1[k]->divide(sumCoeff); } + slopesMixtureLocal1->divide(sumCoeff); + for (int k = 0; k < numberTransports; k++) { slopesTransportLocal1[k] /= sumCoeff; } } //Limitations des slopes @@ -194,6 +195,7 @@ void CellO2Ghost::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& g else { alphaCellAfterOppositeSide = m_vecPhases[0]->getAlpha(); } + if ((alphaCell >= epsInterface) && (alphaCell <= 1. - epsInterface) && ((alphaCellOtherInterfaceSide - alphaCell)*(alphaCell - alphaCellAfterOppositeSide) >= 1.e-8)) { for (int k = 0; k < numberPhases; k++) { @@ -217,16 +219,16 @@ void CellO2Ghost::computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& g //*********************************************************************** -void CellO2Ghost::createChildCell(const int& lvl) +void CellO2GhostCartesian::createChildCell(const int& lvl) { - m_childrenCells.push_back(new CellO2Ghost(lvl + 1)); + m_childrenCells.push_back(new CellO2GhostCartesian(lvl + 1)); m_childrenCells.back()->setRankOfNeighborCPU(m_rankOfNeighborCPU); m_childrenCells.back()->pushBackSlope(); } //*********************************************************************** -void CellO2Ghost::getBufferSlopes(double* buffer, int& counter, const int& lvl) +void CellO2GhostCartesian::getBufferSlopes(double* buffer, int& counter, const int& lvl) { if (m_lvl == lvl) { for (unsigned int s = 0; s < m_vecPhasesSlopesGhost.size(); s++) { diff --git a/src/Order2/CellO2GhostCartesian.h b/src/Order2/CellO2GhostCartesian.h new file mode 100644 index 00000000..f510164f --- /dev/null +++ b/src/Order2/CellO2GhostCartesian.h @@ -0,0 +1,69 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef CELLO2GHOSTCARTESIAN_H +#define CELLO2GHOSTCARTESIAN_H + +#include "CellO2Cartesian.h" + +class CellInterface; + +class CellO2GhostCartesian : public CellO2Cartesian +{ +public: + CellO2GhostCartesian(); + CellO2GhostCartesian(int lvl); //Pour AMR + virtual ~CellO2GhostCartesian(); + + virtual void pushBackSlope(); + virtual void popBackSlope(); + virtual void allocate(const std::vector& addPhys); + virtual int getRankOfNeighborCPU() const; + virtual void setRankOfNeighborCPU(int rank); + + virtual void computeLocalSlopes(CellInterface& cellInterfaceRef, Limiter& globalLimiter, Limiter& interfaceLimiter, + Limiter& globalVolumeFractionLimiter, Limiter& interfaceVolumeFractionLimiter, double& alphaCellAfterOppositeSide, + double& alphaCell, double& alphaCellOtherInterfaceSide, double& epsInterface); + virtual void createChildCell(const int& lvl); + virtual void getBufferSlopes(double* buffer, int& counter, const int& lvl); + virtual bool isCellGhost() const { return true; }; + +protected: + int m_rankOfNeighborCPU; /*!< Rank of the neighbor CPU corresponding to this ghost cell */ + std::vector m_indexCellInterface; /*!< Index of the corresponding cell interface for vectors below*/ + std::vector m_vecPhasesSlopesGhost; /*!< To store slopes of phases */ + std::vector m_mixtureSlopesGhost; /*!< To store slopes of mixtures */ + std::vector m_vecTransportsSlopesGhost; /*!< To store slopes of transports */ + std::vector m_alphaCellAfterOppositeSide; /*!< To store volume fractions after ghost cell */ + +private: +}; + +#endif // CELLO2GHOSTCARTESIAN_H diff --git a/src/Order2/CellO2GhostNS.cpp b/src/Order2/CellO2GhostNS.cpp new file mode 100644 index 00000000..122004e0 --- /dev/null +++ b/src/Order2/CellO2GhostNS.cpp @@ -0,0 +1,43 @@ +#include "CellO2GhostNS.h" + +//*************************************************************************** + +CellO2GhostNS::CellO2GhostNS() +{ +} + +//*************************************************************************** + +CellO2GhostNS::~CellO2GhostNS() +{ +} + +//*************************************************************************** + +int CellO2GhostNS::getRankOfNeighborCPU() const +{ + return m_rankOfNeighborCPU; +} + +//*************************************************************************** + +void CellO2GhostNS::setRankOfNeighborCPU(int rank) +{ + m_rankOfNeighborCPU = rank; +} + +//*************************************************************************** + +void CellO2GhostNS::getBufferSlopes(double* buffer, int& counter, const int& /*lvl*/) +{ + // Fill buffer to send + for (int k = 0; k < numberPhases; k++) { + m_gradPhase[k]->getBufferGradients(buffer, counter); + } + m_gradMixture->getBufferGradients(buffer, counter); + for (int t = 0; t < numberTransports; t++) { + m_gradTransport[t].getBufferGradients(buffer, counter); + } +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Order2/CellO2GhostNS.h b/src/Order2/CellO2GhostNS.h new file mode 100644 index 00000000..7727020e --- /dev/null +++ b/src/Order2/CellO2GhostNS.h @@ -0,0 +1,51 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef CELLO2GHOSTNS_H +#define CELLO2GHOSTNS_H + +#include "CellO2NS.h" + +class CellO2GhostNS : public CellO2NS +{ +public: + CellO2GhostNS(); + ~CellO2GhostNS(); + + virtual int getRankOfNeighborCPU() const; + virtual void setRankOfNeighborCPU(int rank); + + virtual void getBufferSlopes(double* buffer, int& counter, const int& /*lvl*/); + +protected: + int m_rankOfNeighborCPU; /*!< Rank of the neighbor CPU corresponding to this ghost cell */ +}; + +#endif \ No newline at end of file diff --git a/src/Order2/CellO2NS.cpp b/src/Order2/CellO2NS.cpp new file mode 100644 index 00000000..6bc0c6ed --- /dev/null +++ b/src/Order2/CellO2NS.cpp @@ -0,0 +1,241 @@ +#include "CellO2NS.h" + +Phase** buffPhasesMin; +Phase** buffPhasesMax; +Mixture* buffMixtureMin; +Mixture* buffMixtureMax; +double* buffTransportMin; +double* buffTransportMax; + +//*********************************************************************** + +CellO2NS::CellO2NS() : CellO2(), m_gradPhase(nullptr), m_gradMixture(nullptr), m_gradTransport(nullptr) +{ +} + +//*********************************************************************** + +CellO2NS::~CellO2NS() +{ + for (int k = 0; k < numberPhases; k++) { + delete m_gradPhase[k]; + } + delete[] m_gradPhase; + delete m_gradMixture; + if (m_gradTransport != nullptr) { + delete[] m_gradTransport; + } +} + +//*********************************************************************** + +void CellO2NS::allocateSecondOrderBuffersAndGradientVectors(Phase** phases, Mixture* mixture) +{ + buffPhasesMin = new Phase*[numberPhases]; + buffPhasesMax = new Phase*[numberPhases]; + for (int k = 0; k < numberPhases; k++) { + phases[k]->allocateAndCopyPhase(&buffPhasesMin[k]); + phases[k]->allocateAndCopyPhase(&buffPhasesMax[k]); + } + mixture->allocateAndCopyMixture(&buffMixtureMin); + mixture->allocateAndCopyMixture(&buffMixtureMax); + + if (numberTransports > 0) { + buffTransportMin = new double[numberTransports]; + buffTransportMax = new double[numberTransports]; + for (int t = 0; t < numberTransports; t++) { + buffTransportMin[t] = 0.; + buffTransportMax[t] = 0.; + } + } + + m_gradPhase[0]->initializeGradientVectors(); + m_gradMixture->initializeGradientVectors(); + if (numberTransports > 0) m_gradTransport[0].initializeGradientVectors(); +} + +//*********************************************************************** + +void CellO2NS::allocate(const std::vector& addPhys) +{ + CellO2::allocate(addPhys); + + m_gradPhase = new GradPhase*[numberPhases]; + for (int k = 0; k < numberSolids; k++) { + model->allocatePhaseSolidGradient(&m_gradPhase[k]); + } + for (int k = numberSolids; k < numberPhases; k++) { + model->allocatePhaseGradient(&m_gradPhase[k]); + } + model->allocateMixtureGradient(&m_gradMixture); + + if (numberTransports > 0) { + m_gradTransport = new GradTransport[numberTransports]; + } +} + +//*********************************************************************** + +void CellO2NS::computeGradientsO2() +{ + for (int k = 0; k < numberPhases; k++) { + m_gradPhase[k]->computeGradients(this, k); + } + m_gradMixture->computeGradients(this); + + for (int t = 0; t < numberTransports; t++) { + m_gradTransport[t].computeGradient(this, t); + } +} + +//*********************************************************************** + +void CellO2NS::limitGradientsO2(Limiter& globalLimiter) +{ + // Reset local slopes + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal1[k]->setToZero(); + slopesPhasesLocal2[k]->setToZero(); + } + slopesMixtureLocal1->setToZero(); + slopesMixtureLocal2->setToZero(); + for (int t = 0; t < numberTransports; t++) { + slopesTransportLocal1[t] = 0.; + slopesTransportLocal2[t] = 0.; + } + + // 1) Determine Wmin/Wmax + buffMixtureMin->copyMixture(*(this->getMixture())); + buffMixtureMax->copyMixture(*(this->getMixture())); + for (int k = 0; k < numberPhases; k++) { + buffPhasesMin[k]->copyPhase(*(this->getPhase(k))); + buffPhasesMax[k]->copyPhase(*(this->getPhase(k))); + } + for (int t = 0; t < numberTransports; t++) { + buffTransportMin[t] = this->getTransport(t).getValue(); + buffTransportMax[t] = this->getTransport(t).getValue(); + } + + for (unsigned int i = 0; i < m_cellInterfaces.size(); i++) { + // Inner domain cell interface (not a boundary) + if (m_cellInterfaces[i]->whoAmI() == 0) { + for (int k = 0; k < numberPhases; k++) { + buffPhasesMin[k]->setMin(*(m_cellInterfaces[i]->getCellLeft()->getPhase(k)), *buffPhasesMin[k]); + buffPhasesMin[k]->setMin(*(m_cellInterfaces[i]->getCellRight()->getPhase(k)), *buffPhasesMin[k]); + + buffPhasesMax[k]->setMax(*(m_cellInterfaces[i]->getCellLeft()->getPhase(k)), *buffPhasesMax[k]); + buffPhasesMax[k]->setMax(*(m_cellInterfaces[i]->getCellRight()->getPhase(k)), *buffPhasesMax[k]); + } + buffMixtureMin->setMin(*(m_cellInterfaces[i]->getCellLeft()->getMixture()), *buffMixtureMin); + buffMixtureMin->setMin(*(m_cellInterfaces[i]->getCellRight()->getMixture()), *buffMixtureMin); + + buffMixtureMax->setMax(*(m_cellInterfaces[i]->getCellLeft()->getMixture()), *buffMixtureMax); + buffMixtureMax->setMax(*(m_cellInterfaces[i]->getCellRight()->getMixture()), *buffMixtureMax); + + for (int t = 0; t < numberTransports; t++) { + buffTransportMin[t] = std::min(m_cellInterfaces[i]->getCellLeft()->getTransport(t).getValue(), buffTransportMin[t]); + buffTransportMin[t] = std::min(m_cellInterfaces[i]->getCellRight()->getTransport(t).getValue(), buffTransportMin[t]); + buffTransportMax[t] = std::max(m_cellInterfaces[i]->getCellLeft()->getTransport(t).getValue(), buffTransportMax[t]); + buffTransportMax[t] = std::max(m_cellInterfaces[i]->getCellRight()->getTransport(t).getValue(), buffTransportMax[t]); + } + } + } + + // 2) Compute gradient limiter of the cell theta_i + + // Reset cell gradient limiter theta_i cell to high values for search on minimum cell interfaces theta_ij + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal2[k]->setToMax(); + } + slopesMixtureLocal2->setToMax(); + for (int t = 0; t < numberTransports; t++) { + slopesTransportLocal2[t] = 1.e15; + } + + Coord rij; + for (unsigned int i = 0; i < m_cellInterfaces.size(); i++) { + // Compute rij * grad(Wi) => slopesPhases1/MixtureLocal1/slopesTransportLocal1 + rij = m_cellInterfaces[i]->getFace()->getPos() - this->getPosition(); + + for (int k = 0; k < numberPhases; k++) { + m_gradPhase[k]->computeDistanceGradientScalarProduct(rij, slopesPhasesLocal1[k]); + } + m_gradMixture->computeDistanceGradientScalarProduct(rij, slopesMixtureLocal1); + for (int t = 0; t < numberTransports; t++) { + m_gradTransport[t].computeDistanceGradientScalarProduct(rij, slopesTransportLocal1[t]); + } + + // Compute interface gradient limiter theta_ij and update cell gradient limiter theta_i of cell with minimum of theta_ij + for (int k = 0; k < numberPhases; k++) { + slopesPhasesLocal2[k]->computeGradientLimiter(globalLimiter, *(this->getPhase(k)), *buffPhasesMin[k], *buffPhasesMax[k], *slopesPhasesLocal1[k]); + } + slopesMixtureLocal2->computeGradientLimiter(globalLimiter, *(this->getMixture()), *buffMixtureMin, *buffMixtureMax, *slopesMixtureLocal1); + for (int t = 0; t < numberTransports; t++) { + slopesTransportLocal2[t] = std::min(slopesTransportLocal2[t], globalLimiter.computeGradientLimiter(this->getTransport(t).getValue(), buffTransportMin[t], buffTransportMax[t], slopesTransportLocal1[t])); + } + } + + // 3) Limit gradient with gradientLimiter * grad(Wi) and stores it in gradient to make it ready for extrapolation + for (int k = 0; k < numberPhases; k++) { + m_gradPhase[k]->limitGradients(*slopesPhasesLocal2[k]); + } + m_gradMixture->limitGradients(*slopesMixtureLocal2); + for (int t = 0; t < numberTransports; t++) { + m_gradTransport[t].limitGradients(slopesTransportLocal2[t]); + } +} + +//*********************************************************************** + +void CellO2NS::computeLocalSlopes(CellInterface& cellInterfaceRef) +{ + // Compute gradientLimiter * rij . grad(Wi) and stores it in + // slopesPhases1/MixtureLocal1/slopesTransportLocal1 for extrapolation + Coord rij = cellInterfaceRef.getFace()->getPos() - this->getPosition(); + + for (int k = 0; k < numberPhases; k++) { + m_gradPhase[k]->computeDistanceGradientScalarProduct(rij, slopesPhasesLocal1[k]); + } + m_gradMixture->computeDistanceGradientScalarProduct(rij, slopesMixtureLocal1); + + for (int t = 0; t < numberTransports; t++) { + m_gradTransport[t].computeDistanceGradientScalarProduct(rij, slopesTransportLocal1[t]); + } +} + +//*********************************************************************** + +GradPhase* CellO2NS::getGradPhase(const int& phaseNumber) const +{ + return m_gradPhase[phaseNumber]; +} + +//*********************************************************************** + +GradMixture* CellO2NS::getGradMixture() const +{ + return m_gradMixture; +} + +//*********************************************************************** + +GradTransport* CellO2NS::getGradTransport(const int& transportNumber) const +{ + return &m_gradTransport[transportNumber]; +} + +//*********************************************************************** + +void CellO2NS::fillBufferSlopes(double* buffer, int& counter, const int& /*lvl*/, const int& /*neighbour*/) const +{ + //Fill buffer to send + for (int k = 0; k < numberPhases; k++) { + m_gradPhase[k]->fillBufferGradients(buffer, counter); + } + m_gradMixture->fillBufferGradients(buffer, counter); + for (int t = 0; t < numberTransports; t++) { + m_gradTransport[t].fillBufferGradients(buffer, counter); + } +} + +//*********************************************************************** \ No newline at end of file diff --git a/src/Order2/CellO2NS.h b/src/Order2/CellO2NS.h new file mode 100644 index 00000000..37c6ba6f --- /dev/null +++ b/src/Order2/CellO2NS.h @@ -0,0 +1,68 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef CELLO2NS_H +#define CELLO2NS_H + +#include "CellO2.h" + +class CellO2NS : public CellO2 +{ +public: + CellO2NS(); + virtual ~CellO2NS(); + + virtual void allocateSecondOrderBuffersAndGradientVectors(Phase** phases, Mixture* mixture); + virtual void allocate(const std::vector& addPhys); + virtual void computeGradientsO2(); + virtual void limitGradientsO2(Limiter& globalLimiter); + virtual void computeLocalSlopes(CellInterface& cellInterfaceRef); + + // For 2nd order with parallel + virtual GradPhase* getGradPhase(const int& phaseNumber) const; + virtual GradMixture* getGradMixture() const; + virtual GradTransport* getGradTransport(const int& transportNumber) const; + virtual void getBufferSlopes(double* /*buffer*/, int& /*counter*/, const int& /*lvl*/) { Errors::errorMessage("getBufferSlopes not available for CellO2NS"); }; + virtual void fillBufferSlopes(double* buffer, int& counter, const int& /*lvl*/, const int& /*neighbour*/) const; + +protected: + GradPhase** m_gradPhase; + GradMixture* m_gradMixture; + GradTransport* m_gradTransport; +}; + +extern Phase** buffPhasesMin; //!< Stores minimum phases from neighbors of a cell +extern Phase** buffPhasesMax; //!< Stores maximum phases from neighbors of a cell +extern Mixture* buffMixtureMin; //!< Stores minimum mixture from neighbors of a cell +extern Mixture* buffMixtureMax; //!< Stores maximum mixture from neighbors of a cell +extern double* buffTransportMin; //!< Stores minimum transport from neighbors of a cell +extern double* buffTransportMax; //!< Stores maximum transport from neighbors of a cell + +#endif \ No newline at end of file diff --git a/src/Order2/HeaderLimiter.h b/src/Order2/HeaderLimiter.h index 1dc7b6c6..123ceaed 100644 --- a/src/Order2/HeaderLimiter.h +++ b/src/Order2/HeaderLimiter.h @@ -38,6 +38,6 @@ #include "LimiterMC.h" #include "LimiterTHINC.h" -//Ajouter ici entetes des nouveaux limiters +//Add here headers of new limiters #endif // HEADERLIMITER_H \ No newline at end of file diff --git a/src/Order2/Limiter.cpp b/src/Order2/Limiter.cpp index bca699c8..79d85bb7 100644 --- a/src/Order2/Limiter.cpp +++ b/src/Order2/Limiter.cpp @@ -32,10 +32,33 @@ //*********************************************************************** -Limiter::Limiter(){} +Limiter::Limiter() : m_limType(LimiterType::NONE) {} //*********************************************************************** Limiter::~Limiter(){} +//*********************************************************************** + +double Limiter::computeGradientLimiter(double val, double min, double max, double slope) const +{ + double eps(1.e-6); + double phi(1.); + + if (slope > eps * val) { + phi = (max - val) * 0.5 / slope; + } + else if (slope < - eps * val) { + phi = (min - val) * 0.5 / slope; + } + + double buff1(0.), buff2(0.); + buff1 = std::min(double(m_limType) * phi, 1.); + buff2 = std::min(phi, double(m_limType)); + double theta(0.); + theta = std::max(theta, buff1); + theta = std::max(theta, buff2); + return theta; +} + //*********************************************************************** \ No newline at end of file diff --git a/src/Order2/Limiter.h b/src/Order2/Limiter.h index bb40dd4b..cd2c7e89 100644 --- a/src/Order2/Limiter.h +++ b/src/Order2/Limiter.h @@ -32,6 +32,7 @@ #define LIMITER_H #include "../Errors.h" +#include "../Tools.h" class Limiter { @@ -42,6 +43,12 @@ class Limiter virtual double limiteSlope(const double& /*slope1*/, const double& /*slope2*/) { Errors::errorMessage("Unknown limiter"); return 0.; }; virtual bool AmITHINC() { return false; } + virtual double computeGradientLimiter(double val, double min, double max, double slope) const; + + virtual LimiterType getType() { return m_limType; } + + protected: + LimiterType m_limType; //!< Type of second-order limiter (NS only) }; #endif // LIMITER_H \ No newline at end of file diff --git a/src/Order2/LimiterMinmod.cpp b/src/Order2/LimiterMinmod.cpp index ffe06d4d..4472e17a 100644 --- a/src/Order2/LimiterMinmod.cpp +++ b/src/Order2/LimiterMinmod.cpp @@ -32,7 +32,10 @@ //*********************************************************************** -LimiterMinmod::LimiterMinmod(){} +LimiterMinmod::LimiterMinmod() : Limiter() +{ + m_limType = LimiterType::MINMOD; +} //*********************************************************************** diff --git a/src/Order2/LimiterSuperBee.cpp b/src/Order2/LimiterSuperBee.cpp index d620cf30..3a5cd2f6 100644 --- a/src/Order2/LimiterSuperBee.cpp +++ b/src/Order2/LimiterSuperBee.cpp @@ -32,7 +32,10 @@ //*********************************************************************** -LimiterSuperBee::LimiterSuperBee(){} +LimiterSuperBee::LimiterSuperBee() : Limiter() +{ + m_limType = LimiterType::SUPERBEE; +} //*********************************************************************** diff --git a/src/Order2/LimiterVanAlbada.cpp b/src/Order2/LimiterVanAlbada.cpp index acb1269e..34974438 100644 --- a/src/Order2/LimiterVanAlbada.cpp +++ b/src/Order2/LimiterVanAlbada.cpp @@ -43,9 +43,9 @@ LimiterVanAlbada::~LimiterVanAlbada(){} double LimiterVanAlbada::limiteSlope(const double& slope1, const double& slope2) { double zero(1e-6); - double slope(0.), produit(slope1*slope2), somme(slope1 + slope2); - if( (std::fabs(slope1)>zero) && (std::fabs(slope2)>zero) && (std::fabs(somme)>zero) && (produit>zero)){ - slope = produit*somme / (slope1*slope1 + slope2*slope2); + double slope(0.), produit(slope1*slope2), sum(slope1 + slope2); + if( (std::fabs(slope1)>zero) && (std::fabs(slope2)>zero) && (std::fabs(sum)>zero) && (produit>zero)){ + slope = produit*sum / (slope1*slope1 + slope2*slope2); } return slope; } \ No newline at end of file diff --git a/src/Order2/LimiterVanLeer.cpp b/src/Order2/LimiterVanLeer.cpp index cd59a37b..442743f8 100644 --- a/src/Order2/LimiterVanLeer.cpp +++ b/src/Order2/LimiterVanLeer.cpp @@ -43,7 +43,7 @@ LimiterVanLeer::~LimiterVanLeer(){} double LimiterVanLeer::limiteSlope(const double& slope1, const double& slope2) { double zero(1e-6); - double slope(0.), produit(slope1*slope2), somme(slope1+slope2); - if ((std::fabs(somme)>zero) && (produit > zero)) { slope = 2.*produit / somme; } + double slope(0.), produit(slope1*slope2), sum(slope1+slope2); + if ((std::fabs(sum)>zero) && (produit > zero)) { slope = 2.*produit / sum; } return slope; } \ No newline at end of file diff --git a/src/Parallel/Parallel.cpp b/src/Parallel/Parallel.cpp index 52318fda..7bdaad40 100644 --- a/src/Parallel/Parallel.cpp +++ b/src/Parallel/Parallel.cpp @@ -179,6 +179,20 @@ void Parallel::addSlopesToReceive(int neighbour) //*********************************************************************** +void Parallel::deleteSlopesToSend(int neighbour) +{ + m_numberSlopesToSendToNeighbour[neighbour] -= 1; +} + +//*********************************************************************** + +void Parallel::deleteSlopesToReceive(int neighbour) +{ + m_numberSlopesToReceiveFromNeighbour[neighbour] -= 1; +} + +//*********************************************************************** + void Parallel::clearElementsAndSlopesToSendAndReceivePLusNeighbour() { for (int neighbour = 0; neighbour < Ncpu; neighbour++) { @@ -442,7 +456,7 @@ void Parallel::communicationsSlopes(int lvl) { int count(0); MPI_Status status; - + for (int neighbour = 0; neighbour < Ncpu; neighbour++) { if (m_isNeighbour[neighbour]) { //Prepation of sendings diff --git a/src/Parallel/Parallel.h b/src/Parallel/Parallel.h index 420b1af9..e070432b 100644 --- a/src/Parallel/Parallel.h +++ b/src/Parallel/Parallel.h @@ -48,6 +48,8 @@ class Parallel void addElementToReceive(int neighbour, Cell* cell); void addSlopesToSend(int neighbour); void addSlopesToReceive(int neighbour); + void deleteSlopesToSend(int neighbour); + void deleteSlopesToReceive(int neighbour); void clearElementsAndSlopesToSendAndReceivePLusNeighbour(); TypeMeshContainer& getElementsToSend(int neighbour); TypeMeshContainer& getElementsToReceive(int neighbour); @@ -78,7 +80,7 @@ class Parallel void finalizePersistentCommunicationsVector(const int& lvlMax); void communicationsVector(Variable nameVector, const int& dim, int lvl, int num = 0, int index = -1); - //Methodes pour toutes les variables primitives + //Methodes pour toutes les variables transports void initializePersistentCommunicationsTransports(); void finalizePersistentCommunicationsTransports(const int& lvlMax); void communicationsTransports(int lvl); diff --git a/src/Relaxations/Relaxation.h b/src/Relaxations/Relaxation.h index 98a86d5f..89c1cfb2 100644 --- a/src/Relaxations/Relaxation.h +++ b/src/Relaxations/Relaxation.h @@ -37,6 +37,7 @@ class Relaxation; //Predeclaration of class Relaxation to include Cell.h #include "../Errors.h" #include "../Tools.h" #include "../Order1/Cell.h" +#include "../libTierces/svd.h" //! \class Relaxation //! \brief Abstract class for Relaxations @@ -46,14 +47,20 @@ class Relaxation Relaxation(); virtual ~Relaxation(); + //! \brief Return the type of the corresponding relaxation method + virtual int getType() const { Errors::errorMessage("getType not available for required relaxation"); return 0; } + //! \brief Stiff relaxation methods //! \details Call for this method computes the one of the stiff relaxation methods. //! \param cell cell to relax + //! \param dt time step //! \param type enumeration allowing to relax either state in the cell or second order half time step state virtual void relaxation(Cell* /*cell*/, const double& /*dt*/, Prim /*type*/ = vecPhases) { Errors::errorMessage("relaxation not available for required relaxation"); }; - //! \brief Return the type of the corresponding relaxation method - virtual int getType() const { Errors::errorMessage("getType not available for required relaxation"); return 0; } + //! \brief Initialize the theoritical critical pressure of the fluid (only required for PTMu relax) + //! \param cell cell to get the eos + //! \param numberPhases number of phases + virtual void initializeCriticalPressure(Cell* /*cell*/) {}; private: }; diff --git a/src/Relaxations/RelaxationP.cpp b/src/Relaxations/RelaxationP.cpp index 6677f18c..5eee5b31 100644 --- a/src/Relaxations/RelaxationP.cpp +++ b/src/Relaxations/RelaxationP.cpp @@ -43,7 +43,7 @@ RelaxationP::~RelaxationP(){} void RelaxationP::NewtonRaphson(double& pStar, int& iteration) { //Iterative process for relaxed pressure determination - double f(0.), df(1.), drho(0.), dalpha(0.); + double f(0.), df(1.), drhodp(0.), dalpha(0.); do { iteration++; pStar -= f / df; @@ -51,22 +51,44 @@ void RelaxationP::NewtonRaphson(double& pStar, int& iteration) for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(pStar); } f = -1.; df = 0.; for (int k = 0; k < numberPhases; k++) { - TB->rhokS[k] = TB->eos[k]->computeDensityPfinal(TB->pk[k], TB->rhok[k], pStar, &drho); + TB->rhokS[k] = TB->eos[k]->computeDensityPfinal(TB->pk[k], TB->rhok[k], pStar, &drhodp); TB->akS[k] = TB->ak[k] * TB->rhok[k] / TB->rhokS[k]; - dalpha = TB->ak[k] * TB->rhok[k] * drho / (TB->rhokS[k] * TB->rhokS[k]); + dalpha = TB->ak[k] * TB->rhok[k] * drhodp / (TB->rhokS[k] * TB->rhokS[k]); f += TB->akS[k]; df -= dalpha; } } while (std::fabs(f)>1e-10 && iteration < 100); - if (iteration == 100) { - // std::cout<<"alpha0 "<ak[0]<<" "<akS[0]<ak[1]<<" "<akS[1]<ak[0]+TB->ak[1]<<" "<akS[0]+TB->akS[1]<zk[k] = cell->getPhase(k, type)->getDensity() * cell->getPhase(k, type)->getSoundSpeed(); - } - pI = 0.; - sumZk = 0.; - for (int k = 0; k < numberPhases; k++) { - sumZk += TB->zk[k]; - sumZj = 0.; - for (int j = 0; j < numberPhases; j++) { - if (j != k) sumZj += TB->zk[j]; - } - pI += sumZj * cell->getPhase(k, type)->getPressure(); - } - pI /= sumZk; - + double pI(0.), drhodp(0.); + pI = computeInterfacePressure(cell, type); for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(pI); } //Physical pressure? for (int k = 0; k < numberPhases; k++) { - TB->rhokS[k] = TB->eos[k]->computeDensityPfinal(TB->pk[k], TB->rhok[k], pI, &drho); + TB->rhokS[k] = TB->eos[k]->computeDensityPfinal(TB->pk[k], TB->rhok[k], pI, &drhodp); TB->akS[k] = TB->ak[k] * TB->rhok[k] / TB->rhokS[k]; phase = cell->getPhase(k, type); phase->setAlpha(TB->akS[k]); diff --git a/src/Relaxations/RelaxationPInfinite.h b/src/Relaxations/RelaxationPInfinite.h index c7546e82..84b8efa6 100644 --- a/src/Relaxations/RelaxationPInfinite.h +++ b/src/Relaxations/RelaxationPInfinite.h @@ -37,15 +37,16 @@ //! \brief Stiff (infinite) pressure relaxation class RelaxationPInfinite : public RelaxationP { -public: - RelaxationPInfinite(); - virtual ~RelaxationPInfinite(); + public: + RelaxationPInfinite(); + virtual ~RelaxationPInfinite(); - //! \brief Stiff (infinite) Pressure relaxation method - //! \details Call for this method computes the mechanical relaxed state in a given cell. Relaxed state is stored depending on the type enum. - //! \param cell cell to relax - //! \param type enumeration allowing to relax either state in the cell or second order half time step state - virtual void relaxation(Cell* cell, const double& /*dt*/, Prim type = vecPhases); + //! \brief Stiff (infinite) Pressure relaxation method + //! \details Call for this method computes the mechanical relaxed state in a given cell. Relaxed state is stored depending on the type enum. + //! \param cell cell to relax + //! \param dt time step (not used here) + //! \param type enumeration allowing to relax either state in the cell or second order half time step state + virtual void relaxation(Cell* cell, const double& /*dt*/, Prim type = vecPhases); }; #endif // RELAXATIONPINFINITE_H diff --git a/src/Relaxations/RelaxationPT.h b/src/Relaxations/RelaxationPT.h index e9d3aa6b..ccc3f31f 100644 --- a/src/Relaxations/RelaxationPT.h +++ b/src/Relaxations/RelaxationPT.h @@ -44,6 +44,7 @@ class RelaxationPT : public Relaxation //! \brief Stiff Pressure-Temperature relaxation method //! \details call for this method computes the mechanical and thermal relaxed state in a given cell. Relaxed state is stored depending on the type enum //! \param cell cell to relax + //! \param dt time step (not used here) //! \param type enumeration allowing to relax either state in the cell or second order half time step state virtual void relaxation(Cell* cell, const double& /*dt*/, Prim type = vecPhases); diff --git a/src/Relaxations/RelaxationPTMu.cpp b/src/Relaxations/RelaxationPTMu.cpp index 9d562efa..ab33f027 100644 --- a/src/Relaxations/RelaxationPTMu.cpp +++ b/src/Relaxations/RelaxationPTMu.cpp @@ -34,14 +34,25 @@ using namespace tinyxml2; //*********************************************************************** -RelaxationPTMu::RelaxationPTMu(XMLElement* element, std::string fileName) +RelaxationPTMu::RelaxationPTMu(XMLElement* element, std::vector const& nameEOS, std::string fileName) { - XMLElement* sousElement(element->FirstChildElement("dataPTMu")); - if (sousElement == NULL) throw ErrorXMLElement("dataPTMu", fileName, __FILE__, __LINE__); - //Collecting attributes - //--------------------- - m_liq = 0; - m_vap = 1; + XMLElement* subElement(element->FirstChildElement("dataPTMu")); + if (subElement == NULL) throw ErrorXMLElement("dataPTMu", fileName, __FILE__, __LINE__); + + //Collecting attributes + //--------------------- + std::string liqEosName(subElement->Attribute("liquid")); + if (liqEosName == "") throw ErrorXMLAttribut("liquid", fileName, __FILE__, __LINE__); + std::string vapEosName(subElement->Attribute("vapor")); + if (vapEosName == "") throw ErrorXMLAttribut("vapor", fileName, __FILE__, __LINE__); + + if (nameEOS.size() > 2) throw ErrorXMLMessage("Only two phases can be used with PTMu relaxation", fileName, __FILE__, __LINE__); + + for (unsigned int k = 0; k < nameEOS.size(); k++) { + if (nameEOS[k] == liqEosName) { m_liq = k; } + else if (nameEOS[k] == vapEosName) { m_vap = k; } + else { throw ErrorXMLElement("dataPTMu", fileName, __FILE__, __LINE__); } + } } //*********************************************************************** @@ -50,98 +61,140 @@ RelaxationPTMu::~RelaxationPTMu(){} //*********************************************************************** +void RelaxationPTMu::initializeCriticalPressure(Cell *cell) +{ + m_pcrit = cell->getMixture()->computeCriticalPressure( + cell->getPhase(m_liq)->getEos(), cell->getPhase(m_vap)->getEos() + ); +} + +//*********************************************************************** + void RelaxationPTMu::relaxation(Cell* cell, const double& /*dt*/, Prim type) { - Phase* phase(0); - - if (numberPhases > 2) errors.push_back(Errors("More than 2-phase calculation with evaporation not implemented in RelaxationPTMu::relaxation", __FILE__, __LINE__)); - - //Initial state - double pStar(0.), Tsat; - for (int k = 0; k < numberPhases; k++) - { - phase = cell->getPhase(k, type); - TB->ak[k] = phase->getAlpha(); - TB->pk[k] = phase->getPressure(); - TB->rhok[k] = phase->getDensity(); - pStar += TB->ak[k] * TB->pk[k]; - //phase->verifyPhase(); - } - //cell->extendedCalculus(); - double rho = cell->getMixture()->getDensity(); - double rhoe = rho * cell->getMixture()->getEnergy(); - - //Saturation temperature determination - double dTsat(0.); - Tsat = cell->getMixture()->computeTsat(cell->getPhase(m_liq)->getEos(), cell->getPhase(m_vap)->getEos(), pStar, &dTsat); - - //evap or not? - double TL = TB->eos[m_liq]->computeTemperature(TB->rhok[m_liq], pStar); - double TV = TB->eos[m_vap]->computeTemperature(TB->rhok[m_vap], pStar); - //if (TB->ak[m_liq] < 1.e-6) return; - //if (TB->ak[m_vap] < 1.e-6) return; - //if (TL < Tsat) return; - - //Iterative process for relaxed pressure determination - double rhoLSat, rhoVSat, drhoLSat, drhoVSat; - double aLSat, aVSat, daLSat, daVSat; - double rhoeLSat, rhoeVSat, drhoeLSat, drhoeVSat; - int iteration(0); - double f(0.), df(1.); - do { - pStar -= f / df; iteration++; - if (iteration > 50) { - errors.push_back(Errors("Number of iterations too large in relaxPTMu", __FILE__, __LINE__)); - std::cout << "info cell problematic" << std::endl; - std::cout << "Liq " << TL << " " << TB->rhok[m_liq] << " " << cell->getMixture()->getPressure() << std::endl; - std::cout << "Vap " << TV << " " << TB->rhok[m_vap] << " " << cell->getMixture()->getPressure() << std::endl; - std::cout << Tsat << " " << pStar << std::endl; - break; - } - //Physical pressure? - for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(pStar); } - //Liquid-vapor densities calculus - Tsat = cell->getMixture()->computeTsat(cell->getPhase(m_liq)->getEos(), cell->getPhase(m_vap)->getEos(), pStar, &dTsat); - rhoLSat = TB->eos[m_liq]->computeDensitySaturation(pStar, Tsat, dTsat, &drhoLSat); - rhoVSat = TB->eos[m_vap]->computeDensitySaturation(pStar, Tsat, dTsat, &drhoVSat); - //limit values - if (rhoLSat <= rho) { - rhoLSat = rho + 1e-6; - drhoLSat = 0.; - } - if (rhoVSat >= rho) { - rhoVSat = rho - 1e-6; - drhoVSat = 0.; - } - //Liquid-vapor volume fraction calculus - aLSat = (rho - rhoVSat) / (rhoLSat - rhoVSat); - daLSat = (-drhoVSat * (rhoLSat - rhoVSat) - (rho - rhoVSat)*(drhoLSat - drhoVSat)) / ((rhoLSat - rhoVSat)*(rhoLSat - rhoVSat)); - //limit values - if (aLSat <= 0.) aLSat = 1e-8; - if (aLSat >= 1.) aLSat = 1. - 1e-8; - aVSat = 1. - aLSat; - daVSat = -daLSat; - - f = rhoe; df = 0.; - //Liquid-vapor couple only - rhoeLSat = TB->eos[m_liq]->computeDensityEnergySaturation(pStar, rhoLSat, drhoLSat, &drhoeLSat); - rhoeVSat = TB->eos[m_vap]->computeDensityEnergySaturation(pStar, rhoVSat, drhoVSat, &drhoeVSat); - f -= (aLSat*rhoeLSat + aVSat * rhoeVSat); - df -= (daLSat*rhoeLSat + aLSat * drhoeLSat + daVSat * rhoeVSat + aVSat * drhoeVSat); - f /= rhoe; - df /= rhoe; - } while (std::fabs(f) > 1e-10); - - //Cell update - phase = cell->getPhase(m_liq); - phase->setAlpha(aLSat); - phase->setDensity(rhoLSat); - phase->setPressure(pStar); - - phase = cell->getPhase(m_vap); - phase->setAlpha(aVSat); - phase->setDensity(rhoVSat); - phase->setPressure(pStar); - - cell->fulfillState(); -} \ No newline at end of file + Phase* phase(0); + + if (numberPhases > 2) { + errors.push_back(Errors("More than 2-phase calculation with evaporation not implemented in RelaxationPTMu::relaxation", __FILE__, __LINE__)); + } + + //Initial state + double pStar(0.), Tsat; + for (int k = 0; k < numberPhases; k++) + { + phase = cell->getPhase(k, type); + TB->ak[k] = phase->getAlpha(); + TB->Yk[k] = phase->getMassFraction(); + TB->pk[k] = phase->getPressure(); + TB->rhok[k] = phase->getDensity(); + pStar += TB->ak[k] * TB->pk[k]; + //phase->verifyPhase(); + } + if (pStar > m_pcrit) { + warnings.push_back(Errors("Pressure higher than critical pressure in relaxPTMu", __FILE__, __LINE__)); + return; + } + //cell->extendedCalculus(numberPhases); + double rho = cell->getMixture(type)->getDensity(); + double rhoe = rho * cell->getMixture(type)->getEnergy(); + double dTsat(0.); + + // Pure vapor hypothesis + double rhov, ev, pv, Tv; + rhov = cell->getMixture(type)->getDensity(); + ev = cell->getMixture(type)->getEnergy(); + pv = cell->getPhase(m_vap, type)->getEos()->computePressure(rhov, ev); + Tv = cell->getPhase(m_vap, type)->getEos()->computeTemperature(rhov, pv); + + if (pv > 0) { + Tsat = cell->getMixture(type)->computeTsat(cell->getPhase(m_liq, type)->getEos(), cell->getPhase(m_vap, type)->getEos(), pv, &dTsat); + if (Tv >= Tsat) { + // Hypothesis verified + cell->getPhase(m_vap, type)->setAlpha(1.); + cell->getPhase(m_liq, type)->setAlpha(0.); + cell->getPhase(m_vap, type)->setDensity(rhov); + + cell->getPhase(m_vap, type)->setEnergy(ev); + cell->getPhase(m_vap, type)->setPressure(pv); + cell->fulfillState(type); + return; + } + } + + // Pure liquid hypothesis + double rhol, el, pl, Tl; + rhol = cell->getMixture(type)->getDensity(); + el = cell->getMixture(type)->getEnergy(); + pl = cell->getPhase(m_liq, type)->getEos()->computePressure(rhol, el); + Tl = cell->getPhase(m_liq, type)->getEos()->computeTemperature(rhol, pl); + + if (pl > 0.) { + Tsat = cell->getMixture(type)->computeTsat(cell->getPhase(m_liq, type)->getEos(), cell->getPhase(m_vap, type)->getEos(), pl, &dTsat); + if (Tl <= Tsat) { + // Hypothesis verified + cell->getPhase(m_liq, type)->setAlpha(1.); + cell->getPhase(m_vap, type)->setAlpha(0.); + cell->getPhase(m_liq, type)->setDensity(rhol); + + cell->getPhase(m_liq, type)->setEnergy(el); + cell->getPhase(m_liq, type)->setPressure(pl); + cell->fulfillState(type); + return; + } + } + + //Iterative process for relaxed state determination + double rhoLSat, rhoVSat, drhoLSat, drhoVSat; + double aLSat, aVSat, daLSat, daVSat; + double rhoeLSat, rhoeVSat, drhoeLSat, drhoeVSat; + int iteration(0); + double f(0.), df(1.); + do { + pStar -= f / df; iteration++; + + if (iteration > 50) { + errors.push_back(Errors("Number of iterations too large in relaxPTMu", __FILE__, __LINE__)); + break; + } + + //Physical pressure? + for (int k = 0; k < numberPhases; k++) { TB->eos[k]->verifyAndModifyPressure(pStar); } + + //Liquid-vapor densities calculus using phases' EOS + Tsat = cell->getMixture(type)->computeTsat(cell->getPhase(m_liq, type)->getEos(), cell->getPhase(m_vap, type)->getEos(), pStar, &dTsat); + rhoLSat = TB->eos[m_liq]->computeDensitySaturation(pStar, Tsat, dTsat, &drhoLSat); + rhoVSat = TB->eos[m_vap]->computeDensitySaturation(pStar, Tsat, dTsat, &drhoVSat); + + //Liquid-vapor volume fraction calculus using mass conservation within a cell + aLSat = (rho - rhoVSat) / (rhoLSat - rhoVSat); + daLSat = (-drhoVSat * (rhoLSat - rhoVSat) - (rho - rhoVSat)*(drhoLSat - drhoVSat)) / ((rhoLSat - rhoVSat)*(rhoLSat - rhoVSat)); + aVSat = 1. - aLSat; + daVSat = -daLSat; + + f = rhoe; df = 0.; + rhoeLSat = TB->eos[m_liq]->computeDensityEnergySaturation(pStar, rhoLSat, drhoLSat, &drhoeLSat); + rhoeVSat = TB->eos[m_vap]->computeDensityEnergySaturation(pStar, rhoVSat, drhoVSat, &drhoeVSat); + + // Iterative process based on energy conservation within a cell + f -= (aLSat*rhoeLSat + aVSat * rhoeVSat); + df -= (daLSat*rhoeLSat + aLSat * drhoeLSat + daVSat * rhoeVSat + aVSat * drhoeVSat); + f /= rhoe; + df /= rhoe; + } while (std::fabs(f) > 1e-10); + + //Cell update + phase = cell->getPhase(m_liq, type); + phase->setAlpha(aLSat); + phase->setDensity(rhoLSat); + phase->setPressure(pStar); + + phase = cell->getPhase(m_vap, type); + phase->setAlpha(aVSat); + phase->setDensity(rhoVSat); + phase->setPressure(pStar); + + cell->fulfillState(type); +} + +//*********************************************************************** + diff --git a/src/Relaxations/RelaxationPTMu.h b/src/Relaxations/RelaxationPTMu.h index 652d73f2..13ccbb85 100644 --- a/src/Relaxations/RelaxationPTMu.h +++ b/src/Relaxations/RelaxationPTMu.h @@ -32,6 +32,7 @@ #define RELAXATIONPTMU_H #include "Relaxation.h" +#include "../libTierces/LSODA.h" //! \class RelaxationPTMu //! \brief Pressure-Temperature-Chemical Potential relaxation / Phase change @@ -43,12 +44,18 @@ class RelaxationPTMu : public Relaxation //! ex: //! \param element XML element to read for source term //! \param fileName string name of readed XML file - RelaxationPTMu(tinyxml2::XMLElement* element, std::string fileName = "Unknown file"); + RelaxationPTMu(tinyxml2::XMLElement* element, std::vector const& nameEOS, std::string fileName = "Unknown file"); virtual ~RelaxationPTMu(); + //! \brief Initialize the theoritical critical pressure of the fluid + //! \param cell cell to get the eos + //! \param numberPhases number of phases + virtual void initializeCriticalPressure(Cell *cell); + //! \brief Stiff Thermo-Chemical relaxation method //! \details call for this method computes the thermodyanmical equilibrium state in a given cell for a liquid and its vapor. Relaxed state is stored depending on the type enum //! \param cell cell to relax + //! \param dt time step (not used here) //! \param type enumeration allowing to relax either state in the cell or second order half time step state virtual void relaxation(Cell* cell, const double& /*dt*/, Prim type = vecPhases); @@ -56,8 +63,9 @@ class RelaxationPTMu : public Relaxation virtual int getType() const { return PTMU; } private: - int m_liq; //!< Liquid phase number for phase change - int m_vap; //!< Vapor phase number for phase change + int m_liq; //!< Liquid phase number for phase change + int m_vap; //!< Vapor phase number for phase change + double m_pcrit; //!< Theoritical critical pressure of the fluid }; #endif // RELAXATIONPTMU_H diff --git a/src/Run.cpp b/src/Run.cpp index 5aafcf0e..70ca2bb4 100644 --- a/src/Run.cpp +++ b/src/Run.cpp @@ -34,9 +34,9 @@ using namespace tinyxml2; //*********************************************************************** -Run::Run(std::string nameCasTest, const int& number) : m_numTest(number), m_simulationName(nameCasTest), m_numberEos(0), - m_numberTransports(0), m_MRF(-1), m_smoothCrossSection1d(false), m_dt(1.e-15), m_physicalTime(0.), m_iteration(0), - m_restartSimulation(0), m_restartAMRsaveFreq(0) +Run::Run(std::string nameCasTest, const int& number) : m_numTest(number), m_simulationName(nameCasTest), m_numberSolids(0), + m_numberEos(0), m_numberTransports(0), m_MRF(-1), m_viscous(false), m_extractRefLength(false), m_smoothCrossSection1d(false), m_dt(1.e-15), + m_physicalTime(0.), m_iteration(0), m_restartSimulation(0), m_restartAMRsaveFreq(0), m_recordPsat(false) { m_mesh = nullptr; m_model = nullptr; @@ -53,6 +53,10 @@ Run::Run(std::string nameCasTest, const int& number) : m_numTest(number), m_simu m_input = nullptr; m_outPut = nullptr; + // Specific for simulation restart with mesh mapping + m_outputMeshMapping = nullptr; + m_restartMeshMapping = false; + m_stat.initialize(); } @@ -71,10 +75,12 @@ void Run::initialize() std::vector boundCond; try { m_input = new Input(this); - m_input->readInputXML(domains, boundCond); + m_input->readInputXML(domains, boundCond, m_solidDomains); + // Copy input files to simulation result folder + m_outPut->copyInputFiles(); } - catch (ErrorXML &) { throw; } - TB = new Tools(m_numberPhases, m_numberTransports); + catch (ErrorInput &) { throw; } + TB = new Tools(m_numberPhases, m_numberSolids, m_numberTransports); //2) Initialization of parallel computing (also needed for 1 CPU) //--------------------------------------------------------------- @@ -86,7 +92,7 @@ void Run::initialize() //3) Mesh data initialization //--------------------------- - m_mesh->attributLimites(boundCond); + m_mesh->assignLimits(boundCond); m_cellsLvl = new TypeMeshContainer[m_lvlMax + 1]; m_cellsLvlGhost = new TypeMeshContainer[m_lvlMax + 1]; m_cellInterfacesLvl = new TypeMeshContainer[m_lvlMax + 1]; @@ -96,19 +102,23 @@ void Run::initialize() if (rankCpu == 0) std::cout << "T" << m_numTest << " | Restarting simulation from result file number: " << m_restartSimulation << "..." << std::endl; m_outPut->readInfos(); if (m_mesh->getType() == AMR) { + m_stat.startAMRTime(); if (m_restartSimulation % m_restartAMRsaveFreq == 0) { m_outPut->readDomainDecompostion(m_mesh); } else { Errors::errorMessage("Run::restartSimulation: Restart files not available"); } + m_stat.endAMRTime(); } } else { Errors::errorMessage("Run::restartSimulation: Restart option only available for XML output"); } } + if (m_mesh->getType() == AMR) m_stat.startAMRTime(); m_dimension = m_mesh->initializeGeometrie(m_cellsLvl[0], m_cellsLvlGhost[0], m_cellInterfacesLvl[0], m_restartSimulation, m_parallelPreTreatment, m_order); + if (m_mesh->getType() == AMR) m_stat.endAMRTime(); } catch (ErrorECOGEN &) { throw; } @@ -124,31 +134,48 @@ void Run::initialize() for (unsigned int i = 0; i < m_cellsLvlGhost[0].size(); i++) { m_cellsLvlGhost[0][i]->fill(domains, m_lvlMax); } //EOS filling m_cellsLvl[0][0]->allocateEos(); + //Initialize relaxation + m_model->initializeRelaxation(m_cellsLvl[0][0]); //Complete fluid state with additional calculations (sound speed, energies, mixture variables, etc.) for (unsigned int i = 0; i < m_cellsLvl[0].size(); i++) { m_cellsLvl[0][i]->completeFulfillState(); } //6) Allocate Sloped and buffer Cells for Riemann problems //-------------------------------------------------------- int allocateSlopeLocal = 0; - for (int i = 0; i < m_mesh->getNumberFaces(); i++) { m_cellInterfacesLvl[0][i]->allocateSlopes(allocateSlopeLocal); } + for (unsigned int i = 0; i < m_cellInterfacesLvl[0].size(); i++) { m_cellInterfacesLvl[0][i]->allocateSlopes(allocateSlopeLocal); } bufferCellLeft = new Cell; bufferCellRight = new Cell; bufferCellLeft->allocate(m_addPhys); bufferCellRight->allocate(m_addPhys); domains[0]->fillIn(bufferCellLeft); domains[0]->fillIn(bufferCellRight); + m_cellsLvl[0][0]->allocateSecondOrderBuffersAndGradientVectors(bufferCellLeft->getPhases(), bufferCellLeft->getMixture()); //Only for O2NS + + //7) Set immersed boundaries + //-------------------------- + m_mesh->setImmersedBoundaries(m_cellInterfacesLvl, m_order); - //7) Intialization of persistant communications for parallel computing + //8) Intialization of persistant communications for parallel computing //-------------------------------------------------------------------- m_mesh->initializePersistentCommunications(m_cellsLvl[0], m_order); if (Ncpu > 1) { parallel.communicationsPrimitives(m_eos, 0); } - - //8) AMR initialization + + //9) AMR initialization //--------------------- - m_mesh->procedureRaffinementInitialization(m_cellsLvl, m_cellsLvlGhost, m_cellInterfacesLvl, m_addPhys, m_nbCellsTotalAMR, domains, m_eos, m_restartSimulation, m_order); + if (m_mesh->getType() == AMR) m_stat.startAMRTime(); + m_mesh->procedureRaffinementInitialization(m_cellsLvl, m_cellsLvlGhost, m_cellInterfacesLvl, m_addPhys, m_nbCellsTotalAMR, domains, m_eos, m_restartSimulation, m_order, m_solidDomains); + if (m_mesh->getType() == AMR) m_stat.endAMRTime(); - for (unsigned int d = 0; d < domains.size(); d++) { delete domains[d]; } + //10) Initialize MRF Riemann coupling + //---------------------------------- + if (m_MRF != -1) { + if (m_sources[m_MRF]->getRiemannCoupling() != false) { + for (unsigned int i = 0; i < m_cellInterfacesLvl[0].size(); i++) { + m_cellInterfacesLvl[0][i]->checkMrfInterface(m_sources[m_MRF]); + } + } + } - //9) Output file preparation + //11) Output file preparation //-------------------------- m_outPut->initializeOutput(*bufferCellLeft); for (unsigned int c = 0; c < m_cuts.size(); c++) m_cuts[c]->initializeOutput(*bufferCellLeft); @@ -156,14 +183,28 @@ void Run::initialize() for (unsigned int g = 0; g < m_globalQuantities.size(); g++) m_globalQuantities[g]->initializeOutput(*bufferCellLeft); for (unsigned int b = 0; b < m_recordBoundaries.size(); b++) m_recordBoundaries[b]->initializeOutput(m_cellInterfacesLvl); - //10) Restart simulation + //12) Restart simulation //---------------------- if (m_restartSimulation > 0) { - try { this->restartSimulation(); } + try { + this->restartSimulation(); + } catch (ErrorECOGEN &) { throw; } } + + //13) Mesh mapping restart + //------------------------ + if (m_restartMeshMapping) { + try { + this->restartSimulationMeshMapping(domains, m_mesh); + MPI_Barrier(MPI_COMM_WORLD); + } + catch (ErrorECOGEN &) { throw; } + } + + for (unsigned int d = 0; d < domains.size(); d++) { delete domains[d]; } - //11) Printing t0 solution + //14) Printing t0 solution //------------------------ if (m_restartSimulation == 0) { try { @@ -175,6 +216,7 @@ void Run::initialize() // m_volumePhaseK = 0.; // for (unsigned int c = 0; c < m_cellsLvl[0].size(); c++) { m_cellsLvl[0][c]->computeVolumePhaseK(m_volumePhaseK, phase); } // if (Ncpu > 1) { parallel.computeSum(m_volumePhaseK); } + // // m_volumePhaseK = std::pow(m_volumePhaseK, 1./3.); //m_pMax = new double[4]; //m_pMaxWall = new double[4]; //m_pMax[0] = 0.; @@ -190,7 +232,7 @@ void Run::initialize() //----- m_outPut->initializeOutputInfos(); if (rankCpu == 0) m_outPut->writeInfos(); - m_outPut->saveInfosMailles(); + m_outPut->saveInfoCells(); if (m_mesh->getType() == AMR) m_outPut->printTree(m_mesh, m_cellsLvl, m_restartAMRsaveFreq); for (unsigned int c = 0; c < m_cuts.size(); c++) m_cuts[c]->writeResults(m_mesh, m_cellsLvl); for (unsigned int p = 0; p < m_probes.size(); p++) { if (m_probes[p]->possesses()) m_probes[p]->writeResults(m_mesh, m_cellsLvl); } @@ -205,10 +247,103 @@ void Run::initialize() //*********************************************************************** -void Run::restartSimulation() +void Run::restartSimulationMeshMapping(std::vector &domains, Mesh* mesh) { - std::ifstream fileStream; + // Get the number of CPUs + int nbCpusPrevious(m_outputMeshMapping->readNbCpu()); + // Output init. required to set ref. cell used for results reading + m_outputMeshMapping->initializeOutputMeshMapping(*bufferCellLeft); + + // Store dist. between cells -> to avoid min. dist. of each partition + // Set big value to ensure that a lower distance is found + std::vector distMin(m_cellsLvl[0].size(), 1.e10); + + // Define prefix mesh filename + std::string meshExtension(mesh->getMeshExtension()); + bool mappedMeshIsSeq(true); + if (nbCpusPrevious != 1) { + // Remove mesh file extension to add 'CPU' prefix + m_meshFileMapped.resize(m_meshFileMapped.size() - meshExtension.size() - 1); + mappedMeshIsSeq = false; + } + + // Each cpu of new run builds the previous run mesh + for (int cpu = 0; cpu < nbCpusPrevious; cpu++) { + // Build array of cells for rough mesh + TypeMeshContainer *cellsLvlMeshMapped; + cellsLvlMeshMapped = new TypeMeshContainer[m_lvlMax + 1]; + + // Build mesh of each cpu on the fly + std::string filenameCpuMesh(m_meshFileMapped); + if (!mappedMeshIsSeq) { + filenameCpuMesh += "_CPU" + IO::toString(cpu) + ".msh"; + } + Mesh *meshMapped = new MUSGmshV2(filenameCpuMesh, meshExtension); + + // Read the mesh to build the list of of nodes and elements + // Attribute cells to elements but no need to define faces + if (!mappedMeshIsSeq) { + meshMapped->initCpuMeshParallel(cellsLvlMeshMapped[0], this->m_order, cpu); + } + else { + meshMapped->initCpuMeshSequential(cellsLvlMeshMapped[0], this->m_order); + } + + // Set phases, mixture etc. to cell according to the model + for (auto cell : cellsLvlMeshMapped[0]) { cell->allocate(m_addPhys); } + // Filling cell is required to set proper EOS to mesh mapped cells and avoid nullptr during cell copy + for (auto cell : cellsLvlMeshMapped[0]) { cell->fill(domains, m_lvlMax); } + + // Read results of rough mesh simulation + m_outputMeshMapping->readResultsCpu(meshMapped, cellsLvlMeshMapped, cpu); + + // Mapping value rough mesh to fine one + double distCells(0.); + int indexNearestCell(0); + // Find nearest cell in rough mesh + for (unsigned int i = 0; i < m_cellsLvl[0].size(); i++) { + // Be careful to not copy state of nearest cell in partition in case it is not + // the nearest in the all old mesh + indexNearestCell = -1; + + for (unsigned int j = 0; j < cellsLvlMeshMapped[0].size(); j++) { + distCells = m_cellsLvl[0][i]->distance(cellsLvlMeshMapped[0][j]); + if (distMin[i] > distCells) { + distMin[i] = distCells; + indexNearestCell = j; + } + } + + // Copy only if cell is the nearest in the current partition and the previous ones + if (indexNearestCell >= 0) { + // Copy primitive state of rough cell to fine one + m_cellsLvl[0][i]->copyVec( + cellsLvlMeshMapped[0][indexNearestCell]->getPhases(), + cellsLvlMeshMapped[0][indexNearestCell]->getMixture(), + cellsLvlMeshMapped[0][indexNearestCell]->getTransports() + ); + // Fill cell state + m_cellsLvl[0][i]->fulfillStateRestart(); + m_cellsLvl[0][i]->completeFulfillState(); + } + + } + + //Deallocation of rough mesh + if (cellsLvlMeshMapped != nullptr) { + for (auto cell : cellsLvlMeshMapped[0]) { delete cell; } + } + delete[] cellsLvlMeshMapped; + delete meshMapped; + } + delete m_outputMeshMapping; +} + +//*********************************************************************** + +void Run::restartSimulation() +{ //Reconstruct the AMR mesh if any and get physical data from restart point try { if (m_mesh->getType() == AMR) { @@ -218,8 +353,7 @@ void Run::restartSimulation() } m_outPut->readResults(m_mesh, m_cellsLvl); } - catch (ErrorECOGEN &) { fileStream.close(); throw; } - fileStream.close(); + catch (ErrorECOGEN &) { throw; } //Communicate physical data between processors and complete fluid state with additional calculations (sound speed, energies, mixture variables, etc.) for (int lvl = 0; lvl <= m_lvlMax; lvl++) { @@ -277,13 +411,14 @@ void Run::solver() //Still alive... if (m_iteration !=0 && m_iteration % 1000 == 0 && rankCpu == 0) { - std::cout << "T" << m_numTest << " | Iteration " << m_iteration << " / Timestep " << m_dt << " / Progress " << m_physicalTime / m_finalPhysicalTime * 100. << "%" << std::endl; + m_outPut->writeProgress(); } m_physicalTime += m_dt; + TB->physicalTime = m_physicalTime; m_iteration++; //Managing output files printing / End of time iterative loop - if (m_controleIterations) { + if (m_timeControlIterations) { if (m_iteration%m_freq == 0) { print = true; } if (m_iteration >= m_nbIte) { computeFini = true; } } @@ -312,6 +447,7 @@ void Run::solver() // m_volumePhaseK = 0.; // for (unsigned int c = 0; c < m_cellsLvl[0].size(); c++) { m_cellsLvl[0][c]->computeVolumePhaseK(m_volumePhaseK, phase); } // if (Ncpu > 1) { parallel.computeSum(m_volumePhaseK); } + // // m_volumePhaseK = std::pow(m_volumePhaseK, 1./3.); //if (Ncpu > 1) { parallel.computePMax(m_pMax[0], m_pMaxWall[0]); } //m_pMax[0] = 0.; //m_pMaxWall[0] = 0.; @@ -326,7 +462,7 @@ void Run::solver() // if (m_alphaWanted < 1.e-10) m_alphaWanted = 0.; //----- if (rankCpu == 0) m_outPut->writeInfos(); - m_outPut->saveInfosMailles(); + m_outPut->saveInfoCells(); if (m_mesh->getType() == AMR) m_outPut->printTree(m_mesh, m_cellsLvl, m_restartAMRsaveFreq); for (unsigned int c = 0; c < m_cuts.size(); c++) { m_cuts[c]->writeResults(m_mesh, m_cellsLvl); } for (unsigned int g = 0; g < m_globalQuantities.size(); g++) { m_globalQuantities[g]->writeResults(m_mesh, m_cellsLvl); } @@ -367,7 +503,7 @@ void Run::integrationProcedure(double& dt, int lvl, double& dtMax, int& nbCellsT { //1) AMR Level time step determination double dtLvl = dt * std::pow(2., -(double)lvl); - + //2) Refinement procedure if (m_lvlMax > 0) { m_stat.startAMRTime(); @@ -375,7 +511,7 @@ void Run::integrationProcedure(double& dt, int lvl, double& dtMax, int& nbCellsT if (Ncpu > 1) { if (lvl == 0) { if (m_iteration % (static_cast(1./m_cfl/0.6) + 1) == 0) { - m_mesh->parallelLoadBalancingAMR(m_cellsLvl, m_cellsLvlGhost, m_cellInterfacesLvl, m_order, m_addPhys, m_eos, nbCellsTotalAMR); + m_mesh->parallelLoadBalancingAMR(m_cellsLvl, m_cellsLvlGhost, m_cellInterfacesLvl, m_order, m_addPhys, m_eos, nbCellsTotalAMR, m_solidDomains); for (unsigned int p = 0; p < m_probes.size(); p++) { m_probes[p]->locateProbeInMesh(m_cellsLvl[0], m_mesh->getNumberCells()); //Locate new probes CPU after Load Balancing } @@ -388,7 +524,21 @@ void Run::integrationProcedure(double& dt, int lvl, double& dtMax, int& nbCellsT //3) Slopes determination for second order and gradients for additional physics //Fait ici pour avoir une mise a jour d'effectuer lors de l'execution de la procedure de niveau lvl+1 (donc pour les slopes plus besoin de les faire au debut de resolHyperboliqueO2) if (m_order == "SECONDORDER") { - for (unsigned int i = 0; i < m_cellInterfacesLvl[lvl].size(); i++) { if (!m_cellInterfacesLvl[lvl][i]->getSplit()) { m_cellInterfacesLvl[lvl][i]->computeSlopes(); } } + if (m_mesh->getType() != TypeM::UNS) { + for (unsigned int i = 0; i < m_cellInterfacesLvl[lvl].size(); i++) { + if (!m_cellInterfacesLvl[lvl][i]->getSplit()) { + m_cellInterfacesLvl[lvl][i]->computeSlopes(); + } + } + } + else { + for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { + if (!m_cellsLvl[lvl][i]->getSplit()) { + m_cellsLvl[lvl][i]->computeGradientsO2(); + m_cellsLvl[lvl][i]->limitGradientsO2(*m_globalLimiter); + } + } + } if (Ncpu > 1) { m_stat.startCommunicationTime(); parallel.communicationsSlopes(lvl); @@ -440,7 +590,7 @@ void Run::advancingProcedure(double& dt, int& lvl, double& dtMax) //3) Source terms integration before relaxations if (m_numberSources) this->solveSourceTerms(dt, lvl); //4) Relaxations to equilibria - if (m_numberPhases > 1) this->solveRelaxations(dt, lvl); + if (m_model->getRelaxations()->size() > 0) this->solveRelaxations(dt, lvl); //5) Averaging childs cells in mother cell (if AMR) if (lvl < m_lvlMax) { for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { m_cellsLvl[lvl][i]->averageChildrenInParent(); } } //6) Final communications @@ -453,10 +603,12 @@ void Run::advancingProcedure(double& dt, int& lvl, double& dtMax) //----- //for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { m_cellsLvl[lvl][i]->lookForPmax(m_pMax, m_pMaxWall); } //Compute total energy of the simulation - // double totalEnergy(0.), internalEnergies(0.), momentum(0.); + // double totalEnergy(0.), internalEnergies(0.), compactionEnergies(0.), elasticEnergies(0.), momentum(0.); // for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { // for (int k = 0; k < m_numberPhases; k++) { // internalEnergies += m_cellsLvl[lvl][i]->getPhase(k)->getAlpha() * m_cellsLvl[lvl][i]->getPhase(k)->getDensity() * m_cellsLvl[lvl][i]->getPhase(k)->getEnergy(); + // compactionEnergies += m_cellsLvl[lvl][i]->getPhase(k)->getAlpha() * m_cellsLvl[lvl][i]->getPhase(k)->getDensity() * m_cellsLvl[lvl][i]->getPhase(k)->getEnergyCompaction(); + // elasticEnergies += m_cellsLvl[lvl][i]->getPhase(k)->getAlpha() * m_cellsLvl[lvl][i]->getPhase(k)->getDensity() * m_cellsLvl[lvl][i]->getPhase(k)->getEnergyElastic(); // } // momentum += 0.5 * m_cellsLvl[lvl][i]->getMixture()->getDensity() * m_cellsLvl[lvl][i]->getMixture()->getVelocity().squaredNorm(); // totalEnergy += m_cellsLvl[lvl][i]->getMixture()->getDensity() * m_cellsLvl[lvl][i]->getMixture()->getTotalEnergy(); @@ -464,7 +616,8 @@ void Run::advancingProcedure(double& dt, int& lvl, double& dtMax) // // totalEnergy = internalEnergies + momentum; // // std::cout << std::fixed; // // std::cout << std::setprecision(3) << "Total energy = " << totalEnergy << std::endl; - // std::cout << std::setprecision(15) << "Iter = " << m_iteration << " ; Total energy = " << totalEnergy << " / " << internalEnergies + momentum << std::endl; + // std::cout << std::setprecision(15) << "Iter = " << m_iteration << " ; Total energy = " << totalEnergy + // << " / " << internalEnergies + compactionEnergies + elasticEnergies + momentum << std::endl; // if (isnan(totalEnergy) || isnan(internalEnergies + momentum)) exit(0); //----- } @@ -480,7 +633,11 @@ void Run::solveHyperbolicO2(double& dt, int& lvl, double& dtMax) //2) Spatial second order scheme //------------------------------ //Fluxes are determined at each cells interfaces and stored in the m_cons variableof corresponding cells. Hyperbolic maximum time step determination - for (unsigned int i = 0; i < m_cellInterfacesLvl[lvl].size(); i++) { if (!m_cellInterfacesLvl[lvl][i]->getSplit()) { m_cellInterfacesLvl[lvl][i]->computeFlux(dtMax, *m_globalLimiter, *m_interfaceLimiter, *m_globalVolumeFractionLimiter, *m_interfaceVolumeFractionLimiter); } } + for (unsigned int i = 0; i < m_cellInterfacesLvl[lvl].size(); i++) { + if (!m_cellInterfacesLvl[lvl][i]->getSplit()) { + m_cellInterfacesLvl[lvl][i]->computeFlux(dtMax, *m_globalLimiter, *m_interfaceLimiter, *m_globalVolumeFractionLimiter, *m_interfaceVolumeFractionLimiter); + } + } //3)Prediction step using slopes //------------------------------ @@ -491,7 +648,7 @@ void Run::solveHyperbolicO2(double& dt, int& lvl, double& dtMax) //4) m_cons recovery for AMR/second order combination (substitute to setToZeroCons) //--------------------------------------------------------------------------------- - for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { if (!m_cellsLvl[lvl][i]->getSplit()) { m_cellsLvl[lvl][i]->recuperationCons(); } } + for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { if (!m_cellsLvl[lvl][i]->getSplit()) { m_cellsLvl[lvl][i]->getBackCons(); } } //5) vecPhasesO2 communications //----------------------------- @@ -503,12 +660,19 @@ void Run::solveHyperbolicO2(double& dt, int& lvl, double& dtMax) //6) Optional new slopes determination (improves code stability) //-------------------------------------------------------------- - for (unsigned int i = 0; i < m_cellInterfacesLvl[lvl].size(); i++) { if (!m_cellInterfacesLvl[lvl][i]->getSplit()) { m_cellInterfacesLvl[lvl][i]->computeSlopes(vecPhasesO2); } } - if (Ncpu > 1) { - m_stat.startCommunicationTime(); - parallel.communicationsSlopes(lvl); - if (lvl > 0) { parallel.communicationsSlopes(lvl - 1); } - m_stat.endCommunicationTime(); + // Slopes are updated only for O2 on cartesian grids + if (m_mesh->getType() != TypeM::UNS) { + for (unsigned int i = 0; i < m_cellInterfacesLvl[lvl].size(); i++) { + if (!m_cellInterfacesLvl[lvl][i]->getSplit()) { + m_cellInterfacesLvl[lvl][i]->computeSlopes(vecPhasesO2); + } + } + if (Ncpu > 1) { + m_stat.startCommunicationTime(); + parallel.communicationsSlopes(lvl); + if (lvl > 0) { parallel.communicationsSlopes(lvl - 1); } + m_stat.endCommunicationTime(); + } } //7) Spatial scheme on predicted variables @@ -571,7 +735,7 @@ void Run::solveAdditionalPhysics(double& dt, int& lvl) //2) Additional physics fluxes determination (Surface tensions, viscosity, conductivity, ...) //------------------------------------------------------------------------------------------- - //Calcul de la somme des flux des physiques additionnelles que l on stock dans m_cons de chaque cell + //Calcul de la sum des flux des physiques additionnelles que l on stock dans m_cons de chaque cell for (unsigned int pa = 0; pa < m_addPhys.size(); pa++) { for (unsigned int i = 0; i < m_cellInterfacesLvl[lvl].size(); i++) { if (!m_cellInterfacesLvl[lvl][i]->getSplit()) { m_cellInterfacesLvl[lvl][i]->computeFluxAddPhys(*m_addPhys[pa]); } } for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { if (!m_cellsLvl[lvl][i]->getSplit()) { m_cellsLvl[lvl][i]->addNonConsAddPhys(*m_addPhys[pa], m_symmetry); } } @@ -607,10 +771,10 @@ void Run::solveSourceTerms(double& dt, int& lvl) void Run::solveRelaxations(double& dt, int& lvl) { //Relaxations - for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { - if (!m_cellsLvl[lvl][i]->getSplit()) { - m_model->relaxations(m_cellsLvl[lvl][i], dt); - } + for (unsigned int i = 0; i < m_cellsLvl[lvl].size(); i++) { + if (!m_cellsLvl[lvl][i]->getSplit()) { + m_model->relaxations(m_cellsLvl[lvl][i], dt); + } } //Reset of colour function (transports) using volume fraction for (unsigned int pa = 0; pa < m_addPhys.size(); pa++) { @@ -635,7 +799,6 @@ void Run::solveRelaxations(double& dt, int& lvl) if (!m_cellsLvl[lvl][i]->getSplit()) { m_cellsLvl[lvl][i]->correctionEnergy(); //Correction of energies m_cellsLvl[lvl][i]->fulfillState(); - //if (m_evaporation) m_cellsLvl[lvl][i]->relaxPTMu(); //Relaxation des pressures, temperatures et potentiels chimiques //KS//FP// To implement dynamically } } } @@ -703,6 +866,19 @@ void Run::finalize() delete slopesMixtureLocal2; delete[] slopesTransportLocal1; delete[] slopesTransportLocal2; + + if (m_mesh->getType() == TypeM::UNS) { + for (int k = 0; k < m_numberPhases; k++) { delete buffPhasesMin[k]; } + for (int k = 0; k < m_numberPhases; k++) { delete buffPhasesMax[k]; } + delete[] buffPhasesMin; + delete[] buffPhasesMax; + delete buffMixtureMin; + delete buffMixtureMax; + if (buffTransportMin != nullptr) { + delete buffTransportMin; + delete buffTransportMax; + } + } } //Parallel desaloccations @@ -718,6 +894,7 @@ void Run::finalize() delete m_globalLimiter; delete m_interfaceLimiter; delete m_globalVolumeFractionLimiter; delete m_interfaceVolumeFractionLimiter; delete m_input; delete m_outPut; + for (unsigned int d = 0; d < m_solidDomains.size(); d++) { delete m_solidDomains[d]; } for (unsigned int c = 0; c < m_cuts.size(); c++) { delete m_cuts[c]; } for (unsigned int p = 0; p < m_probes.size(); p++) { delete m_probes[p]; } for (unsigned int g = 0; g < m_globalQuantities.size(); g++) { delete m_globalQuantities[g]; } diff --git a/src/Run.h b/src/Run.h index 14c125dd..cd8cbd68 100644 --- a/src/Run.h +++ b/src/Run.h @@ -75,6 +75,7 @@ class Run void finalize(); void restartSimulation(); + void restartSimulationMeshMapping(std::vector &domains, Mesh* mesh); //Accessors const int& getNumberPhases() const { return m_numberPhases; }; @@ -95,22 +96,26 @@ class Run //Input attributes std::string m_simulationName; //! m_solidDomains; //!QueryDoubleAttribute("tf", &m_tf); m_incr = 0.; } + + //Riemann coupling for MRF option (default = false) + //Note that the source must be applied only to a physical entity and not the whole domain (SRF) + sousElement = element->FirstChildElement("riemannCoupling"); + if (sousElement != NULL) { + error = sousElement->QueryBoolAttribute("state", &m_riemannCoupling); + if (error != XML_NO_ERROR) throw ErrorXMLAttribut("riemannCoupling", fileName, __FILE__, __LINE__); + } } //*********************************************************************** diff --git a/src/Sources/SourceNumMRF.h b/src/Sources/SourceNumMRF.h index 0ef23764..90e8e73c 100644 --- a/src/Sources/SourceNumMRF.h +++ b/src/Sources/SourceNumMRF.h @@ -51,10 +51,14 @@ class SourceNumMRF : public SourceNum virtual Coord computeAbsVelocity(const Coord& relVelocity, const Coord& position); + virtual Coord getOmega() { return m_omega; } + virtual bool getRiemannCoupling() { return m_riemannCoupling; } + private: - Coord m_omega; //!Angular velocity - double m_tf; //!Optional final time to increase linearly omega - double m_incr; //!To increment angular velocity from zero to omega + Coord m_omega; //!Angular velocity + double m_tf; //!Optional final time to increase linearly omega + double m_incr; //!To increment angular velocity from zero to omega + bool m_riemannCoupling; //!Option to set Riemann problem coupling between static and rotating region }; #endif //SOURCENUMMRF_H diff --git a/src/Tools.cpp b/src/Tools.cpp index abb51ed1..97706351 100644 --- a/src/Tools.cpp +++ b/src/Tools.cpp @@ -34,7 +34,7 @@ Tools *TB; //*********************************************************************** -Tools::Tools(const int& numbPhases, const int& numbTransports) +Tools::Tools(const int& numbPhases, const int& numbSolids, const int& numbTransports) { ak = new double[numbPhases]; Yk = new double[numbPhases]; @@ -56,8 +56,22 @@ Tools::Tools(const int& numbPhases, const int& numbTransports) eos = new Eos*[numbPhases]; Hk0 = new double[numbPhases]; Yk0 = new double[numbPhases]; + compactionPk = new double[numbPhases]; + dlambda = new double[numbPhases]; + dplast = new Tensor[numbPhases]; + alphaNull = new bool[numbPhases]; + relaxSolidPlast = new bool[numbPhases]; + + for (int k = 0; k < numbPhases; k++) { + compactionPk[k] = 0.; + alphaNull[k] = false; + relaxSolidPlast[k] = false; + } + + physicalTime = 0.; numberPhases = numbPhases; + numberSolids = numbSolids; numberTransports = numbTransports; } @@ -65,7 +79,7 @@ Tools::Tools(const int& numbPhases, const int& numbTransports) Tools::~Tools() { - if (ak!=0) delete[] ak; + if (ak != 0) delete[] ak; if (Yk != 0) delete[] Yk; if (rhok != 0) delete[] rhok; if (pk != 0) delete[] pk; @@ -83,9 +97,13 @@ Tools::~Tools() if (zk != 0) delete[] zk; if (rho_cIksquare != 0) delete[] rho_cIksquare; if (eos != 0) delete[] eos; - if (Hk0 != 0) delete[] Hk0; if (Yk0 != 0) delete[] Yk0; + if (compactionPk != 0) delete[] compactionPk; + if (dlambda != 0) delete[] dlambda; + if (dplast != 0) delete[] dplast; + if (alphaNull != 0) delete[] alphaNull; + if (relaxSolidPlast != 0) delete[] relaxSolidPlast; } //*********************************************************************** diff --git a/src/Tools.h b/src/Tools.h index 174e2172..f026c929 100644 --- a/src/Tools.h +++ b/src/Tools.h @@ -53,8 +53,8 @@ enum TypeData { FLOAT, DOUBLE, INT, CHAR }; //! \brief Enumeration for the type of geometric object (VERTEX, LINE, PLAN) enum TypeGO { VERTEX, LINE, PLAN }; -//! \brief Enumeration for the type of boundary (INJ, NONREFLECTING, OUTFLOW, SUBINJ, SYMMETRY, TANK, WALL, NULLFLUX) -enum TypeBC { INJ = 4, NONREFLECTING = 1, OUTFLOW = 3, SUBINJ = 7, SYMMETRY = 6, TANK = 5, WALL = 2, NULLFLUX = 8 }; +//! \brief Enumeration for the type of boundary +enum TypeBC { NONREFLECTING = 1, WALL = 2, OUTLETPRESSURE = 3, INLETINJSTAGSTATE = 4, INLETTANK = 5, SYMMETRY = 6, INLETINJTEMP = 7, NULLFLUX = 8, OUTLETMASSFLOW = 9, PISTON = 10 }; //! \brief Enumeration for the variable to extract on a boundary enum VarBoundary { p, rho, velU, velV, velW, SIZE = (velW+1) }; @@ -68,6 +68,16 @@ enum TypeRelax { P = 1, PT = 2, PTMU = 3 }; //! \brief Enumeration for the gradient method (Finite-Difference (FD), Green-Gauss (GG)) enum TypeGrad { FD, GG }; +//! \brief Enumeration for the phase index of a liquid/vapor couple +enum PhaseType { LIQ = 0, VAP = 1 }; + +//! \brief Enumeration for the type of second order limiter (NS only) +enum LimiterType { NONE = 0, MINMOD = 1, SUPERBEE = 2 }; + +//! \brief Enumeration for the flow variables +enum class Variable { transport, pressure, density, alpha, velocityMag, velocityU, velocityV, velocityW, temperature, QPA, lambda, + cobaseXX, cobaseXY, cobaseXZ, cobaseYX, cobaseYY, cobaseYZ, cobaseZX, cobaseZY, cobaseZZ }; + //! \brief Template for the type of the mesh container (std::list for now, but may change to something else if wanted) template using TypeMeshContainer=std::vector; @@ -84,8 +94,9 @@ class Tools public: //! \brief Generic model constructor //! \param numbPhases number of phases + //! \param numbSolids number of solid phases //! \param numberTransports number of additional transport equations - Tools(const int& numbPhases, const int& numbTransports); + Tools(const int& numbPhases, const int& numbSolids, const int& numbTransports); ~Tools(); //! \brief Modify the string of characters to uppercase it @@ -124,12 +135,19 @@ class Tools Eos** eos; double* Hk0; double* Yk0; + double* compactionPk; //!< Compaction pressure, one for each phase + double* dlambda; //!< Plastic compaction term, one for each phase + Tensor* dplast; //!< Plastic shear term, one for each phase + bool* alphaNull; //!< Parameter to know if we consider the volume fraction as null or not + bool* relaxSolidPlast; //!< Parameter to know if we need the solid plastic relaxation static double uselessDouble; + double physicalTime; //!< Current physical time }; extern Tools *TB; extern int numberPhases; +extern int numberSolids; extern int numberTransports; diff --git a/src/Transport/GradTransport.cpp b/src/Transport/GradTransport.cpp new file mode 100644 index 00000000..9747b550 --- /dev/null +++ b/src/Transport/GradTransport.cpp @@ -0,0 +1,86 @@ +#include "GradTransport.h" +#include "../Order2/CellO2NS.h" + +std::vector variableNamesTransports; +std::vector> numeratorTransports; + +//*************************************************************************** + +GradTransport::GradTransport() : m_grads(1) +{ + m_grads[0] = 0.; +} + +//*************************************************************************** + +GradTransport::~GradTransport() +{ +} + +//*************************************************************************** + +void GradTransport::initializeGradientVectors() +{ + numeratorTransports.resize(numberTransports); + for (int i = 0; i < numberTransports; ++i) { + numeratorTransports[i].resize(m_grads.size()); + for (unsigned int j = 0; j < m_grads.size(); ++j) { + numeratorTransports[i][j] = i; + } + } + + variableNamesTransports.resize(m_grads.size()); + variableNamesTransports[0] = Variable::transport; +} + +//*************************************************************************** + +void GradTransport::computeGradient(Cell* cell, const int& numTransport) +{ + cell->computeGradients(m_grads, variableNamesTransports, numeratorTransports[numTransport]); +} + +//*************************************************************************** + +void GradTransport::computeDistanceGradientScalarProduct(Coord const& distance, double &transport) const +{ + transport = distance.scalar(m_grads[0]); +} + +//**************************************************************************** + +void GradTransport::limitGradients(const double& gradientLimiter) +{ + m_grads[0].setX(m_grads[0].getX() * gradientLimiter); + m_grads[0].setY(m_grads[0].getY() * gradientLimiter); + m_grads[0].setZ(m_grads[0].getZ() * gradientLimiter); +} + +//**************************************************************************** +//************************** ORDER 2 PARALLEL ******************************** +//**************************************************************************** + +int GradTransport::numberOfTransmittedGradients() const +{ + return 3; +} + +//*************************************************************************** + +void GradTransport::getBufferGradients(double * buffer, int& counter) +{ + m_grads[0].setX(buffer[++counter]); + m_grads[0].setY(buffer[++counter]); + m_grads[0].setZ(buffer[++counter]); +} + +//*************************************************************************** + +void GradTransport::fillBufferGradients(double * buffer, int& counter) +{ + buffer[++counter] = m_grads[0].getX(); + buffer[++counter] = m_grads[0].getY(); + buffer[++counter] = m_grads[0].getZ(); +} + +//*************************************************************************** \ No newline at end of file diff --git a/src/Transport/GradTransport.h b/src/Transport/GradTransport.h new file mode 100644 index 00000000..a04e8c5d --- /dev/null +++ b/src/Transport/GradTransport.h @@ -0,0 +1,65 @@ +// +// ,---. ,--, .---. ,--, ,---. .-. .-. +// | .-' .' .') / .-. ) .' .' | .-' | \| | +// | `-. | |(_) | | |(_) | | __ | `-. | | | +// | .-' \ \ | | | | \ \ ( _) | .-' | |\ | +// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)| +// /( __.' \____\ )---' )\____/ /( __.' /( (_) +// (__) (_) (__) (__) (__) +// Official webSite: https://code-mphi.github.io/ECOGEN/ +// +// This file is part of ECOGEN. +// +// ECOGEN is the legal property of its developers, whose names +// are listed in the copyright file included with this source +// distribution. +// +// ECOGEN is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation, either version 3 of the License, +// or (at your option) any later version. +// +// ECOGEN is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ECOGEN (file LICENSE). +// If not, see . + +#ifndef GRADTRANSPORT_H +#define GRADTRANSPORT_H + +#include "../Maths/Coord.h" +#include "../Tools.h" + +//! \class GradTransport +//! \brief Transport variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS) + +class Cell; + +class GradTransport +{ +public: + GradTransport(); + virtual ~GradTransport(); + + virtual void initializeGradientVectors(); + + virtual void computeGradient(Cell* cell, const int& numTransport); + virtual void computeDistanceGradientScalarProduct(Coord const& distance, double &transport) const; + virtual void limitGradients(const double& gradientLimiter); + + virtual int numberOfTransmittedGradients() const; + virtual void getBufferGradients(double * buffer, int& counter); + virtual void fillBufferGradients(double * buffer, int& counter); + +protected: + std::vector m_grads; //!< Gradient of the transport variable (size of 1) +}; + +extern std::vector variableNamesTransports; //!< Variable names of the corresponding gradients (for transports) +extern std::vector> numeratorTransports; //!< Numerator of the computed transport for gradients + +#endif \ No newline at end of file diff --git a/src/Transport/Transport.cpp b/src/Transport/Transport.cpp index c8da8a7b..dae81faa 100644 --- a/src/Transport/Transport.cpp +++ b/src/Transport/Transport.cpp @@ -67,7 +67,22 @@ void Transport::solveRiemannWall() //*********************************************************************** -void Transport::solveRiemannInflow(double transportLeft, double sM, double valueTransport) +void Transport::solveRiemannPiston(double transportLeft, double uPiston) +{ + m_value = transportLeft * uPiston; +} + +//*********************************************************************** + +void Transport::solveRiemannInletInjStagState(double transportLeft, double sM, double valueTransport) +{ + if (sM > 0.) { m_value = transportLeft*sM; } + else { m_value = valueTransport*sM; } +} + +//*********************************************************************** + +void Transport::solveRiemannInletInjTemp(double transportLeft, double sM, double valueTransport) { if (sM > 0.) { m_value = transportLeft*sM; } else { m_value = valueTransport*sM; } @@ -75,7 +90,7 @@ void Transport::solveRiemannInflow(double transportLeft, double sM, double value //*********************************************************************** -void Transport::solveRiemannTank(double transportLeft, double sM, double valueTransport) +void Transport::solveRiemannInletTank(double transportLeft, double sM, double valueTransport) { if (sM > 0.) { m_value = transportLeft*sM; } else { m_value = valueTransport*sM; } @@ -83,7 +98,7 @@ void Transport::solveRiemannTank(double transportLeft, double sM, double valueTr //*********************************************************************** -void Transport::solveRiemannOutflow(double transportLeft, double sM, double valueTransport) +void Transport::solveRiemannOutletPressure(double transportLeft, double sM, double valueTransport) { if (sM > 0.) { m_value = transportLeft*sM; } else { m_value = valueTransport*sM; } diff --git a/src/Transport/Transport.h b/src/Transport/Transport.h index 72e55542..c37c2404 100644 --- a/src/Transport/Transport.h +++ b/src/Transport/Transport.h @@ -56,21 +56,30 @@ class Transport void solveRiemann(double transportLeft, double transportRight, double sM); //! \brief Wall half Riemann solver for the corresponding transport equation void solveRiemannWall(); - //! \brief Inflow (injection) half Riemann solver for the corresponding transport equation + //! \brief Piston half Riemann solver for the corresponding transport equation + //! \param transportLeft left value of transport variable + //! \param uPiston piston velocity for intercell interfaces + void solveRiemannPiston(double transportLeft, double uPiston); + //! \brief Inlet injection using stagnation state half Riemann solver for the corresponding transport equation + //! \param transportLeft left value of transport variable + //! \param sM fluid velocity for intercell interfaces + //! \param valueTransport injection value of transport variable + void solveRiemannInletInjStagState(double transportLeft, double sM, double valueTransport); + //! \brief Inlet injection using temperature half Riemann solver for the corresponding transport equation //! \param transportLeft left value of transport variable //! \param sM fluid velocity for intercell interfaces //! \param valueTransport injection value of transport variable - void solveRiemannInflow(double transportLeft, double sM, double valueTransport); - //! \brief Tank half Riemann solver for the corresponding transport equation + void solveRiemannInletInjTemp(double transportLeft, double sM, double valueTransport); + //! \brief Inlet tank half Riemann solver for the corresponding transport equation //! \param transportLeft left value of transport variable //! \param sM fluid velocity for intercell interfaces //! \param valueTransport tank value of transport variable - void solveRiemannTank(double transportLeft, double sM, double valueTransport); - //! \brief Outflow half Riemann solver for the corresponding transport equation + void solveRiemannInletTank(double transportLeft, double sM, double valueTransport); + //! \brief Outlet at imposed pressure half Riemann solver for the corresponding transport equation //! \param transportLeft left value of transport variable //! \param sM fluid velocity for intercell interfaces //! \param valueTransport outflow value of transport variable - void solveRiemannOutflow(double transportLeft, double sM, double valueTransport); + void solveRiemannOutletPressure(double transportLeft, double sM, double valueTransport); //! \brief Add flux to the corresponding transport buffer flux //! \param coefA possibility to multiply the flux before adding (set 1.d0 if not needed) //! \param num number of the corresponding transport equation @@ -98,16 +107,17 @@ class Transport //! \brief Change the sign of the corresponding transport value void changeSign(); - //Specifique secondOrder + //Second order + //! \brief Extrapolate the value of the corresponding transport equation from the center of the cell to its edge + //! \param slope value of the slope + //! \param distance distance between the center and the corresponding edge of the cell + void extrapolate(const double& slope, const double& distance); + //Second order on cartesian grids //! \brief Compute the slope at the edge of a cell //! \param valueLeft transport value of the left cell //! \param valueRight transport value of the right cell //! \param distance distance between the left and right cell centers void computeSlopeTransport(const double valueLeft, const double valueRight, const double& distance); - //! \brief Extrapolate the value of the corresponding transport equation from the center of the cell to its edge - //! \param slope value of the slope - //! \param distance distance between the center and the corresponding edge of the cell - void extrapolate(const double& slope, const double& distance); private: double m_value; //! Value of the corresponding transport variable diff --git a/src/libTierces/matrix.c b/src/libTierces/matrix.c new file mode 100644 index 00000000..97dc6294 --- /dev/null +++ b/src/libTierces/matrix.c @@ -0,0 +1,679 @@ +/* + * HISTORY: + * This is a matrix C file for the SVD library slightly modified by Kevin Schmidmayer. + * The original version was aquired from + * https://www.gb.nrao.edu/~rcreager/Zpectrometer/. +*/ + +/* + * some elementary (2d) matrix operations - also contain + * some #define'd sections of code to benchmark + * matrix acccess AA[][] vs. A[] + * + * On a P600 the typical cost to operate on a 100x100 matrix is + * 0.2-0.3ms on elemental functions (allocate, transpose, dup) + * 1.2ms on a laplacian + * 8-12ms on a matrix multiplication + * 18ms on a matrix inversion + * + * + * Some random references: + * http://math.nist.gov/javanumerics/jama/ a JAVA matrix package + */ + +#include +#include "matrix.h" + +extern double xrandom(double, double); + +static char *matrix_version = "$Id: matrix.c,v 1.16 2003/05/09 05:00:31 pteuben Exp $"; + +Matrix *allocate_matrix(int nr, int nc) +{ + Matrix *m; + + if (nr<0) error("allocate_matrix: illegal size nr=%d",nr); + if (nc<0) error("allocate_matrix: illegal size nr=%d",nc); + m = (Matrix *) allocate(sizeof(Matrix)); + m->dat = (double *) NULL; + m->p = (double **) NULL; + m->nc = m->nr = 0; + m->ac = m->ar = (Axis2 *) NULL; + reallocate_matrix(m,nr,nc); /* actually allocate the data */ + + return m; +} + +void reallocate_matrix(Matrix *m, int nr, int nc) +{ + double *d, **p; + int i; + + if (m->nr == nr && m->nc == nc) return; /* nothing to do */ + + if (m->p) free(m->p); /* free up old data */ + if (m->dat) free(m->dat); + + m->nr = nr; + m->nc = nc; + if (nr==0 && nc==0) return; /* return with dummy empty matrix */ + d = m->dat = (double *) allocate(nr*nc*sizeof(double)); /* contigues block of data */ + p = m->p = (double **) allocate(sizeof(double *)*nr); /* array of pointers */ + nemo_dprintf(1,"reallocate_matrix: @0x%x 0x%x 0x%x\n",m,d,p); + for (i=0; idat,m->p); + free(m->p); + free(m->dat); + m->nc = -1; + m->nr = -1; + free(m->ar); + free(m->ac); + free(m); +} + +Axis2 * +new_axis(double crpix, double crval, double cdelt, string ctype, string cunit) +{ + Axis2 *a = (Axis2 *) allocate(sizeof(Axis2)); + a->crpix = crpix; + a->crval = crval; + a->cdelt = cdelt; + a->ctype = (ctype ? strdup(ctype) : NULL); + a->cunit = (cunit ? strdup(cunit) : NULL); + return a; + +} + +Axis2 * +new_axis1(Axis2 *o) +{ + Axis2 *a; + + if (o == NULL) return NULL; + + a = (Axis2 *) allocate(sizeof(Axis2)); + a->crpix = o->crpix; + a->crval = o->crval; + a->cdelt = o->cdelt; + a->ctype = (o->ctype ? strdup(o->ctype) : NULL); + a->cunit = (o->cunit ? strdup(o->cunit) : NULL); + return a; +} + +void free_axis(Axis2 *a) +{ + if (a == NULL) return; + if (a->ctype) free(a->ctype); + if (a->cunit) free(a->cunit); + free(a); +} + + +void check_matrix(const Matrix *m, int nr, int nc, const char *msg) +{ + if (m->nr != nr || m->nc != nc) + error("%s: found matrix[%d][%d], expected [%d][%d]", + msg,m->nr,m->nc,nr,nc); +} + + +void zero_matrix(Matrix *z) +{ + double *dp; + + int n = z->nr * z->nc; + dp = z->dat; + while (n--) + *dp++ = 0.0; +} + + +void random_matrix(Matrix *z) +{ + double *dp; + + int n = z->nr * z->nc; + dp = z->dat; + while (n--) + *dp++ = xrandom(0.0,1.0); +} + +/* + * create a unit matrix, or something close to it. + * columns > nr or rows > nc are left at 0.0 + */ + +void unit_matrix(Matrix *u) +{ + int i, n=MIN(u->nr,u->nc); + + double **p = u->p; + zero_matrix(u); + for (i=0; inr,a->nc); + for (i=0; inr; i++) + for (j=0; jnc; j++) + c->p[i][j] = a->p[i][j]; + + return c; +} + + + +/* + * add two matrices + * c = a + b + * if c==0, create a new one and return it + */ + +Matrix *add_matrix(const Matrix *a, const Matrix *b, Matrix *c) +{ + int i, j; + + if (a->nr != b->nr) + error("add_matrix: nr not equal: a[%d][%d] b[%d][%d]",a->nr,a->nc,b->nr,b->nc); + if (a->nc != b->nc) + error("add_matrix: nc not equal: a[%d][%d] b[%d][%d]",a->nr,a->nc,b->nr,b->nc); + + if (c == NULL) + c = allocate_matrix(a->nr,a->nc); + else + if (a->nr != c->nr || a->nc != c->nc) + error("add_matrix: A and C not equal: a[%d][%d] c[%d][%d]",a->nr,a->nc,c->nr,c->nc); + for (i=0; inr; i++) + for (j=0; jnc; j++) + c->p[i][j] = a->p[i][j] + b->p[i][j]; + + return c; +} + +/* + * a += b (scalar) + */ + +void adds_matrix(Matrix *a, const double b) +{ + int n = a->nr * a->nc; + + double *dp = a->dat; + while (n--) + *dp++ += b; +} + + +/* + * COST: 100x100 at about 8-12ms/call (depending on access method) + * + * c = a * b + * + * if c==0, allocate new and return it + */ + +#if 1 +#define _use_p 1 +#endif + +Matrix *mul_matrix(const Matrix *a, const Matrix *b, Matrix *c) +{ + int i,j,k; + double s; +#ifndef _use_p + double **ap, **bp, **cp; +#else + double *ad, *bd, *cd; + double *d1, *d2; +#endif + + + if (a->nc != b->nr) + error("mul_matrix: cannot a[%d][%d] x b[%d][%d]",a->nr,a->nc,b->nr,b->nc); + if (c == NULL) + c = allocate_matrix(a->nr,b->nc); + + /* 1000 times 100x100 matrix : 11.9" at -O2 */ +#ifndef _use_p + ap = a->p; + bp = b->p; + cp = c->p; + for (i=0; inr; i++) { + for (j=0; jnc; j++) { + s = 0; + for (k=0; knc; k++) { + s+= ap[i][k] * bp[k][j]; + } + cp[i][j] = s; + } + } +#else + /* 1000 times 100x100 matrix: 8.0" at -02 */ + ad = a->dat; + bd = b->dat; + cd = c->dat; + for (j=0; jnc; j++) { + for (i=0; inr; i++) { + s = 0; + d1 = &ad[i*a->nc]; + d2 = &bd[j]; + for (k=0; knc; k++) { + s+= (*d1) * (*d2); + d1++; + d2 += b->nc; + } + cd[i*c->nc+j] = s; + } + } +#endif + c->ar = new_axis1(a->ar); + c->ac = new_axis1(b->ac); + return c; +} + +/* + * IMUL: C = A * B, where B is really a diagonal matrix (useful for SVD work) + * B[1][n] is treated as a diagonal square matrix B[n][n] + * + * Only useful to speed up SVD type multiplications - an interface hack + * + */ + +Matrix *imul_matrix(const Matrix *a, const Matrix *b, Matrix *c) +{ + int i,j; + double **ap, **bp, **cp; + + if (b->nr != 1) + error("imul_matrix: expect b[1][%d], got b[%d][%d]",b->nr,b->nr,b->nc); + if (c == NULL) + c = allocate_matrix(a->nr,b->nc); + + ap = a->p; + bp = b->p; + cp = c->p; + for (i=0; inr; i++) { + for (j=0; jnc; j++) { + cp[i][j] = ap[i][j] * bp[0][j]; + } + } + c->ar = new_axis1(a->ar); + c->ac = new_axis1(b->ac); + return c; +} + +void vmul_matrix(const double *v, const Matrix *a, double *b) +{ + int i,j; + double s; + double **ap = a->p; + + for (i=0; inc; i++) { + for (j=0, s=0.0; jnr; j++) + s+= v[j]*ap[j][i]; + b[i] = s; + } +} + +/* + * multiply a matrix with a scalar + * a *= b (scalar) + */ + +void muls_matrix(Matrix *a, const double b) +{ + int n = a->nr * a->nc; + + double *dp = a->dat; + while (n--) + *dp++ *= b; +} + +/* + * print a matrix, with a label + * a[0][0] a[0][1] ..... + * a[1][0] ... + * .... + */ + +void print_matrix(const Matrix *a, const char *msg) +{ + int i,j; + double **p = a->p; + + printf("============================\n%s[%d][%d]\n",msg,a->nr,a->nc); + for (j=0; jnr; j++) { + for (i=0; inc; i++) { + printf("%g ",p[j][i]); + } + printf("\n"); + } + printf("============================\n"); +} + + +/* + * COST: 100x100 at 0.26ms/call + * + * 100x100 :: 1000 in 0.8" wo/ free_matrix + * 100000 in 26.4" w/ free_matrix (-O2) + * + */ + +Matrix *transpose_matrix(const Matrix *a) +{ + Matrix *mp; + int i,j; + double **p, **q; + + mp = allocate_matrix(a->nc, a->nr); + p = a->p; + q = mp->p; + + for (j=0; jnc; j++) + for (i=0; inr; i++) + q[j][i] = p[i][j]; + mp->ac = a->ar; + mp->ar = a->ac; + return mp; +} + +/* + * an example matrix operation to show when pointer arithmetic can + * a) look ugly + * b) be slow + * compared to a[i][j] notation + */ + +Matrix *laplace_matrix(const Matrix *a) +{ + Matrix *mp; + int i,j,k,nc; + double **p, **q, d1,d2,d3,d4; + double *pd, *qd; + + mp = allocate_matrix(a->nr, a->nc); + +#if 1 + /* COST: 100x100 at about 1.2ms/call */ + p = a->p; + q = mp->p; + for (j=1; jnc-1; j++) + for (i=1; inr-1; i++) { + d1 = p[i][j]-p[i-1][j]; + d2 = p[i][j]-p[i+1][j]; + d3 = p[i][j]-p[i][j-1]; + d4 = p[i][j]-p[i][j+1]; + q[i][j] = sqrt(d1*d1+d2*d2+d3*d3+d4*d4); + } +#else + /* COST: 100x100 at about 1.2ms/call */ + pd = a->dat; + qd = mp->dat; + nc = a->nc; + for (j=1; jnc-1; j++) + for (i=1; inr-1; i++) { + k = i*nc + j; + d1 = pd[k]-pd[k-1]; + d2 = pd[k]-pd[k+1]; + d3 = pd[k]-pd[k+nc]; + d4 = pd[k]-pd[k-nc]; + qd[k] = sqrt(d1*d1+d2*d2+d3*d3+d4*d4); + } +#endif + mp->ac = a->ac; + mp->ar = a->ar; + return mp; +} + +/* + * return a matrix that can be used for binning by right-hand + * matrix multiplication, i.e. + * M[nx][ny] * B[ny][nbin] = MB[nx][nbin] + * + */ + +Matrix *bin_matrix(const Matrix *a, const int nbin, const int *bin0, const int *bin1) +{ + Matrix *mp; + double **p; + int i, j; + + if (nbin > a->nr) error("Cannot bin this way, too many"); + mp = allocate_matrix(a->nr, nbin); + + zero_matrix(mp); + p = mp->p; + for (j=0; j 0) { + free(per); + free(hv); + maxcol = -1; + return -1.0; + } + error("invert_matrix: null matrix"); + } + + if (a->nc != a->nr) + error("matrix[%d][%d] not square",a->nr,a->nc); + + size = a->nc; + matrix = a->p; + + if (maxcol < 0) { + nemo_dprintf(1,"invert_matrix: allocating %d\n",size); + per = (int *) allocate(sizeof(int)*size); + hv = (double *) allocate(sizeof(double)*size); + maxcol = size; + } else if (size > maxcol) { + nemo_dprintf(1,"invert_matrix: incrementing allocation to %d\n",size); + per = (int *) reallocate(per, sizeof(int)*size); + hv = (double *) reallocate(hv, sizeof(double)*size); + maxcol = size; + } + + det=1.0; /* in case of normal end */ + + for (i=0; i max) { + max=ABS(matrix[j][i]); + row=i; + } + i++; + } + if (matrix[j][row] == 0.0) /* determinant zero ? */ + return 0.0; /* no solution possible */ + + if (row > j) { /* if largest element not on diagonal: */ + /* then permute rows */ + for (k=0; kac; + a->ac = a->ar; + a->ar = tmp; + } + + return det; /* but note, it's not even computed yet !!!! */ +} + +/* + * refactor matrix A[m][n] into U[m][n] * W[n][n] * V^T[n][n] + * (W is actually stored as vector W[n] for compactness) + * such that + * V[n][n] * W[n][n] * U ^T[n][m] * A[m][n] = I[n][n] + */ + +void svd_matrix(const Matrix *a, Matrix *u, Matrix *v, Matrix *w) +{ + int nr = a->nr; + int nc = a->nc; + int i; + double **wp; + +#if 0 + print_matrix(a,"a-before"); +#endif + + reallocate_matrix(u,nr,nc); + reallocate_matrix(v,nc,nc); +#if 1 + /* production code ??? */ + reallocate_matrix(w,1,nc); + /* Kevin's NR-emulator */ + svdcmp(u->dat, w->dat, v->dat, a->dat, a->nr, a->nc); +#else + warning("svd_matrix: using W as matrix"); + /* only for testing if W is needed as matrix */ + /* various other routines will fail if W is a matrix, and not a vector */ + /* because of the NR interfaces and our inability to do left hand matrix */ + /* multiplications */ + reallocate_matrix(w,nc,nc); /* !! note !! */ + + /* Kevin's NR-emulator */ + svdcmp(u->dat, w->dat, v->dat, a->dat, a->nr, a->nc); + /* the first row of the W matrix needs to become its diagonal */ + wp = w->p; + for (i=1; iar = new_axis1(a->ar); + u->ac = new_axis1(a->ac); + v->ar = new_axis1(a->ac); + v->ac = new_axis1(a->ac); + w->ac = new_axis1(a->ac); +} + +/* + * solve Ax=b, assuming you have factored A into their U,V,W svd matrices + * x and b can contain multiple columns (p) + */ +void svd_solve(const Matrix *a, const Matrix *u, const Matrix *v, const Matrix *w, + Matrix *b, Matrix *x) +{ + int m = a->nr; + int n = a->nc; + int p = b->nc; + + check_matrix(a,m,n,"svd_solve: A"); + check_matrix(u,m,n,"svd_solve: U"); + check_matrix(v,n,n,"svd_solve: V"); + check_matrix(w,n,n,"svd_solve: W"); + check_matrix(b,n,p,"svd_solve: B"); + check_matrix(x,n,p,"svd_solve: X"); + + + /* call Kevin's NR routine */ + svbksb(x->dat, u->dat, w->dat, v->dat, b->dat, m, n, p); +} \ No newline at end of file diff --git a/src/libTierces/matrix.h b/src/libTierces/matrix.h new file mode 100644 index 00000000..c08c033c --- /dev/null +++ b/src/libTierces/matrix.h @@ -0,0 +1,73 @@ +/* + * HISTORY: + * This is a matrix header for the SVD library slightly modified by Kevin Schmidmayer. + * The original version was aquired from + * https://www.gb.nrao.edu/~rcreager/Zpectrometer/. +*/ + +typedef struct _axis { + double crpix; + double crval; + double cdelt; + char *ctype; + char *cunit; +} Axis2; + +typedef struct _vector { + int n; + double *dat; + Axis2 *a; +} Vector; + +typedef struct _matrix { + int nr; + int nc; + double *dat; + double **p; + Axis2 *ar, *ac; +} Matrix; + + +/* svd.c routines. */ +extern int +svdcmp(double u[/*m x n*/], double w[/*n*/], double v[/*n x n*/], + const double a[/*m x n*/], int m, int n); +extern int +svbksb(double x[/*n x p*/], const double u[/*m x n*/], + const double w[/*n*/], const double v[/*n x n*/], + const double b[/*m x p*/], int m, int n, int p); +extern int +svsolve(double x[/*n x p*/], double wmin, double a[/*m x n*/], + const double b[/*m x p*/], int m, int n, int p, int preserve); +extern int +svinverse(double x[/*n x m*/], double wmin, const double a[/*m x n*/], + int m, int n); + +/* cproto -I../include -I$NEMOLIB -I$NEMOINC matrix.c */ + +Matrix *allocate_matrix(int nr, int nc); +void reallocate_matrix(Matrix *m, int nr, int nc); +void free_matrix(Matrix *m); +Axis2 *new_axis(double crpix, double crval, double cdelt, char *ct, char *cu); +Axis2 *new_axis1(Axis2 *a); +void check_matrix(const Matrix *m, int nr, int nc, const char *msg); +void zero_matrix(Matrix *z); +void random_matrix(Matrix *z); +void unit_matrix(Matrix *u); +Matrix *dup_matrix(const Matrix *a); +Matrix *add_matrix(const Matrix *a, const Matrix *b, Matrix *c); +void adds_matrix(Matrix *a, const double b); +Matrix *mul_matrix(const Matrix *a, const Matrix *b, Matrix *c); +Matrix *imul_matrix(const Matrix *a, const Matrix *b, Matrix *c); +void vmul_matrix(const double *v, const Matrix *a, double *b); +void muls_matrix(Matrix *a, const double b); +void print_matrix(const Matrix *a, const char *msg); +Matrix *transpose_matrix(const Matrix *a); +Matrix *laplace_matrix(const Matrix *a); +Matrix *bin_matrix(const Matrix *a, const int nbin, const int *bin0, const int *bin1); +double invert_matrix(Matrix *a); +void svd_matrix(const Matrix *a, Matrix *u, Matrix *v, Matrix *w); +void svd_solve(const Matrix *a, const Matrix *u, const Matrix *v, const Matrix *w, Matrix *b, Matrix *x); + +Matrix *simple_image_read(const char *fname); +void simple_image_write(const char *fname, Matrix *a); \ No newline at end of file diff --git a/src/libTierces/svd.h b/src/libTierces/svd.h new file mode 100644 index 00000000..343dd6d8 --- /dev/null +++ b/src/libTierces/svd.h @@ -0,0 +1,334 @@ +/* + * HISTORY: + * This is an SVD library slightly modified by Kevin Schmidmayer. + * The original version was aquired from + * https://www.gb.nrao.edu/~rcreager/Zpectrometer/. +*/ + +/* + $Id: svd.c,v 1.4 2004/03/24 04:58:59 rauch Exp $ + + Routines related to singular value decomposition of matrices, based on + routines in Numerical Recipes which have been modified: to accept + standard 0-based, row-order C arrays as input; to return error codes if + memory could not be allocated; to use double precision instead of floats. + svsolve() and svinverse() functions have also been added. + + Note that all matrix dimensions are specified as the number of rows + followed by the number of columns. +*/ +#include +#include +#include +#include + +#include "matrix.h" + +#define MAXIT 32 +#define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) + +/* Elements of static temporary storage to allocate. */ +#define NSTAT 16 + +/* Default value for smallest meaningful singular value. */ +#define WMIN 1e-13 + +inline int svdcmp(double u[/*m x n*/], double w[/*n*/], double v[/*n x n*/], + const double a[/*m x n*/], int m, int n) +{ +/* + Compute the SVD A = U x W x V^T of the m (rows) by n (columns) matrix A; + on output, u[] holds the m by n matrix U, w[] holds the n diagonal + elements of the (diagonal) n by n matrix W, and v[] holds the transpose of + the n by n matrix V^T; note that u[] can be identical to a[]. + Returns 0 on success, or a system error code otherwise + (ERANGE if MAXIT iterations are reached without converging). +*/ + static double srv1[NSTAT]; + int flag, i, its, j, jj, k, l=0, nm=0; + double anorm, c, f, g, h, s, scale, x, y, z, *rv1; + + if (n<=NSTAT) rv1=srv1; else rv1=(double *)malloc(n*sizeof(double)); + if (!rv1) return(errno); + + if (u!=a) memcpy(u, a, m*n*sizeof(double)); + g=scale=anorm=0; + + for (i=0; ianorm) anorm=tmp; } + } + + for (i=n-1; i>=0; i--) { + if (in ? n : m)-1; i>=0; i--) { + l=i+1; g=w[i]; + { double *ui=u+i*n; for (j=l; j=0; k--) { + for (its=0; its<=MAXIT; its++) { + flag=1; + for (l=k; l>=0; l--) { + nm=l-1; if (fabs(rv1[l])+anorm==anorm) { flag=0; break; } + if (fabs(w[nm])+anorm==anorm) break; + } + if (flag) { + c=0; s=1; + for (i=l; i<=k; i++) { + f=s*rv1[i]; rv1[i]=c*rv1[i]; + if (fabs(f)+anorm==anorm) break; + g=w[i]; h=hypot(f, g); w[i]=h; h=1/h; c=g*h; s=-f*h; + { + double *ujnm=u+nm, *uji=u+i; + + for (j=0; jNSTAT) free(rv1); return(ERANGE); } + + x=w[l]; nm=k-1; y=w[nm]; g=rv1[nm]; h=rv1[k]; + f=((y-z)*(y+z)+(g-h)*(g+h))/(2*h*y); + g=hypot(f, 1); f=((x-z)*(x+z)+h*((y/(f+SIGN(g,f)))-h))/x; c=s=1; + for (j=l; j<=nm; j++) { + i=j+1; g=rv1[i]; y=w[i]; h=s*g; g=c*g; z=hypot(f,h); + rv1[j]=z; + { double z1=1/z; c=f*z1; s=h*z1; } + f=x*c+g*s; g=g*c-x*s; h=y*s; y*=c; + { + double *vjjj=v+j, *vjji=v+i; + + for (jj=0; jjNSTAT) free(rv1); + return(0); +} + +inline int svbksb(double x[/*n x p*/], const double u[/*m x n*/], + const double w[/*n*/], const double v[/*n x n*/], + const double b[/*m x p*/], int m, int n, int p) +{ +/* + Solves A X = B for X, where A = U x W x V^T is the SVD of the m by n + matrix A, B is an m by p matrix, and X is an n by p matrix. + Returns 0 on success, or a system error code otherwise. +*/ + int jj, j, i, k; + static double stmp[NSTAT]; + double s, *tmp=(n<=NSTAT ? stmp : (double *)malloc(n*sizeof(double))), *xjk; + + if (!tmp) return(errno); + + for (k=0; kNSTAT) free(tmp); + return(0); +} + +inline int svsolve(double x[/*n x p*/], double wmin, double a[/*m x n*/], + const double b[/*m x p*/], int m, int n, int p, int preserve) +{ +/* + Solve a (least squares) system of linear equations A X = B by singular value + decomposition. Zero all singular values smaller than wmin*max(w[]), using + wmin=WMIN if wmin<0. If preserve is non-zero, A is copied before + decomposition; A is m x n, B is m x p, and X will be n x p. + Returns 0 on success, or a system error code otherwise. +*/ + double *utmp, *w, *v, wmax; + int i, status; + + w=(double *)malloc(n*sizeof(double)); + v=(double *)malloc(n*n*sizeof(double)); + utmp=(preserve ? (double *)malloc(m*n*sizeof(double)) : a); + if (!w || !v || !utmp) { + if (w) free(w); + if (v) free(v); + if (utmp && preserve) free(utmp); + return(errno); + } + + status=svdcmp(utmp, w, v, a, m, n); + if (status) { + free(w); free(v); if (preserve) free(utmp); + return(status); + } + + for (wmax=0, i=0; i