Skip to content

Commit

Permalink
Updated FESolventSupplyStarling to use FEParamDouble instead of doubl…
Browse files Browse the repository at this point in the history
…e material parameters
  • Loading branch information
gateshian committed Jul 20, 2024
1 parent c31d6bb commit 1b5e6de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
18 changes: 12 additions & 6 deletions FEBioMix/FESolventSupplyStarling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ FESolventSupplyStarling::FESolventSupplyStarling(FEModel* pfem) : FESolventSuppl
int MAX_CDOFS = fedofs.GetVariableSize("concentration");

if (MAX_CDOFS > 0) {
m_qc.assign(MAX_CDOFS,0);
m_cv.assign(MAX_CDOFS,0);
FEParamDouble tmp;
tmp = 0;
m_qc.assign(MAX_CDOFS,tmp);
m_cv.assign(MAX_CDOFS,tmp);
}
}

Expand All @@ -65,13 +67,17 @@ double FESolventSupplyStarling::Supply(FEMaterialPoint& mp)
FESolutesMaterialPoint* mpt = mp.ExtractData<FESolutesMaterialPoint>();

// evaluate solvent supply from pressure drop
double phiwhat = m_kp*(m_pv - ppt.m_p);
double kp = m_kp(mp);
double pv = m_pv(mp);
double phiwhat = kp*(pv - ppt.m_p);

// evaluate solvent supply from concentration drop
if (mpt) {
int nsol = mpt->m_nsol;
for (int isol=0; isol<nsol; ++isol) {
phiwhat += m_qc[isol]*(m_cv[isol] - mpt->m_c[isol]);
double qc = m_qc[isol](mp);
double cv = m_cv[isol](mp);
phiwhat += qc*(cv - mpt->m_c[isol]);
}
}

Expand All @@ -91,7 +97,7 @@ mat3ds FESolventSupplyStarling::Tangent_Supply_Strain(FEMaterialPoint &mp)
//! Tangent of solvent supply with respect to pressure
double FESolventSupplyStarling::Tangent_Supply_Pressure(FEMaterialPoint &mp)
{
return -m_kp;
return -m_kp(mp);
}

//-----------------------------------------------------------------------------
Expand All @@ -100,7 +106,7 @@ double FESolventSupplyStarling::Tangent_Supply_Concentration(FEMaterialPoint &mp
{
FESolutesMaterialPoint& mpt = *mp.ExtractData<FESolutesMaterialPoint>();
if (isol < mpt.m_nsol) {
return -m_qc[isol];
return -m_qc[isol](mp);
}

return 0;
Expand Down
8 changes: 4 additions & 4 deletions FEBioMix/FESolventSupplyStarling.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ class FEBIOMIX_API FESolventSupplyStarling : public FESolventSupply


public:
double m_kp; //!< coefficient of pressure drop
double m_pv; //!< prescribed (e.g., vascular) pressure
vector<double> m_qc; //!< coefficients of concentration drops
vector<double> m_cv; //!< prescribed (e.g., vascular) concentrations
FEParamDouble m_kp; //!< coefficient of pressure drop
FEParamDouble m_pv; //!< prescribed (e.g., vascular) pressure
vector<FEParamDouble> m_qc; //!< coefficients of concentration drops
vector<FEParamDouble> m_cv; //!< prescribed (e.g., vascular) concentrations

// declare parameter list
DECLARE_FECORE_CLASS();
Expand Down

0 comments on commit 1b5e6de

Please sign in to comment.