CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   ddt for unsteady term (https://www.cfd-online.com/Forums/openfoam/228536-ddt-unsteady-term.html)

jagan1mohan July 5, 2020 01:19

ddt for unsteady term
 
Hello Friends, I'm trying to build an application in OpenFOAM. I'm starting from scratch as I think this is best way to learn what exactly happens behind screen. Lets focus on following.



for (int i = 0; i <= 10; i++)

{
solve
(
fvm::laplacian(kTh, T)
);
runTime++;
runTime.write( );
}


This code runs okay and I get the required temperature profile. Next, I experimented following code, with all others details implemented into main function, compilation successful, here are my questions.


for (int i = 0; i <= 10; i++)

{
solve
(
fvm::ddt(T) - konst
);
runTime++;
runTime.write( );
}



As you can see, I'm solving a first order linear differential equation in T. I have casted konst as dimensionedScalar and everything compiles without any error. ControlDict settings are timeStep is 1 with some startTime and endTime. What I observe is in all steps, the initial, final residual and iterations are perfect 0. That is, equation is not being solved.


1. What is happening here?


2. How to make this solve? We should expect a linear increase in temperature by 1 unit in very time step across all the domain.


Thank you,
Jagan Mohan.


All times are GMT -4. The time now is 19:59.