CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] outputTime in Swak function (https://www.cfd-online.com/Forums/openfoam-community-contributions/118000-outputtime-swak-function.html)

immortality May 19, 2013 05:54

outputTime in Swak function
 
I have written this SWAK function to write the expression at each outputTime(not each timeStep):
Code:

n1_totalTemperature
    {
        type swakExpression;
        valueType surface;
        surfaceName normalPlane_T0_1;
        verbose true;
        surface {
            type plane;
            basePoint      (0.01725 0.002 0);
            normalVector    (1 0 0);
            interpolate true;
        }
        expression "sum((T+0.000497517*magSqr(U))*rho*area())/sum(rho*area())";
        accumulations (
            average
        );
        outputControl outputTime;//outputTime;//
        outputInterval 1; // 5000
    }

bu it writes still the values in each time step:

Code:

nused output: areaAverage(right) for p = 303977.3946
Unused output: areaAverage(right) for U = (0 -78.27914269 0)
Unused output: areaAverage(right) for T = 440.0158214
Unused output: areaAverage(right) for rho = 2.406229408
Unused output: areaAverage(right) for h = 143969.4069
Unused output:
Unused output: Expression totalPressure_right :  average=311349.633
Unused output: Expression totalTemperature_right :  average=443.0644198
Unused output: Expression totalEnthalpy_right :  average=202609.9735
Unused output: Expression flowInlet :  sum=-0.000200896449
Unused output: faceSource Average_left output:
Unused output: areaAverage(left) for p = 328460.3658
Unused output: areaAverage(left) for U = (24.89352103 -84.5762301 0)
Unused output: areaAverage(left) for T = 496.1931543
Unused output: areaAverage(left) for rho = 2.355562913
Unused output: areaAverage(left) for h = 204658.9719
Unused output:
Unused output: Expression totalPressure_left :  average=344793.4867
Unused output: Expression totalTemperature_left :  average=494.9186351
Unused output: Expression n1_totalTemperature :  average=440
Unused output: Expression n1_totalPressure :  average=303975
Unused output: Expression n2_totalTemperature :  average=440
Unused output: Expression n2_totalPressure :  average=303975
Unused output: Expression n2_MaxU :  average=2.00358353e-13
Unused output: Expression n2_Maxp :  average=303975
Unused output: Expression n2_pressure_minMax :  min=303975 max=303975
Unused output: Expression n3_totalTemperature :  average=440
Unused output: Expression n3_totalPressure :  average=303975
Unused output: Expression h1_totalTemperature :  average=440.0002414
Unused output: Expression h1_totalPressure :  average=303975.5373
Unused output: Expression h2_totalTemperature :  average=440.0000913
Unused output: Expression h2_totalPressure :  average=303975.0635
Unused output: Expression h2_pressure_minMax :  min=303975 max=303978.1412
Unused output: Expression h3_totalTemperature :  average=440.5776045
Unused output: Expression h3_totalPressure :  average=305028.7895
Unused output: Mean and max Courant Numbers = 0.007692142019 0.09958988306

why?

wyldckat May 19, 2013 07:38

Hi Ehsan,

In this case, swak4Foam doesn't use "outputControl". It only uses "outputInterval". Which means that it you'll have to use something like this:
Code:

outputInterval 10;
Best regards,
Bruno

immortality May 19, 2013 07:53

Hi Bruno
1)what do you mean by "in this case"?
2)I have a variable timeStep.there isn't any other way to have outputs concurrent with folder writing times to save time?
I saw this,what does cloud mean?
Code:

createThrePointSet
    {
        type createSampledSet;
        outputControl timeStep;
        outputInterval 1;
        setName threePoints;
        set {
            type cloud;
            axis x;
            points (
                (0.1 0.14 0.0001)
                (0.0 0.02 0.0001)
                (-0.1 0.02 0.0001)
            );
        }
        writeSetOnConstruction true;
        autoWriteSet true;
        setFormat vtk;
    }

3)can use phi on patch in sampledSurfaces?
thanks.

wyldckat May 19, 2013 08:00

