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

Unstable solution for pulsed heat source

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 29, 2021, 18:13
Default Unstable solution for pulsed heat source
  #1
New Member
 
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8
seregaxvm is on a distinguished road
Hello!
I'm trying to simulate cooling of the pulse heater. Heating happens at high rate (819 [kW] in heater region) for a very short period of time (6 [µs]).
Unfortunately, simulation stops somewhere around 3 [µs] with either exceeded maxIter or negative temperature errors.
I've tried limiting minimum temperature in regions, subdividing the mesh, lowering deltaT value ... nothing seem to work.
What can I do to obtain a solution to this problem?


PS. Project may be run by issuing the command
Code:
make solve
PPS. I'm using scalarCodedSource defined in constant/heater/fvOptions to simulate a pulsed heat source.
PPPS. I it just me or scalarCodedSource does not work with MPI?
Attached Files
File Type: zip project.zip (77.0 KB, 4 views)
seregaxvm is offline   Reply With Quote

Old   July 30, 2021, 01:58
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
At first I would try to simulate just one pulse and understand how the physics need to be implemented.
At such a very short time, is it really necessary to have a transient solution here? Or may it be sufficient simply to add the amount of het in form of an increased temperature?
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   July 30, 2021, 05:27
Default
  #3
New Member
 
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8
seregaxvm is on a distinguished road
I did a simulation of the model in static case with 1000 [W] of heater power (run command make setup-stationary to setup stationary solution). Everything worked fine.

I need a transient solution because I need to investigate maximum temperature in the model in time and optimize the geometry.
seregaxvm is offline   Reply With Quote

Old   July 30, 2021, 18:15
Default
  #4
New Member
 
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8
seregaxvm is on a distinguished road
I seem to overcome this problem. Previously I used a separate heating region, which was uniformly heated in time. I removed this region and added Gaussian heat source:
heSource_i = A V_i \exp{\left(
-\frac{1}{2}\left(\frac{x_i-x_0}{\sigma_x}\right)^2
-\frac{1}{2}\left(\frac{y_i-y_0}{\sigma_y}\right)^2
-\frac{1}{2}\left(\frac{z_i-z_0}{\sigma_z}\right)^2
 \right)}
where A may be found from
A = \frac{P_{tot}}{\sqrt{2\pi}^3\sigma_x\sigma_y\sigma_z}


There may be some mistake there because I have to adjust A. Or may be it's due to discretization. I don't know.

Here's my codedSource for the heater:
Code:
transientHeatSource
{
    type        scalarCodedSource;
    name        sourceTime;
    active        true;

    scalarCodedSourceCoeffs
    {
        selectionMode    all;

        fields        (h);

        codeInclude
            #{
            #};

        codeCorrect
            #{
            #};

        codeAddSup
            #{
                const scalar time = mesh().time().value();
                const scalarField& V = mesh_.V();
                const vectorField& C = mesh_.C();
                scalar xMean = 0, yMean = 0.00806, zMean = 0;
                scalarField& heSource = eqn.source();
                const scalar sigmaX = 1e-3;
                const scalar sigmaY = 1e-4;
                const scalar sigmaZ = 1e-3;
                const scalar freq = 200;
                const scalar amp = 6.3e6 * 0.130;
                const scalar impulse = 6e-6;
                const scalar T = 1/(2*Foam::constant::mathematical::pi*freq);
                const scalar func = fmod(time, T) / T;
                const scalar duty = impulse / T;
                const scalar Tot = func <= duty ? amp : 0;
                const scalar A = 0.8 * Tot / (std::pow(2*Foam::constant::mathematical::pi, 3.0/2.0) * sigmaX * sigmaY * sigmaZ);
                scalar heSourceTot = 0;
                forAll (heSource, i) {
                    scalar x = -std::pow((C[i].x() - xMean) / sigmaX, 2) / 2.0;
                    scalar y = -std::pow((C[i].y() - yMean) / sigmaY, 2) / 2.0;
                    scalar z = -std::pow((C[i].z() - zMean) / sigmaZ, 2) / 2.0;
                    heSource[i] -= A * V[i] * std::exp(x + y + z);
                    heSourceTot -= heSource[i];
                }
                Pout<< "Adding heat source: " << heSourceTot << " [W] " \
                    " " << heSource.size() << " with center at (" << xMean << ";" << yMean << ";" << zMean << ")" << endl;
            #};

        codeConstrain
            #{
            #};
    }
}
seregaxvm is offline   Reply With Quote

Old   August 1, 2021, 08:10
Default
  #5
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 9
ErenC is on a distinguished road
AdjustableTimeStep seems active but you didn't spesify maxCo and maxDT. First, I would disable adjustableTimeStep and run, if it doesn't work lower the dt again etc.
Also, your first timestep is 5e-7 but your timePresicion is 1e-6. You might wanna lower that too.
ErenC is offline   Reply With Quote

Old   August 1, 2021, 08:37
Default
  #6
New Member
 
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8
seregaxvm is on a distinguished road
Quote:
Originally Posted by ErenC View Post
AdjustableTimeStep seems active but you didn't spesify maxCo and maxDT. First, I would disable adjustableTimeStep and run, if it doesn't work lower the dt again etc.
Also, your first timestep is 5e-7 but your timePresicion is 1e-6. You might wanna lower that too.

I ended up disabling it completely and doing a 10^{-6} timestep. Otherwise simulation may skip my heat source pulse.
seregaxvm is offline   Reply With Quote

Old   August 1, 2021, 14:42
Default
  #7
Member
 
Eren
Join Date: Aug 2018
Posts: 86
Rep Power: 9
ErenC is on a distinguished road
Well, by using 1e-6 you'll get a trapezoidal'ish wave, if you need sinusodal wave you might wanna lower it.
ErenC is offline   Reply With Quote

Old   August 1, 2021, 15:35
Default
  #8
New Member
 
Sergey
Join Date: Apr 2018
Posts: 16
Rep Power: 8
seregaxvm is on a distinguished road
Quote:
Originally Posted by ErenC View Post
Well, by using 1e-6 you'll get a trapezoidal'ish wave, if you need sinusodal wave you might wanna lower it.

No, I use a square wave, so it's ok.
seregaxvm is offline   Reply With Quote

Reply

Tags
chtmultiregionfoam, heating, scalarcodedsource, stability problem


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
SU2 7.0.7 Built on CentOS 7, parallel computation pyscript mpi exit error? EternalSeekerX SU2 3 October 9, 2020 19:28
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 04:04
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 14:59
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


All times are GMT -4. The time now is 23:45.