Skip to content

Commit

Permalink
Merge pull request #971 from KratosMultiphysics/fluid/div-stable-elem…
Browse files Browse the repository at this point in the history
…ent-p2-p1

[Fluid] Div-stable element P2-P1
  • Loading branch information
rubenzorrilla authored May 27, 2024
2 parents 642229e + 4fa799b commit b0054d9
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 7 deletions.
23 changes: 17 additions & 6 deletions kratos.gid/apps/Fluid/write/write.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,28 @@ proc ::Fluid::write::writeBoundaryConditions { } {
spdAux::MergeGroups $skin_group_name $groups

# Write the conditions
lassign [write::_getConditionDefaultName] kname nnodes
set last_condition_iterator [write::writeGroupConditionByUniqueId $skin_group_name $kname $nnodes 0 $::Fluid::write::FluidConditionMap]

# Clean
GiD_Groups delete $skin_group_name
}

proc ::Fluid::write::_getConditionDefaultName { } {
set is_quadratic [write::isquadratic]
if {$::Model::SpatialDimension eq "3D"} {
set kname SurfaceCondition3D3N

set nnodes 3
if {$is_quadratic} {set nnodes 6}

set kname SurfaceCondition3D${nnodes}N
} {
set kname LineCondition2D2N
set nnodes 2
if {$is_quadratic} {set nnodes 3}
set kname LineCondition2D${nnodes}N
}
set last_condition_iterator [write::writeGroupConditionByUniqueId $skin_group_name $kname $nnodes 0 $::Fluid::write::FluidConditionMap]

# Clean
GiD_Groups delete $skin_group_name

return [list $kname $nnodes]
}

proc ::Fluid::write::writeDrags { } {
Expand Down
54 changes: 54 additions & 0 deletions kratos.gid/apps/Fluid/xml/Elements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,58 @@
</outputs>
</ElementItem>

<ElementItem n="P2P12D" pn="P2-P1" ImplementedInFile="incompressible_navier_stokes_p2_p1_continuous.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="p2p1"
MinimumKratosVersion="9000" WorkingSpaceDimension="2D" LocalSpaceDimension="2" RequiresLocalAxes="False"
LargeDeformation="False" ElementType="Fluid" help="This element implements a P2-P1 incompressible Navier-Stokes element">
<!--here we could add a list of all of the possible geometries-->
<TopologyFeatures>
<item GeometryType="Triangle" nodes="6" KratosName="Element2D6N"/>
</TopologyFeatures>
<!-- here we add the block of features which we require from the constitutive law-->

<ConstitutiveLaw_FilterFeatures>
<filter field="App" value="Fluid"/>
<filter field="ElementCompressibility" value="Incompressible"/>
</ConstitutiveLaw_FilterFeatures>

<!--define list of NodalConditions-->
<NodalConditions>
<NodalCondition n="VELOCITY"/>
<NodalCondition n="PRESSURE"/>
</NodalConditions>

<inputs>
</inputs>

<outputs>
</outputs>
</ElementItem>

<ElementItem n="P2P13D" pn="P2-P1" ImplementedInFile="incompressible_navier_stokes_p2_p1_continuous.cpp" ImplementedInApplication="FluidDynamicsApplication" FormulationElementType="p2p1"
MinimumKratosVersion="9000" WorkingSpaceDimension="3D" LocalSpaceDimension="3" RequiresLocalAxes="False"
LargeDeformation="False" ElementType="Fluid" help="This element implements a P2-P1 incompressible Navier-Stokes element">
<!--here we could add a list of all of the possible geometries-->
<TopologyFeatures>
<item GeometryType="Tetrahedra" nodes="10" KratosName="Element3D10N"/>
</TopologyFeatures>
<!-- here we add the block of features which we require from the constitutive law-->

<ConstitutiveLaw_FilterFeatures>
<filter field="App" value="Fluid"/>
<filter field="ElementCompressibility" value="Incompressible"/>
</ConstitutiveLaw_FilterFeatures>

<!--define list of NodalConditions-->
<NodalConditions>
<NodalCondition n="VELOCITY"/>
<NodalCondition n="PRESSURE"/>
</NodalConditions>

<inputs>
</inputs>

<outputs>
</outputs>
</ElementItem>

</ElementList>
2 changes: 1 addition & 1 deletion kratos.gid/apps/Fluid/xml/Strategies.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<scheme n="bdf2" pn="BDF2" help="2nd order Backward Differenctiation Formula (BDF2) scheme for CFD problems." >
<parameter_list></parameter_list>
<element_filters>
<filter field="n" value="QSVMS2D,QSVMS3D,DVMS2D,DVMS3D,FIC2D,FIC3D,WeaklyCompressible2D,WeaklyCompressible3D"/>
<filter field="n" value="QSVMS2D,QSVMS3D,DVMS2D,DVMS3D,FIC2D,FIC3D,WeaklyCompressible2D,WeaklyCompressible3D,P2P12D,P2P13D"/>
</element_filters>
</scheme>
</schemes>
Expand Down

0 comments on commit b0054d9

Please sign in to comment.