Plugins
Loading...
Searching...
No Matches
d3f_util.lua File Reference

Functions

function util d3f AdvectLSF (step, t, dt, inst, vol, coef)
 
function util d3f ComputeFSFVIntegral (step, inst, vol, cmp, time, dest)
 
function util d3f ComputeFSHeight (step, inst, time)
 
function util d3f ComputeFSIntegral (step, inst, vol, cmp, time, dest)
 
function util d3f ComputeFSTransportIntegral (step, inst, problem, vol, time)
 
function util d3f ComputeFSVolume (step, inst, vol, time)
 
function util d3f ComputePWFSVolume (step, inst, vol, cmp_w, time)
 
function util d3f ComputeSDF (inst, time, step)
 
function util d3f CreateRiverRechargeObject (problem, inst, lsf)
 
function DDensitySeparationTFct_T (TC)
 
function util d3f parse Density (DensityDesc, w)
 
function util d3f check exist (param, name)
 
function get (x, y, z, t)
 
function util d3f parse Gravity (GravityDesc)
 
function util d3f InitLSF (inst, problem, time)
 
function util d3f InitRivers (problem, inst)
 
function Kroehn_T (TC)
 
function PorosityExp_p (p)
 
function util d3f PrepareLSF (step, inst, problem, vol, coef, time)
 
function util d3f RewindLSF (step, inst, time)
 
function util d3f SaveRivers (problem, inst, info)
 
function util d3f SetFixedLSValues (inst, time)
 
function util d3f SetFSBoundaryCond (inst, problem, cmp, bc_kind, bc_val)
 
function util d3f SetUpFreeSurfaceData (inst, problem, domain, vol)
 
function util d3f check type (param, name, typ)
 
function util d3f parse Upwind (upwind)
 
function util d3f usage ()
 
function util d3f parse Viscosity (ViscosityDesc, w)
 

Variables

parameterNumber fromCP = 0
 id of the checkpoint
 

Function Documentation

◆ AdvectLSF()

