thermophysicalProperties with temperature dependance
Hi all,
is it possible to set upper and lower limits for let's say density when using a polynomial approach? I want to establish something like that: Density as a function of temperature rho_min: 1000 T < 240: 1100 T>240 : C1* T^2 + C2 *T + C3 It would also be possible to use step functions, if available. Best |
hello,
This is not a feature in OF, but it's easy to add this : check how to modify the polynomial density, and add your limiter. Take a loot at :http://www.tfd.chalmers.se/~hani/kur...nFoam%20v2.pdf This is for viscosity, but do the same for density... The basic step are: 1) copy $FOAM_SRC/thermophysicalModels/specie/equationOfState/icoPolynomial/ where you want. 2) rename all "icoPolynomial" by what you want like "icoLimitPolynomail"(file name AND inside !) 3) modify in file to add what you want 4) add a make file (make sur lib will be in FOAM_USER_LIBBIN) 4) compile (wmake) and use it ! (do not forget the libname in you controlDict) regards, olivier |
Ok found the solution
Use icoPolynomial for density as explained here http://cfd.direct/openfoam/user-guide/thermophysical/ and set the upper and lower limits for rho in the fvSolution |
Thanks for showing me that paper, but to be honest I'm not very familiar with OF programming and I found this simple solution for density which works good for me.
BUT I want to do the same thing for heat capacit in chtMultiRegionSimpleFoam-solver. For density the feature is implemented in the pressure equation as Quote:
Code:
Code:
CpMax.set(i, new dimensionedScalar(simpleDict.lookup("CpMax"))); Code:
{ Could you help me with this one? It would also be nice to write the Cp-field while solving to check whether it's correct or not. |
Viscosity depending on temperature exponentially
2) Question
Is it also possible to set an exponential dependance between viscosity and temperature? Something like: (C1 + C2*exp(-(T-Tref)/C5) + C3*exp(-(T-Tref)/C6) + C4*exp(-(T-Tref)/C7) |
hello,
You are wrong about the limit in fvSolution => this bound rho, but NOT in a conservative way. This is only for stability purpose. You should use a correct model for density. About 1°): Cp is inside alphaEff() ( ~ something like k/Cp + kt/Cp) You can use polynomal for Cp => use janaf model About 2°) by defaut, OF has only Sutherland viscosity(T) for gas. Take a look at the link i give you: this is how to add a custom viscosity. BTW, you should not be afraid about coding with OF: this is the way do do. regards, olivier |
Thanks for your advice, I followed the tutorial you showed me for implementing a temperature dependent viscosity, but this tutorial is only for incompressible flow using a viscosityProperties dictionary. But I want to calculate compressible using thermophysicalProperties.
Code:
thermoType When I look at heRhoThermo.C Code:
Where should I start when modifying the compressible case? I mean basically I only need an exponential function for defining mu and I need to know how to write the transportProperties as fields. Thx again for your help! |
hello,
You should add a custom thermo model. Check this : http://www.cfd-online.com/Forums/ope...tml#post451937 regards, olivier |
Ok I checked the post you recommended to me and I am trying to get into programming with OpenFoam.
But since this is quite tedious I am wondering whether it is possible to define a kind of lookup table for a thermophysical propertie in OpenFoam where I can put some data points (calculated externally) and OpenFoam does linear interpolation between those. I hope you get my idea. |
Didn't checked it but for everybody coming after me
This gives you the possibility to assign exponential terms https://github.com/OpenFOAM/OpenFOAM...1ec9af6f399210 |
All times are GMT -4. The time now is 23:37. |