|
[Sponsors] |
source term modification in poisson equation does not affect results |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 16, 2016, 18:11 |
|
#21 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
||
September 25, 2016, 01:46 |
|
#22 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
Dear Fellows
The equation written with the following snippet : Code:
solve ( fvm::laplacian(phi) == beta * sinh(phi) // fvm::laplacian(phi) - beta * (phi + (1/6)*pow(phi,3) + (1/120)*pow(phi,5) + (1/362880)*pow(phi,9) + (1/39916800)*pow(phi,11)) ); The following ideas didn't resolve the crashing issue: 1) relaxing the steady equation 2) Solving the transient form (adding time derivative) 3) relaxing the transient form 4) refining the grid 5) replacing with its polynomial counterpart At the moment, I have found that some people have solved the above equation in a weak variational form in a Galerkin projection: A Newton iteration strategy is used: Here shows the iteration number. I tried to write the above formulation in OpenFoam 2.1.x using the following snippet: Code:
solve (fvm::laplacian(phi) == beta * sinh(phi)); while (runTime.loop()) { Info<< "Iteration = " << runTime.timeName() << nl << endl; (fvm::laplacian(phi) - beta * cosh(phi.oldTime()) * phi == beta * sinh(phi.oldTime()) - beta * cosh(phi.oldTime()) * phi.oldTime(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } error as before. I have a feeling that I am not implementing correctly the above iterative equation. Any hint is appreciated |
|
September 30, 2016, 12:32 |
|
#23 | |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Quote:
Instead of this Code:
(fvm::laplacian(phi) - beta * cosh(phi.oldTime()) * phi == beta * sinh(phi.oldTime()) - beta * cosh(phi.oldTime()) * phi.oldTime(); Code:
(fvm::laplacian(phi) == beta * sinh(phi)).solve(); phi.relax(); Code:
//- system/fvSolution relaxationFactors { fields { phi 0.3; } } Code:
//- src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C template<class Type, template<class> class PatchField, class GeoMesh> void Foam::GeometricField<Type, PatchField, GeoMesh>::relax() { word name = this->name(); if ( this->mesh().data::template lookupOrDefault<bool> ( "finalIteration", false ) ) { name += "Final"; } if (this->mesh().relaxField(name)) { relax(this->mesh().fieldRelaxationFactor(name)); } } Code:
//- src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C template<class Type, template<class> class PatchField, class GeoMesh> void Foam::GeometricField<Type, PatchField, GeoMesh>::relax(const scalar alpha) { if (debug) { InfoInFunction << "Relaxing" << endl << this->info() << " by " << alpha << endl; } operator==(prevIter() + alpha*(*this - prevIter())); } |
||
October 1, 2016, 17:15 |
|
#24 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
Dear Sergei
Many thanks for your reply. Actually, I had applied the under-relaxation in a correct way. http://www.cfd-online.com/Forums/ope...tml#post618146 Either my value was not small enough (0.3) or a specific algorithm for iterating is needed, however, I solved my problem through employing the following solver in fvSolution file: Code:
solver smoothSolver; smoother GaussSeidel; preconditioner DIC; tolerance 1e-11; relTol 0.2; |
|
October 1, 2016, 17:28 |
|
#25 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 22 |
Hi, Bobi
Glad to hear you solved your problem. |
|
October 1, 2016, 17:34 |
|
#26 |
Senior Member
Bobby
Join Date: Oct 2012
Location: Michigan
Posts: 454
Rep Power: 16 |
Thanks Bro.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
what is swap4foam ?? | AB08 | OpenFOAM | 28 | February 2, 2016 02:22 |
implicit - scalar product source term in momentum equation | vinch | OpenFOAM Running, Solving & CFD | 0 | October 28, 2014 15:57 |
UDF for source term in momentum equation | Enrico | FLUENT | 9 | May 30, 2014 12:34 |
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
[swak4Foam] build problem swak4Foam OF 2.2.0 | mcathela | OpenFOAM Community Contributions | 14 | April 23, 2013 14:59 |