Skip to main content

log

Description

The log function object computes the natural logarithm of an input volScalarField.

f=sln(max(f0,a))+t f = s \ln(\max(f_0, a)) + t

where:

ff : Output volScalarField

f0f_0 : Input volScalarField

ln\ln : Natural logarithm operator

aa : Clip scalar

ss : Scaling factor

tt : Offset factor

Operands

OperandTypeLocation
inputvolScalarField$FOAM_CASE/<time>/<inpField>
output file--
output fieldvolScalarField$FOAM_CASE/<time>/<outField>

Usage

Example of the log function object by using functions sub-dictionary in system/controlDict file:

log1
{
// Mandatory entries (unmodifiable)
type log;
libs (fieldFunctionObjects);

// Mandatory (inherited) entry (runtime modifiable)
field <inpField>;

// Optional entries (runtime modifiable)
clip 1e-3;
checkDimensions false;
scale 1.0;
offset 0.0;

// Optional (inherited) entries
result <fieldResult>;
region region0;
enabled true;
log true;
timeStart 0;
timeEnd 1000;
executeControl timeStep;
executeInterval 1;
writeControl timeStep;
writeInterval 1;
}

where the entries mean:

PropertyDescriptionTypeRequiredDefault
typeType name: logwordyes-
libsLibrary name: fieldFunctionObjectswordyes-
fieldName of the operand fieldwordyes-
clipValue to clip the operand field values to prevent zero or negative inputscalarnoSMALL
checkDimensionsFlag to check dimensions of the operand fieldboolnotrue
scaleScaling factor - s abovescalarno1.0
offsetOffset factor - t abovescalarno0.0

The inherited entries are elaborated in:

Example by using the postProcess utility:

postProcess -func "log(<inpField>)" -scale 1.0 -offset 0.0

Further information

Tutorial:

Source code:

API:

History: Introduced in version v2006