CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

How to output other properties?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   April 23, 2012, 18:13
Default How to output other properties?
  #1
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
Hi,
I am using the OpenFOAM-210 and I Know that with foamCalc utility I can get the components of velocity and I also know how to get mach number and vorticity, but does anybody know how to output other variables such as viscosity, Reynolds number and etc?
thanks,
Wagner
wagnergaluppo is offline   Reply With Quote

Old   April 24, 2012, 02:42
Default
  #2
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 1,014
Rep Power: 18
akidess will become famous soon enough
Viscosity will be written to the time directories if it's not constant, and you can plot it with paraview. You can also use paraview to calculate the Reynolds number. If you want a command line utility, you'll have to get your hands dirty.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Join the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oHPxcPqde7HtA2
akidess is offline   Reply With Quote

Old   April 26, 2012, 23:51
Default
  #3
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
Thank you for your reply. I'm ready to get my hands dirty. Even though my viscosity is constant, I would still like to know how to output it at each time-step. I would like to verify that I am getting the correct value for my viscosity. I'm using the rhoCentralFoam solver. This is the output of the "createFields.H" file:

13--> const volScalarField& mu = thermo.mu();

So what I did was change this file to something like this:

13--> volScalarField mu
14--> (
15--> IOobject
16--> (
17--> "mu",
18--> runTime.timeName(),
19--> mesh,
20--> IOobject::MUST_READ,
21--> IOobject::AUTO_WRITE
22--> ),
23--> mesh
24--> );

Then I recompiled and created a "mu" file at my "/0/" directory. But after I running, the other time directories do not have the mu property. It's not autowriting as ordered. For the Reynolds number I'm still having problems. Do you know of any documentation about the command line utility for this?
thanks,
Wagner
wagnergaluppo is offline   Reply With Quote

Old   May 1, 2012, 14:42
Default sutherland viscosity
  #4
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
Hi Akidess,

I followed your suggestion and set the viscosity to sutherland. Now that the viscosity is not constant, I would have expected it to write to the time directories like you suggested. Unfortunately, viscosity does not appear in any of the time directories.

Have I missed something?

Here is the output of my thermophysical properties

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType      ePsiThermo<pureMixture<sutherlandTransport<specieThermo<eConstThermo<perfectGas>>>>>;

mixture
{
    // normalised gas
    specie
    {
        nMoles          1;
        molWeight       50;
    }
    thermodynamics
    {
        Cv              1007.8039105;
        Hf              2.544e+06;
    }
    transport
    {
        As              1.67212e-06;
        Ts              170.672;
    }
}
wagnergaluppo is offline   Reply With Quote

Old   May 1, 2012, 14:48
Default createfields.H
  #5
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
This is what I've specified in the createfields.H file

Code:
const volScalarField& psi = thermo.psi();
volScalarField mu
(
IOobject
(
"mu",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
wagnergaluppo is offline   Reply With Quote

Old   May 2, 2012, 03:39
Default
  #6
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 1,014
Rep Power: 18
akidess will become famous soon enough
Which solver are you using? I'll try it out and see if I can get it to work.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Join the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oHPxcPqde7HtA2
akidess is offline   Reply With Quote

Old   May 2, 2012, 12:36
Default
  #7
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
I'm using the rhoCentralFoam.
Thanks,
Wagner
wagnergaluppo is offline   Reply With Quote

Old   May 16, 2012, 15:28
Default
  #8
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
I figure it out.
Thank you,
Wagner Galuppo
wagnergaluppo is offline   Reply With Quote

Old   May 19, 2012, 05:09
Default
  #9
Senior Member
 
akidess's Avatar
 
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 1,014
Rep Power: 18
akidess will become famous soon enough
Sorry I couldn't help much, I got busy with other things. Can you add a post on how you solved the problem? It might help others in the future.
__________________
*On twitter @akidTwit
*Spend as much time formulating your questions as you expect people to spend on their answer.
*Join the OpenFOAM stackexchange Q&A site: http://area51.stackexchange.com/prop...oHPxcPqde7HtA2
akidess is offline   Reply With Quote

Old   May 24, 2012, 12:29
Default
  #10
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
Actually I partly figured it out. I found the file "basicThermo.C" in (/opt/openfoam210/src/thermophysicalModels/basic/basicThermo/)
If you have look from the 201st until 213th line you will find this:
Code:
mu_
    (
        IOobject
        (
            "mu",
            mesh.time().timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        mesh,
        dimensionSet(1, -1, -1, 0, 0)
    ),
I copied the directory (/opt/openfoam210/src/thermophysicalModels/basic/) to my workplace and I changed the name from /basic/ to /myBasic/.
in terminal:
Code:
$ cd /opt/openfoam210
$ cp -r --parents src/thermophysicalModels/basic/ /home/cfd02/OpenFOAM/USER-2.1.0/
$ cd ~/OpenFOAM/USER-2.1.0/src/thermophysicalModels/
$ mv basic myBasic
Next I edited line 209 in the file myBasic/basicThermo/basicThermo.C from:
Code:
IOobject::NO_WRITE
to
Code:
IOobject::AUTO_WRITE
and saved and closed it.

Then I changed the 27th line in the file myBasic/Make/files from:
Code:
LIB = $(FOAM_LIBBIN)/libbasicThermophysicalModels
to
Code:
LIB = $(FOAM_USER_LIBBIN)/libbasicThermophysicalModels
and saved and closed it.

Next I compiled the code:
Code:
$ cd ~/OpenFOAM/USER-2.1.0/src/thermophysicalModels/myBasic/
$ wmake libso
It works, if you run rhoCentralFoam will output mu and doesn't matter if it is constant.
The Problem is that I'm overwriting the main library basicThermophysicalModels instead of creating a new one.
wagnergaluppo is offline   Reply With Quote

Old   May 24, 2012, 19:20
Default
  #11
New Member
 
Wagner de Campos Galuppo
Join Date: Feb 2012
Location: Calgary
Posts: 9
Rep Power: 6
wagnergaluppo is on a distinguished road
I changed the last modifications for mu on line 209 (in myBasic/basicThermo/basicThermo.C) back to

Code:
IOobject::NO_WRITE
and doing so reverted to the original configuration of OpenFoam for basic thermophysical property. I recompiled it overwriting my last changes.

Now OpenFoam is using the original configuration, and so I try to make a new basic thermoPhysical model.

First, I reset mu to AUTO_WRITE (since I want to output mu).

Next, I changed line 27 in the file myBasic/Make/files from
Code:
LIB = $(FOAM_USER_LIBBIN)/libbasicThermophysicalModels
to:
Code:
LIB = $(FOAM_USER_LIBBIN)/libmubasicThermophysicalModels
and compiled it with the wmake libso command.

Then I copied rhoCentralFoam solver to my workplace and renamed the directory from /rhoCentralFoam/ to /muRhoCentralFoam/, and after that in the new /muRhoCentralFoam/ directory I changed the file from rhoCentralFoam.C to muRhoCentralFoam.C.
Code:
$ cd /opt/opefoam210/
$ cp -r --parents applications/solvers/compressible/rhoCentralFoam/ $WM_PROJECT_USER_DIR
$ cd $WM_PROJECT_USER_DIR/applications/solvers/compressible/
$ mv rhoCentralFoam muRhoCentralFoam
$ cd muRhoCentralFoam
$ mv rhoCentralFoam.C muRhoCentralFoam.C
Next, in the /muRhoCentralFoam/Make/ directory I changed the file files from
Code:
rhoCentralFoam.C

EXE = $(FOAM_APPBIN)/rhoCentralFoam
to
Code:
muRhoCentralFoam.C

EXE = $(FOAM_USER_APPBIN)/muRhoCentralFoam
And the file options from
Code:
EXE_INC = \
    -IBCs/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lbasicThermophysicalModels \
    -lspecie \
    -lrhoCentralFoam \
    -lcompressibleTurbulenceModel \
    -lcompressibleRASModels \
    -lcompressibleLESModels \
    -lmeshTools
to
Code:
EXE_INC = \
    -IBCs/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/myBasic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lmubasicThermophysicalModels \
    -lspecie \
    -lrhoCentralFoam \
    -lcompressibleTurbulenceModel \
    -lcompressibleRASModels \
    -lcompressibleLESModels \
    -lmeshTools
Then I tried to compile it, but it cannot find -lmubasicThermophysicalModels, the solver compilation is not reading my new basic thermophysicalModel.

Copilation error message:
Code:
Making dependency list for source file muRhoCentralFoam.C
SOURCE=muRhoCentralFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -I/home/USER/OpenFOAM/USER-2.1.0/src/thermophysicalModels/myBasic/lnInclude -I/opt/openfoam210/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam210/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam210/src/dynamicMesh/lnInclude -I/opt/openfoam210/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/muRhoCentralFoam.o
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H: In function ‘int main(int, char**)’:
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:32: warning: unused variable ‘adjustTimeStep’
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:35: warning: unused variable ‘maxCo’
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:38: warning: unused variable ‘maxDeltaT’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -I/home/USER/OpenFOAM/USER-2.1.0/src/thermophysicalModels/myBasic/lnInclude -I/opt/openfoam210/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam210/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam210/src/dynamicMesh/lnInclude -I/opt/openfoam210/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/muRhoCentralFoam.o -L/opt/openfoam210/platforms/linux64GccDPOpt/lib \
	     -lfiniteVolume -lmubasicThermophysicalModels -lspecie -lrhoCentralFoam -lcompressibleTurbulenceModel -lcompressibleRASModels -lcompressibleLESModels -lmeshTools -lOpenFOAM -ldl   -lm -o /home/USER/OpenFOAM/USER-2.1.0/platforms/linux64GccDPOpt/bin/muRhoCentralFoam
/usr/bin/ld: cannot find -lmubasicThermophysicalModels
collect2: ld returned 1 exit status
make: *** [/home/USER/OpenFOAM/USER-2.1.0/platforms/linux64GccDPOpt/bin/muRhoCentralFoam] Error 1
I also tried replacing in the file /Make/options
Code:
-lmubasicThermophysicalModels \
for the original one
Code:
-lbasicThermophysicalModels \
but it loads the main basic thermophysicalModel from OpenFoam.
Do you have any suggestions or ideas about how can I create this new basic thermophysicalModel and load it in my new solver, or what I am doing wrong?

Thanks,
Wagner Galuppo
wagnergaluppo is offline   Reply With Quote

Old   September 1, 2015, 08:49
Default Figured out?
  #12
Member
 
Lisandro Maders
Join Date: Feb 2013
Posts: 50
Rep Power: 4
Lisandro Maders is on a distinguished road
Quote:
Originally Posted by wagnergaluppo View Post
I changed the last modifications for mu on line 209 (in myBasic/basicThermo/basicThermo.C) back to

Code:
IOobject::NO_WRITE
and doing so reverted to the original configuration of OpenFoam for basic thermophysical property. I recompiled it overwriting my last changes.

Now OpenFoam is using the original configuration, and so I try to make a new basic thermoPhysical model.

First, I reset mu to AUTO_WRITE (since I want to output mu).

Next, I changed line 27 in the file myBasic/Make/files from
Code:
LIB = $(FOAM_USER_LIBBIN)/libbasicThermophysicalModels
to:
Code:
LIB = $(FOAM_USER_LIBBIN)/libmubasicThermophysicalModels
and compiled it with the wmake libso command.

Then I copied rhoCentralFoam solver to my workplace and renamed the directory from /rhoCentralFoam/ to /muRhoCentralFoam/, and after that in the new /muRhoCentralFoam/ directory I changed the file from rhoCentralFoam.C to muRhoCentralFoam.C.
Code:
$ cd /opt/opefoam210/
$ cp -r --parents applications/solvers/compressible/rhoCentralFoam/ $WM_PROJECT_USER_DIR
$ cd $WM_PROJECT_USER_DIR/applications/solvers/compressible/
$ mv rhoCentralFoam muRhoCentralFoam
$ cd muRhoCentralFoam
$ mv rhoCentralFoam.C muRhoCentralFoam.C
Next, in the /muRhoCentralFoam/Make/ directory I changed the file files from
Code:
rhoCentralFoam.C

EXE = $(FOAM_APPBIN)/rhoCentralFoam
to
Code:
muRhoCentralFoam.C

EXE = $(FOAM_USER_APPBIN)/muRhoCentralFoam
And the file options from
Code:
EXE_INC = \
    -IBCs/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lbasicThermophysicalModels \
    -lspecie \
    -lrhoCentralFoam \
    -lcompressibleTurbulenceModel \
    -lcompressibleRASModels \
    -lcompressibleLESModels \
    -lmeshTools
to
Code:
EXE_INC = \
    -IBCs/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/thermophysicalModels/myBasic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
    -I$(LIB_SRC)/dynamicMesh/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude

EXE_LIBS = \
    -lfiniteVolume \
    -lmubasicThermophysicalModels \
    -lspecie \
    -lrhoCentralFoam \
    -lcompressibleTurbulenceModel \
    -lcompressibleRASModels \
    -lcompressibleLESModels \
    -lmeshTools
Then I tried to compile it, but it cannot find -lmubasicThermophysicalModels, the solver compilation is not reading my new basic thermophysicalModel.

Copilation error message:
Code:
Making dependency list for source file muRhoCentralFoam.C
SOURCE=muRhoCentralFoam.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -I/home/USER/OpenFOAM/USER-2.1.0/src/thermophysicalModels/myBasic/lnInclude -I/opt/openfoam210/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam210/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam210/src/dynamicMesh/lnInclude -I/opt/openfoam210/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/muRhoCentralFoam.o
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H: In function ‘int main(int, char**)’:
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:32: warning: unused variable ‘adjustTimeStep’
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:35: warning: unused variable ‘maxCo’
/opt/openfoam210/src/finiteVolume/lnInclude/readTimeControls.H:38: warning: unused variable ‘maxDeltaT’
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -IBCs/lnInclude -I/opt/openfoam210/src/finiteVolume/lnInclude -I/home/USER/OpenFOAM/USER-2.1.0/src/thermophysicalModels/myBasic/lnInclude -I/opt/openfoam210/src/thermophysicalModels/specie/lnInclude -I/opt/openfoam210/src/turbulenceModels/compressible/turbulenceModel -I/opt/openfoam210/src/dynamicMesh/lnInclude -I/opt/openfoam210/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam210/src/OpenFOAM/lnInclude -I/opt/openfoam210/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/muRhoCentralFoam.o -L/opt/openfoam210/platforms/linux64GccDPOpt/lib \
         -lfiniteVolume -lmubasicThermophysicalModels -lspecie -lrhoCentralFoam -lcompressibleTurbulenceModel -lcompressibleRASModels -lcompressibleLESModels -lmeshTools -lOpenFOAM -ldl   -lm -o /home/USER/OpenFOAM/USER-2.1.0/platforms/linux64GccDPOpt/bin/muRhoCentralFoam
/usr/bin/ld: cannot find -lmubasicThermophysicalModels
collect2: ld returned 1 exit status
make: *** [/home/USER/OpenFOAM/USER-2.1.0/platforms/linux64GccDPOpt/bin/muRhoCentralFoam] Error 1
I also tried replacing in the file /Make/options
Code:
-lmubasicThermophysicalModels \
for the original one
Code:
-lbasicThermophysicalModels \
but it loads the main basic thermophysicalModel from OpenFoam.
Do you have any suggestions or ideas about how can I create this new basic thermophysicalModel and load it in my new solver, or what I am doing wrong?

Thanks,
Wagner Galuppo
Hello Wagner,

did you figure out your issue? It would be good if you write what you have done then other people could make use of this knowledge as well. I am trying to make a very similar implementation and I am getting similar errors..

Regards,

Lisandro
Lisandro Maders is offline   Reply With Quote

Old   September 1, 2015, 10:04
Default
  #13
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 252
Rep Power: 9
olivierG is on a distinguished road
Hello,

You don't need to do this to output viscosity, just use the functions objects "writeRegisteredObject".
ex:
Code:
{
type writeRegisteredObject;
functionObjectLibs ("libIOFunctionObjects.so");
objectNames ("bananas");
outputControl outputTime;
outputInterval 1;
}
Here, "bananas" will give you the list of all registered object, replace by the one you want.

regards,
olivier
hcl734 likes this.
olivierG is offline   Reply With Quote

Old   September 1, 2015, 10:42
Default
  #14
Member
 
Lisandro Maders
Join Date: Feb 2013
Posts: 50
Rep Power: 4
Lisandro Maders is on a distinguished road
Thanks for your tip Olivier, it seems much more straightforward and ease to get this value.

However, I am not able to find it working.

I put transportProperties instead of bananas but it does not write the nu field in any step.. (by the way,I think I am doing the basic things right. I put the "functions" subdict in the controlDict file, etc..)

Lisandro
Lisandro Maders is offline   Reply With Quote

Old   September 1, 2015, 10:49
Default
  #15
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 252
Rep Power: 9
olivierG is on a distinguished road
hello,

Yes, function object should be in controlDict.
First, run your solver with bananas => you will get an error message with the full list of possible object, and there is no bananas.
Then, pick up the good one (name here can be something::nu instead of nu)

regards,
olivier
olivierG is offline   Reply With Quote

Old   September 3, 2015, 09:10
Default
  #16
Member
 
Lisandro Maders
Join Date: Feb 2013
Posts: 50
Rep Power: 4
Lisandro Maders is on a distinguished road
Hi Olivier,

Does it work even if my viscosity has a constant value in all points? Because it seems not to be working.. The maximum I got was having a nu file in the time directories when I created it as a volScalarField in the createFields.H file in the solver directory..

Regards,
Lisandro
Lisandro Maders is offline   Reply With Quote

Old   September 11, 2015, 09:24
Default
  #17
Member
 
Lisandro Maders
Join Date: Feb 2013
Posts: 50
Rep Power: 4
Lisandro Maders is on a distinguished road
I solved it a couple of days ago, here is what I have done in order to make it:

I wanted to write the viscosity and Cp values any written time in the case folder.

1. In the createFields.H file:

Code:
 
volScalarField mu_output
(
    IOobject
    (
        "mu_output",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    turbulence->mu()
);
and

Code:
volScalarField cp_output
(
    IOobject
    (
        "cp_output",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    thermo.Cp()
);
2. In the solver.C file:

Code:
    while (runTime.run())
    {
        ....
        ....

        runTime.write();

        mu_output = turbulence->mu();
        cp_output = thermo.Cp();
    
    }
That worked for me! Later when I finish my project I will try to use the functionObject tool as recommended by Olivier. It seems much easier but I was not able to make it work! Thanks anyway!


Regards,

Lisandro
Lisandro Maders is offline   Reply With Quote

Old   December 14, 2015, 18:24
Default and Reynold's number
  #18
New Member
 
Join Date: Dec 2015
Posts: 4
Rep Power: 2
thunde47 is on a distinguished road
I want to plot Reynold's number. Not, Reynold's number is dependent on velocity. So, all I should do is provide a formula to calculate Re in the code. Also, I am going to calculate Re with mag(U). Please suggest how to incorporate these features in the code. I will appreciate if replies are relevant to icoFoam solver.
thunde47 is offline   Reply With Quote

Old   January 5, 2016, 04:12
Default
  #19
Member
 
Join Date: May 2015
Posts: 63
Rep Power: 2
hcl734 is on a distinguished road
Hi olivier,

your approach using function objects seems quite comfortable and I can reproduce some results for the thermo:... properties.
But when I put thermophysicalProperties for function object names, there is no result at all.
It says writing thermophysicalProperties object in the log-file but there is no output.
Ok there seems to be a bug in this function since it manipulates the header of the thermophysicalProperties-Dict adding the thermoType{...} entries into the FoamFile-header.
Could you help me to figure this one out?
hcl734 is offline   Reply With Quote

Old   January 5, 2016, 04:40
Default
  #20
Senior Member
 
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 252
Rep Power: 9
olivierG is on a distinguished road
hello,

function object work only with registered object. So there is 2 solution:
1) the properties you want is an object => just use the fuctionObject
2) you need some coding, and create a custom solver

the part 2) is easy, so don"t be scare.

regards,
olivier
olivierG is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error message cuteapathy CFX 14 March 20, 2012 07:45
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
lift and drag on ship superstructures vaina74 OpenFOAM Running, Solving & CFD 3 June 8, 2010 12:30
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
Two-Phase Buoyant Flow Issue Miguel Baritto CFX 4 August 31, 2006 12:02


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