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

how can see Cp values?

Register Blogs Community New Posts Updated Threads Search

Like Tree16Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 27, 2013, 19:01
Default how can see Cp values?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
i use janaf for Cp(isobaric speciefic heat).then does anyone know the keyword for puting Cp's in each time step?(like the command Mach for mach number

Last edited by immortality; March 27, 2013 at 19:39.
immortality is offline   Reply With Quote

Old   March 28, 2013, 07:52
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
any suggestion?nobody knows?!!
immortality is offline   Reply With Quote

Old   March 28, 2013, 13:16
Default
  #3
Member
 
Chris
Join Date: Aug 2012
Location: Calgary, Alberta, Canada
Posts: 77
Rep Power: 13
ChrisA is on a distinguished road
If you look at the code for mach you'll see that it has to call Cp to calculate the mach number, you can mimic the code outputting the mach number to output Cp as well using the same call. This would be to extract the Cp values post simulation.

You could also do it while the solver is running by defining an I/O field that simply gains the value of Cp for each timestep and set it to autowrite. Depending on how your thermo package is defined in the solver you intend on using thermo.Cp() might work, I think, just writing from the top of my head right now. At any rate Cp will come from the same call that pulls temperature, pressure, rho, etc.
immortality likes this.
ChrisA is offline   Reply With Quote

Old   March 28, 2013, 14:35
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
thank you for your guidance.
I've added this to creatFields.H:
Code:
volScalarField Cp
    (
    IOobject
        (
            "Cp",
            runTime.timeName(),
            mesh,
            IOobject::READ_IF_PRESENT,
            IOobject::AUTO_WRITE
        ),
         thermo.Cp()
     );
is it true?
but it isn't written in each folder.
immortality is offline   Reply With Quote

Old   March 28, 2013, 23:57
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
why it is not written in time folders in your opinion?
immortality is offline   Reply With Quote

Old   March 29, 2013, 08:02
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
any help or suggestion?
immortality is offline   Reply With Quote

Old   March 30, 2013, 04:31
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
is it not possible to have Cp values in folders?
immortality is offline   Reply With Quote

Old   March 31, 2013, 06:11
Default HOW to write Cp in time folders during or after the run?
  #8
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
I've added this to creatFields.H:
Code:
volScalarField Cp
    (
    IOobject
        (
            "Cp",
            runTime.timeName(),
            mesh,
            IOobject::READ_IF_PRESENT,
            IOobject::AUTO_WRITE
        ),
         thermo.Cp()
     );
is it true?
but it isn't written in each folder.
immortality is offline   Reply With Quote

Old   April 1, 2013, 04:10
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
why it doesn't work?
immortality is offline   Reply With Quote

Old   April 1, 2013, 14:18
Default
  #10
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Ehsan: try the attached package "specificHeat.tar.gz". To build it:
Code:
tar -xzf specificHeat.tar.gz
cd specificHeat
wmake
It was tested with OpenFOAM 2.1.x. It's based on OpenFOAM's pPrime2 and buoyantSimpleFoam.

Since I don't know which tutorial case I should test on, I tried "heatTransfer/buoyantSimpleFoam/buoyantCavity" and it worked... with limited success. In essence, the "Cp" value was constant on the whole field.

edit: forgot to mention that to use it, you need to run:
Code:
specificHeat
It will execute for all time instances.


Without knowing more information about a test case I can use, I suggest that you also try the function object "writeRegisteredObject": http://openfoamwiki.net/index.php/Ti...gisteredObject

Best regards,
Bruno
Attached Files
File Type: gz specificHeat.tar.gz (1.3 KB, 158 views)
immortality and Kummi like this.
__________________

Last edited by wyldckat; April 1, 2013 at 14:20. Reason: see "edit:"
wyldckat is offline   Reply With Quote

Old   April 1, 2013, 15:24
Default
  #11
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
thank you dear Bruno.since i use OF 2.2.0 recently.it got some eerors on basicPsiThermo that has changed its name into only psiThermo.when i changed all basicPsiThermo to psiThermo this error dispalyed in compiling.
Code:
ehsan@Ehsan-com:~/Desktop/specificHeat$ wmake
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam220/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPOpt/specificHeat.o -L/opt/openfoam220/platforms/linux64GccDPOpt/lib \
	     -lmeshTools -lbasicThermophysicalModels -lspecie -lfiniteVolume -lgenericPatchFields -lOpenFOAM -ldl   -lm -o /home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/specificHeat
