Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial flow rate value is never used #104

Open
lucapegolotti opened this issue Nov 30, 2022 · 0 comments
Open

Initial flow rate value is never used #104

lucapegolotti opened this issue Nov 30, 2022 · 0 comments

Comments

@lucapegolotti
Copy link

lucapegolotti commented Nov 30, 2022

The SEGMENT section in the input file offers the ability to set an initial value for flow rate:

# ============
# SEGMENT CARD
# ============
# - Segment Name (string)
# - Segment ID (int)
# - Segment Length (double)
# - Total Finite Elements in Segment (int)
# - Segment Inlet Node (int)
# - Segment Outlet Node (int)
# - Segment Inlet Area (double)
# - Segment Outlet Area (double)
# - Segment Inflow Value (double)
# - Segment Material (string)
# - Type of Loss (string - 'NONE','STENOSIS','BRANCH_THROUGH_DIVIDING','BRANCH_SIDE_DIVIDING','BRANCH_THROUGH_CONVERGING',
#                          'BRANCH_SIDE_CONVERGING','BIFURCATION_BRANCH')
# - Branch Angle (double)
# - Upstream Segment ID (int)
# - Branch Segment ID (int)
# - Boundary Condition Type (string - 'NOBOUND','PRESSURE','AREA','FLOW','RESISTANCE','RESISTANCE_TIME','PRESSURE_WAVE',
#                                     'WAVE','RCR','CORONARY','IMPEDANCE','PULMONARY')
# - Data Table Name (string)

The specified value is only set at the inlet of each segment and 0 elsewhere (line 1347 of cvOneDBFSolver).

void cvOneDBFSolver::CalcInitProps(long ID){
  double segLen = subdomainList[ID] -> GetLength();
  double Qo, dQ0dT;
  Qo = subdomainList[ID] -> GetInitialFlow();
  dQ0dT=0;

  double So = subdomainList[ID] -> GetInitInletS();
  double Sn = subdomainList[ID] -> GetInitOutletS();
  for( long node = 0; node < subdomainList[ID]->GetNumberOfNodes(); node++){
  double zn = subdomainList[ID]->GetNodalCoordinate( node);
  long eqNumbers[2];
  mathModels[0]->GetNodalEquationNumbers(node, eqNumbers, ID);

  // Linear Interpolation
  double zi = (zn - segLen)/(0.0-segLen);
  double Si = (zi*(So - Sn)) + Sn;
  (*previousSolution)[eqNumbers[0]] = Si;

    if(node == 0){
      (*previousSolution)[eqNumbers[1]] = Qo;
    }else{
      (*previousSolution)[eqNumbers[1]] = 0.0;
    }
  }
}

I think it would make more sense to set it to the specified value for all points belonging to the same segment, since this is the best guess in case of very stiff walls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant