Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add pfem flow contlaws #738

Merged
merged 6 commits into from
Apr 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions kratos.gid/apps/PfemFluid/write/write.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ proc PfemFluid::write::Init { } {
set bodies_list [list ]
variable Names
set Names [dict create DeltaTime DeltaTime]

SetAttribute properties_location json
SetAttribute model_part_name "PfemFluidModelPart"
SetAttribute materials_file "PFEMFluidMaterials.json"
Expand All @@ -24,17 +24,17 @@ proc PfemFluid::write::Init { } {
proc PfemFluid::write::writeModelPartEvent { } {
# Init data
write::initWriteConfiguration [GetAttributes]

set parts_un_list [GetPartsUN]
foreach part_un $parts_un_list {
write::initWriteData $part_un "PFEMFLUID_Materials"
}

write::writeModelPartData
write::WriteString "Begin Properties 0"
write::WriteString "End Properties"
# write::writeMaterials "PfemFluid"

write::writeNodalCoordinates
foreach part_un $parts_un_list {
write::initWriteData $part_un "PFEMFLUID_Materials"
Expand All @@ -44,21 +44,21 @@ proc PfemFluid::write::writeModelPartEvent { } {
}

proc PfemFluid::write::writeMeshes { } {

foreach part_un [GetPartsUN] {
write::initWriteData $part_un "PFEMFLUID_Materials"
write::writePartSubModelPart
}
# Solo Malla , no en conditions
writeNodalConditions "PFEMFLUID_NodalConditions"

}


proc PfemFluid::write::writeNodalConditions { keyword } {
write::writeNodalConditions $keyword
return ""

set root [customlib::GetBaseRoot]
set xp1 "[spdAux::getRoute $keyword]/container/blockdata"
set groups [$root selectNodes $xp1]
Expand Down Expand Up @@ -98,11 +98,11 @@ proc PfemFluid::write::GetPartsUN { } {
# Custom files (Copy python scripts, write materials file...)
proc PfemFluid::write::writeCustomFilesEvent { } {
# Write the fluid materials json file
PfemFluid::write::WriteMaterialsFile False
PfemFluid::write::WriteMaterialsFile

write::CopyFileIntoModel "python/RunPFEM.py"
write::RenameFileInModel "RunPFEM.py" "MainKratos.py"

#write::RenameFileInModel "ProjectParameters.json" "ProjectParameters.py"
}

Expand Down
136 changes: 129 additions & 7 deletions kratos.gid/apps/PfemFluid/xml/ConstitutiveLaws.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<ConstitutiveLaws>
<!--linear elastic laws-->
<CLaw n="Newtonian" pn="Newtonian" ProductionReady="ProductionReady" help="Newtonian fluid" App="Pfem" OutputMode="Parameters" kratos_module="PfemFluidDynamicsApplication">

<!--Fluid laws-->
<CLaw n="Newtonian2DLaw" pn="2D Newtonian" ProductionReady="ProductionReady" help="Newtonian fluid" Dimension="2D" App="Pfem" OutputMode="Parameters" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the fluid Bulk modulus."/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the fluid Bulk modulus."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="Newtonian3DLaw" pn="3D Newtonian" ProductionReady="ProductionReady" help="Newtonian fluid" Dimension="3D" App="Pfem" OutputMode="Parameters" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the fluid Bulk modulus."/>
</inputs>
<outputs>
</outputs>
</CLaw>
<CLaw n="NonNewtonian" pn="Non Newtonian" ProductionReady="ProductionReady" help="Non Newtonian fluid" OutputMode="Parameters" App="Pfem" kratos_module="PfemFluidDynamicsApplication">

<CLaw n="Bingham2DLaw" pn="2D Bingham" ProductionReady="ProductionReady" help="Non Newtonian Bingham fluid" Dimension="2D" OutputMode="Parameters" App="Pfem" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
Expand All @@ -22,7 +34,36 @@
<outputs>
</outputs>
</CLaw>
<CLaw n="MuIrheology" pn="Mu(I) Rheology" ProductionReady="ProductionReady" help="Dense Incompressible granular material" OutputMode="Parameters" App="Pfem" kratos_module="PfemFluidDynamicsApplication">

<CLaw n="Bingham3DLaw" pn="3D Bingham" ProductionReady="ProductionReady" help="Non Newtonian Bingham fluid" Dimension="3D" OutputMode="Parameters" App="Pfem" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the Bulk modulus."/>
<parameter n="FLOW_INDEX" pn="Flow index" unit_magnitude="" units="" v="1"/>
<parameter n="YIELD_SHEAR" pn="Yield shear" unit_magnitude="P" units="Pa" v="100"/>
<parameter n="ADAPTIVE_EXPONENT" pn="Adaptive exponent" unit_magnitude="" units="1/s" v="1000" help="The higher is, the lower is the regularization."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="PapanastasiouMuIRheology2DLaw" pn="2D Mu(I) Rheology" ProductionReady="ProductionReady" help="Dense Incompressible granular material" Dimension="2D" OutputMode="Parameters" App="Pfem" type="Fluid" kratos_module="PfemFluidDynamicsApplication">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1600"/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the Bulk modulus."/>
<parameter n="STATIC_FRICTION" pn="Static Friction" unit_magnitude="" units="" v="0.3"/>
<parameter n="DYNAMIC_FRICTION" pn="Dynamic Friction" unit_magnitude="" units="" v="0.5"/>
<parameter n="INERTIAL_NUMBER_ZERO" pn="Inertial Number Zero" unit_magnitude="" units="" v="0.5"/>
<parameter n="GRAIN_DIAMETER" pn="Grain Diameter" unit_magnitude="" units="m" v="0.001"/>
<parameter n="GRAIN_DENSITY" pn="Grain Density" unit_magnitude="" units="kg/m^3" v="2500"/>
<parameter n="REGULARIZATION_COEFFICIENT" pn="Regularization Coefficient" unit_magnitude="" units="1/s" v="0.01" help="The smaller is, the lower is the regularization."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="PapanastasiouMuIRheology3DLaw" pn="3D Mu(I) Rheology" ProductionReady="ProductionReady" help="Dense Incompressible granular material" Dimension="3D" OutputMode="Parameters" App="Pfem" type="Fluid" kratos_module="PfemFluidDynamicsApplication">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1600"/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the Bulk modulus."/>
Expand All @@ -36,7 +77,87 @@
<outputs>
</outputs>
</CLaw>
<CLaw n="Hypoelastic" pn="Hypoelastic" ProductionReady="ProductionReady" help="Hypoelastic solid" App="Pfem" OutputMode="Parameters" kratos_module="PfemFluidDynamicsApplication">

<!--Fluid temperature dependent laws-->
<CLaw n="NewtonianTemperatureDependent2DLaw" pn="2D Newtonian temperature dependent" ProductionReady="ProductionReady" help="Newtonian temperature dependent fluid" Dimension="2D" App="Pfem" OutputMode="Parameters" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the fluid Bulk modulus."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="NewtonianTemperatureDependent3DLaw" pn="3D Newtonian temperature dependent" ProductionReady="ProductionReady" help="Newtonian temperature dependent fluid" Dimension="3D" App="Pfem" OutputMode="Parameters" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the fluid Bulk modulus."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="BinghamTemperatureDependent2DLaw" pn="2D Bingham temperature dependent" ProductionReady="ProductionReady" help="Non Newtonian Bingham temperature dependent fluid" Dimension="2D" OutputMode="Parameters" App="Pfem" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the Bulk modulus."/>
<parameter n="FLOW_INDEX" pn="Flow index" unit_magnitude="" units="" v="1"/>
<parameter n="YIELD_SHEAR" pn="Yield shear" unit_magnitude="P" units="Pa" v="100"/>
<parameter n="ADAPTIVE_EXPONENT" pn="Adaptive exponent" unit_magnitude="" units="1/s" v="1000" help="The higher is, the lower is the regularization."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="BinghamTemperatureDependent3DLaw" pn="3D Bingham temperature dependent" ProductionReady="ProductionReady" help="Non Newtonian Bingham temperature dependent fluid" Dimension="3D" OutputMode="Parameters" App="Pfem" kratos_module="PfemFluidDynamicsApplication" type="Fluid">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="1000"/>
<parameter n="DYNAMIC_VISCOSITY" pn="Dynamic viscosity" unit_magnitude="P*T" units="Pa*s" v="1e-3" help="Set the dynamic viscosity."/>
<parameter n="BULK_MODULUS" pn="Bulk modulus" unit_magnitude="P" units="Pa" v="2.1e+9" help="Set the Bulk modulus."/>
<parameter n="FLOW_INDEX" pn="Flow index" unit_magnitude="" units="" v="1"/>
<parameter n="YIELD_SHEAR" pn="Yield shear" unit_magnitude="P" units="Pa" v="100"/>
<parameter n="ADAPTIVE_EXPONENT" pn="Adaptive exponent" unit_magnitude="" units="1/s" v="1000" help="The higher is, the lower is the regularization."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<!--Solid laws-->
<CLaw n="Hypoelastic2DLaw" pn="2D Hypoelastic" ProductionReady="ProductionReady" help="Hypoelastic solid" Dimension="2D" App="Pfem" OutputMode="Parameters" type="Solid" kratos_module="PfemFluidDynamicsApplication">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="500"/>
<parameter n="YOUNG_MODULUS" pn="Young modulus" unit_magnitude="P" units="Pa" v="2.1e+07" help="Set the Young modulus."/>
<parameter n="POISSON_RATIO" pn="Poisson ratio" unit_magnitude="" units="" v="0.25" help="Set the Poisson ratio."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="Hypoelastic3DLaw" pn="3D Hypoelastic" ProductionReady="ProductionReady" help="Hypoelastic solid" Dimension="3D" App="Pfem" OutputMode="Parameters" type="Solid" kratos_module="PfemFluidDynamicsApplication">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="500"/>
<parameter n="YOUNG_MODULUS" pn="Young modulus" unit_magnitude="P" units="Pa" v="2.1e+07" help="Set the Young modulus."/>
<parameter n="POISSON_RATIO" pn="Poisson ratio" unit_magnitude="" units="" v="0.25" help="Set the Poisson ratio."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<!--Solid temperature dependent laws-->
<CLaw n="HypoelasticTemperatureDependent2DLaw" pn="2D Hypoelastic temperature dependent" ProductionReady="ProductionReady" Dimension="2D" help="Hypoelastic temperature dependent solid" App="Pfem" OutputMode="Parameters" type="Solid" kratos_module="PfemFluidDynamicsApplication">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="500"/>
<parameter n="YOUNG_MODULUS" pn="Young modulus" unit_magnitude="P" units="Pa" v="2.1e+07" help="Set the Young modulus."/>
<parameter n="POISSON_RATIO" pn="Poisson ratio" unit_magnitude="" units="" v="0.25" help="Set the Poisson ratio."/>
</inputs>
<outputs>
</outputs>
</CLaw>

<CLaw n="HypoelasticTemperatureDependent3DLaw" pn="3D Hypoelastic temperature dependent" ProductionReady="ProductionReady" Dimension="3D" help="Hypoelastic temperature dependent solid" App="Pfem" OutputMode="Parameters" type="Solid" kratos_module="PfemFluidDynamicsApplication">
<inputs>
<parameter n="DENSITY" pn="Density" unit_magnitude="Density" units="kg/m^3" v="500"/>
<parameter n="YOUNG_MODULUS" pn="Young modulus" unit_magnitude="P" units="Pa" v="2.1e+07" help="Set the Young modulus."/>
Expand All @@ -45,4 +166,5 @@
<outputs>
</outputs>
</CLaw>

</ConstitutiveLaws>
Loading