/usr/bin/ld: cannot find -lbasicThermophysicalModels
collect2: ld returned 1 exit status
make: *** [/home/ehsan/OpenFOAM/ehsan-2.2.0/platforms/linux64GccDPOpt/bin/specificHeat] Error 1
immortality is offline   Reply With Quote

Old   April 1, 2013, 17:31
Default
  #12
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

I was hoping you would figure it out how to upgrade it

Attached is the version that compiles and seems to work in OpenFOAM 2.2... at least until I've got a better test case...

Best regards,
Bruno
Attached Files
File Type: gz specificHeat-2.2.tar.gz (1.3 KB, 99 views)
arvindpj and immortality like this.
__________________
wyldckat is offline   Reply With Quote

Old   April 2, 2013, 08:04
Default
  #13
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
thank you dear Bruno very much.if this error resolve the difficulty is passed.should i only change rhoThermo to psiThermo in specificHeat?
Code:
Create time

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package 
{
    type            hePsiThermo;
    mixture         pureMixture;
    transport       sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}



--> FOAM FATAL ERROR: 
Unknown rhoThermo type 
thermoType
{
    type            hePsiThermo;
    mixture         pureMixture;
    transport       sutherland;
    thermo          janaf;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}


Valid rhoThermo types are:

type         mixture                    transport   thermo       equationOfState           specie  energy                  

heRhoThermo  homogeneousMixture         const       hConst       incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  homogeneousMixture         const       hConst       perfectGas                specie  sensibleEnthalpy        
heRhoThermo  homogeneousMixture         sutherland  janaf        incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  homogeneousMixture         sutherland  janaf        perfectGas                specie  sensibleEnthalpy        
heRhoThermo  inhomogeneousMixture       const       hConst       incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  inhomogeneousMixture       const       hConst       perfectGas                specie  sensibleEnthalpy        
heRhoThermo  inhomogeneousMixture       sutherland  janaf        incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  inhomogeneousMixture       sutherland  janaf        perfectGas                specie  sensibleEnthalpy        
heRhoThermo  multiComponentMixture      const       hConst       incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  multiComponentMixture      const       hConst       perfectGas                specie  sensibleEnthalpy        
heRhoThermo  multiComponentMixture      polynomial  hPolynomial  icoPolynomial             specie  sensibleEnthalpy        
heRhoThermo  multiComponentMixture      sutherland  janaf        incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  multiComponentMixture      sutherland  janaf        perfectGas                specie  sensibleEnthalpy        
heRhoThermo  pureMixture                const       hConst       incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  pureMixture                const       hConst       incompressiblePerfectGas  specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                const       hConst       perfectFluid              specie  sensibleEnthalpy        
heRhoThermo  pureMixture                const       hConst       perfectFluid              specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                const       hConst       perfectGas                specie  sensibleEnthalpy        
heRhoThermo  pureMixture                const       hConst       perfectGas                specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                const       hConst       rhoConst                  specie  sensibleEnthalpy        
heRhoThermo  pureMixture                const       hConst       rhoConst                  specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                polynomial  hPolynomial  icoPolynomial             specie  sensibleEnthalpy        
heRhoThermo  pureMixture                polynomial  hPolynomial  icoPolynomial             specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                sutherland  hConst       incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  pureMixture                sutherland  hConst       incompressiblePerfectGas  specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                sutherland  hConst       perfectGas                specie  sensibleEnthalpy        
heRhoThermo  pureMixture                sutherland  hConst       perfectGas                specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                sutherland  janaf        incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  pureMixture                sutherland  janaf        incompressiblePerfectGas  specie  sensibleInternalEnergy  
heRhoThermo  pureMixture                sutherland  janaf        perfectGas                specie  sensibleEnthalpy        
heRhoThermo  pureMixture                sutherland  janaf        perfectGas                specie  sensibleInternalEnergy  
heRhoThermo  reactingMixture            const       hConst       incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  reactingMixture            const       hConst       perfectGas                specie  sensibleEnthalpy        
heRhoThermo  reactingMixture            polynomial  hPolynomial  icoPolynomial             specie  sensibleEnthalpy        
heRhoThermo  reactingMixture            sutherland  janaf        incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  reactingMixture            sutherland  janaf        perfectGas                specie  sensibleEnthalpy        
heRhoThermo  singleStepReactingMixture  sutherland  janaf        perfectGas                specie  sensibleEnthalpy        
heRhoThermo  veryInhomogeneousMixture   const       hConst       incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  veryInhomogeneousMixture   const       hConst       perfectGas                specie  sensibleEnthalpy        
heRhoThermo  veryInhomogeneousMixture   sutherland  janaf        incompressiblePerfectGas  specie  sensibleEnthalpy        
heRhoThermo  veryInhomogeneousMixture   sutherland  janaf        perfectGas                specie  sensibleEnthalpy        


    From function rhoThermo::New
    in file lnInclude/basicThermoTemplates.C at line 73.

