Skip to content

Commit

Permalink
there's been another issue: for some reason, the code is taking a lon…
Browse files Browse the repository at this point in the history
…g time to converge for L_P = 1e-4, even though PREVIOUSLY it did not have this issue. I can't for the life of me remember what changed to get us here. I'm just committing this so I can switch the branch to master and then make a new branch where I hard-code in the outflow and see what happens. Break the least amount of shit and see what stays broken, right?
  • Loading branch information
JRao-rgb committed Dec 6, 2023
1 parent d78d0de commit 908ae08
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 25 deletions.
6 changes: 6 additions & 0 deletions Code/Source/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"iostream": "cpp",
"ostream": "cpp"
}
}
15 changes: 8 additions & 7 deletions Code/Source/cvOneDBFSolver.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ void cvOneDBFSolver::QuerryModelInformation(void)
subdomain->SetBoundCondition(BoundCondTypeScope::NOBOUND);
}
}

// For branch use.
temp *= 2;
for(i=0; i<ij; i++){
Expand Down Expand Up @@ -1470,10 +1470,11 @@ void cvOneDBFSolver::GenerateSolution(void){

// Check Newton-Raphson Convergence
if((currentTime != deltaTime || (currentTime == deltaTime && iter != 0)) && normf < convCriteria && norms < convCriteria){
cout << " iter: " << std::to_string(iter) << " ";
cout << "normf: " << normf << " ";
cout << "norms: " << norms << " ";
cout << "time: " << ((float)(tend_iter-tstart_iter))/CLOCKS_PER_SEC << endl;
// !!!!! REMEMBER TO UNCOMMENT THIS !!!!!
// cout << " iter: " << std::to_string(iter) << " ";
// cout << "normf: " << normf << " ";
// cout << "norms: " << norms << " ";
// cout << "time: " << ((float)(tend_iter-tstart_iter))/CLOCKS_PER_SEC << endl;
break;
}

Expand Down Expand Up @@ -1514,10 +1515,10 @@ void cvOneDBFSolver::GenerateSolution(void){
}
}

if(negArea==1) {
if(negArea==1) {
postprocess_Text();
assert(0);
}
}

if(cvOneDGlobal::debugMode){
printf("(Debug) Printing Solution...\n");
Expand Down
3 changes: 2 additions & 1 deletion Code/Source/cvOneDMaterialOlufsen.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ double cvOneDMaterialOlufsen::GetD2pDS2(double area, double z)const{
}

double cvOneDMaterialOlufsen::GetOutflowFunction(double pressure, double z)const{
return L_P*(pressure - P_ambient); // JR 10/11/23: added function for outflow term
// cout << "L_P: " << L_P << " pressure: " << pressure << " P_ambient: " << P_ambient << " total: " << L_P*(pressure - P_ambient) << endl;
return 1e-4 * (pressure - 0.0);
}

double cvOneDMaterialOlufsen::GetDOutflowDp(double pressure, double z)const{
Expand Down
34 changes: 17 additions & 17 deletions Code/Source/cvOneDSolverDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef CVONEDSOLVERDEFINITIONS_H
#define CVONEDSOLVERDEFINITIONS_H


//
// cvOneDSolverDefinitions.h - Some definitions used throughout the solver
//

#define MAX_STRING_SIZE 20
#define EPSILON 1.0e-10
#define OUTPUT_PRECISION 12
#define MAX_NONLINEAR_ITERATIONS 30
#define RELATIVE_TOLERANCE 1.0e-7
#define ABSOLUTE_TOLERANCE 5.0e-6

#endif // CVONEDSOLVERDEFINITIONS_H
#ifndef CVONEDSOLVERDEFINITIONS_H
#define CVONEDSOLVERDEFINITIONS_H


//
// cvOneDSolverDefinitions.h - Some definitions used throughout the solver
//

#define MAX_STRING_SIZE 20
#define EPSILON 1.0e-10
#define OUTPUT_PRECISION 12
#define MAX_NONLINEAR_ITERATIONS 1000
#define RELATIVE_TOLERANCE 1.0e-7
#define ABSOLUTE_TOLERANCE 5.0e-6

#endif // CVONEDSOLVERDEFINITIONS_H

0 comments on commit 908ae08

Please sign in to comment.