Hi Ehsan,

1) From what I can figure out, swak4Foam can use "outputControl" in some other function objects. But in this case, namely for "swakExpression", this doesn't work.

2)
Quote:

I have a variable timeStep.there isn't any other way to have outputs concurrent with folder writing times to save time?
It's necessary to change the source code of swak4Foam for this to be possible.

Quote:

I saw this,what does cloud mean?
I'm not familiar with this function object... but "cloud" is used for indicating multiple points for sampling.

3) As I said on the email a few minutes ago, "phi" cannot be used with the "sampledSurface" in OpenFOAM's function object, which is why "faceZone" has to be used instead.

Best regards,
Bruno

gschaider May 19, 2013 17:47

Quote:

Originally Posted by wyldckat (Post 428539)
Hi Ehsan,

1) From what I can figure out, swak4Foam can use "outputControl" in some other function objects. But in this case, namely for "swakExpression", this doesn't work.

For historical reasons all function objects in swak that are based on the simpleFunctionObjects are not based on OutputFilterFunctionObject and therefor do not support outputControl (other function objects do). Incidentally my current development version already supports this.

Quote:

Originally Posted by wyldckat (Post 428539)
2) It's necessary to change the source code of swak4Foam for this to be possible.


Also writing at fixed time intervals is already supported

immortality May 20, 2013 04:53

Hi Bernhard
when does the new version will release?(current version i use is 0.2.3 is there a newer one?)

gschaider May 20, 2013 06:43

Quote:

Originally Posted by immortality (Post 428652)
Hi Bernhard
when does the new version will release?

When it is ready. Intermediate versions are found in the mercurial-repository. But they may contain bugs so use with care. New features are documented in the README

Quote:

Originally Posted by immortality (Post 428652)
(current version i use is 0.2.3 is there a newer one?)

No. That is the latest released one

manju819 June 24, 2015 07:13

Hi Bernhard
I'm writing the variable on the patch using swakEpression

Code:

Ttop {
                type    swakExpression;
                valueType      patch;
                patchName      top;
                outputControlMode timeStep;
                outputInterval  100;
                region          stratumCorneum;
                expression      "T";
                accumulations  (
                        average
                );
                verbose        true;
                autoInterpolate true;
        }

I added libraries also but it is showing the error


Code:

--> FOAM FATAL ERROR:
Unknown function type swakExpression

Valid functions are :

71
(
CourantNo
DESModelRegions
Lambda2
Peclet
Q
addForeignMeshes
addGlobalVariable
calculateGlobalVariables
clearExpressionField
coded
correctThermo
createSampledSet
createSampledSurface
dsmcFields
dynamicFunctionObjectListProxy
executeIfEnvironmentVariable
executeIfExecutableFits
executeIfFunctionObjectPresent
executeIfObjectExists
executeIfOpenFOAMVersionBiggerEqual
executeIfParallelSerial
executeIfStartTime
expressionField
fieldDistribution
foreignMeshesFollowTime
functionObjectListProxy
initPotentialFlow
initSwakFunctionObject
listRegisteredObjects
loadCompressibleTurbulenceModel
loadIncompressibleTurbulenceModel
loadPsiThermoModel
loadRhoThermoModel
loadSLGThermoModel
manipulateField
manipulatePatchField
panicDump
patchAverage
patchFieldDistribution
patchFieldFlow
patchIntegrate
patchMassFlow
patchMassFlowAverage
patchProbes
pressureTools
probes
readAndUpdateFields
readGravitation
recalcPhi
recalcThermoHe
removeGlobalVariable
scalarTransport
setDeltaTByTimeline
setTimeStep
sets
solveLaplacianPDE
solveTransportPDE
solverPerformanceToGlobalVariables
surfaces
swakCoded
timeActivatedFileUpdate
trackDictionary
volumeAverage
volumeIntegrate
volumeMinMax
wallShearStress
writeAdditionalFields
writeAndEndFieldRange
writeFieldsOften
yPlusLES
yPlusRAS
)



    From function functionObject::New(const word& name, const Time&, const dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 92.

FOAM exiting

why swakExpression function is not working? Please help me.

This is showing this error also


Code:

--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : /home/mechfoam/OpenFOAM/mechfoam-2.2.x/platforms/linux64GccDPOpt/lib/libsimpleSwakFunctionObjects.so: undefined symbol: _ZTIN4Foam36conditionDrivenWritingFunctionObjectE
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libsimpleSwakFunctionObjects.so"


wyldckat June 28, 2015 16:25

Quote:

Originally Posted by manju819 (Post 551911)
why swakExpression function is not working?

Quick answer: Edit the "system/controlDict" and add the library "libsimpleFunctionObjects.so" in "libs" before "libsimpleSwakFunctionObjects.so", e.g.:
Code:

libs
(
"libsimpleFunctionObjects.so"
"libsimpleSwakFunctionObjects.so"
);


afshinb February 7, 2016 03:02

I'm using OF 3.0.1 and just installed swak4Foam 0.4.0 from here.
installation process seemed to went well. but now I'm getting this error.
Code:

-> FOAM FATAL ERROR:
Unknown function type swakExpression

Valid functions are :

4
(
patchProbes
probes
sets
surfaces
)



    From function functionObject::New(const word& name, const Time&, const dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 92.

FOAM exiting

is it about the libraries location?
where should swak4Foam libraries be placed now?

wyldckat February 7, 2016 11:07

Quote:

Originally Posted by afshinb (Post 584050)
is it about the libraries location?
where should swak4Foam libraries be placed now?

Quick requests:
  1. Please provide the "system/controlDict" file you're using in your case.
  2. Please provide the complete output from the solver.
  3. Please provide what the following command gives you:
    Code:

    ls -l $FOAM_USER_LIBBIN

afshinb February 7, 2016 11:53

Quote:

Originally Posted by wyldckat (Post 584077)
Quick requests:
  1. Please provide the "system/controlDict" file you're using in your case.
  2. Please provide the complete output from the solver.
  3. Please provide what the following command gives you:
    Code:

    ls -l $FOAM_USER_LIBBIN

1.
Code:

libs (
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
);
functions
{
liquid_COG //simpleFunctionObjects
{
type swakExpression;
valueType internalField;
setName liquidCog;
accumulations (sum);
expression "sum(pos()*alpha.water*vol())/(vol()*alpha.water)"; //works

/*# Time sum
0.01 (0.000309988 0.0903394 0.25)*/
verbose true;
outputControl outputTime;
}

2. I'm not sure what you want.

3. it gives me this:
Code:

ls: cannot access /home/afshin/OpenFOAM/afshin-3.0.1/platforms/linux64GccDPInt32Opt/lib: No such file or directory
are you looking for this directory?
Code:

/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib

wyldckat February 7, 2016 13:45

Greetings Afshin,

Please keep in mind that OpenFOAM is very picky with every single detail ;) Any missing detail can be the reason for it to not work as intended.

Quote:

Originally Posted by afshinb (Post 584083)
1.
Code:

libs (
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
);
functions
{
liquid_COG //simpleFunctionObjects
{
type swakExpression;
valueType internalField;
setName liquidCog;
accumulations (sum);
expression "sum(pos()*alpha.water*vol())/(vol()*alpha.water)"; //works

/*# Time sum
0.01 (0.000309988 0.0903394 0.25)*/
verbose true;
outputControl outputTime;
}


For this list, I hope the missing closing bracket is not missing from your complete "system/controlDict" file. In addition, I hope you only have a single "libs" entry. Beyond that, I don't see any specific problem.

Quote:

Originally Posted by afshinb (Post 584083)
2. I'm not sure what you want.

Remember what you posted in your previous post, namely post #10? Namely this:
Quote:

Originally Posted by afshinb (Post 584050)
Code:

-> FOAM FATAL ERROR:
Unknown function type swakExpression

Valid functions are :


This is only a very small part of the output that the solver gave you on-screen. I need the complete output, so that I can confirm if there were any other diagnostics that OpenFOAM gave earlier or later.

Quote:

Originally Posted by afshinb (Post 584083)
3. it gives me this:
Code:

ls: cannot access /home/afshin/OpenFOAM/afshin-3.0.1/platforms/linux64GccDPInt32Opt/lib: No such file or directory
are you looking for this directory?
Code:

/opt/openfoam30/platforms/linux64GccDPInt32Opt/lib

If you didn't change anything from the conventional installation instructions for swak4Foam, then I was looking for the correct directory. And it doesn't exist, then that probably means that swak4Foam did not build at all :(

If this diagnosis is correct, then I need the log file "log.make" that results from this command:
Code:

./Allwmake > log.make 2>&1
You can compress the file with this command:
Code:

gzip < log.make > log.make.gz
Then please attach the file "log.make.gz" to your next post.

Best regards,
Bruno

afshinb February 7, 2016 17:56

1 Attachment(s)
Quote:

Originally Posted by wyldckat (Post 584090)
Greetings Afshin,

Please keep in mind that OpenFOAM is very picky with every single detail ;) Any missing detail can be the reason for it to not work as intended.


For this list, I hope the missing closing bracket is not missing from your complete "system/controlDict" file. In addition, I hope you only have a single "libs" entry. Beyond that, I don't see any specific problem.


Remember what you posted in your previous post, namely post #10? Namely this:

This is only a very small part of the output that the solver gave you on-screen. I need the complete output, so that I can confirm if there were any other diagnostics that OpenFOAM gave earlier or later.


If you didn't change anything from the conventional installation instructions for swak4Foam, then I was looking for the correct directory. And it doesn't exist, then that probably means that swak4Foam did not build at all :(

If this diagnosis is correct, then I need the log file "log.make" that results from this command:
Code:

./Allwmake > log.make 2>&1
You can compress the file with this command:
Code:

gzip < log.make > log.make.gz
Then please attach the file "log.make.gz" to your next post.

Best regards,
Bruno

yes you are right, there was a missing closing bracket but fixing it didn't solve the problem.
is there a problem in having multiple libs entries ?

that's the complete output:
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 3.0.1-119cac7e8750
Exec  : interFoam
Date  : Feb 08 2016
Time  : 02:11:19
Host  : "afshin-System"
PID    : 11058
Case  : /home/afshin/Desktop/damBreak
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : libsimpleSwakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libsimpleSwakFunctionObjects.so"
--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : libswakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libswakFunctionObjects.so"
--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : libgroovyBC.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libgroovyBC.so"
--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1179
    dlopen error : libsimpleFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 99
    could not load "libsimpleFunctionObjects.so"
Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar

Reading g

Reading hRef
Calculating field g.h

No MRF models present

No finite volume options present

DICPCG:  Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
Courant Number mean: 0 max: 0

Starting time loop



--> FOAM FATAL ERROR:
Unknown function type swakExpression

Valid functions are :

4
(
patchProbes
probes
sets
surfaces
)



    From function functionObject::New(const word& name, const Time&, const dictionary&)
    in file db/functionObjects/functionObject/functionObject.C at line 92.

FOAM exiting

thank you for your kind responses.

Regards,
Afshin.

wyldckat February 7, 2016 18:24

Quick answer: The log file told us the whole story! :)
The problem is that you built swak4Foam with root powers (probably using sudo), because it tells us that one of the installation folders was this:
Code:

/home/afshin/OpenFOAM/root-3.0.1/platforms/linux64GccDPInt32Opt/lib/
"root-3.0.1" is not "afshin-3.0.1", which is why the libraries are not being found.

OK, let's see if I don't make a mistake in the following code... please carefully run these commands:
Code:

cd ~/OpenFOAM
mkdir afshin-3.0.1
sudo mv root-3.0.1/* afshin-3.0.1/
sudo chown -R afshin:afshin afshin-3.0.1

And finally, check if the folder I asked about in a previous post exists as intended with the desired libraries:
Code:

ls -l $FOAM_USER_LIBBIN
If all went well, it should list the libraries we want, such as "libgroovyBC.so".

Quote:

Originally Posted by afshinb (Post 584116)
is there a problem in having multiple libs entries ?

For example, having the following two lines in "system/controlDict" is wrong:
Code:

libs ("libsimpleFunctionObjects.so");
libs ("libsimpleSwakFunctionObjects.so");

It's wrong, because OpenFOAM will only read the first one. Therefore, the correct way is something this:
Code:

libs ("libsimpleFunctionObjects.so" "libsimpleSwakFunctionObjects.so" );

afshinb February 8, 2016 08:16

Quote:

Originally Posted by wyldckat (Post 584121)
Quick answer: The log file told us the whole story! :)
The problem is that you built swak4Foam with root powers (probably using sudo), because it tells us that one of the installation folders was this:
Code:

/home/afshin/OpenFOAM/root-3.0.1/platforms/linux64GccDPInt32Opt/lib/
"root-3.0.1" is not "afshin-3.0.1", which is why the libraries are not being found.

OK, let's see if I don't make a mistake in the following code... please carefully run these commands:
Code:

cd ~/OpenFOAM
mkdir afshin-3.0.1
sudo mv root-3.0.1/* afshin-3.0.1/
sudo chown -R afshin:afshin afshin-3.0.1

And finally, check if the folder I asked about in a previous post exists as intended with the desired libraries:
Code:

ls -l $FOAM_USER_LIBBIN
If all went well, it should list the libraries we want, such as "libgroovyBC.so".


For example, having the following two lines in "system/controlDict" is wrong:
Code:

libs ("libsimpleFunctionObjects.so");
libs ("libsimpleSwakFunctionObjects.so");

It's wrong, because OpenFOAM will only read the first one. Therefore, the correct way is something this:
Code:

libs ("libsimpleFunctionObjects.so" "libsimpleSwakFunctionObjects.so" );

That did the job.
thank you for your kind help.
but I can't get my code to work:

Code:

functions
{
liquid_COG //simpleFunctionObjects
{
type swakExpression;
valueType internalField;
setName liquidCog;
accumulations (sum);
expression "sum(pos()*alpha.water*vol())/(vol()*alpha.water)";
verbose true;
outputControl outputTime;
}
}

do you have any idea about it?
Code:

Create time

Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Reading field p_rgh

Reading field U

Reading/calculating face flux field phi

Reading transportProperties

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar

Reading g

Reading hRef
Calculating field g.h

No MRF models present

No finite volume options present

DICPCG:  Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0, global = 0, cumulative = 0
Courant Number mean: 0 max: 0

Starting time loop

--> FOAM Warning :
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 109
    'outputControlMode' not found in liquid_COG
Assuming: timeStep
--> FOAM Warning :
    From function simpleFunctionObject::simpleFunctionObject
    in file simpleFunctionObject/simpleFunctionObject.C at line 117
    'outputInterval' not found in liquid_COG
Assuming: 1
swak4Foam: Setting default mesh
Courant Number mean: 0 max: 0
Interface Courant Number mean: 0 max: 0
deltaT = 0.00119048
Time = 0.00119048

PIMPLE: iteration 1
smoothSolver:  Solving for alpha.water, Initial residual = 0, Final residual = 0, No Iterations 0
Phase-1 volume fraction = 0.130194  Min(alpha.water) = 0  Max(alpha.water) = 1
MULES: Correcting alpha.water
MULES: Correcting alpha.water
Phase-1 volume fraction = 0.130194  Min(alpha.water) = 0  Max(alpha.water) = 1
DICPCG:  Solving for p_rgh, Initial residual = 1, Final residual = 0.00312205, No Iterations 1
time step continuity errors : sum local = 0.000863557, global = 1.26712e-12, cumulative = 1.26712e-12
DICPCG:  Solving for p_rgh, Initial residual = 0.00146358, Final residual = 6.1835e-05, No Iterations 13
time step continuity errors : sum local = 3.64891e-05, global = 1.00147e-05, cumulative = 1.00147e-05
DICPCG:  Solving for p_rgh, Initial residual = 5.08691e-05, Final residual = 8.19239e-08, No Iterations 48
time step continuity errors : sum local = 5.88452e-08, global = -1.01668e-08, cumulative = 1.00045e-05
ExecutionTime = 0.19 s  ClockTime = 1 s

Expression liquid_COG : swak4Foam: Allocating new repository for sampledMeshes
swak4Foam: Allocating new repository for sampledGlobalVariables
--> FOAM Warning :
    From function ConcretePluginFunction<DriverType>::exists
    in file lnInclude/ConcretePluginFunction.C at line 121
    Constructor table of plugin functions for FieldValueExpressionDriver is not initialized


--> FOAM FATAL ERROR:
 Parser Error for driver FieldValueExpressionDriver at "1.11-15" :"field alpha not existing or of wrong type"
"sum(pos()*alpha.water*vol())/(vol()*alpha.water)"
            ^^^^^
------------|   

Context of the error:


- From dictionary: /home/afshin/Desktop/damBreak/system/controlDict.functions.liquid_COG
  Evaluating expression "sum(pos()*alpha.water*vol())/(vol()*alpha.water)"


    From function parsingValue
    in file lnInclude/CommonValueExpressionDriverI.H at line 1204.

FOAM exiting


wyldckat February 14, 2016 16:02

Quick answer: "alpha.water" problem... that has to do with a problem that swak4Foam has with field names that have dots in their names. Googling... results:
  1. https://sourceforge.net/p/openfoam-e...swak4foam/210/
  2. http://xiaopingqiu.github.io/2015/11...m-alpha-water/

Elham November 22, 2018 21:08

Hi,


I would like the output time step of swakExpression be written in 7 precisions. My current command is as following:


Code:

    interfaceTemp
    {
    ignore_unimplemented_simpleFunctionObject::updateMesh true;
        aliases {
        alpha1 alpha.water;
        }
    type swakExpression;
    valueType surface;
    surfaceName interface1;
    surface {
        type isoSurface;
        isoField alpha.water;
        isoValue 0.9;
        interpolate true;
                writePrecision 7;
    }
    verbose true;
    expression "T";
    accumulations (
        average
        min
        max
    );
        outputInterval 20;
        timePrecision 7;
    }


But it is still written in 4, although the processing time step precision is 7:



# Time average min max
31.8321 343.078 342.996 362.95
31.8321 343.065 341.481 362.862
31.8321 343.061 342.085 362.834




I will apprciate any help.


Cheers,


Elham

gschaider November 23, 2018 08:53

Quote:

Originally Posted by Elham (Post 716571)
Hi,


I would like the output time step of swakExpression be written in 7 precisions. My current command is as following:


Code:

    interfaceTemp
    {
    ignore_unimplemented_simpleFunctionObject::updateMesh true;
        aliases {
        alpha1 alpha.water;
        }
    type swakExpression;
    valueType surface;
    surfaceName interface1;
    surface {
        type isoSurface;
        isoField alpha.water;
        isoValue 0.9;
        interpolate true;
                writePrecision 7;
    }
    verbose true;
    expression "T";
    accumulations (
        average
        min
        max
    );
        outputInterval 20;
        timePrecision 7;
    }

But it is still written in 4, although the processing time step precision is 7:



# Time average min max
31.8321 343.078 342.996 362.95
31.8321 343.065 341.481 362.862
31.8321 343.061 342.085 362.834




I will apprciate any help.


Cheers,


Elham


AFAIK (but I'd have to check the sources to be sure) swak makes no effort to change the write precision. So unless the underlying Foam-implementation doesn't support this on a functionObject-level (I'm not aware of this) your best chance is to set it in the controlDict for the whole run (everything will be written with 7 digits)

Elham November 25, 2018 05:40

Quote:

Originally Posted by gschaider (Post 716631)
AFAIK (but I'd have to check the sources to be sure) swak makes no effort to change the write precision. So unless the underlying Foam-implementation doesn't support this on a functionObject-level (I'm not aware of this) your best chance is to set it in the controlDict for the whole run (everything will be written with 7 digits)

Ok. Thanks for your comment.


All times are GMT -4. The time now is 22:22.