CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Time-varying BC with externalWallHeatFluxTemperature

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By Bloerb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 30, 2020, 07:02
Smile Time-varying BC with externalWallHeatFluxTemperature
  #1
New Member
 
Romain SL
Join Date: Apr 2020
Location: Lyon, France
Posts: 8
Rep Power: 6
rsaintlege is on a distinguished road
Hello,

I'm new on this forum and OpenFOAM so I hope that I'm posting at the right place and that I'll be clear enough.

So, I found this boundary condition 'externalWallHeatFluxTemperature' that seems perfect for my case. But I would like to impose a sinusoidal heat flux and I don't manage to write it down. The best I managed to get was a time-varying external temperature like this (and that works well) but that does not correspond perfectly to the reality of the problem:

Code:
    upperFace
    {

        type            externalWallHeatFluxTemperature;
        mode            coefficient;

        Ta		           	 
	{
          type             sine;
          frequency        0.1;
          amplitude        4;
          scale            1;
          level            293;
      	}
	h		uniform	50;
        thicknessLayers (0.002);
        kappaLayers     (0.16);
        kappaMethod     fluidThermo;
        value           $internalField;
    }
Unfortunately, when I try to do the same with the heat flux I get this error:

Code:
--> FOAM FATAL IO ERROR: 
Attempt to return dictionary entry as a primitive

file: /home/romain/OpenFOAM/romain-7/run/pipe_v5.3/0/T.boundaryField.lowerFace.q from line 52 to line 56.

    From function virtual Foam::ITstream& Foam::dictionaryEntry::stream() const
    in file db/dictionary/dictionaryEntry/dictionaryEntry.C at line 83.

FOAM aborting
Hoping someone can help me figure out this problem.
rsaintlege is offline   Reply With Quote

Old   May 3, 2020, 11:43
Default
  #2
New Member
 
Romain SL
Join Date: Apr 2020
Location: Lyon, France
Posts: 8
Rep Power: 6
rsaintlege is on a distinguished road
Nobody?

I think it's just a question of syntax but I can't figure it out.
There is probably only one word missing to allow OpenFOAM to understand that the flux needs to be time-varying and I can't find it...
rsaintlege is offline   Reply With Quote

Old   May 3, 2020, 14:46
Default
  #3
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
The error report is related to `lowerFace`'s `q`, rather than the `upperFace` reported above.
HPE is offline   Reply With Quote

Old   May 4, 2020, 04:08
Default
  #4
New Member
 
Romain SL
Join Date: Apr 2020
Location: Lyon, France
Posts: 8
Rep Power: 6
rsaintlege is on a distinguished road
Quote:
Originally Posted by HPE View Post
The error report is related to `lowerFace`'s `q`, rather than the `upperFace` reported above.
Thank you for your reply. Yes, they both have the same BC, it was just a test on one of them to get the error in order to post it on the forum.

That's what I try to run (the range of q is not coherent but that's not the problem) and I precise that I get the same error for the two other modes (power and flux):

Code:
    upperFace
    {

        type            externalWallHeatFluxTemperature;

        mode            flux;

        q		           	 
	{
          type             sine;
          frequency        0.1;
          amplitude        4;
          scale            1;  
          level            293;  
        }
        thicknessLayers (0.002);
        kappaLayers     (0.16);

        kappaMethod     fluidThermo;

        value           $internalField;
    }
It seems that OpenFOAM doesn't want to interpret heat flux as a time-varying parameter.
rsaintlege is offline   Reply With Quote

Old   May 4, 2020, 16:06
Default
  #5
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 21
Bloerb will become famous soon enough
That is because it is not programmed to do so.


externalWallHeatFluxTemperatureFvPatchScalarField. H:

Code:
scalar Q_; //- Heat flux [W/m^2] 
scalarField q_;  //- Heat transfer coefficient [W/m^2K]
scalarField h_; //- Ambient temperature [K] 
autoPtr<Function1<scalar>> Ta_; //- Heat power [W]
As you can see only Ta is defined as a Function1 (the thing that lets you choose between time varying table sin cos and polynomial definitions for its value). q and h are however allowed to vary in space (scalarField). Rather than time they change in space. For the power mode Q is only a scalar. So only one fixed value.
You can take the boundary condition, rename it, and compile a new boundary condition. Add an additional Function1 entry and simply multiply that with the q field, which you'll define as 1. Or e.g change Q from scalar to Function1. Something like this with additional changes in the .C file:

Code:
autoPtr<Function1<scalar>> yourValue_;
parthigcar, rsaintlege and Utkan like this.
Bloerb is offline   Reply With Quote

Old   May 5, 2020, 04:34
Default
  #6
New Member
 
Romain SL
Join Date: Apr 2020
Location: Lyon, France
Posts: 8
Rep Power: 6
rsaintlege is on a distinguished road
Oh ok I see, it's more difficult than I thought. I have never done this before but I will try what you propose.
Thanks a lot for your help!
rsaintlege is offline   Reply With Quote

Old   June 14, 2021, 22:08
Default
  #7
New Member
 
Hamdani
Join Date: Nov 2011
Posts: 5
Rep Power: 15
hamdani is on a distinguished road
Hi

Did you succeed to compile the new BC?

If yes, please let me know the step-by-step what you did. It would be very helpful.
hamdani is offline   Reply With Quote

Reply

Tags
externalwallheatfluxtemp, time-varying bc


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
bash script for pseudo-parallel usage of reconstructPar kwardle OpenFOAM Post-Processing 42 May 8, 2024 00:17
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 03:36
AMI speed performance danny123 OpenFOAM 21 October 24, 2020 05:13
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 10:34


All times are GMT -4. The time now is 12:58.