CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

fvOptions / Volumetric heat source

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2024, 11:37
Default fvOptions / Volumetric heat source
  #1
New Member
 
Christoph Trier
Join Date: Mar 2024
Posts: 6
Rep Power: 2
Lorddrinkalot is on a distinguished road
Hey guys,

I could use some help setting up my Volumetric heat source. I am trying to model a uniform volumetric thermal source in the fluid.

For that, I am using fvOptions. I already wrote my option file and the solver also works; however, I get a warning "Source heatSource defined for field he but never used", and I can't find out why. I have tried different fvOptions.

In both cases, I get the same error, and I can't find out why.

I am using a solver named buoyantPimpleMhdFoam (combination to use MHD and Heat). Further down, I'll post the EEqn.H.

Thanks, Christoph

first one
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
options
{
heatSource
{
    type            scalarSemiImplicitSource;
    active          true;
    selectionMode   all;
	volumeMode      specific;

		sources
		{
            he           (19.4487 0); 
        }
    
}
}
second one I used
Code:
    HeatSource
    {
        type scalarSemiImplicitSource;
        active          true;
        selectionMode   all; 

        scalarSemiImplicitSourceCoeffs 
        {
            volumeMode absolute; //alt. specific
			selectionMode   all;
            injectionRateSuSp 
            {
                he (20 0);
            }
        }
   }
Code:
{
    volScalarField& he = thermo.he();

    fvScalarMatrix EEqn
    (
        fvm::ddt(rho, he) + fvm::div(phi, he)
      + fvc::ddt(rho, K) + fvc::div(phi, K)
      + (
            he.name() == "e"
          ? fvc::div
            (
                fvc::absolute(phi/fvc::interpolate(rho), U),
                p,
                "div(phiv,p)"
            )
          : -dpdt
        )
      - fvm::laplacian(turbulence->alphaEff(), he)
     ==
        rho*(U&g)
      + radiation->Sh(thermo, he)
      + fvOptions(rho, he)
    );

    EEqn.relax();

    fvOptions.constrain(EEqn);

    EEqn.solve();

    fvOptions.correct(he);

    thermo.correct();
    radiation->correct();
}
The warning says:
PIMPLE: iteration 1
--> FOAM Warning :
From virtual void Foam::fv:ption::checkApplied() const
in file cfdTools/general/fvOptions/fvOption.C at line 137
Source heatSource defined for field he but never used
Lorddrinkalot is offline   Reply With Quote

Old   April 28, 2024, 03:57
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,104
Rep Power: 26
Yann will become famous soon enough
Hello Christoph,

Here:
Code:
he           (19.4487 0);
Try replacing he by h or e depending on your thermophysical setup.
If you are using enthalpy it should be h, if you are using internal energy it should be e.

In the code the variable is named he because it can be both, but the simulation actually solves for h or e depending on the case settings, and your source must be defined for the variable which is solved.

I hope this will solve your problem.
Yann
Lorddrinkalot likes this.
Yann is offline   Reply With Quote

Reply

Tags
heatsource fvoptions


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
Unsteady problem with volumetric heat source Jonathan94 STAR-CCM+ 1 July 21, 2018 02:26
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
friction forces icoFoam ofslcm OpenFOAM 3 April 7, 2012 10:57


All times are GMT -4. The time now is 09:22.