chtMultiRegionFOAM-boundary condition error
1 Attachment(s)
Hello FOAMERS,
I am trying to simulate a 2D electronic component cooling system. Where I have three different solids (2 ICs and 1 PCB) regions and rest are air, one inlet and one outlet. The ICs are generating constant heat. Could anyone help me to define heat generation in a solid region using chtMultiRegionFoam? Currently I am trying with constant temperature in ICs but I am getting error as follows: --> FOAM FATAL ERROR: gradientInternalCoeffs cannot be called for a calculatedFvPatchField on patch bottomAir_to_rightAir of field h in file "/home2/msarkar/OpenFOAM/msarkar-1.6.x/run/project/project3/run1/0.001/bottomAir/h" You are probably trying to solve for a field with a default boundary condition. From function calculatedFvPatchField<Type>::gradientInternalCoef fs() const in file /home2/galleon/freefoam_pu_build/include/finiteVolume/../../../freefoam/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 187. FOAM exiting I did not understand this error as I did not define the field h anywhere. I guess it is defined somewhere inside the code but I am not sure where it is. Any help on this regard would be very much appreciated. The computational domain is attached here. The domain has seven different regions - three solid and four air fields. Thanks M. Sarkar |
The field 'h' is defined in file 'fluid/setRegionFluidFields.H' as
basicPsiThermo& thermo = thermoFluid[i]; volScalarField& h = thermo.h(); and then it's used in 'fluid/hEqn.H'. What boundary conditions did you set? If you have a constant heat generation, maybe you can define a heat source in solid regions? For this purpose you could modify the equation in 'solid/solveSolid.H' to be like this: tmp<fvScalarMatrix> TEqn ( fvm::ddt(rho*cp, T) == fvm::laplacian(K, T) + Q ); and declare a heat source field Q. This field can be initialized before running the case using 'setField' or assigned straight in the code. I used this approach myself but I'm not sure how reliable it is. |
Hi Robertas,
Thanks a ton for your reply. I think there is no option to define any boundary conditions for h. Then why it is giving the following error and how to resolve this? Do I need to modify the code anywhere for this? --> FOAM FATAL ERROR: gradientInternalCoeffs cannot be called for a calculatedFvPatchField on patch bottomAir_to_rightAir of field h in file "/home2/msarkar/OpenFOAM/msarkar-1.6.x/run/project/project3/run1/0.001/bottomAir/h" You are probably trying to solve for a field with a default boundary condition. From function calculatedFvPatchField<Type>::gradientInternalCoef fs() const in file /home2/galleon/freefoam_pu_build/include/finiteVolume/../../../freefoam/src/finiteVolume/fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 187. FOAM exiting Quote:
bottomAir_to_pcb { type solidWallMixedTemperatureCoupled; neighbourFieldName T; Kcond Kcond; value uniform 300; } My intention is first run the case then change the source code if I need to do so to accommodate the heat generation part. If I understood your reply correctly, I have to modify the source code to accommodate the heat generation as specified and recompile the solver. There is no other way to define constant heat generation from solid parts, is that correct? You mentioned that you used the above approach. I guess you also simulated similar type of case like me. Could you give me your case file? So I can see how you initialized the field Q. Regards M. Sarkar |
5 Attachment(s)
The field 'h' is read from the thermophysical properties file; there is an equation for 'h' (fluid/hEqn.H), and the field 'h' is defined in fluid/setRegionFluidFields.H. Evidently, its boundary values are recalculated from other field values, therefore, it depends on how you set up BCs of other fields. I cannot tell anything about this specific error yet -- haven't dug so deep yet :-)
I attach a couple of cases that I have run myself. The 1st one contains two solid regions, in contact with each other, hovering in the air. One of them has a heat source inside. You can set also a heat source inside another one -- edit the file heat2/Q; currently, the heat source is commented out there. Another case contains two solid regions with heat sources inside and an air flow inbetween. Both cases are 2D. Air is green, solids are blue and yellow, heat sources (inside solids) are red. To run these cases, you'll have to recompile the chtMultiRegionFoam solver: here are the modified source files that should go into the 'solid' folder. case1 case2 |
Hi Robertas,
Thank you very much for sharing the source and case files. I will follow your instruction to accommodate heat generation inside solid and recompile the solver. I will also update you from my side and try to resolve the current error I am getting. Once again thank you. Regards M. Sarkar |
controlDict in chtMultiRegionFoam
Hi Robertas,
I included heat source generation on chtMultiRegionFoam as well, the solver compiled fine and cases runs without error. I did it on my own, but changes are similar to the files you attached. the only things that is different is that I wrote solveSolid.H as: Code:
tmp<fvScalarMatrix> TEqn I guess the problem in my case is with controlDict parameters:
Thanks mad PS: you set air/U as: Code:
internalField uniform (0 0 0); Code:
Region: air Courant Number mean: 0 max: 0 |
Hi, Maddalena,
Quote:
to set up a case with only a solid region, so that there is no heat loss due to fluid flow; or, it seems, if you set the thermal conductivity (K) to 0, heat will not be transferred to fluid region. Quote:
Quote:
|
Hi Robertas,
Quote:
Quote:
Quote:
Cheers, mad |
Quote:
sorry if I come back on the same point again, but I am getting hard time to have the chtMultiRegionFoam + heat source working. In particular, I have difficulties on obtaining a time vs temperature variation with the well known exponential behavior. In my simple case, I have a linear variation of it! :eek: Do you have ever experienced anything like that? If so, can you tell me what the problem was? You can find a more detailed explanation of my case on http://www.cfd-online.com/Forums/ope...egionfoam.html. Thank you of any suggestion you could give to me. regards, mad |
today i tried to test a case with chtMultiregionFoam.
my case includes natural convection in an enclosure with a block at the bottom. the bottom surface of block was heated. the strange thing is that the temperature is not passing throgh solid zone to fluid zone. I am using turbulentTemperatureCoupledBaffleMixed as the boundary condition on the interface of soid and liquid zone. I thinck there should be sth related to boundary condition. I will be too much thankful to recive you oponions :). |
All times are GMT -4. The time now is 03:00. |