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   November 18, 2015, 19:34
Default
  #41
ait
New Member
 
Aly Taleb
Join Date: Aug 2015
Posts: 5
Rep Power: 11
ait is on a distinguished road
Hi everybody,

What does one need to do if one wants the solver to update a temperature dependent Cp for every time step? I am running coldEngineFoam and it only calculates Cp through Janaf for the beginning of the run. After that Cp is constant although the temperature fluctuates. All the solutions are post processing. Cp is calculated at the end of the run depending on the temperature field. I want the temperature field to be coupled to the varying Cp.

Thanks!
ait is offline   Reply With Quote

Old   November 19, 2015, 04:34
Default
  #42
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Quote:
Originally Posted by taleb.aly@gmail.com View Post
Hi everybody,

What does one need to do if one wants the solver to update a temperature dependent Cp for every time step? I am running coldEngineFoam and it only calculates Cp through Janaf for the beginning of the run. After that Cp is constant although the temperature fluctuates. All the solutions are post processing. Cp is calculated at the end of the run depending on the temperature field. I want the temperature field to be coupled to the varying Cp.

Thanks!
Hello,

taking a look to the code, you are using the energy equation of rhoSimpleFoam. Inside that file, you have thermo.correct(), which is updating Cp each time step.

This is the thing you were asking for? Because it should change once your equation is solved.
agustinvo is offline   Reply With Quote

Old   November 19, 2015, 16:20
Default
  #43
ait
New Member
 
Aly Taleb
Join Date: Aug 2015
Posts: 5
Rep Power: 11
ait is on a distinguished road
Thanks agustinvo. You are right. It does calculate an updated Cp value for every time step. For some reason, the output that I wrote for Cp only showed the value calculated at the beginning of the run and did not change it for the time steps.

I wrote the following in the createFields.H file:

Code:
   volScalarField heatCp
    (
	IOobject
	(
		"heatCp",
		runTime.timeName(),
		mesh,
		IOobject::NO_READ,
                IOobject::AUTO_WRITE
	),
    thermo.Cp()
    );
I also added the the following in the controlDict file:

Code:
heatCp
    {
        type            cellSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
	outputControl   timeStep;
        outputInterval  1;
        log             true;
        valueOutput     false;
        source          all;
        sourceName      none;
        operation       volAverage;
        fields
	(
		heatCp
        );
    }
Additionally, if I write "Cp" instead of "heatCp" in the createFields.H file, it gives me an error while compiling. Can somebody help me produce the correct output?
Kummi likes this.
ait is offline   Reply With Quote

Old   November 24, 2015, 11:30
Default
  #44
Senior Member
 
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15
agustinvo is on a distinguished road
Did you try to write in your code, just after the thermo.correct()

Code:
heatCp=thermo.Cp
this should update your variable each time step
agustinvo is offline   Reply With Quote

Old   November 26, 2015, 07:59
Default
  #45
ait
New Member
 
Aly Taleb
Join Date: Aug 2015
Posts: 5
Rep Power: 11
ait is on a distinguished road
Thanks augustinvo. I've found a work-around for the problem. I tried your suggestion but it gives me an error. However, I don't need this solution any more
ait is offline   Reply With Quote

Old   March 10, 2016, 10:56
Default
  #46
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 11
Gerrit is on a distinguished road
Hi,

sorry to bump into this thread again. I would like to see the cp values after my simulation. I used wyldckats last code, but when I try to wmake it I gain this:

Code:
Making dependency list for source file specificHeat.C
could not open file cyclicAMILduInterface.H for source file specificHeat.C due to No such file or directory
could not open file cyclicAMIPolyPatch.H for source file specificHeat.C due to No such file or directory
SOURCE=specificHeat.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam240/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam240/src/finiteVolume/lnInclude -IlnInclude -I. -I/opt/openfoam240/src/OpenFOAM/lnInclude -I/opt/openfoam240/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/specificHeat.o
In file included from /opt/openfoam240/src/finiteVolume/lnInclude/ddtScheme.C:30:0,
                 from /opt/openfoam240/src/finiteVolume/lnInclude/ddtScheme.H:325,
                 from /opt/openfoam240/src/finiteVolume/lnInclude/fvcDdt.C:28,
                 from /opt/openfoam240/src/finiteVolume/lnInclude/fvcDdt.H:199,
                 from /opt/openfoam240/src/finiteVolume/lnInclude/fvc.H:44,
                 from /opt/openfoam240/src/finiteVolume/lnInclude/fvCFD.H:8,
                 from specificHeat.C:27:
/opt/openfoam240/src/finiteVolume/lnInclude/cyclicAMIFvPatch.H:39:35: fatal error: cyclicAMILduInterface.H: No such file or directory
 #include "cyclicAMILduInterface.H"
                                   ^
compilation terminated.
make: *** [Make/linux64GccDPOpt/specificHeat.o] Error 1
I know that this is due to the fact, that I use OF 2.4.0, but I would like to solve this. Could someone help? I tried to find where the software uses cyclicAMILduInterface.H, but could not find it...
If it is looking for it, but does not find it, is there maybe only a new place or name of cyclicAMILduInterface.H?

Thank you.
Best
Gerrit is offline   Reply With Quote

Old   March 11, 2016, 10:56
Default
  #47
Senior Member
 
Freedom
Join Date: May 2014
Posts: 209
Rep Power: 13
wenxu is on a distinguished road
Dear Georg,

What's wrong with the "Not implemented" problem as you posted? Could you tell us how to solve this problem?

Best,
Xu
wenxu is offline   Reply With Quote

Old   March 13, 2016, 12:48
Default
  #48
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
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
Quick answers/questions:

@Gerrit:
Quote:
Originally Posted by Gerrit View Post
Could someone help? I tried to find where the software uses cyclicAMILduInterface.H, but could not find it...
If it is looking for it, but does not find it, is there maybe only a new place or name of cyclicAMILduInterface.H?
Simply stating "last code" is a bit ambiguous, because I or you might have missed which exact post was the last one with code
Anyway, see this post: http://www.cfd-online.com/Forums/ope...tml#post567796 - post #2

@wenxu:
Quote:
Originally Posted by wenxu View Post
Dear Georg,

What's wrong with the "Not implemented" problem as you posted? Could you tell us how to solve this problem?
Georg did state how it was solved... at least it looks like it, as described in post #31.
__________________
wyldckat is offline   Reply With Quote

Old   March 14, 2016, 04:34
Default
  #49
Member
 
Join Date: Jul 2015
Location: Aalborg
Posts: 83
Rep Power: 11
Gerrit is on a distinguished road
Hi Bruno,

thank you very much for your reply! I refered to post #17,
but this part of your answer solved my problem already!
Quote:
Anyway, see this post: http://www.cfd-online.com/Forums/ope...tml#post567796 - post #2
Best
wyldckat likes this.
Gerrit is offline   Reply With Quote

Old   April 15, 2017, 17:19
Default read Cp value from thermodynamics dictionary
  #50
mom
New Member
 
Join Date: Jan 2017
Posts: 5
Rep Power: 9
mom is on a distinguished road
Dear Foamers, Using cHT solver, How can I get the Cp value from my thermophysicalProperties in constant/ into controlDict in system?
my thermophysicalProperties file looks like this:
...
mixture
{
...

thermodynamics
{
Hf 0;
Cp 12;
}
...
Is it possible to get it with a command like :
const volScalarField& T = mesh_.lookupObject<volScalarField>("T");
that is used for temperature?
Annoying is that I managed to access thermodynamics dictionary (dictionary that you can see above) but I don't know how to extract Cp value from it, is there any command that I can use for it?
Kummi likes this.

Last edited by mom; April 18, 2017 at 05:07.
mom is offline   Reply With Quote

Old   July 11, 2019, 08:54
Default cp coeffs
  #51
New Member
 
TAKILT Hocine
Join Date: May 2019
Posts: 2
Rep Power: 0
kévine is on a distinguished road
hello all
can someone help me to see the cp of a fluid after the combustion air-H2 to be able to calculate gamma
mass fraction:
H2 = 1
H2O = 0.256
O2 = 0.258
N2 = 0.486
THANK YOU
kévine is offline   Reply With Quote

Old   June 18, 2021, 08:19
Default Cp field for multiphase solvers
  #52
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 8
john myce is on a distinguished road
Hi all !

I am trying to add the isobaric heat capacity in createFields.H to visualize it using the multiphase solver compressibleInterFoam.

So I added the following lines on the createFields.H file :

Code:
volScalarField Cp
    (
	IOobject
	(
		"Cp",
		runTime.timeName(),
		mesh,
		IOobject::READ_IF_PRESENT,
                IOobject::AUTO_WRITE
	),
    mixture.thermo1().Cp()()*alpha1 + mixture.thermo2().Cp()()*alpha2
    );
What it does : It actually reads the initial value but it does not update the value during the simulation (please refers to the image attached, comparing cp vs rho)

I tried to follow the method suggested by wyldckat & gork by adding these following lines :

Code:
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
rhoThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
The recompilation works but when I run again the simulation, it stop with the following error (2nd image attached).

Actually, this message is normal as I declare the thermo package in separate thermophysicalProperties for each phase (for instance thermophysicalProperties.liquid and thermophysicalProperties.gas)

So my question is how can I do to update the Cp by forcing the code to read into the right thermophysicalProperties files ?

Cheers,
Attached Images
File Type: jpg updateCp.jpg (25.4 KB, 8 views)
File Type: png cpvsrho.PNG (86.1 KB, 10 views)
john myce 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 07:55
Numerical errors in nested domain with pre-calculated boundary values Arnoldinho OpenFOAM Running, Solving & CFD 3 April 4, 2012 11:31
max node values exceed max element values in contour plot jason_t FLUENT 0 August 19, 2009 12:32
exact face values RubenG Main CFD Forum 0 June 22, 2009 12:09
strange node values @ solid/fluid interface - help JB FLUENT 2 November 1, 2008 13:04


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