FOAM exiting
immortality is offline   Reply With Quote

Old   April 2, 2013, 15:40
Default
  #14
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

I need a test case. Without one, I don't know what should be the correct choice to make

Because as I said on a previous post, I used the tutorial "heatTransfer/buoyantSimpleFoam/buoyantCavity" to test the attached application. It worked with that tutorial, but there are more solvers that use thermodynamics in different ways.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 2, 2013, 18:19
Default
  #15
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
dear Bruno my case is like shock tube but in rhoPimpleFoam(there is not a tutorial case in rhoPimpleFoam).could you please test for my case if i send to you.
Thank you very much.
immortality is offline   Reply With Quote

Old   April 3, 2013, 17:22
Default
  #16
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
dear Bruno could you see my case to modify Cp function?
could it be changed to calculate 1)mass flow rate on patches and also 2)total mass inflow and outflow measuring by a function like this?
thank you very very much.
Attached Files
File Type: gz Nazeri.tar.gz (9.9 KB, 41 views)
immortality is offline   Reply With Quote

Old   April 3, 2013, 19:07
Default
  #17
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

For calculating mass flow, the following has been around for several years now: http://openfoamwiki.net/index.php/Contrib_calcMassFlow

As for the specificHeat utility: I'm glad you provided a test case, because now I've managed to figure out that Cp was not correctly updated with each time step.
The attached version specificHeatHePsi (for OpenFOAM 2.2) is based on wdot and rhoPimpleFoam. It updates (by force) the thermo variable and writes the updated "Cp" field for all time steps.

Keeping in mind that this new utility is named specificHeatHePsi.

Best regards,
Bruno
Attached Files
File Type: gz specificHeatHePsi_2.2.tar.gz (1.3 KB, 131 views)
charmc and Kummi like this.
__________________
wyldckat is offline   Reply With Quote

Old   April 4, 2013, 07:55
Default
  #18
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Thank you very much dear Bruno.now it works well.
the mass flow application gives an error when compiled:
Code:
ehsan@Ehsan-com:~/Desktop/calcMassFlow$ wmake
Making dependency list for source file calcMassFlow.C
could not open file fvCFD.H for source file calcMassFlow.C
could not open file FaceSetUtilities.H for source file calcMassFlow.C
SOURCE=calcMassFlow.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam220/src/cfdTools/lnInclude -I/opt/openfoam220/src/cfdTools/general/lnInclude 	 -I/opt/openfoam220/src/meshTools/lnInclude 	 -I/home/ehsan/OpenFOAM/ehsan-2.2.0/Libraries/cellFaceSetUtilities/lnInclude -IlnInclude -I. -I/opt/openfoam220/src/OpenFOAM/lnInclude -I/opt/openfoam220/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/calcMassFlow.o
calcMassFlow.C:33:19: fatal error: fvCFD.H: No such file or directory
compilation terminated.
make: *** [Make/linux64GccDPOpt/calcMassFlow.o] Error 1
what does it mean that fvCFD.H doesn't exist.while its there.
I have done the run and now i want to calculate mass flow.how to do it like Cp after end of simulation?can modify Cp tool or anything like this?
thank you very much dear Bruno.
immortality is offline   Reply With Quote

Old   April 6, 2013, 07:20
Default
  #19
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,975
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Ehsan,

It's possible to merge the two applications, since the source code is fully open. Nonetheless, I don't have to time to look into such a feature.

And since you have about 2 threads on the topic of mass flow:
... so I'll answer to the compile error on the second thread.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 6, 2013, 11:33
Default
  #20
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
thanks Bruno.but i don't know how to use funkyDoCalc now.
what dictionary i have to add in system folder?
calcMassFlow is very nice.but it very good ta modify it a bit more.
thank you again.
immortality is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
TimeVaryingMappedFixedValue irishdave OpenFOAM Running, Solving & CFD 32 June 16, 2021 06:55
Numerical errors in nested domain with pre-calculated boundary values Arnoldinho OpenFOAM Running, Solving & CFD 3 April 4, 2012 10:31
max node values exceed max element values in contour plot jason_t FLUENT 0 August 19, 2009 11:32
exact face values RubenG Main CFD Forum 0 June 22, 2009 11:09
strange node values @ solid/fluid interface - help JB FLUENT 2 November 1, 2008 12:04


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