function util d3f AdvectLSF ( step  ,
,
dt  ,
inst  ,
vol  ,
coef   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1186-1264

◆ ComputeFSFVIntegral()

function util d3f ComputeFSFVIntegral ( step  ,
inst  ,
vol  ,
cmp  ,
time  ,
dest   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :954-983

◆ ComputeFSHeight()

function util d3f ComputeFSHeight ( step  ,
inst  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1007-1019

function util.d3f.ComputeFSHeight (step, inst, time)
if inst.free_surface_present then
if inst.fs_height_measurer ~= nil then
inst.fs_height_measurer:reinit ()
end
if inst.fs_height_data ~= nil then
inst.fs_height_data:reinit ()
end
end
end

◆ ComputeFSIntegral()

function util d3f ComputeFSIntegral ( step  ,
inst  ,
vol  ,
cmp  ,
time  ,
dest   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :923-952

◆ ComputeFSTransportIntegral()

function util d3f ComputeFSTransportIntegral ( step  ,
inst  ,
problem  ,
vol  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :985-1004

function util.d3f.ComputeFSTransportIntegral (step, inst, problem, vol, time)
if problem.transport ~= nil then
for _, spec in pairs(problem.transport) do
if type(spec) == "table" and spec.cmp ~= nil then
if spec.integral ~= nil then
if type (spec.integral) == "string" then
util.d3f.ComputeFSFVIntegral (step, inst, vol, spec.cmp, time, spec.integral)
elseif type (spec.integral) == "boolean" then
if spec.integral then
util.d3f.ComputeFSFVIntegral (step, inst, vol, spec.cmp, time)
end
else
print ("Error: Illegal specification of the 'integral' field for transport of '"..spec.cmp.."'")
exit ()
end
end
end
end
end
end
function util d3f ComputeFSFVIntegral(step, inst, vol, cmp, time, dest)
Variant::Type type()

◆ ComputeFSVolume()

function util d3f ComputeFSVolume ( step  ,
inst  ,
vol  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :860-891

◆ ComputePWFSVolume()

function util d3f ComputePWFSVolume ( step  ,
inst  ,
vol  ,
cmp_w  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :894-921

◆ ComputeSDF()

function util d3f ComputeSDF ( inst  ,
time  ,
step   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1045-1073

◆ CreateRiverRechargeObject()

function util d3f CreateRiverRechargeObject ( problem  ,
inst  ,
lsf   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :137-317

◆ DDensitySeparationTFct_T()

function DDensitySeparationTFct_T ( TC  )

This function creates a UserData for the density, based on the passed density descriptor

DensityDesc
w
T

/**

/**

/**

/**

/**

/**

/**

/**

/**

/** location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1562-1596

◆ Density()

function util d3f parse Density ( DensityDesc  ,
 
)

This function creates a UserData for the density, based on the passed density descriptor

DensityDesc
w

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1291-1354

◆ exist()

function util d3f check exist ( param  ,
name   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :113-121

function util.d3f.check.exist(param, name)
if param == nil then
print("In util.d3f.solve: Required parameter '"..name.."' not specified.");
util.d3f.usage();
print("Check parameter settings. Aborting execution."); exit();
end
end

◆ get()

function get ( ,
,
,
 
)

Based on the passed permeability descriptor, this function creates a table which contains a UserData and callbacks for the permeability. It either accepts a number value or a table with the following entries: { file,
interpolationOrder,

blurAlpha,

blurIterations,

}

The following table is returned { userData,
get(x,y,t)
get(x,y,z,t)
}

permDesc

/**

/** location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :2081-2116

◆ Gravity()

function util d3f parse Gravity ( GravityDesc  )

This function creates a UserData for the gravity, based on the passed gravity descriptor

GravityDesc
w

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :2006-2037

◆ InitLSF()

function util d3f InitLSF ( inst  ,
problem  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1076-1129

◆ InitRivers()

function util d3f InitRivers ( problem  ,
inst   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :320-337

function util.d3f.InitRivers (problem, inst)
if problem.free_surface.rivers == nil then return end
if problem.free_surface.rivers.set_depth == nil then return end
if problem.domain.dim == 3 then
if problem.free_surface.rivers.set_depth == "free_surface" then
print ("Setting the river depths from the free surface...")
inst.fs_river_recharge:reset_river_depth ()
else
print ("Illegal specification of rivers.set_depth.")
exit ()
end
else
print ("Setting the river water level is only possible in 3d.")
exit ()
end
end

◆ Kroehn_T()

function Kroehn_T ( TC  )

This function creates a UserData for the viscosity, based on the passed viscosity descriptor

ViscosityDesc
w
T

/**

/**

/**

/**

/**

/** location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1941-1971

◆ PorosityExp_p()

function PorosityExp_p ( p  )

This function creates a UserData for the porosity, based on the passed porosity descriptor (See PorosityDesc.md for detailed documentation of supported PorosityDesc formats.)

PorosityDesc
p

/**

/** location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1677-1696

function PorosityExp_p(p)
return alpha * (1.0 - phi_ref) * math.exp(-alpha *(p - p_ref))
end
porosity = LuaUserFunctionNumber("PorosityExp", 1)
porosity:set_deriv(0, "PorosityExp_p");
porosity:set_input(0, p)
end
end
if porosity == nil then
print("Cannot create porosity from porosity descriptor")
exit()
end
return porosity
end
parameterString p
Definition Biogas.lua:1
function PorosityExp_p(p)

◆ PrepareLSF()

function util d3f PrepareLSF ( step  ,
inst  ,
problem  ,
vol  ,
coef  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1132-1183

◆ RewindLSF()

function util d3f RewindLSF ( step  ,
inst  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1267-1277

function util.d3f.RewindLSF (step, inst, time)
if inst.free_surface_present then
print ("Restoring the free surface...")
inst.lsf:assign (inst.nv_old)
inst.sdf_new:assign (inst.lsf)
util.d3f.ComputeSDF (inst, time, step) --> instead of this
end
end
function util d3f ComputeSDF(inst, step)
void assign(const MathSymmetricMatrix &v)

◆ SaveRivers()

function util d3f SaveRivers ( problem  ,
inst  ,
info   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :340-348

function util.d3f.SaveRivers (problem, inst, info)
if problem.free_surface.rivers == nil then return end
if problem.free_surface.rivers.save_to_file ~= nil then
local file_name = problem.free_surface.rivers.save_to_file .. "." .. info .. "." .. problem.free_surface.rivers.river_out_suffix
print ("Saving the rivers to '" .. file_name .. "'")
inst.fs_river_recharge:save_river_depth (file_name)
end
end

◆ SetFixedLSValues()

function util d3f SetFixedLSValues ( inst  ,
time   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1022-1042

◆ SetFSBoundaryCond()

function util d3f SetFSBoundaryCond ( inst  ,
problem  ,
cmp  ,
bc_kind  ,
bc_val   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :357-387

◆ SetUpFreeSurfaceData()

function util d3f SetUpFreeSurfaceData ( inst  ,
problem  ,
domain  ,
vol   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :390-857

◆ type()

function util d3f check type ( param  ,
name  ,
typ   
)

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :123-131

function util.d3f.check.type(param, name, typ)
if type(param) ~= typ then
print("In util.d3f.solve: Parameter '"..name.."' not a "..typ..".");
util.d3f.usage();
print("Check parameter settings. Aborting execution."); exit();
end
end

◆ Upwind()

function util d3f parse Upwind ( upwind  )

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1974-2000

◆ usage()

function util d3f usage ( )

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :92-105

function util.d3f.usage()
print("");
print("Usage of util.d3f.solve(problem):");
print("---------------------------------");
print("");
print(" (r) = required, (o) = optional");
print("");
print("(r) problem.domain -- a subsection ");
print("(r) problem.domain.dim -- World dimension of problem [1,2,3]");
print("(r) problem.domain.grid -- (path to) grid file [\"*.ugx\"]");
print("(r) problem.domain.numRefs -- number of refinements (integer)");
print("(r) problem.domain.numPreRefs -- number of pre-refinements (parallel) (integer)");
end

◆ Viscosity()

function util d3f parse Viscosity ( ViscosityDesc  ,
 
)

This function creates a UserData for the viscosity, based on the passed viscosity descriptor See ViscosityDesc.md for detailed documentation of supported ViscosityDesc formats.

ViscosityDesc
w

location: /home/runner/work/docs/docs/ug4/plugins/d3f/lua / d3f_util.lua :1704-1785

Variable Documentation

◆ fromCP

parameterNumber fromCP = 0

id of the checkpoint