|
[Sponsors] |
chtMultiRegionFoam: meaning of some expressions in the code |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 8, 2016, 14:08 |
chtMultiRegionFoam: meaning of some expressions in the code
|
#1 |
Senior Member
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21 |
Hi everybody!
I have been working for quite a while with chtMultiRegionSimpleFoam, and I know how it works. However, right now I was taking a look at the code and, although I know what it does, due to my weak knowledge on C++ I don't understand a couple of things about it... Here goes a snipet of the solveSolid.H file: Code:
tmp<fvScalarMatrix> hEqn ( fvm::ddt(betav*rho, h) - ( thermo.isotropic() ? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") : fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)") ) == fvOptions(rho, h) ); On the other hand, I would also like to understand how it is interpreted by the solver the following expression Code:
fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") Many thanks in advance! Best regards, Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in! |
|
January 8, 2016, 21:54 |
|
#2 | |
Member
Yan Wang
Join Date: May 2015
Location: Beijing
Posts: 41
Rep Power: 10 |
Quote:
As far as I know, the second laplacian in quotation marks gives a name to this fvm::laplacian term, so that the following discretization scheme will be used for fvm::laplacian(betav*thermo.alpha(), h) and fvm::laplacian(betav*taniAlpha(), h). Code:
laplacianSchemes { default none; laplacian(alpha,h) Gauss linear corrected; } Regards, Yan
__________________
Blog: http://blog.sina.com.cn/multiphyzks RG:https://www.researchgate.net/profile/Yan_Wang154 |
||
January 10, 2016, 07:51 |
|
#3 |
Senior Member
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21 |
Hi Yan,
Many thanks for your explanation, that clarifies a lot! Best regards, Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in! |
|
January 11, 2016, 13:57 |
|
#4 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 20 |
betav is defined in the solver itself (check createSolidFields.H ) and is an additional IOobject. (a file like p U k omega etc)
Code:
// create input output object betavSolidIO IOobject betavSolidIO ( "betavSolid", // name of the file runTime.timeName(), solidRegions[i], // where is it located IOobject::MUST_READ, // must be read IOobject::AUTO_WRITE // is written at each timestep ); // check if the object file is properly defined if (betavSolidIO.headerOk()) { // set a poiner to each region betavSolid.set ( i, new volScalarField(betavSolidIO, solidRegions[i]) // creates a volScalarField with the values in the file betavSolid of the region ); } else // if there is no file { betavSolid.set ( i, new volScalarField ( IOobject ( "betavSolid", runTime.timeName(), solidRegions[i], IOobject::NO_READ, // do not read IOobject::NO_WRITE // don't write ), solidRegions[i], dimensionedScalar("1", dimless, scalar(1.0)) // set it to 1 throughout the domain ) ); } } You can therefore add a file betavSolid into your 0/yoursolidregion/ directory and it will be read. Should look like this Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0/solid"; object betav; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 1; // or your value boundaryField { // you could also define different values for the patches or use setFields to set it in parts of this region ".*" { type zeroGradient; value $internalField; } } // ************************************************************************* // Code:
thermo.isotropic() ? fvm::laplacian(betav*thermo.alpha(), h, "laplacian(alpha,h)") : fvm::laplacian(betav*taniAlpha(), h, "laplacian(alpha,h)") It is therefore most likely a factor to account for porosity in your solid. (In the combustion solvers betav (beta_nu) is a volume porosity) You can set any value you want not just 0 and 1. You could maybe use it to disable heat conduction in parts of your solid. I would also be interested in the mathematics behind this factor. Let me know if you can find something. Last edited by Bloerb; January 12, 2016 at 16:04. |
|
February 8, 2016, 18:08 |
|
#5 | |
Senior Member
Alex
Join Date: Oct 2013
Posts: 337
Rep Power: 21 |
Hi Stephan,
First of all, I'm sorry for my late response, I was busy when you provided such an interesting information and I forgot to respond. Thanks for your detailed explanation about the meaning of betav. That really clarifies! I didn't know that a field called betavSolid could be defined in a solid region. However, I guess that when you define this field, its value will remains constant in time, right? If so, why is it written at each time step? It's quite useless, isn't it? Besides that, I agree with you on the possible meaning of betav, it makes sense that this is a factor that accounts for porosity in the solid. If someone else has any other idea about the meaning of betav, please, let us know! Quote:
Best regards, Alex
__________________
Web site where I present my Master's Thesis: foamingtime.wordpress.com The case I talk about in this site was solved with chtMultiRegionSimpleFoam solver and involves radiation. Some basic tutorials are also resolved step by step in the web. If you are interested in these matters, you are invited to come in! |
||
April 2, 2018, 07:16 |
|
#6 |
Senior Member
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13 |
Lost in the C++! Can you point me to the file were the values of field thermo.alpha gets assigned from stuff like Kappa, cp and T.
I'm thinking you could use betavSolid to allow for a solid with non-homogenous thermal properties I found out what I was looking for... and betavSolid is useful.
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET Last edited by derekm; April 3, 2018 at 06:01. |
|
April 3, 2018, 07:41 |
|
#7 |
Senior Member
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13 |
I 've attached a pdf that shows in picture the effect of betavSolid simulating a local change in conductivity on the heater temperature distribution in the tutorial chtMultiRegionSimpleFoam multiRegionHeaterRadiation. The case to create it is also included.
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET |
|
April 4, 2018, 08:19 |
|
#8 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 20 |
That is a bit complicated. In the Make/options file you should find inclusions for the thermal libraries (of fluid and solid - for the fluid those are based on turbulence etc so a bit more complicated).
Code:
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ ... -I$(LIB_SRC)/thermophysicalModels/solidThermo/lnInclude \ Code:
PtrList<solidThermo> thermos(solidRegions.size()); Here alpha is calculated for each cell and for the boundary. A small part of heSolidThermo.C and .H reads: Code:
alphaCells[celli] = volMixture_.kappa(pCells[celli], TCells[celli]) / mixture_.Cpv(pCells[celli], TCells[celli]); Hence alpha=kappa/cp. All of the files you need to look at are basicThermo heSolidThermo solidThermo Hope that helps |
|
April 7, 2018, 11:36 |
|
#9 |
Senior Member
Derek Mitchell
Join Date: Mar 2014
Location: UK, Reading
Posts: 172
Rep Power: 13 |
Thanks for that... its clarified a few things. The complexity of the thermo models is probably why the betavSolid field was introduced as a quicker way of making local adjustments. I had looked at making custom heSolidThermo but that would mean a custom solidThermo as well. That also means changing the chtMultiRegionSimpleFoam solver code that references that....
__________________
A CHEERING BAND OF FRIENDLY ELVES CARRY THE CONQUERING ADVENTURER OFF INTO THE SUNSET |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD code layout | plasmaCode | Main CFD Forum | 3 | December 12, 2015 22:10 |
The FOAM Documentation Project - SHUT-DOWN | holger_marschall | OpenFOAM | 242 | March 7, 2013 12:30 |
Open Source Vs Commercial Software | MechE | OpenFOAM | 28 | May 16, 2011 11:02 |
[Gmsh] Character expressions in gmsh? | ericnutsch | OpenFOAM Meshing & Mesh Conversion | 0 | January 21, 2010 23:21 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 15:56 |