Plugins
unsat_flow_util.lua File Reference

Functions

function ProblemDisc assert_richards_parameters (medium)
 
function ProblemDisc CreateApproxSpace ()
 
function ProblemDisc CreateDomainDisc (approxSpace)
 
function ProblemDisc CreateElemDisc (subdom, medium)
 
function ProblemDisc CreateModelMap (paramDesc)
 
function ProblemDisc CreateVTKOutput ()
 
function dwDensityFct (w)
 
function dwViscosityFct (w)
 
function ProblemDisc lookup (uid, param)
 
function ProblemDisc new (problemDesc, dom)
 
function ProblemDisc SetInitialData ()
 

Function Documentation

◆ assert_richards_parameters()

function ProblemDisc assert_richards_parameters ( medium  )

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :320-336

function ProblemDisc:assert_richards_parameters(medium)
local porosity = medium.porosity
local cuid = medium.conductivity.value
local suid = medium.saturation.value
assert(cuid == suid, "conductivity and saturation must be defined for the same medium")
local Ksat = self:lookup(cuid, "Ksat")
local case1 = (Ksat == nil) and (medium.permeability ~= nil and self.problem.flow.viscosity ~= nil)
local case2 = (Ksat ~= nil) and (medium.permeability == nil and self.problem.flow.viscosity == nil)
print("Permeability and Viscosity are given, but not hydraulic conductivity: " .. tostring(case1))
print("Only hydraulic conductivity is given: " .. tostring(case2))
assert(case1 or case2, "either Ksat or permeability and viscosity must be defined")
end
void print(const char *const name=NULL) const
int local(bglp_vertex_descriptor p)
function ProblemDisc lookup(uid, param)
function ProblemDisc assert_richards_parameters(medium)

◆ CreateApproxSpace()

function ProblemDisc CreateApproxSpace ( )

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :39-48

function ProblemDisc:CreateApproxSpace()
self.approxSpace = ApproximationSpace(self.domain)
self.approxSpace:add_fct("p", "Lagrange", 1)
self.approxSpace:add_fct("c", "Lagrange", 1)
self.approxSpace:init_levels()
self.approxSpace:init_top_surface()
self.approxSpace:print_statistic()
return self.approxSpace
end
parameterString p
Definition: Biogas.lua:1
function ProblemDisc CreateApproxSpace()

◆ CreateDomainDisc()

function ProblemDisc CreateDomainDisc ( approxSpace  )

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :229-318

◆ CreateElemDisc()

function ProblemDisc CreateElemDisc ( subdom  ,
medium   
)

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :51-227

◆ CreateModelMap()

function ProblemDisc CreateModelMap ( paramDesc  )

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :405-422

function ProblemDisc:CreateModelMap(paramDesc)
local modelMap = {}
local mfactory = RichardsModelFactory()
for i, medium in ipairs(paramDesc) do
if medium.type == "vanGenuchten" then
modelMap[medium.uid] = mfactory:create_van_genuchten(json.encode(medium))
print(medium.uid .. ":v->" .. modelMap[medium.uid]:config_string())
elseif medium.type == "exp" then
modelMap[medium.uid] = mfactory:create_exponential(json.encode(medium))
print(medium.uid .. ":e->" .. modelMap[medium.uid]:config_string())
elseif medium.type == "const" then
modelMap[medium.uid] = medium.value
print(medium.uid .. ":c->" .. modelMap[medium.uid])
end
end
return modelMap
end
Variant::Type type()
function ProblemDisc CreateModelMap(paramDesc)

References local().

◆ CreateVTKOutput()

function ProblemDisc CreateVTKOutput ( )

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :349-402

◆ dwDensityFct()

function dwDensityFct ( )

/**

/**

/**

/**

/**

/** location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :469-480

function dwDensityFct(w)
return (-1.0 * p_w * p_s * (p_w - p_s)) / (p_s * (p_w - 1) - p_w * w) ^ 2
end
density = LuaUserFunctionNumber("DensityFct", 1);
density:set_deriv(0, "dwDensityFct");
elseif self.problem.flow.density.type == "const" then
density = self.problem.flow.density.min
end
return density
end
function dwDensityFct(w)

◆ dwViscosityFct()

function dwViscosityFct ( )

/**

/** location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :496-505

function dwViscosityFct(w)
return mu0 * (1.85 - 8.2 * w + 133.5 * w ^ 2)
end
viscosity = LuaUserFunctionNumber("ViscosityFct", 1);
viscosity:set_deriv(0, "dwViscosityFct");
end
return viscosity
end
function dwViscosityFct(w)

◆ lookup()

function ProblemDisc lookup ( uid  ,
param   
)

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :338-347

function ProblemDisc:lookup(uid, param)
local value = nil
for i, p in ipairs(self.problem.parameter) do
if p.uid == uid then
value = p[param]
end
end
return value
end

◆ new()

function ProblemDisc new ( problemDesc  ,
dom   
)

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :17-37

◆ SetInitialData()

function ProblemDisc SetInitialData ( )

location: /home/runner/work/docs/docs/ug4/plugins/unsat_flow / unsat_flow_util.lua :424-429

function ProblemDisc:SetInitialData()
for i, initial in ipairs(self.problem.initial) do
print("Added Initial Value " .. initial.cmp .. " = " .. initial.value)
Interpolate(initial.value, self.u, initial.cmp)
end
end
function ProblemDisc SetInitialData()