-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11646 from KratosMultiphysics/fluid/weakly-compre…
…ssible-permeability [Fluid] Weakly-compressible automatic differentiation enhancements
- Loading branch information
Showing
12 changed files
with
1,409 additions
and
1,313 deletions.
There are no files selected for viewing
1,886 changes: 956 additions & 930 deletions
1,886
applications/FluidDynamicsApplication/custom_elements/weakly_compressible_navier_stokes.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
...mbolic_generation/navier_stokes/README.md → ...akly_compressible_navier_stokes/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
# Navier-Stokes and Stokes elements automatic differentiation | ||
# Weakly-compressible Navier-Stokes and Stokes elements automatic differentiation | ||
|
||
## ELEMENT DESCRIPTION: | ||
Current directory contains the required files for the Automatic Differenctiation (AD) of both the _"symbolic_stokes"_ and _"symbolic_navier_stokes"_ elements of the FluidDynamicsApplication. These elements implement a **Stokes** and a **weakly-compressible Navier-Stokes** formulation for both **2D** and **3D** cases. | ||
Current directory contains the required files for the Automatic Differenctiation (AD) of both the _"symbolic_stokes"_ and _"weakly_compressible_navier_stokes"_ elements of the FluidDynamicsApplication. These elements implement a **Stokes** and a **weakly-compressible Navier-Stokes** formulation for both **2D** and **3D** cases. | ||
|
||
## SYMBOLIC GENERATOR SETTINGS: | ||
* Dimension to compute: This symbolic generator is valid for both **2D** and **3D** cases. The element has been implemented using a template argument for the problem dimension, so it is advised to set the _dim_to_compute_ flag as "_Both_". In this case the generated .cpp file will contain both **2D** and **3D** implementations. | ||
* Formulation: As mentioned, the symbolic generator is valid for both Stokes and Navier-Stokes formulations. To switch the formulation set the "_formulation_" variable to either "_Stokes_" or "_NavierStokes_" | ||
* Linearisation settings: "_FullNR_" considers the convective velocity as _"v-vmesh"_, implying that _v_ is taken into account in the differenctiation of the **LHS** and **RHS**. On the contrary "_Picard_" option (_a.k.a. QuasiNR_) defines the convective velocity as "a", so it is considered as a constant in the differenctiation of the **LHS** and **RHS**. Note that this option is only meaningful in the Navier-Stokes formulation as there is no convective term in the Stokes case. | ||
* Divide by rho: If _divide_by_rho_ flag is set to "_True_" the mass conservation equation is divided by the density for the sake of having a better conditioned system of equations. It is therefore advised to keep it activated. | ||
* Artificial compressiblity: If set to "_True_", the time derivative of the density is introduced in the mass conservation equation and rearanged to the pressure time derivative by using the simple state equation $$\partial p/\partial\rho = c^{2}$$, being "_c_" the fluid speed of sound. This adds some extra terms to the usual **Navier-Stokes** equations that are intended to act as a soft artificial compressibility. Such artificial compressibility is controlled by the value of "_c_", meaning that the artificial compressibility terms vanishes as "_c_" tends to infinite. So far this option is only available in the Navier-Stokes formulation. Although the generator is already prepared to include it in the Stokes element, slight modifications would be required in the header and source template files. | ||
* Darcy term: If set to "_True_" a darcy term is included in the momentum conservation equation. Such Darcy term is governed by a resistance constant (1/L^2) retrieved from the elemental database. | ||
|
||
## INSTRUCTIONS | ||
Run: | ||
~~~py | ||
python generate_navier_stokes_element.py | ||
python generate_weakly_compressible_navier_stokes_element.py | ||
~~~ | ||
Then, depending on the selected formulation, a file "_symbolic_stokes.cpp_" or "_weakly_compressible_navier_stokes.cpp_" is automatically generated. Such file muest be copied within the "_custom_elements_" folder of the **FluidDynamicsApplication**. The corresponding header file ("symbolic_stokes.h" or "weakly_compressible_navier_stokes.h") is already stored in such folder. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.