|
[Sponsors] | |||||
Distributed Heat Source - fvOptions (chtMultiRegionFoam) |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Stefano Riva
Join Date: Dec 2020
Location: Milano
Posts: 4
Rep Power: 6 ![]() |
Good morning,
I'm pretty new to the OpenFOAM stuff and I'm currently facing the following problem. I would like to solve a multi-region problem (solver: chtMultiRegionFoam) with solid and fluid, some of the solid regions should produce power (different per each region). This has been set with the following fvOptions file Code:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
heat_dwn
{
type scalarCodedSource;
active true;
name sourceTime;
scalarCodedSourceCoeffs
{
selectionMode cellZone;
cellZone heat_dwn;
fields (h);
codeInclude
#{
#};
codeCorrect
#{
#};
codeAddSup
#{
const Time& time = mesh().time();
const scalarField& V = mesh_.V();
scalarField& heSource = eqn.source();
const labelList& cellIDs = cells();
forAll(cellIDs, i)
{
label cellI = cellIDs[i];
heSource[cellI] = -1305525.64*V[cellI]; // net power 1 kW
}
#};
codeSetValue
#{
#};
// Dummy entry. Make dependent on above to trigger recompilation
code
#{
$codeInclude
$codeCorrect
$codeAddSup
$codeSetValue
#};
}
sourceTimeCoeffs
{
$scalarCodedSourceCoeffs;
}
}
// ************************************************************************* //
For instance the previous value of 1305525.64, will be set per each region. Has anyone ever faced this kind of issue? Thanks in advance Regards |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding heat source to chtMultiRegionFoam | maddalena | OpenFOAM Programming & Development | 61 | February 17, 2018 09:33 |
| Specification of Gaussian distributed heat source? | mich_K | FLUENT | 5 | December 30, 2014 09:14 |
| [swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |
| [swak4Foam] swak4Foam-groovyBC build problem | zxj160 | OpenFOAM Community Contributions | 18 | July 30, 2013 14:14 |
| [swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |