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

why ddt is zero??

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 8, 2021, 07:03
Default why ddt is zero??
  #1
Member
 
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 34
Rep Power: 6
reverseila is on a distinguished road
The equations are from here

Here is the code:
Code:
// Including necessary class definition and libraries ( Header files )
#include "fvCFD.H"
#include "simpleControl.H"

// handler for printing stuff
#define print(X) Info << X << endl

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
    // Creating objects from the above defined classes
    // These .H files are basically code snippets ( "inclusion" files )
    #include "setRootCaseLists.H"
    #include "createTime.H"
    #include "createMesh.H"

    simpleControl simple(mesh);

    #include "createFields.H"

    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

    Info<< "\nCalculating scalar transport\n" << endl;

    // Trigger the objects to store the old value of theirs at each iteration
    c.oldTime();
    p.oldTime();
    pSt.oldTime();
    // pD.oldTime();
    w.oldTime();
    q.oldTime();

    // Define constant coefficients before the loop to only be calculated once
    dimensionedScalar coeff1 = (Pmi/Pma);
    dimensionedScalar coeff2 = 1e-9 * coeff1 * (VT/De);
    dimensionedScalar coeff3 = -2 * F / CapSt;

    while (simple.loop(runTime))
    {
        Info<< "Time = " << runTime.timeName() << nl << endl;

        #include "CourantNo.H"

        // Potential Equation
        fvScalarMatrix pEqn
            (
             - fvm::laplacian(c, p)
             ==
             coeff2 * fvc::ddt(q)
            );

        pEqn.relax();
        pEqn.solve();

        while (simple.correctNonOrthogonal())
        {
            // Concentration Equation
            fvScalarMatrix cEqn
                (
                 fvm::ddt(c)
                 + coeff_conv * fvm::div(phi, c)
                 - coeff_diff_1 * fvm::laplacian(De, c) // spacer *2 : *0
                 - coeff_diff_2 * fvm::laplacian(De, c) // electrode *0 : *1
                 ==
                 coeff1 * fvc::ddt(w)
                );

            cEqn.relax();
            cEqn.solve();

        }

        q = src_coeff_p * (-c) * exp(Mu) * sinh(pD/VT);
        pSt = coeff3 * q;
        pD = max(-1 * src_coeff_p * p + EV * src_coeff_c - pSt);
        //w = c * exp(Mu) * cosh(pD/VT);
        w = sqrt(q * q + 4 * src_coeff_c * c * c);

        runTime.write();
    }

    Info<< endl;
    Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
        << "  ClockTime = " << runTime.elapsedClockTime() << " s"
        << nl << endl;

    Info<< "End\n" << endl;

    return 0;
I'm not sure why my source terms are zero
reverseila is offline   Reply With Quote

Old   July 26, 2023, 13:09
Default
  #2
New Member
 
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 3
sreehahaha is on a distinguished road
Hello Ali,

I'm having a similar issue. Did you manage to solve the problem? Please let me know.

Thanks,
S
sreehahaha is offline   Reply With Quote

Reply


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
Errors when using different ddt schemes in interFoam kerim OpenFOAM Running, Solving & CFD 2 August 14, 2020 23:14
Explicit ddt scheme sachinjain OpenFOAM Running, Solving & CFD 6 March 4, 2020 16:08
d2dt2 and ddt versus time-varying boundary conditions bigphil OpenFOAM CC Toolkits for Fluid-Structure Interaction 0 July 3, 2019 05:01
ddt scheme: CrankNic(h)olson Djub OpenFOAM Running, Solving & CFD 0 November 20, 2013 06:22
Ddt schemes update hjasak OpenFOAM Running, Solving & CFD 0 April 11, 2005 07:55


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