Adding dimensioned scalar/scalar field to chtMultiRegionSimpleFoam/chtMultiRegionFoam
Hi Foamers,
I am currently trying to add electrical potential transport equations to chtMultiRegionSimpleFoam/chtMultiRegionFoam. However, I failed to add dimensioned scalars and scalar fields to createFields.H (createSolidFields.H) in chtMultiRegionFoam. The way I did is the same as what I did for icoFoam (https://openfoamwiki.net/index.php/H...ure_to_icoFoam) But it does not work here. In chtMultiRegionFoam, the createFields.H (createSolidFields.H) file is more complex and it seems that the way of defining scalars is also different, which I don't understand by scanning the code lines. Does anyone have any idea/experience on this? Btw I installed Openfoam 5x because it's the latest version that still has chtMultiRegionSimpleFoam, while the later versions combine chtMultiRegionSimpleFoam and chtMultiRegionFoam. Thanks in advance, Lan |
Would you share what you are trying to do exactly, your modifications and the error that you get? This way is it not possible to guess where you are having a problem.
For v6, v7, you can use chtMultiRegionFoam as well, you just define it as steady problem and it works like old chtMultiRegionSimpleFoam I guess. |
Quote:
Simply speaking, I'm trying to add a transport equation into chtMultiRegionFoam like fvm::laplacian(a, X) == b My current problem is to implement the parameters / dimensioned scalars (a and b) and the scalar field (X). In the tutorial that I listed above, it can be done by simply add the lines below into createFields.H: HTML Code:
Info<< "Reading diffusivity a" << endl; HTML Code:
// Initialise solid field pointer lists Thanks again, Lan |
I've been recently trying to adapt chMultiRegionFoam as well. Using OF6 in this my case.
As far as I can understand the code, in this solver the parameters (T, p, rho, ...) are not contained in a single field but each region has its own parameters. In the fluid/createFluidFields.H file a series of PtrList are defined for the magnitudes of interes. Bellow, inside the forAll loop, these properties are read and stored in the list. Code:
// Initialise fluid field pointer lists The same things apply to the solid fields, in case you need to modify them. Hope it helps! |
You need to define it in a such way:
Code:
betavSolid.set |
Thanks Carlos! I'll look into setRegionFluid/SolidField.H
|
All times are GMT -4. The time now is 01:10. |